Thread asynchronous processing system based on demand adaptive adjustment

Through the deep learning model, the thread pool adjustment cycle and parameters are predicted, and the thread pool is adaptively adjusted, which solves the problem of not being able to adapt to dynamic task load in the existing technology, and improves the system's processing efficiency and resource utilization.

CN119862020AActive Publication Date: 2025-04-22ZHEJIANG FUBAO INTELLIGENT TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510354459.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-25
Publication Date
2025-04-22
Estimated Expiration
2045-03-25

AI Technical Summary

Technical Problem

The existing thread pooling technology cannot adapt to dynamic task loads, resulting in low resource utilization and the inability to achieve optimal management of thread pools.

Method used

By obtaining the task type, thread pool operation parameters and system resource parameters in the sequence of tasks to be executed, input these data into the pre-trained deep learning model, predicting the thread pool adjustment period and parameters, thereby adaptively adjusting the thread pool.

Benefits of technology

It effectively improves the system's processing efficiency and resource utilization under different task loads and resource conditions, and solves the problem of resource waste caused by the inability to meet the adaptive needs and frequent dynamic adjustments in traditional thread pools.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119862020A_ABST
    Figure CN119862020A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of thread asynchronous processing, and discloses a thread asynchronous processing system based on demand self-adaptive adjustment. The system firstly obtains demand index data including to-be-executed task types, thread pool operation parameters, system working resource parameters and the like, and then inputs the demand index data into a pre-trained deep learning model. The model predicts a thread pool adjustment period and adjustment parameters, such as thread number, priority and other adjustment amounts, according to index data such as the proportion of to-be-executed task types. And performing adaptive adjustment on the thread pool according to a prediction result. The system intelligently perceives task and resource conditions by means of a deep learning model, periodically optimizes thread pool configuration, effectively improves processing efficiency and resource utilization rate of the system under different task load and resource conditions, and solves the problem that traditional thread pool static adjustment cannot meet self-adaptive requirements, and the service life of the system is prolonged. And the method and the device are suitable for thread asynchronous processing scenes in multiple fields.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of thread asynchronous processing, and in particular to a thread asynchronous processing system based on demand adaptive adjustment. Background Art

[0002] Thread asynchronous processing means that during the execution of a task, the main thread can be returned directly to continue processing other tasks without blocking the main thread, thereby improving the overall processing capacity of the system. When the system processes multiple requests at the same time, if a request takes a long time, subsequent requests can only be processed after the request is completed, which will seriously affect the user experience. Thread asynchronous processing can hand over these time-consuming requests to the background worker thread for processing, and the main thread continues to process other requests, so that users can get faster responses.

[0003] Existing thread asynchronous processing is usually managed by thread pool. Thread pool is a tool for managing threads based on the pooling concept. Its basic idea is to establish an object pool and open up a memory space to store multiple threads. However, in actual applications, the performance and resource utilization of the thread pool may be affected by many factors, such as the arrival rate of tasks, execution time, system load, etc.

[0004] Most current thread pool technologies are managed by preset rules or static configurations, which cannot adapt to dynamic task loads. In addition, there is also a method of dynamically adjusting the thread pool capacity based on the thread pool working parameters. This method requires real-time updates of the thread pool capacity, and does not consider the characteristics of one or multiple consecutive tasks in the task queue in actual demand, which not only causes unnecessary excessive resource consumption but also fails to achieve optimal management of the thread pool. Therefore, how to achieve demand-based adaptive adjustment of thread asynchronous processing is an urgent problem to be solved. Summary of the invention

[0005] In view of the above technical problems, the present invention provides a thread asynchronous processing system, method, electronic device and computer storage medium based on demand adaptive adjustment to at least partially solve the above technical problems.

[0006] The present invention discloses a thread asynchronous processing system based on demand adaptive adjustment, the system includes a thread asynchronous processing device, characterized in that the asynchronous processing device includes: an acquisition unit, used to acquire demand indicator data, the indicator data at least includes the type of task to be executed in the task sequence to be executed, the operation parameters of the thread pool at the current moment, and the system working resource parameters at the current moment; a prediction unit, used to input the demand indicator data into a pre-trained first model to obtain a thread pool adjustment period and a thread pool adjustment parameter, including obtaining a first thread pool adjustment period and a first thread pool adjustment parameter based on the proportion of the first task type in the task sequence to be executed, and obtaining a second thread pool adjustment period and a second thread pool adjustment parameter based on the proportion of the second task type in the task sequence to be executed; an adjustment unit, used to adaptively adjust the thread pool based on the thread pool adjustment period and the thread pool adjustment parameter.

[0007] The present invention also discloses a thread asynchronous processing method based on demand adaptive adjustment, the method comprising the following steps: obtaining demand indicator data, the indicator data at least including the type of task to be executed in the task sequence to be executed, the operating parameters of the thread pool at the current moment, and the system working resource parameters at the current moment; inputting the demand indicator data into a pre-trained first model to obtain a thread pool adjustment cycle and thread pool adjustment parameters, including obtaining a first thread pool adjustment cycle and a first thread pool adjustment parameter based on the proportion of the first task type in the task sequence to be executed, and obtaining a second thread pool adjustment cycle and a second thread pool adjustment parameter based on the proportion of the second task type in the task sequence to be executed; based on the thread pool adjustment cycle and the thread pool adjustment parameters, adaptively adjusting the thread pool.

[0008] Optionally, the thread pool adjustment period is dynamically adjusted based on the types of tasks to be executed and the order of the task types in the task sequence.

[0009] Optionally, based on a second thread pool adjustment period and a second thread pool adjustment parameter corresponding to a second execution task of a similar type to the task to be executed, the thread pool adjustment period and the thread pool adjustment parameter are optimized.

[0010] Optionally, the first task type is a computationally intensive task, and the second task type is an I / O intensive task.

[0011] The present invention also discloses an electronic device, comprising: at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor, wherein the processor executes the computer program to implement any of the above methods.

[0012] The present invention also discloses a computer storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement any of the above methods.

[0013] The present invention discloses a thread asynchronous processing method based on demand adaptive adjustment. The method first obtains demand index data including the type of task to be executed, thread pool operation parameters, system working resource parameters, etc., and then inputs it into a pre-trained deep learning model. The model predicts the thread pool adjustment cycle and adjustment parameters, such as the number of threads, priority, and other adjustment amounts, based on index data such as the proportion of task types to be executed. The thread pool is adaptively adjusted based on the prediction results. This method uses a deep learning model to intelligently perceive the task and resource status, periodically optimizes the thread pool configuration, and effectively improves the system's processing efficiency and resource utilization under different task loads and resource conditions. It solves the problem that the traditional thread pool static adjustment cannot meet the adaptive needs, and the dynamic and frequent adjustment causes waste of system resources. It is suitable for thread asynchronous processing scenarios in multiple fields. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0015] Figure 1 The present invention discloses a method for asynchronously processing threads based on adaptive demand adjustment.

[0016] Figure 2 It is a schematic diagram of a thread asynchronous processing device disclosed in an embodiment of the present invention.

[0017] Figure 3 The present invention is a schematic diagram of an electronic device for thread asynchronous processing based on demand adaptive adjustment disclosed in an embodiment of the present invention. DETAILED DESCRIPTION

[0018] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0019] In addition, the technical features involved in the different embodiments of the present application described below can be combined with each other as long as they do not conflict with each other.

[0020] Figure 1 An embodiment of the present invention provides a thread asynchronous processing method based on demand adaptive adjustment. The method can be executed by a thread asynchronous processing system based on demand adaptive adjustment. The system can be implemented in the form of hardware and / or software and can be configured in an electronic device, which can be a server. Figure 1 As shown, the method includes: S101, obtaining demand indicator data, wherein the indicator data at least includes the type of task to be executed in the task sequence to be executed, the operating parameters of the thread pool at the current moment, and the working parameters of the system resources at the current moment.

[0021] Among them, specific requirements can be determined according to the actual application scenarios, and the tasks to be executed correspond to the actual application scenarios. For example, the application scenario can be a web crawler, and the tasks to be executed may include web page crawling, data parsing and storage; the application scenario can be file processing, and the tasks to be executed may include file upload and download, file format conversion; the application scenario can be distributed computing, and the tasks to be executed may include big data analysis, machine learning model training; the application scenario can be graphics and image processing, and the tasks to be executed may include image rendering, image filter processing; the application scenario can be a server-side application, and the tasks to be executed may include Web service request processing, message queue processing, etc.

[0022] Optionally, the tasks to be executed can be classified according to the resource consumption mode and the purpose of task completion, for example, they can be divided into computing-intensive tasks or I / O-intensive tasks. Computation-intensive tasks mainly rely on the CPU to perform a large number of computing operations, so the CPU priority of the thread needs to be set relatively high. Such tasks are usually suitable for using threads dedicated to computing, and these threads should minimize other non-computing related operations in design and configuration. For example, avoid frequent I / O operations in these threads to avoid interfering with the continuity of computing tasks. I / O-intensive tasks will be in a blocked state when waiting for I / O operations to complete, such as waiting for network responses, disk read and write operations, etc. In order to reduce the impact of frequent I / O operations on system performance, threads can have certain I / O buffering functions. For example, in a file reading task, the thread can temporarily store the read file data in the buffer and process a certain amount of data at one time, instead of processing only a small amount of bytes of data each time, thereby improving I / O efficiency.

[0023] Among them, the running parameters of the thread pool at the current moment may include the number of threads, the type of threads (such as computationally intensive threads, I / O intensive threads), the number of core threads, which is the number of threads that always remain alive in the thread pool, even if they are idle. These threads are the basic working force of the thread pool, used to process tasks in the task queue, the maximum number of threads, the maximum number of threads allowed to be created by the thread pool, the thread survival time, when the number of threads in the thread pool exceeds the number of core threads, the idle threads will be automatically destroyed after the waiting time for tasks exceeds the survival time to release system resources; task queue, a queue for storing tasks waiting for thread processing. Common types of task queues include blocking queues (Blocking Queue), such as ArrayBlockingQueue (bounded blocking queue), LinkedBlockingQueue (unbounded blocking queue), etc., thread factory, a factory class for creating new threads. Through the thread factory, you can customize the thread creation process, such as setting the thread name, priority, daemon thread properties, etc.; rejection strategy, when the task queue is full and the number of threads in the thread pool has reached the maximum number of threads, the processing strategy for newly submitted tasks.

[0024] The system working resource parameters at the current moment may include key indicators such as the current CPU usage (expressed as a percentage), the current memory usage (percentage), the disk I / O bandwidth usage (percentage), and the network bandwidth usage (percentage).

[0025] S102, input the demand indicator data into a pre-trained first model to obtain a thread pool adjustment period and thread pool adjustment parameters, including obtaining a first thread pool adjustment period and a first thread pool adjustment parameter based on the proportion of the first task type in the task sequence to be executed, and obtaining a second thread pool adjustment period and a second thread pool adjustment parameter based on the proportion of the second task type in the task sequence to be executed.

[0026] Among them, the first pre-trained model is an artificial neural network model based on deep learning (multi-layer perceptron (MLP) model), and the model architecture includes an input layer, several hidden layers and an output layer. The number of neurons in the input layer corresponds to the dimension of the demand indicator data. The hidden layer can be set to multiple layers, and the number of neurons in each layer is determined according to the actual situation. The output layer has two outputs, corresponding to the thread pool adjustment cycle and the thread pool adjustment parameters. The thread pool adjustment parameters can be set according to the actual needs. Dimensions, such as thread number adjustment amount, thread priority adjustment amount, etc. It can be understood that the neural network model is not limited to the MLP model.

[0027] Specifically, after the information is processed by the hidden layer, the data finally reaches the output layer. For the prediction of the thread pool adjustment period, the single neuron in the output layer will perform weighted summation and bias addition operations again based on the information received from the hidden layer. Suppose the input of the output layer neuron is (The output from the hidden layer is weighted and summed with the bias), and its output is (The predicted thread pool adjustment period) can be mapped by a suitable activation function. For example, if the expected adjustment period is in the range of positive real numbers, the Sigmoid function may be used. Or use the linear function directly (i.e. ) to get the final prediction value .

[0028] Assume that the input layer has neurons, the input vector is , the weight matrix from the input layer to the first hidden layer is , the bias vector is , then the first hidden layer The output of a neuron for: ;in, is the activation function.

[0029] For subsequent hidden layers, assuming that The hidden layers have neurons, which The weight matrix of the hidden layer is , the bias vector is , then The hidden layer The output of a neuron for: Finally, for the neuron in the output layer that predicts the thread pool adjustment period, let the input it receives from the last hidden layer be , the weight vector is , the bias is , if a linear activation function is used, the predicted thread pool adjustment period for: ;in Indicates neurons, is the last hidden layer The output of a neuron.

[0030] Preferably, based on the proportion of the first task type in the task sequence to be executed, the first thread pool adjustment period and the first thread pool adjustment parameter are obtained, and based on the proportion of the second task type in the task sequence to be executed, the second thread pool adjustment period and the second thread pool adjustment parameter are obtained.

[0031] Preferably, different models can be used to predict the thread pool adjustment period and the thread pool adjustment parameters respectively. For example, considering the serial correlation of tasks or resources changing over time, a long short-term memory network LSTM can be used for the thread pool adjustment period, and a general deep neural network DNN can be used for prediction of the thread pool parameter adjustment, which is not limited in this embodiment.

[0032] Specifically, the first task type is a computationally intensive task, and the second task type is an I / O intensive task. The tasks to be executed in the sequence of tasks to be executed are usually sorted in order of execution. The adjustment period of the thread pool can be dynamically adjusted based on the proportion of task types in the sequence of tasks to be executed and / or the order of different task types. For example, if the proportion of computationally intensive tasks in the sequence is high and / or the computationally intensive tasks are in the front, then based on the high CPU priority requirements for computationally intensive tasks, the thread pool adjustment period is shortened accordingly to minimize the interruption of computational tasks by other tasks. The corresponding adjustment of the thread pool parameters can be to increase the proportion of the number of computationally intensive threads. As another example, for example, if the proportion of I / O intensive tasks in the sequence is high and / or the I / O intensive tasks are in the front, then based on the low CPU priority requirements for I / O intensive tasks, the thread pool adjustment period is lengthened accordingly to reduce the unnecessary consumption and waste of resources caused by frequent adjustment of the thread pool. The corresponding adjustment of the thread pool parameters can be to increase the proportion of I / O intensive task threads. It is understandable that in addition to adjusting the thread type for different situations, other parameters of the thread pool can also be coordinated and adjusted according to the proportion and sorting of task types, which will not be described in detail here.

[0033] Preferably, in order to more accurately predict the adjustment cycle and thread pool adjustment parameters of the thread pool, the thread pool adjustment cycle and thread pool adjustment parameters corresponding to other execution tasks in the system that are similar to the type of task to be executed can also be combined. On the one hand, the adjustment cycle and adjustment parameters of this task can be optimized with reference to the adjustment cycle and adjustment parameters of other tasks. On the other hand, the consumption or pending consumption of the overall system resources can be considered to ensure that the system load is balanced on different thread pools.

[0034] S103, adaptively adjusting the thread pool based on the thread pool adjustment period and the thread pool adjustment parameters.

[0035] Through the disclosed embodiments, the thread pool adjustment cycle and adjustment parameters, such as the number of threads, priority, and other adjustment amounts, can be predicted through a deep learning model based on indicator data such as the proportion of task types to be executed and / or the order of task types. The thread pool is adaptively adjusted based on the prediction results. This method uses a deep learning model to intelligently perceive the task and resource status, periodically optimizes the thread pool configuration, and effectively improves the system's processing efficiency and resource utilization under different task loads and resource conditions. It solves the problem that traditional thread pool static adjustment cannot meet adaptive requirements and dynamic and frequent adjustments cause waste of system resources. It is suitable for thread asynchronous processing scenarios in multiple fields.

[0036] Another exemplary embodiment of the present disclosure provides a thread asynchronous processing system based on demand adaptive adjustment, the system at least includes a thread asynchronous processing device based on demand adaptive adjustment (or thread asynchronous processing device), such as Figure 2 As shown, the device includes: an acquisition unit 201, which is used to acquire demand indicator data, and the indicator data at least includes the type of tasks to be executed in the sequence of tasks to be executed, the operating parameters of the thread pool at the current moment, and the system working resource parameters at the current moment.

[0037] The prediction unit 202 is used to input the demand indicator data into a pre-trained first model to obtain a thread pool adjustment period and thread pool adjustment parameters, including obtaining a first thread pool adjustment period and a first thread pool adjustment parameter based on the proportion of the first task type in the task sequence to be executed, and obtaining a second thread pool adjustment period and a second thread pool adjustment parameter based on the proportion of the second task type in the task sequence to be executed.

[0038] The adjustment unit 203 is used to adaptively adjust the thread pool based on the thread pool adjustment period and the thread pool adjustment parameters.

[0039] Optionally, the acquisition unit 201 is used to acquire demand indicator data, where the indicator data at least includes the type of tasks to be executed in the sequence of tasks to be executed, the operating parameters of the thread pool at the current moment, and the working resource parameters of the system at the current moment.

[0040] Optionally, the prediction unit 202 is used to input the demand indicator data into a pre-trained first model to obtain a thread pool adjustment period and thread pool adjustment parameters, including obtaining a first thread pool adjustment period and a first thread pool adjustment parameter based on the proportion of the first task type in the task sequence to be executed, and obtaining a second thread pool adjustment period and a second thread pool adjustment parameter based on the proportion of the second task type in the task sequence to be executed.

[0041] Optionally, the adjustment unit 203 is used to adaptively adjust the thread pool based on the thread pool adjustment period and the thread pool adjustment parameters.

[0042] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0043] Through the disclosed embodiments, the thread pool adjustment cycle and adjustment parameters, such as the number of threads, priority, and other adjustment amounts, can be predicted through a deep learning model based on indicator data such as the proportion of task types to be executed and / or the order of task types. The thread pool is adaptively adjusted based on the prediction results. This method uses a deep learning model to intelligently perceive the task and resource status, periodically optimizes the thread pool configuration, and effectively improves the system's processing efficiency and resource utilization under different task loads and resource conditions. It solves the problem that traditional thread pool static adjustment cannot meet adaptive requirements and dynamic and frequent adjustments cause waste of system resources. It is suitable for thread asynchronous processing scenarios in multiple fields.

[0044] It should be noted that: the thread asynchronous processing device provided in the above embodiment only uses the division of the above functional units as an example to explain when adjusting the parameters of the thread pool. In actual applications, the above functions can be assigned to different functional units as needed. In addition, the thread asynchronous processing device provided in the above embodiment and the thread asynchronous processing method embodiment based on demand adaptive adjustment belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.

[0045] Figure 3 Schematic diagram of an electronic device 300 according to an embodiment of the present application. Figure 3 As shown, the electronic device 300 further includes: a thread asynchronous processing module 303, a communication module 304, an input unit 305 and a power supply 306. The processor 301 is electrically connected to the thread asynchronous processing module 303, the communication module 304, the input unit 305 and the power supply 306 respectively. Those skilled in the art can understand that Figure 3 The electronic device structure shown in the figure does not constitute a limitation of the electronic device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0046] The thread asynchronous processing module 303 may be used for thread asynchronous processing that is adaptively adjusted based on demand.

[0047] The communication module 304 can be used to communicate with other devices.

[0048] The input unit 305 may be used to receive input numbers, character information or user feature information (such as fingerprint, iris, facial information, etc.), and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.

[0049] The power supply 306 is used to supply power to various components of the electronic device 300. Optionally, the power supply 306 can be logically connected to the processor 301 through a power management system, so that the power management system can manage charging, discharging, power consumption, and other functions. The power supply 306 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0050] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0051] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.

[0052] To this end, an embodiment of the present application provides a computer-readable storage medium, in which a plurality of computer programs are stored, and the computer program can be loaded by a processor to execute the steps of a thread asynchronous processing method based on demand adaptive adjustment provided by an embodiment of the present application. For example, the computer program can perform the following steps: obtaining demand indicator data, the indicator data at least including the type of task to be executed in the task sequence to be executed, the operating parameters of the thread pool at the current moment, and the system working resource parameters at the current moment; inputting the demand indicator data into a pre-trained first model to obtain a thread pool adjustment cycle and a thread pool adjustment parameter, including obtaining a thread pool adjustment first cycle and a thread pool adjustment first parameter based on the proportion of the first task type in the task sequence to be executed, and obtaining a thread pool adjustment second cycle and a thread pool adjustment second parameter based on the proportion of the second task type in the task sequence to be executed, and adaptively adjusting the thread pool based on the thread pool adjustment cycle and the thread pool adjustment parameter.

[0053] The computer-readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0054] Since the computer program stored in the storage medium can execute the steps of any method of thread asynchronous processing based on demand adaptive adjustment provided in the embodiments of the present application, the beneficial effects of any method of thread asynchronous processing based on demand adaptive adjustment provided in the embodiments of the present application can be achieved. For details, please see the previous embodiments and will not be repeated here.

[0055] The present application is described with reference to flowcharts and / or block diagrams of methods, devices (systems) and computer program products according to embodiments of the present application. These computer program instructions may be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the steps in the flowchart. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0056] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0057] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0058] The embodiments of the present invention are described in detail above with reference to the accompanying drawings, but the present invention is not limited to the described embodiments. For those skilled in the art, various changes, modifications, substitutions and variations of these embodiments are made without departing from the principles and spirit of the present invention, and still fall within the scope of protection of the present invention.

Claims

1. A thread asynchronous processing system based on demand adaptive adjustment, the system comprising a thread asynchronous processing device, characterized in that: The asynchronous processing device includes: an acquisition unit, used to acquire demand indicator data, the indicator data at least including the type of tasks to be executed in the sequence of tasks to be executed, the operating parameters of the thread pool at the current moment, and the system working resource parameters at the current moment; a prediction unit, used to input the demand indicator data into a pre-trained first model to obtain a thread pool adjustment period and thread pool adjustment parameters, including obtaining a first thread pool adjustment period and a first thread pool adjustment parameter based on the proportion of the first task type in the sequence of tasks to be executed, and obtaining a second thread pool adjustment period and a second thread pool adjustment parameter based on the proportion of the second task type in the sequence of tasks to be executed; an adjustment unit, used to adaptively adjust the thread pool based on the thread pool adjustment period and the thread pool adjustment parameters.

2. The thread asynchronous processing system based on demand adaptive adjustment according to claim 1, characterized in that: The prediction unit is further used to dynamically adjust the thread pool adjustment period based on the types of tasks to be executed and the order of the task types in the task sequence.

3. The thread asynchronous processing system based on demand adaptive adjustment according to claim 1, characterized in that: The prediction unit is also used to optimize the thread pool adjustment period and the thread pool adjustment parameters based on the second thread pool adjustment period and the second thread pool adjustment parameters corresponding to the second execution task that is similar to the type of the task to be executed.

4. The thread asynchronous processing system based on demand adaptive adjustment according to claim 1, characterized in that: The first task type is a computationally intensive task, and the second task type is an I / O intensive task.

5. A thread asynchronous processing method based on demand adaptive adjustment, characterized in that: The method comprises the following steps: obtaining demand indicator data, wherein the demand indicator data at least comprises the type of tasks to be executed in the sequence of tasks to be executed, the operating parameters of the thread pool at the current moment, and the working resource parameters of the system at the current moment; The demand indicator data is input into a pre-trained first model to obtain a thread pool adjustment period and a thread pool adjustment parameter, including: based on the proportion of the first task type in the task sequence to be executed, obtaining a first thread pool adjustment period and a first thread pool adjustment parameter, and based on the proportion of the second task type in the task sequence to be executed, obtaining a second thread pool adjustment period and a second thread pool adjustment parameter; based on the thread pool adjustment period and the thread pool adjustment parameter, the thread pool is adaptively adjusted.

6. The thread asynchronous processing method based on demand adaptive adjustment according to claim 5, characterized in that: The thread pool adjustment period is dynamically adjusted based on the types of tasks to be executed and the order of the task types in the task sequence.

7. The thread asynchronous processing method based on demand adaptive adjustment according to claim 5, characterized in that: Based on a second thread pool adjustment period and a second thread pool adjustment parameter corresponding to a second execution task similar to the type of the task to be executed, the thread pool adjustment period and the thread pool adjustment parameter are optimized.

8. The thread asynchronous processing method based on demand adaptive adjustment according to claim 5, characterized in that: The first task type is a computationally intensive task, and the second task type is an I / O intensive task.

9. An electronic device, comprising: At least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor, wherein the processor executes the computer program to implement the method according to any one of claims 5 to 7.

10. A computer storage medium storing a computer program, characterized in that: The computer program is executed by a processor to implement the method according to any one of claims 5 to 7.

Citation Information

Patent Citations

  • Deep learning-based thread pool adaptive capacity adjustment method and device

    CN114741186A

  • Control method and device for adaptive thread pool

    CN116820703A

  • Model training method and device, task scheduling method and device and computer storage medium

    CN117193992A

  • Method and device for dynamically regulating and controlling thread pool, storage medium and computer equipment

    CN117667349A

  • Task scheduling method, system and device and computer readable storage medium

    CN118838698A