US10783005B2ActiveUtilityA1

Component logical threads quantity adjustment method and device

Assignee: ALIBABA GROUP HOLDING LTDPriority: Dec 30, 2015Filed: Jun 29, 2018Granted: Sep 22, 2020
Est. expiryDec 30, 2035(~9.4 yrs left)· nominal 20-yr term from priority
G06F 9/5083G06F 2209/503G06F 9/505G06F 9/5027G06F 2209/5018
43
PatentIndex Score
0
Cited by
20
References
20
Claims

Abstract

A method for adjusting a number of logical threads for a component including acquiring a plurality of logical threads that is callable by a component; determining a load state of each logical thread according to a utilization rate of a data processing queue corresponding to each logical thread, the load state including a normal load state and an abnormal load state; determining, according to the load states of the logical threads of the component, whether the number of logical threads of the component needs to be adjusted; and adjusting the number of logical threads of the component according to the determination result if the number of logical threads of the component needs to be adjusted. By using the method and the apparatus, the utilization rate of resources is improved while ensuring real-time calculation of data.

Claims

exact text as granted — not AI-modified
What is claimed is: 
     
       1. A method comprising:
 acquiring a plurality of logical threads that are callable by a component; 
 determining a load state of a respective logical thread according to a utilization rate of a data processing queue corresponding to the respective logical thread, the load state being a normal load state or an abnormal load state; 
 determining, according to load states of the plurality of logical threads of the component, that a number of logical threads of the component needs to be adjusted by:
 calculating a high load probability of the component and a low load probability of the component, 
 determining that at least one of the high load probability of the component and the low load probability of the component is greater than a third preset threshold, and 
 determining that the number of logical threads of the component needs to be adjusted; and 
 
 adjusting the number of logical threads of the component. 
 
     
     
       2. The method of  claim 1 , wherein the adjusting the number of logical threads of the component comprises:
 adjusting the number of logical threads of the component to be a number of current logical threads of the component*amount of data sent by a sending apparatus per second/amount of data received by the component per second, the sending apparatus being an apparatus that sends data to the component. 
 
     
     
       3. The method of  claim 1 , wherein:
 the abnormal load state includes a high load state and a low load state. 
 
     
     
       4. The method of  claim 3 , wherein:
 the utilization rate is a space occupied by data stored in a message queue divided by a pre-allocated storage space of the message queue. 
 
     
     
       5. The method of  claim 4 , wherein the determining the load state of the respective logical thread comprises:
 determining that the utilization rate of the data processing queue corresponding to the respective logical thread is greater than a first preset threshold; 
 determining that the logical thread is in the high load state. 
 
     
     
       6. The method of  claim 4 , wherein the determining the load state of the respective logical thread comprises:
 determining that the utilization rate of the data processing queue corresponding to the respective logical thread is less than a second preset threshold; and 
 determining that the logical thread is in the low load state. 
 
     
     
       7. The method of  claim 1 , wherein determining, according to the load states of the plurality of logical threads of the component, that the number of logical threads of the component needs to be adjusted further comprises:
 respectively counting a number of logical threads in the high load state and a number of logical threads in the low load state among the logical threads that are callable by the component. 
 
     
     
       8. The method of  claim 1 , wherein the calculating the high load probability of the component comprises:
 using a high load probability calculation formula=the number of logical threads in the high load state/a number of all the logical threads that are callable by the component. 
 
     
     
       9. The method of  claim 1 , wherein the calculating the low load probability of the component comprises:
 using a low load probability calculation formula=the number of logical threads in the low load state/a number of all the logical threads that are callable by the component. 
 
     
     
       10. The method of  claim 1 , further comprising:
 determining that the logical threads need to be deleted for the component according to the number of logical threads that needs to be adjusted for the component and a number of current logical threads; and 
 deleting corresponding logical threads in the operational process. 
 
     
     
       11. The method of  claim 1 , wherein
 the logical threads run in one or more operational process; and 
 the method further comprises:
 determining that the logical threads need to be added for the component according to the number of logical threads that needs to be adjusted for the component and a number of current logical threads; 
 determining that the logical threads are allowable to be added in an operational process associated with the current logical threads; and 
 adding the logical threads in the associated operational process. 
 
 
     
     
       12. The method of  claim 11 , wherein the determining that the logical threads are allowable to be added in the operational process associated with the current logical threads comprises:
 determining a plurality of operational processes associated with the current logical threads; 
 determining a number of logical threads that is allowable to be added in a respective operational process, 
 counting a total number of logical threads that is allowable to be added in the plurality of operational processes; 
 determining that the total number of logical threads that is allowable to be added is greater than or equal to the number of logical threads that need to be added for the component; and 
 determining that the logical threads are allowable to be added in associated operational processes. 
 
     
     
       13. The method of  claim 12 , wherein the determining the number of logical threads that is allowable to be added in a respective operational process comprises:
 using a preset increase formula, wherein a number of logical threads that is allowable to be added in the respective operational process=(total pre-allocated resources of the operational processes/resources occupied by the respective operational process for running logical threads*a fourth preset value−1)*a number of logical threads running in the respective operational process. 
 
     
     
       14. The method of  claim 1 , wherein:
 the logical threads run in one or more operational process; and 
 the method further comprises:
 determining that the logical threads need to be added for the component according to the number of logical threads that needs to be adjusted for the component and a number of current logical threads; 
 determining that the logical threads are not allowable to be added in an operational process associated with the current logical threads; and 
 determining a number of operational processes that need to be added for the component. 
 
 
     
     
       15. The method of  claim 14 , wherein the determining the number of operational processes that need to be added comprises:
 acquiring a number Q of logical threads that is allowable to run in the associated operational process under a preset load threshold; and 
 calculating, by using an operational process calculation formula, the number of operational processes that need to be added, the operational process calculation formula being a number of added operational processes=(N−T)/Q+1, wherein N is a number of logical threads that need to be added for the component, T is the number of logical threads that is allowable to be added in the associated operational process, and T, N and Q are positive integers. 
 
     
     
       16. The method of  claim 1 , further comprising:
 determining, at intervals of a preset time, a first logical thread that is callable by an upstream component of the component and a second logical thread that is callable by a downstream component of the component; and 
 establishing a communication connection between a third logical thread that is callable by the component and the first logical thread and a communication connection between the third logical thread and the second logical thread. 
 
     
     
       17. The method of  claim 1 , further comprising:
 determining that a logical thread does not exist in an operational process associated with the component; and 
 deleting the operational process. 
 
     
     
       18. An apparatus comprising:
 one or more processors; and 
 one or more memories storing thereon computer-readable instructions that, when executed by the one or more processors, cause the one or more processors to perform acts comprising:
 acquiring a plurality of logical threads that are callable by a component; 
 determining a load state of a respective logical thread according to a utilization rate of a data processing queue corresponding to the respective logical thread, the load state being a normal load state or an abnormal load state; 
 determining, according to load states of the plurality of logical threads of the component, that a number of logical threads of the component needs to be adjusted by:
 calculating a high load probability of the component and a low load probability of the component, 
 determining that at least one of the high load probability of the component and the low load probability of the component is greater than a third preset threshold, and 
 determining that the number of logical threads of the component needs to be adjusted; and 
 
 adjusting the number of logical threads of the component. 
 
 
     
     
       19. The apparatus of  claim 18 , wherein:
 the abnormal load state includes a high load state and a low load state. 
 
     
     
       20. One or more memories storing thereon computer-readable instructions that, when executed by the one or more processors, cause the one or more processors to perform acts comprising:
 acquiring a plurality of logical threads that are callable by a component; 
 determining a load state of a respective logical thread according to a utilization rate of a data processing queue corresponding to the respective logical thread, the load state being a normal load state or an abnormal load state; 
 determining, according to load states of the plurality of logical threads of the component, that a number of logical threads of the component needs to be adjusted by:
 calculating a high load probability of the component and a low load probability of the component, 
 determining that at least one of the high load probability of the component and the low load probability of the component is greater than a third preset threshold, and 
 determining that the number of logical threads of the component needs to be adjusted; and 
 
 adjusting the number of logical threads of the component.

Join the waitlist — get patent alerts

Track US10783005B2 — get alerts on status changes and closely related new filings.

We store only your email — no account needed. See our privacy policy.