A data transmission priority scheduling method
Through the design of task-level and block-level sending queues, combined with priority sorting and weighting mechanisms, the shortcomings of data transmission priority scheduling in multi-task concurrency scenarios are solved, efficient and reliable data transmission is achieved, and resource utilization is improved. Transmission success rate.
Patent Information
- Application Number
- CN202410961597.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-18
- Publication Date
- 2024-11-01
- Estimated Expiration
- 2044-07-18
AI Technical Summary
In the multi-task concurrency scenario, the existing data transmission mechanism cannot effectively schedule the priority of different tasks, resulting in high-priority tasks not being processed for a long time, low resource utilization, lack of dynamic adaptability and flexibility, affecting system performance .
Task-level and block-level sending queues are designed to ensure priority transmission of high-priority tasks through priority sorting and weighting mechanisms, and improve the real-time and reliability of data transmission through parallel processing and dynamic priority adjustment.
It realizes efficient data transmission priority scheduling, avoids the problem of low-priority tasks being unprocessed for a long time, improves resource utilization and transmission success rate, and meets diversified data transmission needs.
Smart Images

Figure CN118509387B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of information data transmission, and more specifically to a data transmission priority scheduling method. Background Art
[0002] With the continuous development of communication technology, wired IP networks and wireless networks such as 4G / 5G, PSTN, and satellite have emerged, and the transmission capacity has been greatly improved, providing a physical basis for the interconnection of information systems. In order to meet the diverse data transmission needs of various information systems, it is very important to implement a data transmission priority scheduling mechanism in multi-task concurrent processing scenarios.
[0003] However, in a multi-task concurrent scenario, different tasks have different data transmission requirements and priorities, which will cause high-priority transmission tasks to be transmitted first, while low-priority tasks will not be processed for a long time and transmission cannot be guaranteed, affecting the overall performance of the system.
[0004] In addition, with the continuous changes in network environment and task requirements, the existing transmission mechanism lacks dynamic adaptability and cannot flexibly adjust data transmission strategies according to actual conditions, resulting in low resource utilization.
[0005] In summary, the existing data transmission mechanism faces problems such as unreasonable resource allocation, insufficient real-time and flexibility, lack of a unified coordination mechanism, and poor ability to cope with sudden traffic in multi-task concurrent processing scenarios. Summary of the invention
[0006] In view of this, the present invention provides a data transmission priority scheduling method, which aims to improve the real-time performance, reliability and resource utilization of data transmission by designing an optimized scheduling mechanism, ensure the rationality of data transmission, and better meet the diverse data transmission needs. It can ensure that high-priority transmission tasks are transmitted first, and prevent low-priority tasks from being unprocessed for a long time.
[0007] In order to achieve the above object, the present invention adopts the following technical solution:
[0008] The present invention provides a data transmission priority scheduling method, comprising the following steps:
[0009] Create a task-level sending queue; the task-level sending queue is sorted from high to low according to the priority of the transmission task, and tasks with the same priority are sorted in the order of submission;
[0010] Create a block-level sending queue; the block-level sending queue sets different data block sending queues according to the transmission direction, the highest priority of each queue stores control messages, and other data blocks are sorted from high to low according to the transmission task priority, and the data blocks of the same task are sorted according to the insertion order;
[0011] Traverse the task-level sending queue and perform sending processing according to the principle that the higher the priority, the greater the weight. The granularity of the sending processing is data blocks. Insert the data blocks to be sent into the block-level sending queue.
[0012] When scheduling the block-level sending queue, the data block sending queues in different transmission directions are processed in parallel; the same transmission direction is sent and processed according to the principle that the higher the priority, the greater the weight. The granularity of the sending processing is data fragmentation, and the data fragments to be sent are submitted to the transmission channel.
[0013] Further, the task-level sending queue is traversed, and the sending process is performed according to the principle that the higher the priority, the greater the weight, and the granularity of the sending process is data blocks; the data blocks to be sent are inserted into the block-level sending queue; including:
[0014] Set the maximum number of data blocks M for each scheduling process of the task-level sending queue. Calculate the maximum number of blocks M1 to M corresponding to each priority based on the principle that the higher the priority, the greater the weight. i ; i represents the priority number of the task-level sending queue;
[0015] From P i Priority starts traversing the sending tasks;
[0016] P j Priority sending tasks, traverse each task in order, if there is no pending confirmation, read 1 data block from the task and insert it into the block-level sending queue until the number of blocks read reaches M j Or all tasks are traversed; j is less than i;
[0017] If the number of blocks read S is less than M j , then the difference is redistributed to the next priority M j-1 , continue to P j-1 Priority is scheduled until all priorities are traversed.
[0018] Furthermore, when scheduling the block-level sending queue, the data block sending queues in different transmission directions are processed in parallel; the same transmission direction is sent and processed according to the principle that the higher the priority, the greater the weight, and the granularity of the sending processing is data slices, and the data slices to be sent are submitted to the transmission channel; including:
[0019] When scheduling the block-level sending queue, the data block sending queues in different transmission directions do not interfere with each other and are processed in parallel; the scheduling process of each data block sending queue is as follows:
[0020] (1) Check whether there is data to be sent in the highest priority k of the block-level sending queue. If so, all data is sent;
[0021] (2) Calculate the maximum number of fragments N1 to N corresponding to each priority level based on the remaining send buffer area of the transmission channel k-1 ;
[0022] (3) Start sharding and sending scheduling from the k-1th priority level;
[0023] (4) Sending scheduling processing P l Priority, loop through each data block in order, read 1 unsent data shard for processing, until the number of shards read reaches N l ; l<k-1;
[0024] (5) If the number of shards read is less than N l , then the difference is redistributed to the next priority N l-1 , continue to P l-1 Priority is scheduled until all priorities are traversed.
[0025] Furthermore, the method further comprises the following steps:
[0026] When the task-level sending queue is being scheduled, the validity period of the transmission task is determined. If the validity period has been reached, the task is removed from the task-level sending queue for cleaning.
[0027] Furthermore, the method further comprises the following steps:
[0028] When the task-level sending queue is scheduling, the validity period of the transmission task is determined. If the validity period is less than the time threshold t and the amount of data that has not been sent and processed is less than x%, the priority of the transmission task is increased.
[0029] Furthermore, the data blocks in the task-level sending queue are configured according to the maximum value, in units of MB.
[0030] Furthermore, the data fragments in the block-level sending queue are configured according to the MTU value of the transmission channel.
[0031] Furthermore, the remaining sending buffer is configured according to a maximum value in KB.
[0032] It can be seen from the above technical solutions that, compared with the prior art, the present invention discloses a data transmission priority scheduling method, which has the following advantages:
[0033] (1) Priority scheduling based on weight. The higher the priority, the greater the weight, the higher the priority of sending and processing, and avoids the possibility of low priority not having the opportunity to send and process for a long time;
[0034] (2) A two-level priority serial scheduling strategy of task level and block level is adopted;
[0035] (3) Setting the highest priority for control messages such as responses and processing them first can ensure data transmission reliability, flow control and other mechanisms;
[0036] (4) Automatically increase the priority of transmission tasks that are about to expire and are about to be completed, further improving the success rate of data transmission. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0038] Figure 1 A schematic diagram of a sending queue of the data transmission priority scheduling method provided by the present invention. DETAILED DESCRIPTION
[0039] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0040] The embodiment of the present invention discloses a data transmission priority scheduling method, which can ensure that high-priority tasks are transmitted first and prevent low-priority tasks from not being processed for a long time. Specifically, the method includes the following steps:
[0041] 1. Create a task-level sending queue; the task-level sending queue is sorted from high to low according to the priority of the transmission task, and tasks with the same priority are sorted in the order of submission;
[0042] 2. Create a block-level sending queue; the block-level sending queue sets different data block sending queues according to the transmission direction. The highest priority of each queue stores control messages such as transmission response, and other data blocks are sorted from high to low according to the transmission task priority. Data blocks of the same task are sorted in the order of insertion;
[0043] 3. Traverse the task-level sending queue and perform sending processing according to the principle that the higher the priority, the greater the weight. The granularity of the sending processing is data blocks; insert the data blocks to be sent into the block-level sending queue;
[0044] 4. When scheduling the block-level sending queue, the data block sending queues in different transmission directions are processed in parallel; the same transmission direction is sent and processed according to the principle that the higher the priority, the greater the weight. The granularity of the sending processing is data fragmentation, and the data fragments to be sent are submitted to the transmission channel.
[0045] The technical solution of the present invention is described below from 4 aspects:
[0046] 1. Sending queue design:
[0047] This method designs two types of sending queues: task level and block level. The task level has i priorities and the block level has i+1 priorities; (it is assumed that i is 5 for subsequent description), P1~Pi priorities are from low to high, as shown in Figure 1.
[0048] The task-level sending queue sorts the sending tasks in descending order of the transmission task priority, and the sending tasks of the same priority are sorted in the order of submission. For the task-level sending queue, it is traversed in the order of sending tasks, and the principle of higher priority means greater weight is adopted for sending processing. The granularity of sending processing is data block (the maximum value of the block needs to be configured, generally in MB), that is, the data blocks to be sent and processed are inserted into the block-level sending queue.
[0049] The block-level sending queue sets different data block sending queues according to the transmission direction. The highest priority of each data block queue only stores control messages such as transmission response, and then sorts the data blocks to be sent in this direction in descending order according to the transmission task priority. The data blocks of the same sending task are sorted in the order of insertion. When scheduling the sending process, the scheduling strategy and weight of different data block sending queues are the same; for each data block sending queue, it is traversed in order of arrangement, and the principle of the higher the priority, the greater the weight is adopted for sending and processing. The granularity of the sending process is the data slice (the maximum value of the slice is the MTU value of the transmission channel), that is, the data slice to be sent and processed is submitted to the transmission channel for sending and processing.
[0050] 2. Task-level send queue scheduling process
[0051] According to the actual application scenario, the maximum number of data blocks M for each sending scheduling process of the task-level sending queue is set, and the maximum number of blocks M1~M corresponding to each priority is calculated based on the principle that the higher the priority, the greater the weight. i(For example, if M=15 and i=5, the maximum number of blocks corresponding to P1~P5 are M1=1, M2=2, M3=3, M4=4, and M5=5 respectively).
[0052] The task-level sending queue is traversed in descending order of priority for sending processing. The specific processing flow is as follows:
[0053] (1) From P i Priority starts sending traversal sending scheduling processing;
[0054] (2) Sending scheduling processing P j When there is a priority sending task, each sending task is traversed in the order of arrangement. If there is no sending task waiting for confirmation, one data block is read from the sending task for sending processing (that is, it is inserted into the block-level sending queue) until the number of blocks read in this traversal reaches M. j Or all sending tasks have been traversed; j is less than i;
[0055] (3) If you traverse P j Priority, the number of blocks read S is less than M j , then the difference is redistributed to the next priority, i.e. M j-1 =M j-1 +(M j -S), then follow step (2) to j-1 The priority level is sent and scheduled until all priorities are traversed.
[0056] 3. Block-level sending queue scheduling process
[0057] The data block sending queues in different transmission directions do not interfere with each other, are processed in parallel, and have the same sending scheduling process. Figure 1 For example, the scheduling process of each data block sending queue is as follows:
[0058] (1) Determine whether there is data to be sent for processing in the highest priority k (k=i+1; for example, the sixth priority). If so, all data in the highest priority will be sent.
[0059] (2) Based on the principle that the higher the priority, the greater the weight, the maximum number of fragments N1~N corresponding to each priority is calculated based on the remaining send buffer area of the transmission channel. k-1 (For example, if the remaining send buffer is 30KB and the maximum fragment size is 1KB, the maximum number of fragments corresponding to P1~P5 are N1=2, N2=4, N3=6, N4=8, and N5=10 respectively);
[0060] (3) Start the fragment sending scheduling process from the 5th priority level;
[0061] (4) Sending scheduling processing P l When the priority is set, read one unsent data fragment from each data block in the order of arrangement and send it for processing until the number of fragments read reaches N l ; Where, l<k-1;
[0062] (5) If you traverse P l Priority, the number of shards read T is less than N l , then the difference is redistributed to the next priority, that is, N l-1 = N l-1 +(N l -T), then follow step (4) to l-1 The priority level is sent and scheduled until all priorities are traversed.
[0063] 4. Automatic Priority Increase
[0064] When scheduling the task-level sending queue, the validity period of the transmission task must also be determined:
[0065] (1) If the validity period has expired, the task is removed from the task-level sending queue and cleared;
[0066] (2) If the validity period is approaching t (for example, there are 2 minutes left), and the amount of data that has not yet been sent and processed is small, such as less than x% (for example, there are 5% left), then the priority of the transmission task is increased (for example, increased by 2 levels or set to the highest level), thereby improving the success rate of the transmission task.
[0067] The present invention designs and implements a data transmission priority scheduling method, which has the following characteristics:
[0068] Efficient priority scheduling: By introducing a weight mechanism in the task-level and block-level sending queues, higher-priority tasks and data blocks are given higher transmission priorities, ensuring that critical tasks and important data are transmitted first, improving transmission efficiency and real-time performance.
[0069] Avoid unreasonable resources: This method ensures that high-priority tasks are transmitted first while taking into account the transmission opportunities of low-priority tasks, avoiding resource starvation caused by long-term non-processing of low-priority tasks, and ensuring fair use and reasonable allocation of system resources.
[0070] Block-level and shard-level scheduling: By scheduling tasks at two levels, data blocks and data shards, the granularity of transmission is optimized, making data transmission more refined and improving the flexibility and adaptability of transmission.
[0071] Prioritize control messages: In the block-level sending queue, control messages are set to the highest priority, ensuring the timely transmission of response and control information, thereby improving the reliability and effectiveness of the overall transmission.
[0072] Dynamic priority adjustment: In task-level sending queue scheduling, the priority can be dynamically adjusted according to the validity period of the transmission task. The priority of unfinished tasks that are about to expire will be automatically increased, thereby improving the task completion rate and transmission success rate.
[0073] Parallel processing: Data in different transmission directions are sent in blocks and processed in parallel, which improves the parallelism and overall efficiency of data transmission and makes full use of the bandwidth resources of the transmission channel.
[0074] Through the above technical effects, the data transmission priority scheduling method of the present invention significantly improves the efficiency, reliability and resource utilization of data transmission in a multi-task concurrent processing scenario, and can meet the diverse data transmission needs in modern communication systems.
[0075] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0076] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A data transmission priority scheduling method, characterized in that: The following steps are involved: Create a task-level sending queue; the task-level sending queue is sorted from high to low according to the priority of the transmission task, and tasks with the same priority are sorted in the order of submission; Create a block-level send queue; The block-level sending queues are respectively set with different data block sending queues according to the transmission direction, and the highest priority of each queue is used to store control messages, and other data blocks are sorted from high to low according to the transmission task priority, and the data blocks of the same task are sorted according to the insertion order; Traverse the task-level sending queue and perform sending processing according to the principle that the higher the priority, the greater the weight. The granularity of the sending processing is data blocks. Insert the data blocks to be sent into the block-level sending queue. When scheduling the block-level sending queues, the data block sending queues in different transmission directions are processed in parallel; In the same transmission direction, the higher the priority, the greater the weight. The granularity of the transmission processing is data fragmentation, and the data fragments to be sent are submitted to the transmission channel. Among them, traversing the task-level sending queue, performing sending processing according to the principle that the higher the priority, the greater the weight, and the granularity of the sending processing is data block; inserting the data block to be sent into the block-level sending queue; including: 1) Set the maximum number of data blocks M for each scheduling process of the task-level sending queue, and calculate the maximum number of blocks M1 to M corresponding to each priority based on the principle that the higher the priority, the greater the weight i ; i represents the priority number of the task-level sending queue; 2) From P i Priority starts traversing the sending tasks; 3) P j Priority sending tasks, traverse each task in order, if there is no pending confirmation, read 1 data block from the task and insert it into the block-level sending queue until the number of blocks read reaches M j Or all tasks are traversed; j is less than i; 4) If the number of blocks read S is less than M j , then the difference is redistributed to the next priority M j-1 , continue to P j-1 Priority scheduling is performed until all priorities have been traversed; Among them, data blocks in different transmission directions are sent to queues for parallel processing; the same transmission direction is sent and processed according to the principle of higher priority and greater weight, and the granularity of the sending and processing is data slices, and the data slices to be sent are submitted to the transmission channel; including: When scheduling the block-level sending queue, the data block sending queues in different transmission directions do not interfere with each other and are processed in parallel; the scheduling process of each data block sending queue is as follows: (1) Check whether there is data to be sent in the highest priority k of the block-level sending queue. If so, all data is sent; (2) Calculate the maximum number of fragments N1 to N1 corresponding to each priority level based on the remaining buffer area of the transmission channel k-1 ; (3) Segment sending scheduling starts from the k-1th priority level; (4) Sending scheduling processing P l Priority, loop through each data block in order, read 1 unsent data shard for processing, until the number of shards read reaches N l ; l<k-1; (5) If the number of shards read T is less than N l , then the difference is redistributed to the next priority N l-1 , continue to P l-1 Priority is scheduled until all priorities are traversed.
2. A data transmission priority scheduling method according to claim 1, characterized in that: The following steps are also included: When the task-level sending queue is being scheduled, the validity period of the transmission task is determined. If the validity period has been reached, the task is removed from the task-level sending queue for cleaning.
3. A data transmission priority scheduling method according to claim 2, characterized in that: The following steps are also included: When the task-level sending queue is scheduling, the validity period of the transmission task is determined. If the validity period is less than the time threshold t and the amount of data that has not been sent and processed is less than x%, the priority of the transmission task is increased.
4. A data transmission priority scheduling method according to claim 1, characterized in that: The data blocks in the task-level sending queue are configured according to the maximum value, in MB.
5. A data transmission priority scheduling method according to claim 1, characterized in that: The data fragments in the block-level sending queue are configured according to the MTU value of the transmission channel.
6. A data transmission priority scheduling method according to claim 1, characterized in that: The remaining buffer area is configured according to the maximum value, in KB.
Citation Information
Patent Citations
Distributed file downloading method and system, electronic equipment and storage medium
CN116760821A
Distributed cluster communication method and system, electronic equipment and readable storage medium
CN117155929A
Method of scheduling higher and lower priority data packets
US6205150B1
