# US 2024/0202024 A1 · Thread processing methods, scheduling component, monitoring component, server, and storage medium

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2024/0202024 A1
- Document ID: US20240202024A1
- Status: Published application
- Kind: A1
- Application number: 18/171,257
- Filed: 2023-02-17
- Published: 2024-06-20
- Earliest claimed: 2022-12-14
- Assignees: Alibaba Damo (Hangzhou) Technology Co., Ltd.
- Applicants: Alibaba Damo (Hangzhou) Technology Co., Ltd.
- Inventors: Meng Wang; Pengyu Zhang; Yunshan Jia; Biyi Li
- Web page: https://patentgrep.com/patent/US20240202024A1

## CPC

- G06F 9/4881: {Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues}
- G06F 9/505: {considering the load}
- G06F 9/5038: {considering the execution order of a plurality of tasks, e.g. taking priority or time dependency constraints into consideration (scheduling strategies G06F9/4881 and subgroups)}
- G06F 2209/5018: Thread allocation
- G06F 2209/508: Monitor
- Y02D 10/00: Energy efficient computing, e.g. low power processors, power management or thermal management
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- Y02D: CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE

## Abstract

Thread processing methods, a scheduling component, a monitoring component, a server, and a storage medium are provided. The method includes: determining, by a scheduling component in the server, a duration for which a worker thread is in a blocked state, determining a workload index parameter of the worker thread according to the duration, and further generating a resource scheduling strategy according to the workload index parameter. The kernel of the server may reallocate the computing resource of the server by using the resource scheduling strategy.

## Claims

### Claim 1

A thread processing method, applied to a scheduling component in a server, the method comprising:
determining a duration for which a worker thread in the server is in a blocked state, wherein the worker thread is in the blocked state after a previous task generated by a function instance in the server is completed and before a next task generated by the function instance is acquired;
determining a workload index parameter of the worker thread according to the duration of the worker thread in the blocked state; and
generating a resource scheduling strategy according to the workload index parameter, such that a kernel of the server reallocates a computing resource of the server according to the resource scheduling strategy.

### Claim 2 (depends on 1)

The method of claim 1, wherein the scheduling component is provided with a delay function, and
the determining the duration for which the worker thread in the server is in the blocked state, comprises:
determining, when a working cycle of the scheduling component is reached, whether the delay function is executed by the worker thread, wherein a length of the working cycle is on an order of magnitude of microseconds;
determining, in a case where the worker thread executes the delay function after executing the previous task, a start time and an end time at which the delay function is executed; and
determining a time period composed of the start time and the end time as the duration of the blocked state.

### Claim 3 (depends on 1)

The method of claim 1, wherein the server is deployed with at least one function instance, and the worker thread is configured for executing a task generated by any one of the at least one function instance, wherein the working thread is plural in number.

### Claim 4 (depends on 3)

The method of claim 3, wherein the duration of the blocked state is composed of a start time point and an end time point, and
the determining the workload index parameter of the worker thread according to the duration of the worker thread in the blocked state, comprises:
determining a first duration and a second duration of two adjacent blocked states for a target worker thread, wherein the target worker thread is any one of a plurality of worker threads;
determining a time interval between a first start time point in the first duration and a second start time point in the second duration; and
determining a workload index parameter of the target worker thread according to the time interval.

### Claim 5 (depends on 4)

The method of claim 4, wherein the determining the workload index parameter of the target worker thread according to the time interval, comprises:
determining an idle time point, within the time interval, of the target worker thread in a case where the time interval is less than a first preset interval;
determining, according to a plurality of adjacent idle time points of the target worker thread, a first frequency at which the idle time points of the target worker thread occur; and
determining the first frequency as the workload index parameter of the target worker thread.

### Claim 6 (depends on 5)

The method of claim 5, further comprising:
sorting idle time points of each of the plurality of worker threads according to timing-sequence;
determining, according to adjacent idle time points in a sorting result, a second frequency at which the idle time points of the plurality of worker threads occur; and
determining a workload index parameter of the plurality of worker threads according to the second frequency.

### Claim 7 (depends on 5)

The method of claim 5, wherein the first frequency and/or the second frequency are comprised in a target frequency, and
the generating the resource scheduling strategy according to the workload index parameter, comprises:
determining, in a case where the target frequency is less than a preset minimum frequency, that the resource scheduling strategy is to newly create a worker thread and allocate the computing resource of the server to the newly created worker thread; and
determining, in a case where the target frequency is larger than a preset maximum frequency, that the resource scheduling strategy is to recycle the computing resource allocated to the worker thread.

### Claim 8 (depends on 6)

The method of claim 6, wherein the first frequency and/or the second frequency are comprised in a target frequency, and
the generating the resource scheduling strategy according to the workload index parameter, comprises:
determining, in a case where the target frequency is less than a preset minimum frequency, that the resource scheduling strategy is to newly create a worker thread and allocate the computing resource of the server to the newly created worker thread; and
determining, in a case where the target frequency is larger than a preset maximum frequency, that the resource scheduling strategy is to recycle the computing resource allocated to the worker thread.

### Claim 9 (depends on 1)

The method of claim 1, further comprising:
acquiring a generation time of the resource scheduling strategy and a generation time of a previous resource scheduling strategy; and
discarding the resource scheduling strategy in a case where a time interval between the two generation times is less than a second preset interval, wherein the resource scheduling strategy and the previous resource scheduling strategy correspond to a same function instance; and
the generating the resource scheduling strategy according to the workload index parameter, such that the kernel of the server reallocates the computing resource of the server according to the resource scheduling strategy, comprises:
sending the resource scheduling strategy to the kernel in a case where the time interval between the two generation times is larger than the second preset interval.

### Claim 10 (depends on 1)

The method of claim 1, wherein the server is installed with a third-party application program, and the generating the resource scheduling strategy according to the workload index parameter, comprises:
determining, according to the workload index parameter, that the resource scheduling strategy comprises allocating a target computing resource of the server to a worker thread corresponding to the function instance; and
determining that the resource scheduling strategy further comprises allocating a remaining computing resource of the server to a worker thread corresponding to the third-party application program.

### Claim 11

A thread processing method, applied to a cloud server in which a 5G private network runs, the method comprising:
determining a duration for which a worker thread in the cloud server is in a blocked state, wherein the worker thread is in the blocked state after a previous task generated by a function instance in the server is completed and before a next task generated by the function instance is acquired;
determining a workload index parameter of the worker thread according to the duration of the worker thread in the blocked state, wherein the function instance comprises a functional network element in the 5G private network; and
generating a resource scheduling strategy according to the workload index parameter, such that a kernel of the server reallocates a computing resource of the server according to the resource scheduling strategy.

### Claim 12 (depends on 11)

The method of claim 11, wherein the cloud server is provided with a delay function, and
the determining the duration for which the worker thread in the cloud server is in the blocked state, comprises:
determining, when a resource scheduling cycle of the cloud server is reached, whether the delay function is executed by the worker thread, wherein a length of the resource scheduling cycle is on an order of magnitude of microseconds;
determining, in a case where the worker thread executes the delay function after executing the previous task, a start time and an end time at which the delay function is executed; and
determining a time period composed of the start time and the end time as the duration of the blocked state.

### Claim 13 (depends on 11)

The method of claim 11, wherein, the functional network element comprises a functional network element in a core network comprised in the 5G private network and/or an access network element in an access network comprised in the 5G private network.

### Claim 14

A thread processing method, applied to a monitoring component in a server, the method comprising:
determining, when a working cycle of the monitoring component is reached, a duration for which a worker thread in the server is in a blocked state, wherein the worker thread is in the blocked state after a previous task generated by a function instance in the server is completed and before a next task generated by the function instance is acquired; and
determining a workload index parameter of the worker thread according to the duration of the worker thread in the blocked state, wherein a length of the working cycle is on an order of magnitude of microseconds.

### Claim 15

A scheduling component, running on a server, the scheduling component comprising a duration monitoring sub-component, an index monitoring sub-component, and a strategy generation sub-component, wherein
the duration monitoring sub-component is configured for determining a duration for which a worker thread in the server is in a blocked state, wherein the worker thread is in the blocked state after a previous task generated by a function instance in the server is completed and before a next task generated by the function instance is acquired;
the index monitoring sub-component is configured for determining a workload index parameter of the worker thread according to the duration of the worker thread in the blocked state; and
the strategy generation sub-component is configured for generating a resource scheduling strategy according to the workload index parameter, such that a kernel of the server reallocates a computing resource of the server according to the resource scheduling strategy.

### Claim 16 (depends on 15)

The scheduling component of claim 15, wherein the server provides a shared memory, and
the duration monitoring sub-component is configured for writing the duration of the blocked state into the shared memory;
the index monitoring sub-component is configured for reading the duration of the blocked state from the shared memory, and writing the workload index parameter into the shared memory; and
the strategy generation sub-component is configured for reading the workload index parameter from the shared memory.

### Claim 17

A monitoring component, running on a server, the monitoring component comprising a duration monitoring sub-component and an index monitoring sub-component, wherein
the duration monitoring sub-component is configured for determining, when a working cycle of the monitoring component is reached, a duration for which a worker thread in the server is in a blocked state, wherein the worker thread is in the blocked state after a previous task generated by a function instance in the server is completed and before a next task generated by the function instance is acquired; and
the index monitoring sub-component is configured for determining a workload index parameter of the worker thread according to the duration of the worker thread in the blocked state, wherein a length of the working cycle is on an order of magnitude of microseconds.

### Claim 18

A server, comprising a scheduling component, a kernel, a function instance, and a computing resource, wherein
the scheduling component is configured for: determining a duration for which a worker thread in the server is in a blocked state, wherein the worker thread is in the blocked state after a previous task generated by the function instance in the server is completed and before a next task generated by the function instance is acquired; determining a workload index parameter of the worker thread according to the duration of the worker thread in the blocked state; and generating a resource scheduling strategy according to the workload index parameter; and
the kernel is configured for reallocating the computing resource of the server according to the resource scheduling strategy.

### Claim 19 (depends on 16)

The server of claim 16, wherein the resource scheduling strategy comprises recycling the computing resource allocated to the worker thread, and
the kernel is configured for: acquiring the resource scheduling strategy by using a scheduling class function provided in the kernel; and recycling, in a case where the worker thread is in the blocked state, the computing resource allocated to the worker thread.

### Claim 20

A non-transitory machine-readable storage medium, wherein executable codes are stored on the non-transitory machine-readable storage medium, and the executable codes, when executed by a processor of an electronic device, cause the processor to:
determining a duration for which a worker thread in the server is in a blocked state, wherein the worker thread is in the blocked state after a previous task generated by a function instance in the server is completed and before a next task generated by the function instance is acquired;
determining a workload index parameter of the worker thread according to the duration of the worker thread in the blocked state; and
generating a resource scheduling strategy according to the workload index parameter, such that a kernel of the server reallocates a computing resource of the server according to the resource scheduling strategy.
