A multi-queue task parallel computing method, device, equipment and medium
By classifying and parallel processing of electromagnetic compatibility calculation tasks, and using a task queue built with multi-core CPUs, the problem of low computing efficiency in the existing technology is solved and efficient electromagnetic compatibility calculation is achieved.
Patent Information
- Application Number
- CN202210374332.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-11
- Publication Date
- 2025-08-05
- Estimated Expiration
- 2042-04-11
AI Technical Summary
In electromagnetic compatibility analysis and calculation designed for cluster environments, the prior art failed to maximize the computing resource efficiency of a single-machine multi-core CPU, resulting in low computing efficiency and unable to meet the diversity of business needs.
By acquiring the electromagnetic compatibility calculation tasks of each radio station and saving them to the first task queue, the task queue is classified using a preset single thread, and different types of tasks are sent to a stand-alone task processing device built on a multi-core CPU in advance, and parallel computing processing is performed using multiple second task queues.
Maximize the use of multi-core computing capabilities, improve the parallel computing efficiency of electromagnetic compatibility computing tasks, and meet the diversity of business needs.
Smart Images

Figure CN114706683B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of software multi-task parallel computing, and particularly to a multi-queue task parallel computing method, device, equipment and medium. Background Art
[0002] In the software design process for electromagnetic compatibility analysis and calculation of multiple radio stations in a region simultaneously, electromagnetic compatibility analysis and calculation are involved for each radio station. The electromagnetic compatibility analysis and calculation process is complex, with a large amount of calculation, and there is a need for multi-task concurrent processing. Currently, since the framework is designed for a cluster environment, the system is relatively large and complex, and the operation of the system itself occupies a relatively large amount of computing resources. Facing the complex calculation of electromagnetic compatibility analysis, there is no design for computing orchestration for specific radio service scenarios. Therefore, the computing efficiency is low. The design for cluster nodes does not consider the computing power of a single multi-core CPU (Central Processing Unit) itself, and fails to maximize the efficiency of the computing resources of a single CPU.
[0003] As can be seen from the above, in the process of multi-queue task parallel computing, how to maximize the multi-core computing power and improve the parallel computing efficiency of electromagnetic compatibility computing tasks to meet the diversity of business requirements is an issue to be solved in this field. Summary of the Invention
[0004] In view of this, the purpose of the present invention is to provide a multi-queue task parallel computing method, device, equipment and medium, which can maximize the multi-core computing power, improve the parallel computing efficiency of electromagnetic compatibility computing tasks, and meet the diversity of business requirements. The specific solutions are as follows:
[0005] In the first aspect, the present application discloses a multi-queue task parallel computing method, including:
[0006] Obtain the electromagnetic compatibility computing tasks of each radio station and save them to the first task queue;
[0007] Classify the electromagnetic compatibility computing tasks in the first task queue through a preset single thread to obtain different types of electromagnetic compatibility computing tasks;
[0008] Send different types of electromagnetic compatibility computing tasks to a single-machine task processing device pre-constructed based on a multi-core CPU and provided with multiple second task queues through the first task queue; wherein, the single-machine task processing device sends the received different types of electromagnetic compatibility computing tasks to the corresponding second task queues respectively according to a preset mapping relationship, so as to perform parallel computing processing on the obtained electromagnetic compatibility computing tasks through the multiple second task queues.
[0009] Optionally, the classification of the electromagnetic compatibility calculation tasks in the first task queue through the preset single thread includes:
[0010] Obtain the electromagnetic compatibility service requirements of the radio station, and determine a task classification method based on the electromagnetic compatibility service requirements;
[0011] Use the task classification method and classify the electromagnetic compatibility calculation tasks in the first task queue through the preset single thread.
[0012] Optionally, the sending of different types of the electromagnetic compatibility calculation tasks to the single-machine task processing device pre-constructed based on a multi-core CPU and provided with a plurality of second task queues through the first task queue includes:
[0013] Based on the order of magnitude of the running time of the preset single thread, the number of tasks of the currently remaining unprocessed tasks in the second task queue, the total queuing time of all the currently remaining unprocessed tasks in each second task queue, and the average queuing time of each of the currently remaining unprocessed tasks in each second task queue, determine the sending quantity of the electromagnetic compatibility calculation tasks;
[0014] Through the first task queue and based on the sending quantity of the electromagnetic compatibility calculation tasks, send different types of the electromagnetic compatibility calculation tasks to the single-machine task processing device pre-constructed based on a multi-core CPU and provided with a plurality of the second task queues.
[0015] Optionally, before determining the sending quantity of the electromagnetic compatibility calculation tasks, it further includes:
[0016] Send the number of tasks of the currently remaining unprocessed tasks in the second task queue, the total queuing time of all the currently remaining unprocessed tasks in each second task queue, and the average queuing time of each of the currently remaining unprocessed tasks in each second task queue to the first task queue.
[0017] Optionally, before determining the sending quantity of the electromagnetic compatibility calculation tasks, it further includes:
[0018] Estimate the number of tasks of all the electromagnetic compatibility calculation tasks in the first task queue to obtain a task quantity estimated value;
[0019] Based on the task quantity estimated value, determine the order of magnitude of the running time of the preset single thread.
[0020] Optionally, before determining the sending quantity of the electromagnetic compatibility calculation tasks, it further includes:
[0021] Determine the number of tasks currently remaining unprocessed in the second task queue, and determine the total queuing time of all the currently remaining unprocessed tasks in each of the second task queues;
[0022] Calculate the ratio of the total queuing time to the number of tasks currently remaining unprocessed in the second task queue, so as to obtain the average queuing time of each of the currently remaining unprocessed tasks in each of the second task queues.
[0023] Optionally, the multi-queue task parallel computing method further includes:
[0024] Obtain multi-core CPU information and operating system information;
[0025] Create multiple second task queues in the single-machine task processing device based on the multi-core CPU information and the operating system information.
[0026] In a second aspect, the present application discloses a multi-queue task parallel computing device, including:
[0027] A computing task saving module, configured to obtain electromagnetic compatibility computing tasks of each radio station and save them to a first task queue;
[0028] A computing task classification module, configured to classify the electromagnetic compatibility computing tasks in the first task queue through a preset single thread to obtain different types of electromagnetic compatibility computing tasks;
[0029] A task computing module, configured to send different types of electromagnetic compatibility computing tasks to a single-machine task processing device pre-constructed based on a multi-core CPU and provided with multiple second task queues through the first task queue; wherein, the single-machine task processing device sends the received different types of electromagnetic compatibility computing tasks to the corresponding second task queues respectively, so as to perform parallel computing processing on the obtained electromagnetic compatibility computing tasks through the multiple second task queues.
[0030] In a third aspect, the present application discloses an electronic device, including:
[0031] A memory, configured to save a computer program;
[0032] A processor, configured to execute the computer program to implement the foregoing multi-queue task parallel computing method.
[0033] In a fourth aspect, the present application discloses a computer storage medium, configured to save a computer program; wherein, when the computer program is executed by a processor, the steps of the foregoing disclosed multi-queue task parallel computing method are implemented.
[0034] As can be seen, the present application provides a multi-queue task parallel computing method, including obtaining electromagnetic compatibility computing tasks of each radio station and saving them to the first task queue; classifying the electromagnetic compatibility computing tasks in the first task queue through a preset single thread to obtain different types of electromagnetic compatibility computing tasks; sending different types of electromagnetic compatibility computing tasks to a single-machine task processing device pre-constructed based on a multi-core CPU and provided with a plurality of second task queues through the first task queue; wherein, the single-machine task processing device sends the received different types of electromagnetic compatibility computing tasks to the corresponding second task queues respectively according to a preset mapping relationship, so as to perform parallel computing processing on the obtained electromagnetic compatibility computing tasks through the plurality of second task queues. By classifying the electromagnetic compatibility computing tasks, the present application can meet the diversity of business requirements, and by using a single-machine task processing device pre-constructed based on a multi-core CPU and provided with a plurality of second task queues to perform parallel computing processing on the electromagnetic compatibility computing tasks, it can maximize the multi-core computing ability and effectively improve the parallel computing efficiency of the electromagnetic compatibility computing tasks. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only the embodiments of the present invention, and for those of ordinary skill in the art, other drawings can be obtained according to the provided drawings without creative efforts.
[0036] Figure 1 It is a flowchart of a multi-queue task parallel computing method disclosed in the present application;
[0037] Figure 2 It is a flowchart of a multi-queue task parallel computing method disclosed in the present application;
[0038] Figure 3 It is a specific flowchart of a multi-queue task parallel computing method disclosed in the present application;
[0039] Figure 4 It is a schematic structural diagram of a multi-queue task parallel computing device disclosed in the present application;
[0040] Figure 5 It is a structural diagram of an electronic device provided by the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0041] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0042] In the current context, in the software design process of electromagnetic compatibility analysis and calculation for multiple radio stations in a region simultaneously, electromagnetic compatibility analysis and calculation are involved for each radio station. The electromagnetic compatibility analysis and calculation process is complex, with a large amount of calculation, and there is a need for multi-task concurrent processing. Currently, since the framework is designed for a cluster environment, the system is relatively large and complex, and the operation of the system itself requires a relatively large amount of computing resources. Facing the complex calculation of electromagnetic compatibility analysis, there is no design for calculating and arranging according to specific radio service scenarios. Therefore, the calculation efficiency is relatively low. The design for cluster nodes does not consider the computing power of a single multi-core CPU (Central Processing Unit) itself, and fails to maximize the efficiency of the computing resources of a single CPU. As can be seen from the above, in the process of parallel calculation of multi-queue tasks, how to maximize the multi-core computing power and improve the parallel calculation efficiency of electromagnetic compatibility tasks to meet the diversity of service requirements is a problem to be solved in this field.
[0043] See Figure 1 As shown, an embodiment of the present invention discloses a method for parallel calculation of multi-queue tasks, which may specifically include:
[0044] Step S11: Obtain the electromagnetic compatibility calculation tasks of each radio station and save them to the first task queue.
[0045] Step S12: Classify the electromagnetic compatibility calculation tasks in the first task queue through a preset single thread to obtain different types of electromagnetic compatibility calculation tasks.
[0046] Step S13: Send different types of electromagnetic compatibility calculation tasks to a single-machine task processing device constructed based on a multi-core CPU and provided with multiple second task queues through the first task queue; wherein, the single-machine task processing device sends the received different types of electromagnetic compatibility calculation tasks to the corresponding second task queues respectively according to a preset mapping relationship, so as to perform parallel calculation processing on the obtained electromagnetic compatibility calculation tasks through the multiple second task queues.
[0047] In this embodiment, based on the running time order of magnitude of the preset single thread, the number of tasks remaining unprocessed in the second task queue currently, the total queuing time of all the currently remaining unprocessed tasks in each second task queue, and the average queuing time of each of the currently remaining unprocessed tasks in each second task queue, the sending quantity of the electromagnetic compatibility calculation tasks is determined. Then, through the first task queue and based on the sending quantity of the electromagnetic compatibility calculation tasks, different types of the electromagnetic compatibility calculation tasks are sent to a single-machine task processing device that is pre-constructed based on a multi-core CPU and has multiple second task queues.
[0048] In this embodiment, before sending different types of the electromagnetic compatibility calculation tasks to a single-machine task processing device that is pre-constructed based on a multi-core CPU and has multiple second task queues through the first task queue, it further includes estimating the number of tasks of all the electromagnetic compatibility calculation tasks in the first task queue to obtain an estimated value of the number of tasks, and then determining the running time order of magnitude of the preset single thread based on the estimated value of the number of tasks; determining the number of tasks remaining unprocessed in the second task queue currently, and determining the total queuing time of all the currently remaining unprocessed tasks in each second task queue, calculating the ratio of the total queuing time to the number of tasks remaining unprocessed in the second task queue currently to obtain the average queuing time of each of the currently remaining unprocessed tasks in each second task queue; and then sending the number of tasks remaining unprocessed in the second task queue currently, the total queuing time of all the currently remaining unprocessed tasks in each second task queue, and the average queuing time of each of the currently remaining unprocessed tasks in each second task queue to the first task queue.
[0049] In this embodiment, the electromagnetic compatibility calculation tasks of each radio station are obtained and saved to the first task queue; the electromagnetic compatibility calculation tasks in the first task queue are classified through a preset single-thread to obtain different types of electromagnetic compatibility calculation tasks; the different types of electromagnetic compatibility calculation tasks are sent to a single-machine task processing device that is pre-constructed based on a multi-core CPU and has multiple second task queues through the first task queue; wherein, the single-machine task processing device sends the received different types of electromagnetic compatibility calculation tasks to the corresponding second task queues respectively based on a preset mapping relationship, so as to perform parallel calculation processing on the obtained electromagnetic compatibility calculation tasks through the multiple second task queues. By classifying the electromagnetic compatibility calculation tasks, this application can meet the diversity of service requirements, and using a single-machine task processing device that is pre-constructed based on a multi-core CPU and has multiple second task queues to perform parallel calculation processing on the electromagnetic compatibility calculation tasks can maximize the multi-core computing power and effectively improve the parallel calculation efficiency of the electromagnetic compatibility calculation tasks.
[0050] See Figure 2 As shown, an embodiment of the present invention discloses a multi-queue task parallel calculation method, which may specifically include:
[0051] Step S21: Obtain the electromagnetic compatibility calculation tasks of each radio station and save them to the first task queue.
[0052] Step S22: Obtain the electromagnetic compatibility service requirements of the radio station, determine a task classification method based on the electromagnetic compatibility service requirements, and then use the task classification method and a preset single-thread to classify the electromagnetic compatibility calculation tasks in the first task queue to obtain different types of electromagnetic compatibility calculation tasks.
[0053] Step S23: Send the different types of electromagnetic compatibility calculation tasks to a single-machine task processing device that is pre-constructed based on a multi-core CPU and has multiple second task queues through the first task queue; wherein, the single-machine task processing device sends the received different types of electromagnetic compatibility calculation tasks to the corresponding second task queues respectively based on a preset mapping relationship, so as to perform parallel calculation processing on the obtained electromagnetic compatibility calculation tasks through the multiple second task queues.
[0054] In this embodiment, the single-machine task processing device that is pre-constructed based on a multi-core CPU and has multiple second task queues specifically includes: obtaining multi-core CPU information and operating system information, and then creating multiple second task queues in the single-machine task processing device based on the multi-core CPU information and the operating system information.
[0055] In this embodiment, electromagnetic compatibility calculation tasks of each radio station are obtained and saved to a first task queue; the electromagnetic compatibility calculation tasks in the first task queue are classified through a preset single-thread to obtain different types of the electromagnetic compatibility calculation tasks; the different types of the electromagnetic compatibility calculation tasks are sent to a single-machine task processing device that is pre-constructed based on a multi-core CPU and has multiple second task queues through the first task queue; wherein, the single-machine task processing device sends the received different types of the electromagnetic compatibility calculation tasks to the corresponding second task queues respectively, so as to perform parallel calculation processing on the obtained electromagnetic compatibility calculation tasks through the multiple second task queues. By classifying the electromagnetic compatibility calculation tasks, this application can meet the diversity of service requirements. Using the single-machine task processing device that is pre-constructed based on a multi-core CPU and has multiple second task queues to perform parallel calculation processing on the electromagnetic compatibility calculation tasks can maximize the multi-core computing power and effectively improve the parallel calculation efficiency of the electromagnetic compatibility calculation tasks.
[0056] For example, as Figure 3 shown, the electromagnetic compatibility calculation tasks of each radio station sent by the client are saved to the first task queue, and then the electromagnetic compatibility calculation tasks in the first task queue are classified to obtain different types of the electromagnetic compatibility calculation tasks. The number of tasks of all the electromagnetic compatibility calculation tasks in the first task queue is estimated to obtain an estimated value of the number of tasks, and the running time order of magnitude of the preset single-thread is determined based on the estimated value of the number of tasks. Then, the number of tasks of the currently remaining unprocessed tasks in the second task queue is determined, and the total queuing time of all the currently remaining unprocessed tasks in each second task queue is determined. The ratio of the total queuing time to the number of tasks of the currently remaining unprocessed tasks in the second task queue is calculated to obtain the average queuing time of each of the currently remaining unprocessed tasks in each second task queue. Then, the number of tasks of the currently remaining unprocessed tasks in the second task queue, the total queuing time of all the currently remaining unprocessed tasks in each second task queue, and the average queuing time of each of the currently remaining unprocessed tasks in each second task queue are sent to the first task queue, and the received different types of the electromagnetic compatibility calculation tasks are sent to the corresponding second task queues respectively, so as to perform parallel calculation processing on the obtained electromagnetic compatibility calculation tasks through the multiple second task queues.
[0057] See Figure 4 shown, an embodiment of the present invention discloses a multi-queue task parallel calculation device, which may specifically include:
[0058] A computing task saving module, configured to obtain the electromagnetic compatibility computing tasks of each radio station and save them to a first task queue;
[0059] A computing task classification module, configured to classify the electromagnetic compatibility computing tasks in the first task queue through a preset single thread to obtain different types of electromagnetic compatibility computing tasks;
[0060] A task computing module, configured to send different types of electromagnetic compatibility computing tasks to a single-machine task processing device that is pre-constructed based on a multi-core CPU and has multiple second task queues through the first task queue; wherein, the single-machine task processing device sends the received different types of electromagnetic compatibility computing tasks to the corresponding second task queues respectively based on a preset mapping relationship, so as to perform parallel computing processing on the obtained electromagnetic compatibility computing tasks through the multiple second task queues.
[0061] In this embodiment, obtain the electromagnetic compatibility computing tasks of each radio station and save them to the first task queue; classify the electromagnetic compatibility computing tasks in the first task queue through a preset single thread to obtain different types of electromagnetic compatibility computing tasks; send different types of electromagnetic compatibility computing tasks to a single-machine task processing device that is pre-constructed based on a multi-core CPU and has multiple second task queues through the first task queue; wherein, the single-machine task processing device sends the received different types of electromagnetic compatibility computing tasks to the corresponding second task queues respectively based on a preset mapping relationship, so as to perform parallel computing processing on the obtained electromagnetic compatibility computing tasks through the multiple second task queues. By classifying the electromagnetic compatibility computing tasks, this application can meet the diversity of service requirements. Using a single-machine task processing device that is pre-constructed based on a multi-core CPU and has multiple second task queues to perform parallel computing processing on the electromagnetic compatibility computing tasks can maximize the multi-core computing power and effectively improve the parallel computing efficiency of the electromagnetic compatibility computing tasks.
[0062] In some specific embodiments, the computing task classification module 12 may specifically include:
[0063] A classification method determination module, configured to obtain the electromagnetic compatibility service requirements of a radio station and determine a task classification method based on the electromagnetic compatibility service requirements;
[0064] A computing task classification module, configured to classify the electromagnetic compatibility computing tasks in the first task queue by using the task classification method and through a preset single thread.
[0065] In some specific embodiments, the task computing module 13 may specifically include:
[0066] A sending quantity determination module, configured to determine the sending quantity of the electromagnetic compatibility calculation tasks based on the running time order of magnitude of the preset single thread, the task quantity of the currently remaining unprocessed tasks in the second task queue, the total queuing time of all the currently remaining unprocessed tasks in each second task queue, and the average queuing time of each of the currently remaining unprocessed tasks in each second task queue;
[0067] A task calculation module, configured to send different types of the electromagnetic compatibility calculation tasks to a single-machine task processing device that is pre-constructed based on a multi-core CPU and has multiple second task queues through the first task queue and based on the sending quantity of the electromagnetic compatibility calculation tasks.
[0068] In some specific embodiments, the task calculation module 13 may specifically include:
[0069] A sending module, configured to send the task quantity of the currently remaining unprocessed tasks in the second task queue, the total queuing time of all the currently remaining unprocessed tasks in each second task queue, and the average queuing time of each of the currently remaining unprocessed tasks in each second task queue to the first task queue.
[0070] In some specific embodiments, the task calculation module 13 may specifically include:
[0071] A task quantity estimated value determination module, configured to estimate the task quantity of all the electromagnetic compatibility calculation tasks in the first task queue to obtain an estimated value of the task quantity;
[0072] A running time order of magnitude determination module, configured to determine the running time order of magnitude of the preset single thread based on the estimated value of the task quantity.
[0073] In some specific embodiments, the task calculation module 13 may specifically include:
[0074] A total queuing time determination module, configured to determine the task quantity of the currently remaining unprocessed tasks in the second task queue and determine the total queuing time of all the currently remaining unprocessed tasks in each second task queue;
[0075] An average queuing time determination module, configured to calculate the ratio of the total queuing time to the task quantity of the currently remaining unprocessed tasks in the second task queue to obtain the average queuing time of each of the currently remaining unprocessed tasks in each second task queue.
[0076] In some specific embodiments, the task calculation module 13 may specifically include:
[0077] An information acquisition module, configured to acquire multi-core CPU information and operating system information;
[0078] A second task queue creation module, configured to create a plurality of second task queues in the single-machine task processing device based on the multi-core CPU information and the operating system information.
[0079] Figure 5 The figure is a schematic structural diagram of an electronic device provided by an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. Among them, the memory 22 is used to store a computer program, and the computer program is loaded and executed by the processor 21 to implement the relevant steps in the multi-queue task parallel computing method executed by the electronic device disclosed in any of the foregoing embodiments.
[0080] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows is any communication protocol applicable to the technical solution of the present application, and no specific limitation is imposed thereon; the input / output interface 25 is used to acquire external input data or output data to the outside, and its specific interface type can be selected according to specific application requirements, and no specific limitation is made here.
[0081] In addition, the memory 22, as a carrier for resource storage, may be a read-only memory, a random access memory, a magnetic disk, or an optical disc, etc. The resources stored thereon include an operating system 221, a computer program 222, and data 223, etc., and the storage method may be transient storage or permanent storage.
[0082] Among them, the operating system 221 is used to manage and control each hardware device on the electronic device 20 and the computer program 222 to implement the operation and processing of the data 223 in the memory 22 by the processor 21, and it may be Windows, Unix, Linux, etc. In addition to the computer program capable of implementing the multi-queue task parallel computing method executed by the electronic device 20 disclosed in any of the foregoing embodiments, the computer program 222 may further include a computer program capable of completing other specific tasks. The data 223 may include not only the data transmitted by external devices received by the multi-queue task parallel computing device, but also the data collected by its own input / output interface 25, etc.
[0083] The steps of the methods or algorithms described in combination with the embodiments disclosed in this article can be implemented directly by hardware, software modules executed by a processor, or a combination of both. The software modules can be placed in a random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium well-known in the technical field.
[0084] Furthermore, an embodiment of the present application also discloses a computer-readable storage medium. When the computer program stored in the storage medium is loaded and executed by a processor, it implements the steps of the multi-queue task parallel computing method disclosed in any of the foregoing embodiments.
[0085] Finally, it should also be noted that in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or device comprising the element.
[0086] The above has introduced in detail a multi-queue task parallel computing method, device, equipment and storage medium provided by the present invention. Specific examples are used in this article to elaborate on the principle and implementation manner of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present invention.
Claims
1. A multi-queue task parallel computing method, characterized in that: include: Obtaining electromagnetic compatibility calculation tasks of each radio station and saving them to a first task queue; Classifying the electromagnetic compatibility computing tasks in the first task queue by a preset single thread to obtain different types of electromagnetic compatibility computing tasks; Sending different types of electromagnetic compatibility computing tasks to a stand-alone task processing device pre-built based on a multi-core CPU and provided with multiple second task queues through the first task queue; wherein the stand-alone task processing device sends the received different types of electromagnetic compatibility computing tasks to corresponding second task queues based on a preset mapping relationship, so as to perform parallel computing processing on the obtained electromagnetic compatibility computing tasks through the multiple second task queues; The sending of different types of electromagnetic compatibility computing tasks to a stand-alone task processing device pre-built based on a multi-core CPU and provided with multiple second task queues through the first task queue includes: Determine the number of electromagnetic compatibility calculation tasks to be sent based on the order of magnitude of the running time of the preset single thread, the number of tasks currently remaining unprocessed in the second task queue, the total queue time of all the currently remaining unprocessed tasks in each of the second task queues, and the average queue time of each of the currently remaining unprocessed tasks in each of the second task queues; Through the first task queue and based on the sending quantity of the electromagnetic compatibility computing tasks, different types of the electromagnetic compatibility computing tasks are sent to a stand-alone task processing device that is pre-built based on a multi-core CPU and has multiple second task queues.
2. The multi-queue task parallel computing method according to claim 1, characterized in that: The classifying the electromagnetic compatibility computing tasks in the first task queue by presetting a single thread includes: Obtaining electromagnetic compatibility service requirements of the radio station, and determining a task classification method based on the electromagnetic compatibility service requirements; The electromagnetic compatibility calculation tasks in the first task queue are classified by using the task classification method and a preset single thread.
3. The multi-queue task parallel computing method according to claim 1, characterized in that: Before determining the number of electromagnetic compatibility calculation tasks to be sent, the method further includes: The number of currently remaining unprocessed tasks in the second task queue, the total queue time of all the currently remaining unprocessed tasks in each of the second task queues, and the average queue time of each of the currently remaining unprocessed tasks in each of the second task queues are sent to the first task queue.
4. The multi-queue task parallel computing method according to claim 1, characterized in that: Before determining the number of electromagnetic compatibility calculation tasks to be sent, the method further includes: estimating the number of tasks of all the electromagnetic compatibility computing tasks in the first task queue to obtain an estimated value of the number of tasks; The order of magnitude of the running time of the preset single thread is determined based on the estimated value of the number of tasks.
5. The multi-queue task parallel computing method according to claim 1, characterized in that: Before determining the number of electromagnetic compatibility calculation tasks to be sent, the method further includes: Determine the number of currently remaining unprocessed tasks in the second task queue, and determine the total queue time of all currently remaining unprocessed tasks in each of the second task queues; The ratio of the total queuing time to the number of currently remaining unprocessed tasks in the second task queue is calculated to obtain an average queuing time of each of the currently remaining unprocessed tasks in each of the second task queues.
6. The multi-queue task parallel computing method according to any one of claims 1 to 5, characterized in that: Also includes: Get multi-core CPU information and operating system information; A plurality of second task queues are created in the stand-alone task processing device based on the multi-core CPU information and the operating system information.
7. A multi-queue task parallel computing device, characterized in that: include: A calculation task saving module, used for obtaining the electromagnetic compatibility calculation tasks of each radio station and saving them to the first task queue; a computing task classification module, configured to classify the electromagnetic compatibility computing tasks in the first task queue by a preset single thread to obtain different types of electromagnetic compatibility computing tasks; a task computing module, configured to send, through the first task queue, different types of electromagnetic compatibility computing tasks to a stand-alone task processing device pre-built based on a multi-core CPU and provided with a plurality of second task queues; wherein the stand-alone task processing device sends the received electromagnetic compatibility computing tasks of different types to corresponding second task queues based on a preset mapping relationship, so as to perform parallel computing processing on the obtained electromagnetic compatibility computing tasks through the plurality of second task queues; a task calculation module, configured to determine the number of electromagnetic compatibility calculation tasks to be sent based on the order of magnitude of the running time of the preset single thread, the number of tasks currently remaining unprocessed in the second task queue, the total queue time of all the currently remaining unprocessed tasks in each of the second task queues, and the average queue time of each of the currently remaining unprocessed tasks in each of the second task queues; Through the first task queue and based on the sending quantity of the electromagnetic compatibility computing tasks, different types of the electromagnetic compatibility computing tasks are sent to a stand-alone task processing device that is pre-built based on a multi-core CPU and has multiple second task queues.
8. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the multi-queue task parallel computing method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that Used to store a computer program; wherein, when the computer program is executed by a processor, the multi-queue task parallel computing method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Operating system with hardware-enabled task manager for offloading CPU task scheduling
US8881161B1