Data transmission scheduling method and device, electronic equipment and storage medium

By using the method of dynamically allocating time slots in the data transmission scheduling model, the time slots are calculated dynamically based on priority and transmission time duration, the problem of unreasonable time slot allocation in the existing technology is solved, and reasonable scheduling and efficient transmission of data transmission tasks of different priority levels is achieved.

CN120034503APending Publication Date: 2025-05-23CONTEMPORARY AMPEREX FUTURE ENERGY RES INST (SHANGHAI) LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311575524.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-23
Publication Date
2025-05-23

AI Technical Summary

Technical Problem

The existing data transmission scheduling model has insufficient rationality in slot allocation, which leads to high-priority data preemption of the time slot of low-priority data for a long time, resulting in low-priority data transmission delay.

Method used

The method of dynamically allocating time slots is adopted, and each priority queue is used as the consideration object, and the time slot is calculated dynamically based on the priority and transmission time, ensuring that each priority queue is allocated to the corresponding time slot during the transmission cycle.

Benefits of technology

It effectively avoids high-priority data seizing time slots of low-priority data for a long time, realizes reasonable scheduling of data transmission tasks at different priority levels, and improves transmission efficiency and timeliness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120034503A_ABST
    Figure CN120034503A_ABST
Patent Text Reader

Abstract

The invention discloses a data transmission scheduling method, a data transmission scheduling device, electronic equipment and a computer readable storage medium. The method comprises the following steps: acquiring the priority of each sequence transmission task, and dividing each sequence transmission task into a priority queue corresponding to the respective priority; determining a time slot corresponding to each priority queue in a current transmission period; and controlling each sequence transmission task to be executed in the time slot corresponding to the priority queue to which the sequence transmission task belongs. Through the scheme of the invention, reasonable scheduling of transmission tasks with different priorities can be realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of communication technology, and in particular, relates to a data transmission scheduling method, a data transmission scheduling device, an electronic device, and a computer-readable storage medium. Background Art

[0002] How to establish an efficient data transmission scheduling model to ensure the timely transmission of various types of data has always been an important issue to be solved in the field of communication technology, especially in the field of communication technology involving electrical control. At present, the common data transmission scheduling model determines the transmission order according to the priority of the data to be transmitted, which may lead to the situation that when high-priority data continues to be generated, low-priority data cannot obtain time slots, thereby causing some transmission tasks to be blocked; that is, the current data transmission scheduling model still has room for improvement in the rationality of time slot allocation. Summary of the invention

[0003] The present application provides a data transmission scheduling method, a data transmission scheduling device, an electronic device and a computer-readable storage medium, which can realize reasonable scheduling of transmission tasks of different priorities.

[0004] In a first aspect, the present application provides a data transmission scheduling method, comprising:

[0005] Obtain the priority of each sequence transmission task, and divide each sequence transmission task into the priority queue corresponding to the respective priority;

[0006] Determine the time slots corresponding to each priority queue in the current transmission cycle;

[0007] Control each sequence transmission task to be executed within the time slot corresponding to the priority queue to which it belongs.

[0008] The present application scheme no longer allocates fixed time slots based on each sequence transmission task, but dynamically allocates time slots based on each priority queue. In this way, regardless of whether the priority corresponding to each priority queue is high or low, it can be allocated the corresponding time slot in the current transmission cycle, thereby preventing high-priority sequence transmission tasks from occupying the time slots of low-priority sequence transmission tasks for a long time, and realizing the reasonable scheduling of sequence transmission tasks of different priorities.

[0009] In some embodiments, determining the time slots corresponding to the priority queues in the current transmission cycle includes:

[0010] According to the attributes of each priority queue, the time slot corresponding to each priority queue in the current transmission cycle is determined through dynamic time slot calculation.

[0011] Through dynamic allocation of time slots, the latest status of each sequence transmission task can be taken into account before each transmission cycle, so that the time slot allocation can be reasonably adjusted according to the actual situation. For example, after the high-priority data is transmitted, the low-priority queue can dynamically obtain a longer time slot to speed up the transmission of the low-priority task. This further improves the rationality of task scheduling.

[0012] In some embodiments, according to the attributes of each priority queue, the time slots corresponding to each priority queue in the current transmission cycle are determined by dynamic time slot calculation, including:

[0013] Determine the duration coefficient of each priority queue according to the expected transmission duration of each sequence transmission task;

[0014] Determine the priority weight coefficient of each priority queue according to the preset discount coefficient and the preset initial weight coefficient;

[0015] The time slots corresponding to the priority queues in the current transmission cycle are calculated according to the time length coefficients of the priority queues, the priority weight coefficients and the total time length of the current transmission cycle.

[0016] When performing dynamic calculation of time slots, the following dimensions affecting time slot allocation are taken into consideration: one is priority, and the other is transmission duration. Based on this, the embodiment of the present application designs a duration coefficient and a priority weight coefficient to make the result of dynamic calculation of time slots more reasonable.

[0017] In some embodiments, the duration coefficient of each priority queue is determined according to the expected transmission duration of each sequence transmission task, including:

[0018] Calculate the sum of the expected transmission durations of all sequential transmission tasks to obtain the total expected transmission duration;

[0019] According to the expected transmission duration of the sequence transmission tasks in each priority queue, the expected transmission duration of each priority queue is calculated respectively;

[0020] The time coefficient of each priority queue is determined according to the total expected transmission time and the expected transmission time of each queue.

[0021] With respect to the dimension of transmission duration, the embodiment of the present application tends to allocate more duration to the priority queue with longer transmission duration. Based on this, the embodiment of the present application calculates the duration coefficient of the priority queue by the total expected transmission duration and the expected transmission duration of each queue, so that the calculated duration coefficient can meet the requirement of the dimension of transmission duration.

[0022] In some embodiments, the priority weight coefficient of each priority queue is determined according to a preset discount coefficient and a preset initial weight coefficient, including:

[0023] According to the preset discount coefficient and the preset initial weight coefficient, the priority weight coefficient of each priority queue is determined through iterative calculation.

[0024] In terms of the priority dimension, the embodiment of the present application tends to allocate more time to the priority queue with a high priority. Based on this, the embodiment of the present application determines the priority weight coefficient by iteratively calculating the initial weight coefficient through the discount coefficient, so that the calculated priority weight coefficient can meet the requirements of the priority dimension.

[0025] In some embodiments, the data transmission scheduling method further includes:

[0026] When a real-time transmission task is received in the current transmission cycle, a soft interrupt is triggered, and the soft interrupt is used to control the current sequence transmission task to pause execution and control the execution of the real-time transmission task.

[0027] The embodiment of the present application subdivides the transmission tasks into the following two categories: sequential transmission tasks and real-time transmission tasks. Compared with sequential transmission tasks, real-time transmission tasks have higher requirements on real-time performance. Based on this, the embodiment of the present application proposes a soft interrupt solution, so that the real-time transmission task can be executed at the first time, ensuring the real-time performance of the real-time transmission task.

[0028] In some embodiments, the data transmission scheduling method further includes:

[0029] Before triggering the soft interrupt, the context information of the current sequence transmission task is recorded;

[0030] After the real-time transmission task is completed, the current sequence transmission task is controlled to resume execution according to the context information.

[0031] In response to the soft interrupt solution proposed above, the embodiment of the present application also proposes a corresponding recovery solution, so that after the soft interrupt ends, the originally executed sequence transmission task can be resumed in time, and the execution accuracy of the sequence transmission task will not be affected by the recorded context information.

[0032] In some embodiments, the data transmission scheduling method is applied to a management board, the management board establishes a communication connection with at least one data board, and the data transmission scheduling method further includes:

[0033] Create multiple levels of priority queues for each data board.

[0034] The data transmission scheduling method proposed in the embodiment of the present application can be applied to the application scenario of multiple boards. Specifically, since the management board will create an independent multi-level priority queue for each data board, that is, each data board has its own multi-level priority queue, the transmission tasks generated by each data board can be reasonably scheduled through the management board.

[0035] In some embodiments, the data sending end of the sequence transmission task is the first process, and the data receiving end is the second process, wherein the first process and the second process are on the same data board; or, the first process and the second process are on different data boards.

[0036] In the embodiment of the present application, the serial transmission task can be a transmission task between different data boards or a transmission task within the same data board, thereby providing support for the communication of the multi-board system and ensuring the normal communication of the multi-board system.

[0037] In some embodiments, controlling each sequence transmission task to be executed in a time slot corresponding to the priority queue to which it belongs includes:

[0038] According to the order of priority from high to low and task creation time from early to late, each sequence transmission task is controlled to be executed in the time slot corresponding to the priority queue.

[0039] The embodiment of the present application realizes orderly control of each sequence transmission task through the order of priority and task creation time; and in the application scenario of a small amount of data, low latency of high-priority sequence transmission tasks can also be achieved.

[0040] In some embodiments, the data transmission scheduling method further includes:

[0041] When all serial transmission tasks in the first priority queue are completed and there are remaining time slots corresponding to the first priority queue, the remaining time slots of the first priority queue are allocated to the second priority queue, wherein the first priority queue and the second priority queue are adjacent priority queues, and the priority of the first priority queue is higher than that of the second priority queue.

[0042] The embodiment of the present application allocates the remaining time slots that are not used by the high-priority queue to the low-priority queue, so that the low-priority queue can obtain longer time slots within a reasonable range, thereby further improving the overall transmission efficiency.

[0043] In a second aspect, the present application provides a data transmission scheduling device, including:

[0044] A division module is used to divide each sequence transmission task into a corresponding priority queue according to the priority of each sequence transmission task;

[0045] A determination module, used to determine the time slots corresponding to each priority queue in the current transmission cycle through dynamic calculation of time slots;

[0046] The control module is used to control each sequence transmission task to be executed in the time slot corresponding to the priority queue to which it belongs.

[0047] In a third aspect, the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method of the first aspect when executing the computer program.

[0048] In a fourth aspect, the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps of the method of the first aspect are implemented.

[0049] In a fifth aspect, the present application provides a computer program product, which includes a computer program, and when the computer program is executed by one or more processors, the steps of the method of the first aspect are implemented.

[0050] It can be understood that the beneficial effects of the second to fifth aspects can be found in the relevant description of the first aspect and will not be repeated here.

[0051] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the purpose, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] In order to more clearly illustrate the technical solutions in the embodiments of the present application, 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 some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0053] Figure 1 It is a schematic diagram of the implementation flow of the data transmission scheduling method provided in the embodiment of the present application;

[0054] Figure 2 is an example diagram of the architecture of a multi-board system provided in an embodiment of the present application;

[0055] Figure 3 is an example diagram of time slot allocation provided by an embodiment of the present application;

[0056] Figure 4is a structural block diagram of a data transmission scheduling device provided in an embodiment of the present application;

[0057] Figure 5 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0058] The following embodiments of the technical solution of the present application are described in detail in conjunction with the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present application, and are therefore only used as examples, and cannot be used to limit the scope of protection of the present application.

[0059] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by technicians in the technical field to which this application belongs; the terms used herein are only for the purpose of describing specific embodiments and are not intended to limit this application; the terms "including" and "having" in the specification, claims and drawings of this application and any variations thereof are intended to cover non-exclusive inclusions.

[0060] In the description of the embodiments of the present application, technical terms such as "first" and "second" are only used to distinguish different objects and cannot be understood as indicating or implying relative importance or implicitly indicating the number, specific order or primary and secondary relationship of the indicated technical features.

[0061] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0062] In the description of the embodiments of the present application, the term "and / or" is only a description of the association relationship of the associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.

[0063] In the description of the embodiments of the present application, the term "plurality" refers to more than two (including two), unless otherwise clearly and specifically defined.

[0064] An efficient data transmission scheduling model can ensure the timely transmission of various types of data, which has always been a key issue in the communications field; especially for electrical control, the control process involves a variety of data types and multiple types of electrical devices, which will have different requirements on the transmission volume, delay and real-time performance of data transmission.

[0065] At present, the more common data transmission scheduling model usually only considers the priority of the transmission task to allocate the corresponding time slot for each transmission task. Specifically, in a transmission cycle, the high-priority transmission task is executed first; after the high-priority transmission task is completed, the low-priority transmission task is executed. In other words, the processing resources of the current data transmission scheduling model will be tilted to the high-priority transmission task to the greatest extent.

[0066] When applying the above data transmission scheduling model, if high-priority transmission tasks are continuously generated, the transmission cycle will be continuously preempted by the high-priority transmission tasks, so that low-priority transmission tasks cannot obtain time slots for a long time, resulting in excessive delays for low-priority transmission tasks and the inability to guarantee transmission timeliness.

[0067] Based on the above considerations, the embodiment of the present application proposes a data transmission scheduling method, which dynamically allocates time slots based on each priority queue, avoids the situation where low-priority transmission tasks cannot obtain time slots for a long time, and realizes reasonable scheduling of transmission tasks of different priorities. In order to illustrate the technical solution proposed in the embodiment of the present application, it is described below through a specific embodiment.

[0068] The following describes a data transmission scheduling method provided in an embodiment of the present application, which can be applied to an electronic device with a management function. Figure 1 , the data transmission scheduling method in the embodiment of the present application includes:

[0069] Step 101 , obtaining the priority of each sequence transmission task, and dividing each sequence transmission task into a priority queue corresponding to the respective priority.

[0070] The electronic device may pre-set the data priority rules and create a multi-level priority queue, wherein the multi-level priority queue includes at least two priority queues, and different priority queues correspond to different priorities. It can be understood that if the priority setting rules define that the sequence transmission task can have a total of N priority levels, namely priority 1 to priority N, then correspondingly, the multi-level priority queue has a total of N priority queues, namely priority queue 1 to priority queue N, wherein priority queue 1 corresponds to priority 1, and so on, priority queue N corresponds to priority N. As an example only, the multi-level priority queue can be expressed as: {Q 1 ,Q 2 ,Q 3 ,…}, where Q 1 This is the priority queue 1, and the others are not described in detail.

[0071] Before each transmission cycle starts, the electronic device can determine the sequence transmission tasks to be transmitted. It is understood that the sequence transmission tasks to be transmitted include but are not limited to: sequence transmission tasks newly generated after the start of the previous transmission cycle, and sequence transmission tasks that were not transmitted in the previous transmission cycle.

[0072] The electronic device may be pre-configured with priorities of various types of data. Based on this, for each sequence transmission task to be currently transmitted, the electronic device may determine the priority of the data type of the data to be transmitted in the sequence transmission task as the priority of the sequence transmission task.

[0073] In some embodiments, considering that a sequence transmission task usually does not change the data type of its to-be-transmitted data in the middle of the process, for the sequence transmission task that failed to be transmitted in the previous transmission cycle, the electronic device has actually divided the sequence transmission task into the corresponding priority queue in the previous transmission cycle; that is, before the start of the current transmission cycle, the sequence transmission task that failed to be transmitted in the previous transmission cycle is actually already in the corresponding priority queue, and this time the electronic device only needs to divide the sequence transmission task newly generated after the start of the previous transmission cycle into the corresponding priority queue.

[0074] Step 102, determining the time slots corresponding to the various priority queues in the current transmission cycle.

[0075] In the embodiment of the present application, the objects for which time slots are to be determined are each priority queue, rather than each serial transmission task; and, for a non-empty priority queue, the time slots determined by the embodiment of the present application must be greater than 0, that is, the situation where a non-empty priority queue fails to be allocated a time slot will not occur.

[0076] In some embodiments, in order to further improve the rationality of task scheduling, a time slot dynamic calculation method is proposed. Specifically, the time slot dynamic calculation method can be designed from the following two dimensions: priority and transmission duration.

[0077] It can be understood that in different transmission cycles, the sequence transmission tasks contained in each priority queue will change, including but not limited to changes in the number of tasks, etc., which may cause the properties of each priority queue to change. Based on this, the electronic device can take into account the latest situation of each sequence transmission task (that is, the latest properties of each priority queue) before the current transmission cycle through dynamic calculation of time slots, so that the time slot allocation can be reasonably adjusted according to the actual situation; that is, the electronic device can determine the time slots corresponding to each priority queue in the current transmission cycle through dynamic calculation of time slots based on the properties of each priority queue. As an example only, the properties of the priority queue include but are not limited to; the expected transmission duration of the priority queue and the priority of the priority queue.

[0078] Step 103, controlling each sequence transmission task to be executed in the time slot corresponding to the priority queue to which it belongs.

[0079] Through step 102, each non-empty priority queue can be allocated to a corresponding time slot. Thus, for each sequence transmission task, the electronic device can control the sequence transmission task to be executed in the time slot corresponding to the priority queue to which it belongs.

[0080] In some embodiments, the electronic device may control each sequence transmission task to be executed in the time slot corresponding to the corresponding priority queue according to the order of priority from high to low and task creation time from early to late. Specifically, the electronic device may select the priority queue for the time slot to be allocated according to the order of priority from high to low; then, in the selected priority queue, select the sequence transmission task for the time slot to be allocated according to the order of task creation time from early to late, and allocate all the time slots corresponding to the selected priority queue to the selected sequence transmission task; after the selected sequence transmission task is executed, a new sequence transmission task may be selected again in the selected priority queue according to the order of task creation time from early to late, and allocate all the remaining time slots corresponding to the selected priority queue to the selected new sequence transmission task (regardless of whether the remaining time slot can enable the selected new sequence transmission task to complete the complete transmission). The above process is repeated until the current transmission cycle is fully allocated.

[0081] It can be seen from the above process that the electronic device can first execute the high-priority serial transmission task in the same transmission cycle, and can ensure low latency of the high-priority serial transmission task when the data volume is small.

[0082] It can be understood that as the transmission progresses, the current transmission cycle will be continuously updated (for example, the current transmission cycle is updated from the first transmission cycle to the second transmission cycle, and then from the second transmission cycle to the third transmission cycle, and so on); after each current transmission cycle is updated, the electronic device can return to execute steps 102 and 103, that is, re-determine the time slots corresponding to each priority queue in the new current transmission cycle, and on this basis control each ongoing sequence transmission task to be executed in the latest time slot corresponding to the priority queue to which it belongs, which will not be repeated here.

[0083] As can be seen from the above, the embodiment of the present application no longer considers each sequence transmission task as the object for fixed time slot allocation, but takes each priority queue as the object for dynamic time slot allocation. In this way, no matter whether the priority corresponding to each priority queue is high or low, it can be allocated the corresponding time slot in the current transmission cycle, thereby preventing the high-priority sequence transmission task from occupying the time slot of the low-priority sequence transmission task for a long time. Furthermore, through the dynamic allocation of time slots, the latest situation of each sequence transmission task can be considered before each transmission cycle, so that the time slot allocation can be reasonably adjusted according to the actual situation. For example, after the high-priority data is transmitted, the low-priority queue can dynamically obtain a longer time slot to speed up the transmission speed of the low-priority task. Thus, the reasonable scheduling of sequence transmission tasks of different priorities is achieved.

[0084] In some embodiments, when a time slot dynamic calculation method is designed based on priority and transmission duration, the time slot dynamic calculation method may include:

[0085] A1. Determine the duration coefficient of each priority queue according to the expected transmission duration of each sequence transmission task.

[0086] In the embodiment of the present application, the concept of duration coefficient is proposed for the transmission duration. Without considering the priority, the electronic device hopes to achieve the following purpose: the longer the transmission duration, the longer the corresponding time slot. Based on this, the electronic device can determine the duration coefficient of each priority queue according to the expected transmission duration of each sequence transmission task.

[0087] Specifically, for the priority queue Q n , its duration coefficient α n It can be calculated by the following formula:

[0088]

[0089] Where N is the number of priority queues, which is equivalent to the number of priority levels; t n is the priority queue Q n Based on the above formula, the electronic device can first calculate the sum of the expected transmission time of all sequence transmission tasks to obtain the total expected transmission time, which corresponds to the denominator in the above formula, that is, Part; and the electronic device can also calculate the expected transmission time of each priority queue according to the expected transmission time of the sequence transmission task in each priority queue, corresponding to the numerator in the above formula, that is, t n Finally, according to the total expected transmission time and the expected transmission time of each queue, the proportion of the expected transmission time of each queue to the total expected transmission time can be determined, and this proportion is the time coefficient of each priority queue.

[0090] A2. Determine the priority weight coefficient of each priority queue according to the preset discount coefficient and the preset initial weight coefficient.

[0091] In the embodiment of the present application, a concept of priority weight coefficient is proposed for priority. Without considering the transmission duration, the electronic device hopes to achieve the following purpose: the higher the priority, the longer the corresponding time slot. Based on this, the electronic device pre-sets the discount coefficient and the initial weight coefficient to determine the priority weight coefficient of each priority queue.

[0092] The discount factor is used to describe the degree to which the priority weight coefficient decays as the priority decreases, so the value range of the discount factor can be specifically (0, 1); that is, the discount factor is a decimal greater than 0 and less than 1. Based on the role and value range of the discount factor, the electronic device can determine the priority weight coefficient of each priority queue through iterative calculation based on the discount factor and the preset initial weight coefficient. 1 The highest priority is the priority queue Q N Taking the lowest priority as an example, the specific process of the iterative calculation can be expressed as the following formula:

[0093] σ n =δ·σ n-1

[0094] Among them, δ is the discount coefficient; σ is the priority weight coefficient, and its subscript represents the corresponding priority queue. Priority queue Q 1 The priority weight coefficient σ 1 That is the initial weight coefficient; according to the priority weight coefficient σ 1 And the discount factor δ, the priority queue Q can be calculated 2 The priority weight coefficient σ 2 ; By analogy, the priority weight coefficient σ of each priority queue can be obtained by continuous iterative calculation 1 To N .

[0095] It can be understood that since the value range of δ is (0, 1), the priority weight coefficient σ of the low priority queue n Must be smaller than the priority weight coefficient σ of the high priority queue n-1 .

[0096] A3. Calculate the time slot corresponding to each priority queue in the current transmission cycle according to the time length coefficient, priority weight coefficient and the total time length of the current transmission cycle of each priority queue.

[0097] Specifically, for the priority queue Q n , the corresponding time slot Tn It can be calculated by the following formula:

[0098]

[0099] Wherein, T is the total duration of the current transmission cycle; other parameters have been described above and will not be repeated here. Through the above formula, the electronic device can calculate the time slot corresponding to each priority queue in the current transmission cycle.

[0100] Through the above-proposed dynamic calculation method of time slots, uneven distribution of time slots can be achieved, so that the time slots of high-priority queues are longer than those of low-priority queues, thereby ensuring that high-priority data is transmitted faster in the case of large data volumes; in addition, in the next transmission cycle after the high-priority serial transmission task is completed, the low-priority queue can dynamically obtain a longer time slot, thereby speeding up the transmission speed of the low-priority serial transmission task.

[0101] In some embodiments, the electronic device first divides the data into the following two categories: real-time data and sequence data. Among them, real-time data is expected to be transmitted in real time; that is, real-time data has requirements on real-time performance compared with sequence data. For sequence data, the electronic device proposes the concept of priority described above. Based on this, the electronic device can generate a configuration file in advance according to the configuration information input by the user, and the configuration file is configured with the following information: the data type belonging to real-time data, the data type belonging to sequence data, the priority corresponding to each type of sequence data, the priority setting rules (including but not limited to the number of priority levels, etc.), the total duration of a single transmission cycle, the discount coefficient and the initial weight coefficient, etc. Based on this, when receiving a transmission task, the electronic device can first determine whether the data type of the data to be transmitted in the transmission task belongs to real-time data or sequence data according to the configuration file; if it belongs to sequence data, it can be determined that the transmission task is a sequence transmission task; if it belongs to real-time data, it can be determined that the transmission task is a real-time transmission task.

[0102] In the current transmission cycle, if the electronic device receives a real-time transmission task, the electronic device can trigger a soft interrupt considering the particularity of real-time data. The soft interrupt is used to control the suspension of the current sequence transmission task and control the execution of the real-time transmission task, thereby ensuring the real-time nature of the real-time transmission task.

[0103] Of course, in order to ensure that the current sequence transmission task (that is, the suspended sequence transmission task) can be executed smoothly later, the electronic device can also record the context information of the current sequence transmission task before triggering the soft interrupt. In some examples, the context information includes but is not limited to: the sequence number of the current sequence transmission task, the priority of the current sequence transmission task, and the data volume of the current sequence transmission task (specifically, the amount of data transmitted and / or the amount of data not transmitted). After the real-time transmission task is executed, the electronic device can determine which sequence transmission task is the current sequence transmission task (that is, the suspended sequence transmission task) based on the context information, and locate the position where the transmission interruption occurs in the current sequence transmission task, thereby controlling the current sequence transmission task to resume execution.

[0104] In some embodiments, the electronic device may be specifically a management board; that is, the data transmission scheduling method proposed in the embodiment of the present application may be applied to the management board. Among them, the management board can establish a communication connection with at least one data board to establish a multi-board system. Based on this, the data transmission scheduling method may also include: creating an independent multi-level priority queue for each data board. That is, each data board corresponds to its own multi-level priority queue, and the management board can perform the various steps proposed above for the transmission task submitted by each data board, thereby enabling the data transmission scheduling method to be applied to a multi-board system.

[0105] Specifically, the multi-level priority queue can be managed uniformly by the dispatch center on the management board, specifically by using a centralized task scheduler to manage the central processing unit (CPU) resources in the multi-board system and schedule each transmission task. It should be noted that there is only a single instance of the dispatch center in the multi-board system. Figure 2 , Figure 2 Given an example of a multi-board system architecture, the following combines Figure 2 The architecture of the multi-board system is described as follows:

[0106] Each data card (such as Figure 2Board 1 and board 2 in the data transmission process can submit the resource status of their CPUs and the transmission tasks (including real-time transmission tasks and sequence transmission tasks) generated by each process to the scheduling center; the scheduling center can build an independent multi-level priority queue for each data board according to the data transmission scheduling method proposed in the embodiment of the present application, and determine the time slots corresponding to the multi-level priority queues of each data board. In this way, a task scheduling scheme within the current transmission cycle can be generated for each data board. It can be understood that the task scheduling scheme is manifested as the allocation of transmission time slot lengths to the process. The scheduling center can distribute each task scheduling scheme to the node manager in the corresponding data board, and the node manager is responsible for managing the execution of the transmission tasks of each process on the data board, thereby realizing the indirect control of the execution of each transmission task by the scheduling center.

[0107] It should be noted that transmission tasks (real-time transmission tasks and sequence transmission tasks) include inter-board transmission tasks and intra-board transmission tasks. That is, the data sending end of the transmission task is the first process, and the data receiving end is the second process. The first process and the second process can be in the same data board; or, the first process and the second process can be in different data boards. Different data boards can be connected by a high-bandwidth bus, thereby achieving microsecond response between different data boards.

[0108] It should be noted that, except for the discount coefficient, other parameters configured in the configuration file can be personalized by the electronic device for different data boards, thereby making the data transmission scheduling method adaptable to the data transmission requirements of different data boards.

[0109] In some embodiments, the data transmission scheduling method also includes: when all serial transmission tasks in the first priority queue are executed and there are remaining time slots corresponding to the first priority queue, the remaining time slots of the first priority queue are allocated to the second priority queue, wherein the first priority queue and the second priority queue are adjacent priority queues, and the priority of the first priority queue is higher than that of the second priority queue.

[0110] That is, if T n Greater than Q n The total time required to complete the execution, then Q n The corresponding time slots may be incompletely allocated. To avoid wasting time slots, the electronic device can allocate the remaining time slots to the next level of priority queue, i.e., Q n+1 ; In this way, low-priority queues can dynamically obtain more time slots, thereby further improving the overall transmission efficiency. Figure 3 , Figure 3An example is given of allocating time slots of a high priority queue to a low priority queue when time slot allocation is incomplete; specifically, time slots to which transmission tasks of different sequences are allocated are represented by different gray levels.

[0111] like Figure 3 As shown, the priority queue Q 1 The sequence transfer task R 11 , R 12 and R 13 The total time required to complete the execution is much shorter than the priority queue Q 1 corresponding time slots, which results in the sequence transmission task R 11 , R 12 and R 13 After execution, the priority queue Q 1 The corresponding time slots are still available. These remaining time slots are allocated to the next level priority queue, namely priority queue Q 2 The first sequence transfer task R 21 , so that R 21 Similarly, the sequence transmission task R 21 and R 22 After execution, the priority queue Q 2 The corresponding time slots are still available. These remaining time slots are allocated to the next level priority queue, namely priority queue Q 3 The first sequence transfer task R 31 , so that R 31 By reallocating the remaining time slots of the priority queues at all levels, the time slots corresponding to the priority queues at all levels are fully utilized, thus improving the overall transmission efficiency.

[0112] It should be understood that the size of the serial numbers of the steps in the embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0113] Corresponding to the data transmission scheduling method provided above, the embodiment of the present application also provides a data transmission scheduling device. Figure 4 , the data transmission scheduling device 4 in the embodiment of the present application includes:

[0114] The division module 401 is used to obtain the priority of each sequence transmission task and divide each sequence transmission task into a priority queue corresponding to the respective priority;

[0115] A determination module 402, configured to determine the time slots corresponding to the priority queues in the current transmission cycle;

[0116] The control module 403 is used to control each sequence transmission task to be executed in the time slot corresponding to the priority queue to which it belongs.

[0117] In some embodiments, the determination module 402 determines the time slots corresponding to the priority queues in the current transmission cycle through dynamic time slot calculation according to the attributes of the priority queues.

[0118] In some embodiments, the determination module 402 includes:

[0119] A first determination submodule is used to determine the duration coefficient of each priority queue according to the expected transmission duration of each sequence transmission task;

[0120] A second determination submodule is used to determine the priority weight coefficient of each priority queue according to a preset discount coefficient and a preset initial weight coefficient;

[0121] The calculation submodule is used to calculate the time slot corresponding to each priority queue in the current transmission cycle according to the time length coefficient of each priority queue, the priority weight coefficient and the total time length of the current transmission cycle.

[0122] In some embodiments, the first determining submodule includes:

[0123] A first calculation unit, used to calculate the sum of the expected transmission durations of all sequence transmission tasks to obtain a total expected transmission duration;

[0124] A second calculation unit is used to calculate the queue expected transmission duration of each priority queue according to the expected transmission duration of the sequence transmission task in each priority queue;

[0125] The first determining unit is used to determine the duration coefficient of each priority queue according to the total expected transmission duration and the expected transmission duration of each queue.

[0126] In some embodiments, the second determination submodule is specifically configured to determine the priority weight coefficient of each priority queue through iterative calculation according to a preset discount coefficient and a preset initial weight coefficient.

[0127] In some embodiments, the data transmission scheduling device 4 further includes:

[0128] The soft interrupt module is used to trigger a soft interrupt when a real-time transmission task is received in the current transmission cycle. The soft interrupt is used to control the suspension of the current sequence transmission task and control the execution of the real-time transmission task.

[0129] In some embodiments, the data transmission scheduling device 4 further includes:

[0130] The recording module is used to record the context information of the current sequence transmission task before triggering the soft interrupt;

[0131] The recovery module is used to control the current sequence transmission task to resume execution according to the context information after the real-time transmission task is completed.

[0132] In some embodiments, the data transmission scheduling device 4 is applied to a management board, the management board establishes a communication connection with at least one data board, and the data transmission scheduling device 4 further includes:

[0133] Create a module to create multi-level priority queues for each data board.

[0134] In some embodiments, the data sending end of the sequence transmission task is the first process, and the data receiving end is the second process, wherein the first process and the second process are on the same data board; or, the first process and the second process are on different data boards.

[0135] In some embodiments, the control module 403 is specifically used to control each sequence transmission task to be executed in the time slot corresponding to the priority queue to which it belongs according to the order of priority from high to low and task creation time from early to late.

[0136] In some embodiments, the data transmission scheduling device 4 further includes:

[0137] An allocation module is used to allocate the remaining time slots of the first priority queue to the second priority queue when all serial transmission tasks in the first priority queue are completed and there are remaining time slots corresponding to the first priority queue, wherein the first priority queue and the second priority queue are adjacent priority queues, and the priority of the first priority queue is higher than that of the second priority queue.

[0138] As can be seen from the above, the embodiment of the present application no longer considers each sequence transmission task as the object for fixed time slot allocation, but considers each priority queue as the object for dynamic time slot allocation. In this way, no matter whether the priority corresponding to each priority queue is high or low, it can be allocated the corresponding time slot in the current transmission cycle, thereby avoiding the high-priority sequence transmission task from occupying the time slot of the low-priority sequence transmission task for a long time, and realizing the reasonable scheduling of sequence transmission tasks of different priorities.

[0139] Corresponding to the data transmission scheduling method provided above, the embodiment of the present application further provides an electronic device. Figure 5 The electronic device 5 in the embodiment of the present application includes: a memory 501, one or more processors 502 ( Figure 5Only one is shown in the figure) and a computer program stored in the memory 501 and can be run on the processor. Among them: the memory 501 can be used to store software programs and modules, and the processor 502 executes various functional applications and data processing of the electronic device by running the software programs and modules stored in the memory 120. Specifically, the processor 502 implements the following steps when running the computer program stored in the memory 501:

[0140] Obtain the priority of each sequence transmission task, and divide each sequence transmission task into the priority queue corresponding to the respective priority;

[0141] Determine the time slots corresponding to each priority queue in the current transmission cycle;

[0142] Control each sequence transmission task to be executed within the time slot corresponding to the priority queue to which it belongs.

[0143] Assuming the first possible implementation mode, in a second possible implementation mode provided on the basis of the first possible implementation mode, determining the time slots corresponding to the priority queues in the current transmission cycle includes:

[0144] According to the attributes of each priority queue, the time slot corresponding to each priority queue in the current transmission cycle is determined through dynamic time slot calculation.

[0145] In a third possible implementation manner provided on the basis of the second possible implementation manner, according to the attributes of each of the priority queues, determining the time slots corresponding to each of the priority queues in the current transmission cycle by dynamically calculating the time slots includes:

[0146] Determine the duration coefficient of each priority queue according to the expected transmission duration of each sequence transmission task;

[0147] Determine the priority weight coefficient of each priority queue according to the preset discount coefficient and the preset initial weight coefficient;

[0148] The time slots corresponding to the priority queues in the current transmission cycle are calculated according to the time length coefficients of the priority queues, the priority weight coefficients and the total time length of the current transmission cycle.

[0149] In a fourth possible implementation provided on the basis of the third possible implementation, determining the duration coefficient of each priority queue according to the expected transmission duration of each sequence transmission task includes:

[0150] Calculate the sum of the expected transmission durations of all sequential transmission tasks to obtain the total expected transmission duration;

[0151] According to the expected transmission duration of the sequence transmission tasks in each priority queue, the expected transmission duration of each priority queue is calculated respectively;

[0152] The time coefficient of each priority queue is determined according to the total expected transmission time and the expected transmission time of each queue.

[0153] In a fifth possible implementation provided as a basis of the third possible implementation, the priority weight coefficient of each priority queue is determined according to a preset discount coefficient and a preset initial weight coefficient, including:

[0154] According to the preset discount coefficient and the preset initial weight coefficient, the priority weight coefficient of each priority queue is determined through iterative calculation.

[0155] In a sixth possible implementation provided on the basis of the first possible implementation, or on the basis of the second possible implementation, or on the basis of the third possible implementation, or on the basis of the fourth possible implementation, or on the basis of the fifth possible implementation, the processor 502 further implements the following steps when running the computer program stored in the memory 501:

[0156] When a real-time transmission task is received in the current transmission cycle, a soft interrupt is triggered, and the soft interrupt is used to control the current sequence transmission task to pause execution and control the execution of the real-time transmission task.

[0157] In a seventh possible implementation provided as a basis of the sixth possible implementation, the processor 502 further implements the following steps when running the computer program stored in the memory 501:

[0158] Before triggering the soft interrupt, the context information of the current sequence transmission task is recorded;

[0159] After the real-time transmission task is completed, the current sequence transmission task is controlled to resume execution according to the context information.

[0160] In an eighth possible implementation provided on the basis of the first possible implementation, or on the basis of the second possible implementation, or on the basis of the third possible implementation, or on the basis of the fourth possible implementation, or on the basis of the fifth possible implementation, or on the basis of the sixth possible implementation, or on the basis of the seventh possible implementation, the data transmission scheduling method is applied to a management board, the management board establishes a communication connection with at least one data board, and the processor 502 further implements the following steps when running a computer program stored in the memory 501:

[0161] Create multiple levels of priority queues for each data board.

[0162] In a ninth possible implementation provided as a basis of the eighth possible implementation, the data sending end of the sequence transmission task is the first process, and the data receiving end is the second process, wherein the first process and the second process are on the same data board; or, the first process and the second process are on different data boards.

[0163] In a tenth possible implementation provided on the basis of the first possible implementation, or on the basis of the second possible implementation, or on the basis of the third possible implementation, or on the basis of the fourth possible implementation, or on the basis of the fifth possible implementation, or on the basis of the sixth possible implementation, or on the basis of the seventh possible implementation, or on the basis of the eighth possible implementation, or on the basis of the ninth possible implementation, each sequence transmission task is controlled to be executed in a time slot corresponding to the priority queue to which it belongs, including:

[0164] According to the order of priority from high to low and task creation time from early to late, each sequence transmission task is controlled to be executed in the time slot corresponding to the priority queue.

[0165] In an eleventh possible implementation provided on the basis of the first possible implementation, or on the basis of the second possible implementation, or on the basis of the third possible implementation, or on the basis of the fourth possible implementation, or on the basis of the fifth possible implementation, or on the basis of the sixth possible implementation, or on the basis of the seventh possible implementation, or on the basis of the eighth possible implementation, or on the basis of the ninth possible implementation, or on the basis of the tenth possible implementation, the processor 502 further implements the following steps when running the computer program stored in the memory 501:

[0166] When all serial transmission tasks in the first priority queue are completed and there are remaining time slots corresponding to the first priority queue, the remaining time slots of the first priority queue are allocated to the second priority queue, wherein the first priority queue and the second priority queue are adjacent priority queues, and the priority of the first priority queue is higher than that of the second priority queue.

[0167] It should be understood that in the embodiment of the present application, the processor 502 may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0168] The memory 501 may include a read-only memory and a random access memory, and provide instructions and data to the processor 502. A part or all of the memory 501 may also include a non-volatile random access memory. For example, the memory 501 may also store information on the device type.

[0169] As can be seen from the above, the embodiment of the present application no longer considers each sequence transmission task as the object for fixed time slot allocation, but considers each priority queue as the object for dynamic time slot allocation. In this way, no matter whether the priority corresponding to each priority queue is high or low, it can be allocated the corresponding time slot in the current transmission cycle, thereby avoiding the high-priority sequence transmission task from occupying the time slot of the low-priority sequence transmission task for a long time, and realizing the reasonable scheduling of sequence transmission tasks of different priorities.

[0170] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of each functional unit and module is used as an example. In actual application, the function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit, and the integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of each functional unit and module are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

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

[0172] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of external device software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0173] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the system embodiments described above are only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0174] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0175] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the implementation method of the present application can also be completed by instructing the associated hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of each method embodiment when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable storage medium may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer-readable memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable storage medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable storage medium does not include electric carrier signals and telecommunication signals.

[0176] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.

Claims

1. A data transmission scheduling method, It is characterized in that include: Obtaining the priority of each sequence transmission task, and dividing each of the sequence transmission tasks into a priority queue corresponding to the respective priority; Determine the time slots corresponding to the priority queues in the current transmission cycle; Each of the sequence transmission tasks is controlled to be executed within the time slot corresponding to the priority queue to which it belongs.

2. The data transmission scheduling method according to claim 1, It is characterized in that The determining, in the current transmission cycle, time slots corresponding to the priority queues includes: According to the attributes of each priority queue, the time slot corresponding to each priority queue in the current transmission cycle is determined through dynamic time slot calculation.

3. The data transmission scheduling method according to claim 2, It is characterized in that The determining, according to the attributes of each of the priority queues, the time slots corresponding to each of the priority queues in the current transmission cycle by dynamic calculation of the time slots comprises: Determining the duration coefficient of each priority queue according to the expected transmission duration of each of the sequence transmission tasks; Determining the priority weight coefficient of each priority queue according to a preset discount coefficient and a preset initial weight coefficient; The time slots corresponding to the priority queues in the current transmission cycle are calculated according to the time length coefficients of the priority queues, the priority weight coefficients and the total time length of the current transmission cycle.

4. The data transmission scheduling method according to claim 3, It is characterized in that Determining the duration coefficient of each priority queue according to the expected transmission duration of each of the sequence transmission tasks includes: Calculating the sum of the expected transmission durations of all the sequence transmission tasks to obtain a total expected transmission duration; Calculate the expected transmission duration of each priority queue according to the expected transmission duration of the sequence transmission task in each priority queue; The duration coefficient of each priority queue is determined according to the total expected transmission duration and the expected transmission duration of each queue.

5. The data transmission scheduling method according to claim 3, It is characterized in that Determining the priority weight coefficient of each priority queue according to the preset discount coefficient and the preset initial weight coefficient includes: According to the preset discount coefficient and the preset initial weight coefficient, the priority weight coefficient of each priority queue is determined through iterative calculation.

6. The data transmission scheduling method according to any one of claims 1 to 5, It is characterized in that The data transmission scheduling method further includes: In the case where a real-time transmission task is received in the current transmission cycle, a soft interrupt is triggered, and the soft interrupt is used to control the current sequence transmission task to pause execution and control the execution of the real-time transmission task.

7. The data transmission scheduling method according to claim 6, It is characterized in that The data transmission scheduling method further includes: Before triggering the soft interrupt, recording the context information of the current sequence transmission task; After the real-time transmission task is completed, the current sequence transmission task is controlled to resume execution according to the context information.

8. The data transmission scheduling method according to any one of claims 1 to 7, It is characterized in that The data transmission scheduling method is applied to a management board, the management board establishes a communication connection with at least one data board, and the data transmission scheduling method further includes: A multi-level priority queue is created for each of the data boards.

9. The data transmission scheduling method according to claim 8, It is characterized in that The data sending end of the serial transmission task is the first process, and the data receiving end is the second process, wherein the first process and the second process are in the same data board; or, the first process and the second process are in different data boards.

10. The data transmission scheduling method according to any one of claims 1 to 9, It is characterized in that The controlling each of the sequence transmission tasks to be executed in a time slot corresponding to the priority queue to which it belongs includes: According to the order of priority from high to low and task creation time from early to late, each of the sequence transmission tasks is controlled to be executed in the time slot corresponding to the priority queue to which it belongs.

11. The data transmission scheduling method according to any one of claims 1 to 10, It is characterized in that The data transmission scheduling method further includes: When all the sequence transmission tasks in the first priority queue are completed and there are remaining time slots corresponding to the first priority queue, the remaining time slots of the first priority queue are allocated to the second priority queue, wherein the first priority queue and the second priority queue are adjacent priority queues, and the priority of the first priority queue is higher than that of the second priority queue.

12. A data transmission scheduling device, It is characterized in that include: A division module, used to obtain the priority of each sequence transmission task, and divide each of the sequence transmission tasks into a priority queue corresponding to the respective priority; A determination module, used to determine the time slots corresponding to the priority queues in the current transmission cycle; The control module is used to control each of the sequence transmission tasks to be executed in the time slot corresponding to the priority queue to which it belongs.

13. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the method according to any one of claims 1 to 11 is implemented.

14. A computer-readable storage medium storing a computer program. It is characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 11 is implemented.