The invention provides a thread
allocation method and
electronic equipment, and belongs to the technical field of
resource allocation. According to the method, when the number of nodes in a ready node
queue is larger than the number of idle threads, the priority
score of each node in the ready node
queue is calculated according to the time consumption mean value, the time consumption standard deviation and the executed probability corresponding to each node, and then the threads are distributed to each node according to the priority
score corresponding to each node. And distributing threads to the nodes with higher priority scores preferentially. And according to the time consumption mean value, the time consumption standard deviation and the executed probability corresponding to each node, calculating the priority
score of each node in the ready node
queue, so that the time consumption can be minimized under the constraint that each DAG
processing is not overtime, and the priority decision accuracy can be improved. Meanwhile, under limited thread resources, through a priority strategy, the time consumption of micro-service interface
processing can be automatically optimized, the
timeout rate is reduced, the interface response speed is improved, and
machine resources are saved.