Task processing method and device, base station and computer equipment

By setting up task sharing queues and task exclusive queues in the base station and traversing these queues according to specific policies, the existing base station MAC architecture cannot flexibly allocate CPU resources and frequently cache misses, and more efficient CPU resource utilization and processing performance improvements are achieved.

CN120123073APending Publication Date: 2025-06-10DATANG MOBILE COMM EQUIP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311686230.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-08
Publication Date
2025-06-10

AI Technical Summary

Technical Problem

When handling cell tasks, the existing base station MAC architecture cannot flexibly allocate CPU resources according to cell load changes, and frequently replace CPUs when executing serial tasks, resulting in cache misses, affecting processing performance.

Method used

A base station using a multi-core processor sets up at least one task shared queue and multiple task exclusive queues, and traverses these queues through a preset queue traversal policy. In the task-sharing queue, the target task is locked and executed by one processor until the task is completed; in the task-sharing queue, parallel tasks are executed by multiple processors in parallel.

Benefits of technology

It realizes CPU resource sharing and flexible provisioning of each cell, reduces the switching frequency of serial tasks between different CPUs, reduces cache misses, and improves CPU processing performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120123073A_ABST
    Figure CN120123073A_ABST
Patent Text Reader

Abstract

The invention relates to a task processing method and device, a base station and computer equipment, and belongs to the technical field of communication. The method is applied to a base station of a multi-core processor, the base station is provided with at least one task sharing queue and a plurality of task exclusive queues, the task sharing queues are used for storing parallel tasks of all cells, one task exclusive queue is used for storing serial tasks of one cell, and for each processor, the task sharing queues and the task exclusive queues are distributed in parallel. Traversing at least one task sharing queue and a plurality of task exclusive queues; under the condition that the currently traversed task queue is the task exclusive queue, locking the currently traversed target task exclusive queue, executing the serial tasks in the target task exclusive queue, and unlocking the target task exclusive queue after the serial tasks in the target task exclusive queue are executed; and under the condition that the currently traversed task queue is the task sharing queue, executing the parallel tasks in the task sharing queue. According to the invention, the processing performance of the CPU can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technologies, and in particular, to a method, apparatus, base station, and computer device for processing tasks. Background Art

[0002] Currently, in LTE (Long Term Evolution) and NR (New Radio) base stations, the MAC (Medium Access Control) layer is generally deployed on the baseband board and is responsible for resource allocation of the uplink and downlink service channels and control channels of all active users in the cell.

[0003] The architecture of the base station MAC is usually divided into two types. The first type is based on cells, where each cell is an independent process, occupying multiple CPUs (Central Processing Units), and multiple threads are created on each CPU. The base station realizes the execution of cell tasks through the scheduling of threads. The second type is that all cells are an independent process, sharing all CPU resources, and only one thread is created on each CPU. Multiple CPUs realize the execution of all cell tasks by polling the task queue.

[0004] However, in the first base station MAC architecture, the base station cannot flexibly allocate CPU resources for the cell according to the load change of the cell. In the second base station MAC architecture, the tasks of the same cell frequently change CPUs during the execution process, resulting in more cache misses, which affects the CPU processing performance. Summary of the Invention

[0005] Based on this, it is necessary to provide a method, apparatus, base station, and computer device for processing tasks in view of the above technical problems.

[0006] In a first aspect, a method for processing tasks is provided. The method is applied to a base station with a multi-core processor. The base station is provided with at least one task sharing queue and multiple task exclusive queues. The task sharing queue is used to store parallel tasks of each cell, and one task exclusive queue is used to store serial tasks of one cell. The method includes:

[0007] For each processor, traverse the at least one task sharing queue and the multiple task exclusive queues according to a preset queue traversal strategy;

[0008] When the currently traversed task queue is the exclusive task queue of the task, lock the currently traversed target exclusive task queue, execute the serial tasks in the target exclusive task queue, and unlock the target exclusive task queue after the serial tasks in the target exclusive task queue are executed. Among them, in the locked state, the serial tasks in the target exclusive task queue are executed by one processor;

[0009] When the currently traversed task queue is the shared task queue of the task, execute the parallel tasks in the shared task queue. Among them, the parallel tasks in the shared task queue are executed in parallel by multiple processors.

[0010] As an optional implementation manner, the at least one shared task queue includes shared task queues with multiple shared priorities. A shared task queue with one shared priority is used to store parallel tasks with one shared priority of each cell; the multiple exclusive task queues include groups of exclusive task queues with multiple exclusive priorities. An exclusive task queue in the group of exclusive task queues is used to store serial tasks with one exclusive priority of one cell.

[0011] As an optional implementation manner, the traversing the at least one shared task queue and the multiple exclusive task queues according to a preset queue traversal strategy includes:

[0012] Traverse the shared task queue with the highest shared priority;

[0013] Traverse the exclusive task queues in each group of exclusive task queues in the order of the exclusive priority from high to low;

[0014] Traverse the shared task queues with other shared priorities except the highest shared priority in the order of the shared priority from high to low.

[0015] As an optional implementation manner, the traversing the multiple exclusive task queues according to a preset queue traversal strategy includes:

[0016] Traverse the multiple exclusive task queues according to the queue sorting of the multiple exclusive task queues;

[0017] After the last exclusive task queue is traversed, move the first traversed exclusive task queue behind the last exclusive task queue.

[0018] As an optional implementation manner, the traversing the multiple exclusive task queues according to a preset queue traversal strategy includes:

[0019] Among the multiple task exclusive queues, randomly select one task exclusive queue as the starting task exclusive queue for traversal at the beginning of the current traversal cycle, and start traversing the multiple task exclusive queues from the starting task exclusive queue.

[0020] As an optional implementation manner, before locking the target task exclusive queue being currently traversed, the method further includes:

[0021] If the target task exclusive queue being currently traversed is in an unlocked state, perform the step of locking the target task exclusive queue being currently traversed; otherwise, traverse the next task exclusive queue.

[0022] In a second aspect, a base station is provided, including a memory, a transceiver, and multiple processors. The base station is provided with at least one task shared queue and multiple task exclusive queues. The task shared queue is used to store parallel tasks of each cell, and one of the task exclusive queues is used to store serial tasks of one cell;

[0023] Among them, the memory is used to store computer programs; the transceiver is used to transmit and receive data under the control of the processor; each processor is used to read the computer programs in the memory and perform the following operations:

[0024] Traverse the at least one task shared queue and the multiple task exclusive queues according to a preset queue traversal strategy;

[0025] When the task queue being currently traversed is the task exclusive queue, lock the target task exclusive queue being currently traversed, execute the serial task in the target task exclusive queue, and unlock the target task exclusive queue after the serial task in the target task exclusive queue is executed. Among them, in the locked state, the serial task in the target task exclusive queue is executed by one processor;

[0026] When the task queue being currently traversed is the task shared queue, execute the parallel tasks in the task shared queue. Among them, the parallel tasks in the task shared queue are executed in parallel by multiple processors.

[0027] As an optional implementation manner, the at least one task shared queue includes task shared queues with multiple shared priorities. One task shared queue with a shared priority is used to store parallel tasks with one shared priority of each cell; the multiple task exclusive queues include groups of task exclusive queues with multiple exclusive priorities. One task exclusive queue in the task exclusive queue group is used to store serial tasks with one exclusive priority of one cell.

[0028] As an alternative implementation, traversing the at least one task sharing queue and the multiple task exclusive queues according to the preset queue traversal policy includes:

[0029] Traversing the task sharing queue with the highest sharing priority;

[0030] Traversing the task exclusive queues in each of the task exclusive queue groups in the order of the exclusive priority from high to low;

[0031] Traversing the task sharing queues with other sharing priorities except the highest sharing priority in the order of the sharing priority from high to low.

[0032] As an alternative implementation, traversing the multiple task exclusive queues according to the preset queue traversal policy includes:

[0033] Traversing the multiple task exclusive queues according to the queue sorting of the multiple task exclusive queues;

[0034] After the traversal of the last task exclusive queue is completed, moving the first traversed task exclusive queue behind the last task exclusive queue.

[0035] As an alternative implementation, traversing the multiple task exclusive queues according to the preset queue traversal policy includes:

[0036] Randomly selecting a task exclusive queue from the multiple task exclusive queues as the starting task exclusive queue for traversal in the current traversal cycle, and starting from the starting task exclusive queue, traversing the multiple task exclusive queues.

[0037] As an alternative implementation, before locking the target task exclusive queue being currently traversed, each of the processors is further configured to perform the following operations:

[0038] If the target task exclusive queue being currently traversed is in an unlocked state, then performing the step of locking the target task exclusive queue being currently traversed; otherwise, traversing the next task exclusive queue.

[0039] In a third aspect, a task processing device is provided. The device is applied to a base station with a multi-core processor. The base station is provided with at least one task sharing queue and multiple task exclusive queues. The task sharing queue is used to store parallel tasks of each cell, and one task exclusive queue is used to store serial tasks of one cell. The device includes:

[0040] A traversing unit, configured to, for each processor, traverse the at least one task sharing queue and the multiple task exclusive queues according to a preset queue traversal policy;

[0041] A first execution unit, configured to lock the currently traversed target exclusive task queue when the currently traversed task queue is the exclusive task queue of the task, execute the serial tasks in the target exclusive task queue, and unlock the target exclusive task queue after the serial tasks in the target exclusive task queue are executed. Wherein, in the locked state, the serial tasks in the target exclusive task queue are executed by one processor;

[0042] A second execution unit, configured to execute the parallel tasks in the task shared queue when the currently traversed task queue is the task shared queue, where the parallel tasks in the task shared queue are executed in parallel by multiple processors.

[0043] As an optional implementation manner, the at least one task shared queue includes task shared queues with multiple shared priorities, and one task shared queue with a shared priority is used to store the parallel tasks with a shared priority of each cell; the multiple exclusive task queues include groups of exclusive task queues with multiple exclusive priorities, and one exclusive task queue in the group of exclusive task queues is used to store the serial tasks with an exclusive priority of one cell.

[0044] As an optional implementation manner, the traversal unit is specifically configured to:

[0045] Traverse the task shared queue with the highest shared priority;

[0046] Traverse the exclusive task queues in each group of exclusive task queues in the order from high to low of the exclusive priority;

[0047] Traverse the task shared queues with other shared priorities except the highest shared priority in the order from high to low of the shared priority.

[0048] As an optional implementation manner, the traversal unit is specifically configured to:

[0049] Traverse the multiple exclusive task queues according to the queue sorting of the multiple exclusive task queues;

[0050] After the last exclusive task queue is traversed, move the first traversed exclusive task queue behind the last exclusive task queue.

[0051] As an optional implementation manner, the traversal unit is specifically configured to:

[0052] Among the multiple task exclusive queues, randomly select one task exclusive queue as the starting task exclusive queue for traversal in the current traversal cycle, and start traversing the multiple task exclusive queues from the starting task exclusive queue.

[0053] As an optional implementation manner, the apparatus further includes:

[0054] A determination unit, configured to, if the target task exclusive queue being currently traversed is in an unlocked state, trigger the first execution unit to perform the step of locking the target task exclusive queue being currently traversed; otherwise, traverse the next task exclusive queue.

[0055] In a fourth aspect, a computer device is provided, including a memory and a processor. A computer program that can run on the processor is stored on the memory. When the processor executes the computer program, the method steps described in the first aspect are implemented.

[0056] In a fifth aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the method steps described in the first aspect are implemented.

[0057] This application provides a method, an apparatus, a base station, and a computer device for task processing. The technical solutions provided by the embodiments of this application at least bring the following beneficial effects: The method is applied to a base station with a multi-core processor. The base station is provided with at least one task shared queue and multiple task exclusive queues. Among them, the task shared queue is used to store parallel tasks of each cell, and one task exclusive queue is used to store serial tasks of one cell. Each processor traverses at least one task shared queue and multiple task exclusive queues according to a preset queue traversal strategy. When the currently traversed task queue is a task exclusive queue, each processor locks the target task exclusive queue being currently traversed, executes the serial task in the target task exclusive queue, and unlocks the target task exclusive queue after the serial task in the target task exclusive queue is executed. Among them, in the locked state, the serial task in the target task exclusive queue is executed by one processor. When the currently traversed task queue is a task shared queue, each processor executes the parallel tasks in the task shared queue, and among them, the parallel tasks in the task shared queue are executed in parallel by multiple processors. Based on the above method, each cell in this application shares CPU resources, and the base station can flexibly allocate CPU resources for the cell according to the load change of the cell. At the same time, the serial tasks of the same cell are put into one task exclusive queue and processed by one CPU, which reduces the frequency of CPU replacement, avoids the situation that the serial tasks of the same cell are assigned to different CPUs for processing, resulting in more cache misses of the CPU, and improves the processing performance of the CPU.

[0058] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and do not limit this application. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] 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 the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0060] Figure 1 Schematic diagram of a base station MAC architecture provided by an embodiment of this application;

[0061] Figure 2 Flowchart of a method for processing a task provided by an embodiment of this application;

[0062] Figure 3 Schematic diagram of traversing a task queue provided by an embodiment of this application;

[0063] Figure 4 Schematic diagram of a queue sorting provided by an embodiment of this application;

[0064] Figure 5 Flowchart of an example of a method for processing a task provided by an embodiment of this application;

[0065] Figure 6 Schematic diagram of the structure of a base station provided by an embodiment of this application;

[0066] Figure 7 Schematic diagram of the structure of a task processing device provided by an embodiment of this application. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0067] In the embodiments of the present invention, the term "and / or" describes the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. The character " / " generally represents an "or" relationship between the associated objects before and after.

[0068] In the embodiments of this application, the term "a plurality" means two or more, and other quantifiers are similar.

[0069] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present application without creative efforts shall fall within the protection scope of the present application.

[0070] Currently, the architecture of the base station MAC is generally divided into two types. (1) The first type is based on cells, where each cell is an independent process, occupying multiple CPUs, and multiple threads are created on each CPU. The base station realizes the execution of cell tasks through thread scheduling. Since the CPUs occupied by each cell are fixed, the base station cannot flexibly allocate CPU resources for the cell according to the load change of the cell. For example, the base station includes 5 CPUs and covers 2 cells. Among them, Cell 1 occupies CPUs 1 to 3, and Cell 2 occupies CPUs 4 and 5. Cell 1 and Cell 2 are tidal cells. Cell 1 has a high CPU load during the day but a low CPU load at night, while Cell 2 has a low CPU load during the day but a high CPU load at night. Due to the fact that in the first type of base station MAC architecture, the CPUs occupied by each cell are fixed, when the CPU load of Cell 1 is high and the CPU load of Cell 2 is low during the day, the base station cannot allocate some of the CPUs occupied by Cell 2 to Cell 1 to relieve the CPU load of Cell 1. Similarly, when the CPU load of Cell 1 is low and the CPU load of Cell 2 is high at night, the base station also cannot allocate some of the CPUs occupied by Cell 1 to Cell 2 to relieve the CPU load of Cell 2.

[0071] (2) The second type is that all cells are an independent process, sharing all CPU resources, and only one thread is created on each CPU. Multiple CPUs realize the execution of all cell tasks by polling the task queue. In the case where the serial tasks of the same cell are assigned to different CPUs for processing, it will cause more cache misses in the CPU, affecting the processing performance of the CPU.

[0072] To solve the problems existing in the existing base station MAC architecture, such as Figure 1 shown, the base station MAC architecture in the embodiments of the present application is as follows. The base station in the embodiments of the present application has multiple CPUs, and all cells are an independent process, sharing multiple CPUs. One thread is created on each CPU, and multiple CPUs jointly complete the MAC processing of all carriers on the baseband board of the base station. For example, as Figure 1As shown, the base station includes CPUs 1 to 5. Further, at least one task sharing queue and multiple task exclusive queues are provided in the base station according to the embodiments of the present application. Among them, the task sharing queue is used to store parallel tasks of each cell, and one task exclusive queue is used to store serial tasks of one cell. The MAC function of one cell can be split into multiple tasks. Among them, tasks with coupling relationships in terms of time and memory are called serial tasks, and multiple serial tasks are processed by one CPU, while tasks without coupling relationships in terms of time and memory are called parallel tasks, and multiple parallel tasks can be processed in parallel by multiple CPUs. For example, Figure 1 As shown, the base station in the embodiments of the present application covers 3 cells, cell 1 to cell 3. One task sharing queue and 3 task exclusive queues (task exclusive queue 1 to task exclusive queue 3) are provided on the base station. The task sharing queue is used to store parallel tasks of the 3 cells, and task exclusive queue 1 is used to store serial tasks of cell 1, task exclusive queue 2 is used to store serial tasks of cell 2, and task exclusive queue 3 is used to store serial tasks of cell 3.

[0073] It should be noted that, without considering the priority of tasks, one task exclusive queue can store only serial tasks of one cell, or can store serial tasks of multiple cells. When considering the priority of tasks, one task exclusive queue can store only serial tasks of the same priority of one cell, or can store serial tasks of the same priority of multiple cells.

[0074] Next, a method for processing tasks provided by the embodiments of the present application will be described in detail in combination with specific embodiments. Figure 2 It is a flowchart of a method for processing tasks provided by the embodiments of the present application. As Figure 2 shown, the specific steps are as follows:

[0075] Step 201, for each processor, traverse at least one task sharing queue and multiple task exclusive queues according to a preset queue traversal strategy.

[0076] In implementation, the queue traversal policies of the task exclusive queue and the task shared queue can be preset in the base station. Each CPU can traverse at least one task shared queue and multiple task exclusive queues according to the same queue traversal policy. Further, each CPU can also traverse at least one task shared queue and multiple task exclusive queues according to different queue traversal policies. The queue traversal policy can be set according to the task volumes and task processing requirements of the parallel tasks and serial tasks in each cell, or can be set according to the priorities of the parallel tasks and serial tasks, or can also be set according to other actual requirements, which is not limited in the embodiments of the present application. For example, when the task volume of the parallel tasks is greater than that of the serial tasks, the queue traversal policy can be set to traverse the task shared queue first and then the task exclusive queue. Another example is that when the priority of the serial tasks is higher than that of the parallel tasks, the queue traversal policy can be set to traverse the task exclusive queue first and then the task shared queue.

[0077] It should be noted that the queue traversal policy in the base station can also change over time. For example, the queue traversal policy executed by the base station during the day is different from that at night. In addition, the queue traversal policy in the base station can also use an AI (Artificial Intelligence) algorithm for dynamic learning to continuously optimize the queue traversal policy.

[0078] Step 202, when the currently traversed task queue is a task exclusive queue, lock the currently traversed target task exclusive queue, execute the serial task in the target task exclusive queue, and unlock the target task exclusive queue after the serial task in the target task exclusive queue is executed. Among them, in the locked state, the serial task in the target task exclusive queue is executed by one processor.

[0079] In implementation, when the target task queue currently being traversed is a task-exclusive queue, the CPU can first determine whether the target task-exclusive queue is empty, that is, determine whether there are pending serial tasks in the target task-exclusive queue. If the target task-exclusive queue is empty, it means that there are no pending serial tasks in the target task-exclusive queue. Accordingly, the CPU can traverse the next task queue according to the queue traversal strategy. If the target task-exclusive queue is not empty, it means that there are pending serial tasks in the target task-exclusive queue. Accordingly, the CPU can lock the target task-exclusive queue and execute the serial tasks in the target task-exclusive queue. In the locked state, the serial tasks in the target task-exclusive queue are executed by one CPU, and when other CPUs traverse to the target task-exclusive queue, they directly traverse the next task queue according to the queue traversal strategy. Subsequently, after the CPU has completed the execution of the serial tasks in the target task-exclusive queue, it can unlock the target task-exclusive queue. Based on this, for the existing first base station MAC architecture, in the embodiment of the present application, each cell shares CPU resources, and the base station can flexibly allocate CPU resources for the cell according to the load changes of the cell. At the same time, for the existing second base station MAC architecture, in the embodiment of the present application, the serial tasks of the same cell are placed in a task exclusive queue and processed by one CPU, which reduces the frequency of changing the CPU. In this way, it is avoided that the serial tasks of the same cell are assigned to different CPUs for processing, resulting in more cache misses in the CPU, and the processing performance of the CPU is improved.

[0080] As an optional implementation, based on the principle that after the CPU locks the task exclusive queue, the serial tasks in the task exclusive queue are executed by one CPU, the CPU can determine that the target task exclusive queue currently being traversed is in an unlocked state during the process of traversing the task exclusive queue. If the target task exclusive queue currently being traversed is in an unlocked state, it means that the target task exclusive queue is not monopolized by other CPUs. Accordingly, the CPU can execute the step of locking the target task exclusive queue currently being traversed, otherwise, it means that the target task exclusive queue has been monopolized by other CPUs. Accordingly, the CPU can traverse the next task exclusive queue according to the queue traversal strategy.

[0081] Step 203: When the currently traversed task queue is a task sharing queue, the parallel tasks in the task sharing queue are executed, wherein the parallel tasks in the task sharing queue are executed in parallel by multiple processors.

[0082] In implementation, when the currently traversed task queue is a task sharing queue, the CPU can first determine whether the task sharing queue is empty, that is, determine whether there are parallel tasks to be processed in the task sharing queue. If the task sharing queue is empty, it means that there are no parallel tasks to be processed in the task sharing queue. Accordingly, the CPU can traverse the next task queue according to the queue traversal strategy. If the task sharing queue is not empty, it means that there are parallel tasks to be processed in the task sharing queue. Accordingly, the CPU can execute the parallel tasks in the task sharing queue. Among them, the parallel tasks in the task sharing queue can be executed in parallel by multiple processors. Based on this, for the existing first base station MAC architecture, in the embodiment of the present application, each cell shares CPU resources, and the base station can flexibly allocate CPU resources for the cell according to the load changes of the cell.

[0083] As an optional implementation, at least one task sharing queue includes task sharing queues of multiple shared priorities, and a task sharing queue of one shared priority is used to store parallel tasks of one shared priority of each cell; multiple task exclusive queues include task exclusive queue groups of multiple exclusive priorities, and a task exclusive queue in the task exclusive queue group is used to store serial tasks of one exclusive priority of a cell.

[0084] In implementation, parallel tasks in the same cell may have different task priorities (i.e., shared priorities). Serial tasks in the same cell may also have different task priorities (i.e., exclusive priorities). Therefore, the task sharing queue in the base station may include task sharing queues of multiple shared priorities. Among them, a task sharing queue of a shared priority is used to store parallel tasks of a shared priority of each cell. The multiple task exclusive queues in the base station may be divided into task exclusive queue groups of multiple exclusive priorities. Among them, a task exclusive queue in the task exclusive queue group is used to store serial tasks of an exclusive priority of a cell. Moreover, there may be different priorities between task sharing queues and task exclusive queues. For example, Figure 3As shown, the priority of the task sharing queue is higher than that of the task exclusive queue. In the task sharing queue, the sharing priority of task sharing queue 1 is greater than the sharing priority of task sharing queue 2. Among them, task sharing queue 1 is used to store high-priority parallel tasks of cells 1 to cells 3, and task sharing queue 2 is used to store low-priority parallel tasks of cells 1 to cells 3. In the task exclusive queue, the exclusive priority of task exclusive queue 1 to task exclusive queue 3 is higher than the exclusive priority of task exclusive queue 4 to task exclusive queue 6. Among them, task exclusive queue 1 to task exclusive queue 3 are respectively used to store high-priority serial tasks of cells 1 to cells 3, and task exclusive queue 4 to task exclusive queue 6 are respectively used to store low-priority serial tasks of cells 1 to cells 3. Based on this, the CPU can traverse the queue in the order of task sharing queue 1→task sharing queue 2→task sharing queue 1→task sharing queue 2→task sharing queue 3→task sharing queue 4→task sharing queue 5→task sharing queue 6.

[0085] As an optional implementation, the CPU may first traverse the task shared queue with the highest shared priority. Then, in the order of exclusive priority from high to low, the CPU traverses the task exclusive queues in each task exclusive queue group. After that, in the order of shared priority from high to low, the CPU traverses the task shared queues of other shared priorities except the highest shared priority.

[0086] In implementation, the order in which the task-sharing queue and the task-exclusive queue are traversed according to priority is merely an example, and the CPU may also traverse the task-sharing queue and the task-exclusive queue in other traversal orders, which is not limited in the embodiments of the present application.

[0087] As an optional implementation, since different cells have the same priority, the base station can adopt the following two methods to ensure traversal fairness between exclusive queues corresponding to each cell.

[0088] Method 1: traverse multiple task exclusive queues according to their queue order; after the traversal of the last task exclusive queue is completed, move the first traversed task exclusive queue to behind the last task exclusive queue.

[0089] In implementation, in order to ensure the traversal fairness between the exclusive queues corresponding to each cell, the CPU can traverse multiple task exclusive queues according to the queue order of multiple task exclusive queues in each traversal cycle. After the traversal of the last task exclusive queue is completed, the first traversed task exclusive queue is moved to after the last task exclusive queue. Among them, the queue order in the current traversal cycle is updated in the previous traversal cycle. In this way, in each traversal cycle, the queue order of the task exclusive queue is constantly changing, thereby ensuring the traversal fairness between the exclusive queues corresponding to each cell. For example, Figure 4 As shown, in traversal cycle 1, the queue order of the task-exclusive queue is task-exclusive queue 1 → task-exclusive queue 2 → task-exclusive queue 3 → task-exclusive queue 4 → task-exclusive queue 5. In traversal cycle 2, the queue order of the task-exclusive queue is task-exclusive queue 2 → task-exclusive queue 3 → task-exclusive queue 4 → task-exclusive queue 5 → task-exclusive queue 1. In traversal cycle 3, the queue order of the task-exclusive queue is task-exclusive queue 3 → task-exclusive queue 4 → task-exclusive queue 5 → task-exclusive queue 1 → task-exclusive queue 2.

[0090] Method 2: randomly select one of the multiple task-exclusive queues as the starting task-exclusive queue for the current traversal cycle, and traverse the multiple task-exclusive queues starting from the starting task-exclusive queue.

[0091] In implementation, when the task exclusive queue is a ring queue that is connected at the end, in order to ensure the traversal fairness between the exclusive queues corresponding to each cell, in each traversal cycle, the CPU can also randomly select a task exclusive queue from multiple task exclusive queues as the starting task exclusive queue for the current traversal cycle, and traverse multiple task exclusive queues starting from the starting task exclusive queue. In this way, in each traversal cycle, the starting task exclusive queue keeps changing, thereby ensuring the traversal fairness between the exclusive queues corresponding to each cell.

[0092] Figure 5 A flowchart of an example of a task processing method provided in an embodiment of the present application, such as Figure 5 As shown, the task sharing queue includes a high-priority task sharing queue 1 and a low-priority task sharing queue 2, and the task exclusive queue includes high-priority task exclusive queues 1 to 12 and low-priority task exclusive queues 13 to 24. The queue traversal strategy is task sharing queue 1 → task exclusive queues 1 to 12 → task exclusive queues 13 to 24 → task sharing queue 2. The processing process of an example of a task processing method provided in an embodiment of the present application is as follows.

[0093] Step 501, traverse task sharing queue 1.

[0094] Step 502, determine whether the task sharing queue 1 is empty. If it is not empty, execute step 503 and then execute step 501. If it is empty, execute step 504.

[0095] Step 503: execute the parallel tasks in the task sharing queue 1.

[0096] Step 504, starting from the task exclusive queue 1, traverse the task exclusive queues 1 to 24, and the task exclusive queue currently traversed is the task exclusive queue n, n∈[1,24].

[0097] Step 505, determine whether the task exclusive queue n is in a locked state. If it is in an unlocked state, execute step 506, if it is in a locked state, execute step 510.

[0098] Step 506: Lock the task exclusive queue n.

[0099] Step 507, determine whether the task exclusive queue n is empty. If it is not empty, execute step 508 and then step 504. If it is empty, execute step 509.

[0100] Step 509: Unlock the task exclusive queue n.

[0101] Step 510, traverse the next task exclusive queue.

[0102] Step 511, determine whether the traversal of the task exclusive queue is complete. If the traversal is not complete, execute step 504, if the traversal is complete, execute step 512.

[0103] Step 512, traverse the task sharing queue 2.

[0104] Step 513, determine whether the task sharing queue 2 is empty. If it is not empty, execute step 514, then execute step 512, if it is empty, then end.

[0105] Step 514: execute the parallel tasks in the task sharing queue 2.

[0106] The embodiment of the present application provides a method for processing a task, which is applied to a base station with a multi-core processor. The base station is provided with at least one task sharing queue and multiple task exclusive queues. Among them, the task sharing queue is used to store the parallel tasks of each cell, and a task exclusive queue is used to store the serial tasks of a cell. Each processor traverses at least one task sharing queue and multiple task exclusive queues according to a preset queue traversal strategy. In the case where the task queue currently traversed is a task exclusive queue, each processor locks the target task exclusive queue currently traversed, executes the serial tasks in the target task exclusive queue, and unlocks the target task exclusive queue after the serial tasks in the target task exclusive queue are executed. Among them, in the locked state, the serial tasks in the target task exclusive queue are executed by one processor. In the case where the task queue currently traversed is a task sharing queue, each processor executes the parallel tasks in the task sharing queue, wherein the parallel tasks in the task sharing queue are executed in parallel by multiple processors. Based on the above method, each cell in the present application shares CPU resources, and the base station can flexibly allocate CPU resources for the cell according to the load changes of the cell. At the same time, serial tasks of the same cell are placed in a task-exclusive queue and processed by one CPU, which reduces the frequency of CPU replacement and avoids the serial tasks of the same cell being assigned to different CPUs for processing, resulting in more cache misses in the CPU, thereby improving the CPU processing performance.

[0107] It can be understood that the same / similar parts between the various embodiments of the above method in this specification can refer to each other, and each embodiment focuses on the differences from other embodiments. For related points, please refer to the description of other method embodiments.

[0108] The present application also provides a base station, such as Figure 6 As shown, it includes a memory 610, a transceiver 620, and multiple processors 630. The base station is provided with at least one task sharing queue and multiple task exclusive queues. The task sharing queue is used to store parallel tasks of each cell, and a task exclusive queue is used to store serial tasks of one cell.

[0109] The memory 610 is used to store computer programs; the transceiver 620 is used to send and receive data under the control of the processor 630; each processor 630 is used to read the computer program in the memory 610 and perform the following operations:

[0110] According to the preset queue traversal strategy, traverse at least one task shared queue and multiple task exclusive queues;

[0111] When the currently traversed task queue is a task exclusive queue, lock the currently traversed target task exclusive queue, execute the serial tasks in the target task exclusive queue, and unlock the target task exclusive queue after the serial tasks in the target task exclusive queue are executed. Among them, in the locked state, the serial tasks in the target task exclusive queue are executed by one processor;

[0112] When the currently traversed task queue is a task shared queue, execute the parallel tasks in the task shared queue. Among them, the parallel tasks in the task shared queue are executed in parallel by multiple processors.

[0113] As an optional implementation, at least one task shared queue includes task shared queues with multiple shared priorities, and a task shared queue with one shared priority is used to store the parallel tasks with one shared priority of each cell; multiple task exclusive queues include groups of task exclusive queues with multiple exclusive priorities, and one task exclusive queue in the group of task exclusive queues is used to store the serial tasks with one exclusive priority of one cell.

[0114] As an optional implementation, traverse at least one task shared queue and multiple task exclusive queues according to a preset queue traversal strategy, including:

[0115] Traverse the task shared queue with the highest shared priority;

[0116] Traverse the task exclusive queues in each group of task exclusive queues in descending order of exclusive priority;

[0117] Traverse the task shared queues with other shared priorities except the highest shared priority in descending order of shared priority.

[0118] As an optional implementation, traverse multiple task exclusive queues according to a preset queue traversal strategy, including:

[0119] Traverse multiple task exclusive queues according to the queue sorting of multiple task exclusive queues;

[0120] After the last task exclusive queue is traversed, move the first traversed task exclusive queue to the back of the last task exclusive queue.

[0121] As an optional implementation, traverse multiple task exclusive queues according to a preset queue traversal strategy, including:

[0122] Randomly select a task exclusive queue from multiple task exclusive queues as the starting task exclusive queue for starting traversal in the current traversal cycle, and start traversing multiple task exclusive queues from the starting task exclusive queue.

[0123] As an optional implementation, before locking the exclusive queue of the currently traversed target task, each processor is further configured to perform the following operations:

[0124] If the currently traversed target task exclusive queue is in unlocked state, the step of locking the currently traversed target task exclusive queue is executed; otherwise, the next task exclusive queue is traversed.

[0125] The embodiments of the present application involve that the base station may include multiple cells providing services to the terminal. Depending on the specific application scenario, the base station may also be referred to as an access point, or may be a device in the access network that communicates with the wireless terminal device through one or more sectors on the air interface, or other names. The network device may be used to replace the received air frame with the Internet Protocol (IP) packet, as a router between the wireless terminal device and the rest of the access network, wherein the rest of the access network may include an Internet Protocol (IP) communication network. The network device may also coordinate the attribute management of the air interface. For example, the network device involved in the embodiments of the present application may be an evolutionary network device (evolutional Node B, eNB or e-NodeB) in a long term evolution (LTE) system, a 5G base station (gNB) in a 5G network architecture (next generation system), etc., or a home evolved Node B (HeNB), a relay node (relay node), a home base station (femto), a micro base station (pico), a network test device, etc., which is not limited in the embodiments of the present application. In some network structures, the network devices may include centralized unit (CU) nodes and distributed unit (DU) nodes, and the centralized unit and the distributed unit may also be arranged geographically separately.

[0126] The embodiment of the present application provides a task processing device, which is applied to a base station with a multi-core processor, wherein the base station is provided with at least one task sharing queue and multiple task exclusive queues, the task sharing queue is used to store parallel tasks of each cell, and a task exclusive queue is used to store serial tasks of a cell, such as Figure 7 As shown, the device comprises:

[0127] A traversal unit 710 is used to traverse at least one task-shared queue and multiple task-exclusive queues for each processor according to a preset queue traversal strategy;

[0128] The first execution unit 720 is configured to lock the target exclusive task queue being traversed when the currently traversed task queue is an exclusive task queue, execute the serial tasks in the target exclusive task queue, and unlock the target exclusive task queue after the serial tasks in the target exclusive task queue are executed. Wherein, in the locked state, the serial tasks in the target exclusive task queue are executed by one processor;

[0129] The second execution unit is configured to execute the parallel tasks in the task sharing queue when the currently traversed task queue is a task sharing queue, where the parallel tasks in the task sharing queue are executed in parallel by multiple processors.

[0130] As an optional implementation manner, at least one task sharing queue includes task sharing queues with multiple sharing priorities, and a task sharing queue with one sharing priority is used to store the parallel tasks with one sharing priority of each cell; the multiple exclusive task queues include groups of exclusive task queues with multiple exclusive priorities, and one exclusive task queue in the group of exclusive task queues is used to store the serial tasks with one exclusive priority of one cell.

[0131] As an optional implementation manner, the traversal unit 710 is specifically configured to:

[0132] Traverse the task sharing queue with the highest sharing priority;

[0133] Traverse the exclusive task queues in each group of exclusive task queues in the order of decreasing exclusive priority;

[0134] Traverse the task sharing queues with other sharing priorities except the highest sharing priority in the order of decreasing sharing priority.

[0135] As an optional implementation manner, the traversal unit 710 is specifically configured to:

[0136] Traverse the multiple exclusive task queues according to the queue sorting of the multiple exclusive task queues;

[0137] After the last exclusive task queue is traversed, move the first traversed exclusive task queue to the position after the last exclusive task queue.

[0138] As an optional implementation manner, the traversal unit 710 is specifically configured to:

[0139] Randomly select an exclusive task queue from the multiple exclusive task queues as the starting exclusive task queue for starting traversal in the current traversal cycle, and start traversing the multiple exclusive task queues from the starting exclusive task queue.

[0140] As an optional implementation manner, the apparatus further includes:

[0141] A determination unit, configured to, if the exclusive queue of the target task currently traversed is in an unlocked state, trigger the first execution unit 720 to execute the step of locking the exclusive queue of the target task currently traversed; otherwise, traverse the next exclusive task queue.

[0142] It should be noted that the division of units in the embodiments of the present application is illustrative, merely a logical function division. In actual implementation, there may be other division methods. In addition, in each embodiment of the present application, the functional units may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above integrated units may be implemented in the form of hardware or in the form of software functional units.

[0143] If the above integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a processor-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, may be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the method described in each embodiment of the present application.

[0144] It should be noted here that the above device provided in the embodiments of the present invention can implement all the method steps implemented in the above method embodiments and can achieve the same technical effects. Therefore, the same parts and beneficial effects as those in the method embodiments will not be specifically described in this embodiment.

[0145] The embodiments of the present application provide a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the processing method of the above task are implemented.

[0146] The processor-readable storage medium may be any available medium or data storage device accessible by the processor, including but not limited to magnetic memories (such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), etc.), optical memories (such as CDs, DVDs, BDs, HVDs, etc.), and semiconductor memories (such as ROMs, EPROMs, EEPROMs, non-volatile memories (NANDFLASH), solid-state drives (SSD)).

[0147] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memories and optical memories, etc.) that contain computer-usable program code.

[0148] The present application is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, as well as the combination of flows and / or blocks in the flowcharts and / or block diagrams, can be realized by computer-executable instructions. These computer-executable instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices generate means for realizing the functions specified in Figure 1 one or more of the processes Figure 1 or blocks or the combination of blocks.

[0149] These processor-executable instructions can also be stored in a processor-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the processor-readable memory generate a manufactured article including instruction means, and the instruction means realizes the functions specified in Figure 1 one or more of the processes Figure 1 or blocks or the combination of blocks.

[0150] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalent technologies, the present application is also intended to include these changes and modifications.

Claims

1. A method for processing tasks, characterized in that, the method is applied to a base station with a multi-core processor, wherein the base station is provided with at least one task sharing queue and multiple task exclusive queues, the task sharing queue is used to store parallel tasks of each cell, and one task exclusive queue is used to store serial tasks of one cell, and the method includes: For each processor, traverse the at least one task sharing queue and the multiple task exclusive queues according to a preset queue traversal strategy; When the currently traversed task queue is the task exclusive queue, lock the currently traversed target task exclusive queue, execute the serial task in the target task exclusive queue, and unlock the target task exclusive queue after the serial task in the target task exclusive queue is executed. Wherein, in the locked state, the serial task in the target task exclusive queue is executed by one processor; When the currently traversed task queue is the task sharing queue, execute the parallel tasks in the task sharing queue, wherein the parallel tasks in the task sharing queue are executed in parallel by multiple processors.

2. The method according to claim 1, characterized in that, the at least one task sharing queue includes task sharing queues with multiple sharing priorities, and one task sharing queue with a sharing priority is used to store parallel tasks with one sharing priority of each cell; the multiple task exclusive queues include multiple groups of task exclusive queues with multiple exclusive priorities, and one task exclusive queue in the task exclusive queue group is used to store serial tasks with one exclusive priority of one cell.

3. The method according to claim 2, characterized in that, the traversing the at least one task sharing queue and the multiple task exclusive queues according to a preset queue traversal strategy includes: traversing the task sharing queue with the highest sharing priority; traversing the task exclusive queues in each task exclusive queue group in descending order of the exclusive priority; traversing the task sharing queues with other sharing priorities except the highest sharing priority in descending order of the sharing priority.

4. The method according to claim 1, characterized in that, the traversing the multiple task exclusive queues according to a preset queue traversal strategy includes: traversing the multiple task exclusive queues according to the queue sorting of the multiple task exclusive queues; after the last task exclusive queue is traversed, move the first traversed task exclusive queue behind the last traversed task exclusive queue.

5. The method according to claim 1, characterized in that, the traversing the multiple task exclusive queues according to a preset queue traversal strategy includes: randomly select a task exclusive queue in the multiple task exclusive queues as the starting task exclusive queue for starting traversal in the current traversal period, and start traversing the multiple task exclusive queues from the starting task exclusive queue.

6. The method according to claim 1, characterized in that, before locking the currently traversed target task exclusive queue, the method further includes: If the exclusive queue of the currently traversed target task is in an unlocked state, perform the step of locking the exclusive queue of the currently traversed target task; otherwise, traverse the next exclusive task queue.

7. A base station, characterized in that it includes a memory, a transceiver, and multiple processors. The base station is provided with at least one task sharing queue and multiple exclusive task queues. The task sharing queue is used to store parallel tasks of each cell, and one exclusive task queue is used to store serial tasks of one cell; wherein, the memory is used to store computer programs; the transceiver is used to transmit and receive data under the control of the processor; each processor is used to read the computer program in the memory and perform the following operations: Traverse the at least one task sharing queue and the multiple exclusive task queues according to a preset queue traversal strategy; When the currently traversed task queue is the exclusive task queue, lock the exclusive task queue of the currently traversed target task, execute the serial task in the target exclusive task queue, and unlock the target exclusive task queue after the serial task in the target exclusive task queue is completed. Among them, in the locked state, the serial task in the target exclusive task queue is executed by one processor; When the currently traversed task queue is the task sharing queue, execute the parallel tasks in the task sharing queue, where the parallel tasks in the task sharing queue are executed in parallel by multiple processors.

8. The base station according to claim 7, characterized in that the at least one task sharing queue includes task sharing queues with multiple sharing priorities, and one task sharing queue with a sharing priority is used to store parallel tasks with one sharing priority of each cell; the multiple exclusive task queues include groups of exclusive task queues with multiple exclusive priorities, and one exclusive task queue in the group of exclusive task queues is used to store serial tasks with one exclusive priority of one cell.

9. The base station according to claim 8, characterized in that the traversing the at least one task sharing queue and the multiple exclusive task queues according to a preset queue traversal strategy includes: Traverse the task sharing queue with the highest sharing priority; Traverse the exclusive task queues in each group of exclusive task queues in descending order of the exclusive priority; Traverse the task sharing queues with other sharing priorities except the highest sharing priority in descending order of the sharing priority.

10. The base station according to claim 7, characterized in that the traversing the multiple exclusive task queues according to a preset queue traversal strategy includes: Traverse the multiple exclusive task queues according to the queue sorting of the multiple exclusive task queues; After the traversal of the last exclusive task queue is completed, move the first traversed exclusive task queue behind the last traversed exclusive task queue.

11. The base station according to claim 7, characterized in that the traversing the multiple exclusive task queues according to a preset queue traversal strategy includes: Among the multiple task exclusive queues, randomly select one task exclusive queue as the starting task exclusive queue for traversal at the beginning of the current traversal cycle, and start traversing the multiple task exclusive queues from the starting task exclusive queue.

12. The base station according to claim 7, wherein, before locking the target task exclusive queue being currently traversed, each of the processors is further configured to perform the following operations: If the target task exclusive queue being currently traversed is in an unlocked state, then perform the step of locking the target task exclusive queue being currently traversed; otherwise, traverse the next task exclusive queue.

13. A processing device for tasks, wherein, the device is applied to a base station with a multi-core processor, wherein the base station is provided with at least one task shared queue and multiple task exclusive queues. The task shared queue is used to store parallel tasks of each cell, and one task exclusive queue is used to store serial tasks of one cell. The device includes: a traversal unit, configured to traverse the at least one task shared queue and the multiple task exclusive queues for each processor according to a preset queue traversal strategy; a first execution unit, configured to, when the task queue being currently traversed is the task exclusive queue, lock the target task exclusive queue being currently traversed, execute the serial tasks in the target task exclusive queue, and unlock the target task exclusive queue after the serial tasks in the target task exclusive queue are executed. Wherein, in the locked state, the serial tasks in the target task exclusive queue are executed by one processor; a second execution unit, configured to, when the task queue being currently traversed is the task shared queue, execute the parallel tasks in the task shared queue, where the parallel tasks in the task shared queue are executed in parallel by multiple processors.

14. A computer device, including a memory and a processor, and a computer program is stored on the memory and can run on the processor, wherein, when the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

15. A computer-readable storage medium, on which a computer program is stored, wherein, when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.