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

By adopting the method of dynamically allocating time slots in the data transmission scheduling model, the time slots are calculated based on the attributes of the priority queue, the problem of high-priority data preempting low-priority data slots in the prior art is solved, and reasonable scheduling and efficient transmission of data transmission tasks of different priority levels are achieved.

WO2025108309A1PCT designated stage expired Publication Date: 2025-05-30CONTEMPORARY AMPEREX FUTURE ENERGY RES INST (SHANGHAI) LTD +1

Patent Information

Application Number
PCT/CN2024/133231
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-11-23
Filing Date
2024-11-20
Publication Date
2025-05-30

AI Technical Summary

Technical Problem

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

Method used

The method of dynamically allocating time slots is adopted, and each priority queue is used as the consideration object. According to its attributes, the time slot corresponding to each priority queue in the current transmission cycle is determined through time slot dynamic calculation, ensuring that both high-priority and low-priority data can be transmitted within a reasonable time slot.

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 CN2024133231_30052025_PF_FP_ABST
    Figure CN2024133231_30052025_PF_FP_ABST
Patent Text Reader

Abstract

Disclosed in the present application are a data transmission scheduling method, a data transmission scheduling apparatus, an electronic device and a computer-readable storage medium. The method comprises: acquiring the priority of each sequence transmission task, and dividing each sequence transmission task into a priority queue corresponding to the priority thereof; determining a slot that corresponds to each priority queue and is in a current transmission period; and controlling each sequence transmission task to be executed in a slot corresponding to the priority queue to which the sequence transmission task belongs. By means of the solution in the present application, transmission tasks having different priorities can be rationally scheduled.
Need to check novelty before this filing date? Find Prior Art

Description

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

[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on November 23, 2023, with application number 202311575524.9 and invention name “A data transmission scheduling method, device, electronic device and storage medium”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] 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

[0003] Establishing an efficient data transmission scheduling model to ensure the timely transmission of various types of data has long been a critical issue in the field of communications technology, particularly in areas involving electrical control. Currently, the most common data transmission scheduling model determines the transmission order based on the priority of the data to be transmitted. This can result in situations where low-priority data cannot obtain time slots while high-priority data continues to be generated, thus hindering some transmission tasks. In other words, the current data transmission scheduling model still has room for improvement in terms of the rationality of time slot allocation.

[0004] Application Contents

[0005] 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 the reasonable scheduling of transmission tasks of different priorities.

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

[0007] Obtain the priority of each sequence transmission task and divide each sequence transmission task into the priority queue corresponding to its priority;

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

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

[0010] The present application solution no longer allocates fixed time slots based on each serial transmission task, but instead dynamically allocates time slots based on each priority queue. This allows each priority queue, regardless of its priority, to be allocated a corresponding time slot in the current transmission cycle. This prevents high-priority serial transmission tasks from occupying the time slots of low-priority serial transmission tasks for extended periods, thus achieving reasonable scheduling of serial transmission tasks of different priorities.

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

[0012] 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.

[0013] Dynamic time slot allocation takes into account the latest status of each sequential transmission task before each transmission cycle, allowing time slot allocation to be adjusted appropriately based on actual conditions. For example, after high-priority data has completed transmission, low-priority queues can dynamically obtain longer time slots, accelerating the transmission of low-priority tasks. This further improves the rationality of task scheduling.

[0014] In some embodiments, based on the attributes of each priority queue, the time slot corresponding to each priority queue in the current transmission cycle is determined by dynamic time slot calculation, including:

[0015] Determine the duration coefficient of each priority queue based on the expected transmission duration of each sequence transmission task;

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

[0017] The time slot corresponding to each priority queue in the current transmission cycle is calculated according to the time length coefficient, priority weight coefficient and the total time length of the current transmission cycle of each priority queue.

[0018] When performing dynamic time slot calculation, the following dimensions that affect time slot allocation are taken into account: the first is priority, and the second 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 time slot calculation more reasonable.

[0019] In some embodiments, determining the duration coefficient of each priority queue based on the expected transmission duration of each sequence transmission task includes:

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

[0021] Calculate the expected transmission time of each priority queue based on the expected transmission time of the sequence transmission tasks in each priority queue;

[0022] The time coefficient of each priority queue is determined based on the total expected transmission time and the expected transmission time of each queue.

[0023] Regarding the transmission duration dimension, this embodiment of the application tends to allocate more duration to priority queues with longer transmission durations. Based on this, this embodiment of the application calculates the duration coefficient of the priority queue using the total expected transmission duration and the expected transmission duration of each queue, so that the calculated duration coefficient can meet the requirements of the transmission duration dimension.

[0024] In some embodiments, determining the priority weight coefficient of each priority queue based on a preset discount coefficient and a preset initial weight coefficient includes:

[0025] The priority weight coefficient of each priority queue is determined through iterative calculation according to the preset discount coefficient and the preset initial weight coefficient.

[0026] In terms of priority, the embodiment of the present application tends to allocate more time to the priority queue with higher 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.

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

[0028] When a real-time transmission task is received in the current transmission cycle, a soft interrupt is triggered. 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.

[0029] The present embodiment of the application subdivides transmission tasks into two categories: sequential transmission tasks and real-time transmission tasks. Compared to sequential transmission tasks, real-time transmission tasks have higher real-time requirements. Based on this, the present embodiment of the application proposes a soft interrupt solution, which enables real-time transmission tasks to be executed immediately, ensuring their real-time performance.

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

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

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

[0033] 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 recorded context information will not affect the execution accuracy of the sequence transmission task.

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

[0035] Create multi-level priority queues for each data board.

[0036] The data transmission scheduling method proposed in the embodiments of the present application can be applied to multi-board application scenarios. Specifically, because the management board creates 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 by the management board.

[0037] In some embodiments, 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 on the same data board; or, the first process and the second process are on different data boards.

[0038] 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.

[0039] 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:

[0040] 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 to which it belongs.

[0041] The embodiment of the present application realizes orderly control of each serial 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 serial transmission tasks can also be achieved.

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

[0043] 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.

[0044] The embodiment of the present application allocates the remaining unused time slots of 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.

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

[0046] 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;

[0047] A determination module, configured to determine the time slots corresponding to each priority queue in the current transmission cycle through dynamic time slot calculation;

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

[0049] In a third aspect, the present application provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the method of the first aspect are implemented.

[0050] 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.

[0051] 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, it implements the steps of the method of the first aspect.

[0052] 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.

[0053] 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, which can be implemented in accordance with the contents of the specification, and 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

[0054] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. 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 the drawings without creative work.

[0055] FIG1 is a schematic diagram of an implementation flow of a data transmission scheduling method provided in an embodiment of the present application;

[0056] FIG2 is an exemplary diagram of the architecture of a multi-board system provided in an embodiment of the present application;

[0057] FIG3 is an example diagram of time slot allocation provided by an embodiment of the present application;

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

[0059] FIG5 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0060] The following embodiments of the technical solution of the present application will be described in detail with reference to the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present application and are therefore only examples and are not intended to limit the scope of protection of the present application.

[0061] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art 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" and any variations thereof in the specification, claims and drawings of this application are intended to cover non-exclusive inclusions.

[0062] 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.

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

[0064] In the description of the embodiments of this application, the term "and / or" is simply a description of the association relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can represent the following three situations: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in this document generally indicates that the associated objects are in an "or" relationship.

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

[0066] Efficient data transmission scheduling models ensure the timely transmission of various types of data and have always been a key issue in the communications field. This is especially true for electrical control, which involves multiple data types and various types of electrical devices, resulting in different requirements for data transmission volume, latency, and real-time performance.

[0067] Currently, the most common data transmission scheduling models typically allocate time slots to each transmission task based solely on its priority. Specifically, within a transmission cycle, high-priority transmission tasks are executed first; after these high-priority tasks complete, low-priority transmission tasks are executed. In other words, processing resources in current data transmission scheduling models are heavily weighted toward high-priority transmission tasks.

[0068] 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.

[0069] Based on the above considerations, the embodiments of the present application propose a data transmission scheduling method that dynamically allocates time slots based on each priority queue, thereby avoiding the situation where low-priority transmission tasks cannot obtain time slots for a long time and realizing the reasonable scheduling of transmission tasks of different priorities. In order to illustrate the technical solution proposed in the embodiments of the present application, a specific embodiment is used below for description.

[0070] The following describes a data transmission scheduling method provided in an embodiment of the present application, which can be applied to electronic devices with management functions. Referring to FIG1 , the data transmission scheduling method in the embodiment of the present application includes:

[0071] Step 101: Obtain the priority of each sequence transmission task, and divide each sequence transmission task into a priority queue corresponding to the respective priority.

[0072] The electronic device can pre-set the data priority rules and create a multi-level priority queue. 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, where 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: {Q1, Q2, Q3, ...}, where Q1 is priority queue 1, and the others are not repeated.

[0073] Before each transmission cycle begins, the electronic device may determine the sequence transmission tasks currently to be transmitted. It is understood that the sequence transmission tasks currently 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 fully transmitted in the previous transmission cycle.

[0074] The electronic device may be pre-configured with priorities of various types of data. Based on this, for each sequence transmission task currently to be 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.

[0075] In some embodiments, considering that a sequence transmission task usually does not change the data type of the data to be transmitted in the middle, 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 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.

[0076] Step 102: Determine the time slots corresponding to the priority queues in the current transmission cycle.

[0077] In an 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, there will be no situation where a non-empty priority queue fails to be allocated a time slot.

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

[0079] It can be understood that in different transmission cycles, the serial transmission tasks contained in each priority queue will change, including but not limited to changes in the number of tasks, etc., which also causes the properties of each priority queue to change. Based on this, the electronic device can take into account the latest situation of each serial transmission task (that is, the latest properties of each priority queue) before the current transmission cycle through the 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 slot 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 time length of the priority queue and the priority of the priority queue, etc.

[0080] Step 103: Control each sequence transmission task to be executed in the time slot corresponding to the priority queue to which it belongs.

[0081] Each non-empty priority queue can be allocated to a corresponding time slot through step 102. 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.

[0082] In some embodiments, the electronic device can control each serial 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. Specifically, the electronic device can select the priority queue to be allocated time slots according to the order of priority from high to low; then, in the selected priority queue, select the serial transmission task to be allocated time slots 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 serial transmission task; after the selected serial transmission task is executed, a new serial transmission task can 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 serial transmission task (regardless of whether the remaining time slots can enable the selected new serial transmission task to complete the complete transmission). The above process is repeated until the current transmission cycle is fully allocated.

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

[0084] 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 based on this, control each remaining 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.

[0085] As can be seen from the above, the embodiment of the present application no longer takes each serial transmission task as a consideration for fixed time slot allocation, but instead takes each priority queue as a consideration for dynamic time slot allocation. In this way, regardless of whether the priority corresponding to each priority queue is high or low, it can be allocated a corresponding time slot in the current transmission cycle, thereby preventing high-priority serial transmission tasks from occupying the time slots of low-priority serial transmission tasks for a long time. Furthermore, through dynamic time slot allocation, the latest situation of each serial 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, speeding up the transmission speed of the low-priority task. Thus, reasonable scheduling of serial transmission tasks of different priorities is achieved.

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

[0087] A1. Determine the duration coefficient of each priority queue based on the expected transmission duration of each sequence transmission task.

[0088] In the embodiments of this application, the concept of a duration coefficient is proposed for transmission duration. Without considering priority, the electronic device aims to achieve the following goal: the longer the transmission duration, the longer the corresponding time slot. Based on this, the electronic device can determine the duration coefficient for each priority queue based on the expected transmission duration of each sequence transmission task.

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

[0090] Where N is the number of priority queues, which is equivalent to the number of priority levels; n is the priority queue Q nBased 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, 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. This proportion is the time coefficient of each priority queue.

[0091] A2. Determine the priority weight coefficient of each priority queue based on the preset discount coefficient and the preset initial weight coefficient.

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

[0093] Among them, the discount coefficient is used to describe the degree to which the priority weight coefficient decays as the priority decreases, so the value range of the discount coefficient can be specifically (0,1); that is, the discount coefficient is a decimal greater than 0 and less than 1. Based on the role and value range of the discount coefficient, the electronic device can determine the priority weight coefficient of each priority queue through iterative calculation based on the discount coefficient and the preset initial weight coefficient. Priority queue Q1 has the highest priority, and 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: n =δ·σ n-1

[0094] Among them, δ is the discount coefficient; σ is the priority weight coefficient, and its subscript represents the corresponding priority queue. The priority weight coefficient σ1 of the priority queue Q1 is the initial weight coefficient; based on the priority weight coefficient σ1 and the discount coefficient δ, the priority weight coefficient σ2 of the priority queue Q2 can be calculated; and so on, through continuous iterative calculation, the priority weight coefficients σ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 based on the time length coefficient, priority weight coefficient, and total time length of each priority queue in the current transmission cycle.

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

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

[0099] Through the dynamic time slot calculation method proposed above, 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.

[0100] In some embodiments, the electronic device first categorizes data into two types: real-time data and sequence data. Real-time data is expected to be transmitted in real time; that is, it requires greater real-time performance than sequence data. For sequence data, the electronic device proposes the concept of priority described above. Based on this, the electronic device can pre-generate a configuration file based on user-entered configuration information. This configuration file contains the following information: data types that are real-time data, data types that are sequence data, the priorities corresponding to each type of sequence data, priority setting rules (including but not limited to the number of priority levels), the total duration of a single transmission cycle, a discount factor, and an initial weight factor. Based on this, upon receiving a transmission task, the electronic device can first determine, based on the configuration file, whether the data type to be transmitted in the transmission task is real-time data or sequence data. If it is sequence data, the transmission task can be determined as a sequence transmission task; if it is real-time data, the transmission task can be determined as a real-time transmission task.

[0101] During the current transmission cycle, if an electronic device receives a real-time transmission task, it can trigger a soft interrupt, taking into account the special nature of real-time data. This soft interrupt is used to control the suspension of the current serial transmission task and control the execution of the real-time transmission task, thereby ensuring the real-time performance of the real-time transmission task.

[0102] Of course, in order to ensure that the current sequence transmission task (that is, the suspended sequence transmission task) can still be executed smoothly in the future, 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 completed, 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.

[0103] In some embodiments, the electronic device may be specifically a management board; that is, the data transmission scheduling method proposed in the embodiments of the present application may be applied to the management board. The management board may 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 further include: creating an independent multi-level priority queue for each data board. That is, each data board has its own multi-level priority queue, and the management board may execute 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.

[0104] Specifically, the multi-level priority queues can be centrally managed by a dispatch center on the management board. Specifically, a centralized task scheduler is used to manage the central processing unit (CPU) resources in the multi-board system and schedule various transmission tasks. It should be noted that there is only a single instance of this dispatch center in the multi-board system. Please refer to Figure 2, which shows an example of the architecture of a multi-board system. The following describes the architecture of this multi-board system in conjunction with Figure 2:

[0105] Each data board (such as board 1 and board 2 in Figure 2) can submit the resource status of its CPU and the transmission tasks (including real-time transmission tasks and serial 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 for 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 scheduling center's indirect control of the execution of each transmission task.

[0106] It's important to note that transmission tasks (real-time and serial) include both inter-board and intra-board transmission tasks. Specifically, if the data sending end of a transmission task is referred to as the first process and the data receiving end as the second process, the first and second processes can reside on the same data board or on different boards. Different data boards can be connected by a high-bandwidth bus, enabling microsecond-level response times between them.

[0107] 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.

[0108] In some embodiments, the data transmission scheduling method also includes: 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 the priority of the second priority queue.

[0109] 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, electronic devices can allocate the remaining time slots to the next level of priority queue, namely Q n+1 This allows low-priority queues to dynamically obtain more time slots, further improving overall transmission efficiency. Figure 3 shows an example of allocating time slots from a high-priority queue to a low-priority queue when time slot allocation is incomplete. Specifically, the time slots assigned to different transmission tasks are represented by different grayscales.

[0110] As shown in Figure 3, the sequence transmission task R in the priority queue Q1 11 、R 12 and R 13 The total time required to complete the execution is much shorter than the time slot corresponding to the priority queue Q1, which results in the sequential transmission task R 11 、R 12 and R 13 After the execution is completed, there are still time slots corresponding to the priority queue Q1. This remaining time slot is allocated to the next level priority queue, that is, the first sequence transmission task R in the priority queue Q2. 21 , so that R 21A longer time slot is obtained. Similarly, the sequence transmission task R 21 and R 22 After the execution is completed, there are still time slots corresponding to the priority queue Q2. This remaining time slot is allocated to the next level priority queue, that is, the first sequence transmission task R in the priority queue Q3. 31 , so that R 31 By reallocating the remaining time slots of priority queues at all levels, the time slots corresponding to priority queues at all levels are fully utilized, improving overall transmission efficiency.

[0111] It should be understood that the size of the serial numbers of the steps in the embodiment 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 embodiment of the present application.

[0112] Corresponding to the data transmission scheduling method provided above, an embodiment of the present application further provides a data transmission scheduling device. Referring to FIG4 , the data transmission scheduling device 4 in the embodiment of the present application includes:

[0113] 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;

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

[0115] 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.

[0116] In some embodiments, the determination module 402 determines the time slots corresponding to the priority queues in the current transmission cycle by dynamically calculating the time slots according to the attributes of the priority queues.

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

[0118] The 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;

[0119] 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;

[0120] 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, priority weight coefficient and total time length of each priority queue in the current transmission cycle.

[0121] In some embodiments, the first determination submodule includes:

[0122] The first calculation unit is used to calculate the sum of the expected transmission durations of all sequence transmission tasks to obtain a total expected transmission duration;

[0123] The 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 tasks in each priority queue;

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

[0125] 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.

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

[0127] 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.

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

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

[0130] 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.

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

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

[0133] In some embodiments, 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 on the same data board; or, the first process and the second process are on different data boards.

[0134] In some embodiments, the control module 403 is specifically configured to control each sequence transmission task to be executed in a 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.

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

[0136] 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.

[0137] As can be seen from the above, the embodiments of the present application no longer allocate fixed time slots based on individual sequence transmission tasks, but instead dynamically allocate time slots based on individual priority queues. This allows each priority queue, regardless of its priority, to be allocated a corresponding time slot in the current transmission cycle. This prevents high-priority sequence transmission tasks from occupying the time slots of low-priority sequence transmission tasks for extended periods, thus achieving reasonable scheduling of sequence transmission tasks of different priorities.

[0138] Corresponding to the data transmission scheduling method provided above, an embodiment of the present application further provides an electronic device. Referring to Figure 5, the electronic device 5 in the embodiment of the present application includes: a memory 501, one or more processors 502 (only one is shown in Figure 5) and a computer program stored in the memory 501 and executable 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:

[0139] Obtain the priority of each sequence transmission task and divide each sequence transmission task into the priority queue corresponding to its priority;

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

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

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

[0143] 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.

[0144] In a third possible implementation provided as a basis of the second possible implementation, determining, according to the attributes of each priority queue, a time slot corresponding to each priority queue in the current transmission cycle by dynamic time slot calculation includes:

[0145] Determine the duration coefficient of each priority queue based on the expected transmission duration of each sequence transmission task;

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

[0147] The time slot corresponding to each priority queue in the current transmission cycle is calculated according to the time length coefficient, priority weight coefficient and the total time length of the current transmission cycle of each priority queue.

[0148] In a fourth possible implementation provided as a 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:

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

[0150] Calculate the expected transmission time of each priority queue based on the expected transmission time of the sequence transmission tasks in each priority queue;

[0151] The time coefficient of each priority queue is determined based on the total expected transmission time and the expected transmission time of each queue.

[0152] In a fifth possible implementation provided as a basis of the third possible implementation, determining the priority weight coefficient of each priority queue according to a preset discount coefficient and a preset initial weight coefficient includes:

[0153] The priority weight coefficient of each priority queue is determined through iterative calculation according to the preset discount coefficient and the preset initial weight coefficient.

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

[0155] When a real-time transmission task is received in the current transmission cycle, a soft interrupt is triggered. 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.

[0156] 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:

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

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

[0159] In an eighth possible implementation provided on the basis of the first possible implementation, or the second possible implementation, or the third possible implementation, or the fourth possible implementation, or the fifth possible implementation, or the sixth possible implementation, or 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 the computer program stored in the memory 501:

[0160] Create multi-level priority queues for each data board.

[0161] 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.

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

[0163] 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 to which it belongs.

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

[0165] 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.

[0166] 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. The general-purpose processor may be a microprocessor or any conventional processor, etc.

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

[0168] As can be seen from the above, the embodiments of the present application no longer allocate fixed time slots based on individual sequence transmission tasks, but instead dynamically allocate time slots based on individual priority queues. This allows each priority queue, regardless of its priority, to be allocated a corresponding time slot in the current transmission cycle. This prevents high-priority sequence transmission tasks from occupying the time slots of low-priority sequence transmission tasks for extended periods, thus achieving reasonable scheduling of sequence transmission tasks of different priorities.

[0169] Those skilled in the art 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 can be 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 one processing unit, or each unit can exist physically alone, 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 the functional units and modules 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, and will not be repeated here.

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

[0171] Those skilled 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 beyond the scope of this application.

[0172] In the embodiments provided in this 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 merely schematic. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods, 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.

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

[0174] 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 embodiment 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 when the computer program is executed by the processor, it can implement the steps of each method embodiment. 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, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer-readable memory, read-only memory (ROM), random access memory (RAM), 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, computer-readable storage medium does not include electric carrier signal and telecommunication signal.

[0175] 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, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present application, and should all be included in the scope of protection of the present application.

Claims

1. A data transmission scheduling method, comprising: 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, wherein: 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, wherein: 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, wherein: 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, wherein: 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, wherein: 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 suspend execution and control the execution of the real-time transmission task.

7. The data transmission scheduling method according to claim 6, wherein: 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, wherein: 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, wherein: 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, wherein: 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, wherein: 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, comprising: 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, wherein the processor implements the method according to any one of claims 1 to 11 when executing the computer program.

14. A computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the method according to any one of claims 1 to 11.

Citation Information

Patent Citations

  • Multipriority time slot allocation method applicable to centralized TDMA network

    CN109617835A

  • MAC layer queue scheduling method based on TDMA

    CN111371701A

  • Combined transmission of multiple-priority network traffic

    US20150249546A1

Cited By

  • Distributed content distribution network operation method and system, and storage medium

    CN120750926A

  • Multi-band adaptive switching method based on Internet of Things communication base station

    CN120835333A