Hybrid scheduling method, device, electronic device and storage medium for messages
By dividing deterministic messages and ordinary messages into two scheduling queues and scheduling using the export hybrid queue method, the complex problem of hybrid scheduling in traditional scheduling is solved, and efficient mixed scheduling of deterministic messages and ordinary messages is achieved.
Patent Information
- Application Number
- CN202010923671.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-04
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2040-09-04
AI Technical Summary
In traditional message scheduling, the mixed scheduling of deterministic messages and ordinary messages is complex, making it difficult to achieve efficient mixed scheduling, especially when the deterministic delay requirements are incompatible with the ordinary message transmission path.
Deterministic messages and ordinary messages are divided into two independent scheduling queues for storage, and the preset conditions are used to determine the priority scheduling of deterministic messages. At the same time, ordinary messages can share the scheduling resources of deterministic messages and use the export hybrid queue method for scheduling.
It realizes efficient mixed scheduling of deterministic messages and ordinary messages, ensures priority scheduling of deterministic messages and sub-priority scheduling of ordinary messages, and improves the efficiency and reliability of mixed scheduling.
Smart Images

Figure CN114221911B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of data transmission, and in particular to a hybrid scheduling method, device, electronic device, and storage medium for messages. Background Art
[0002] With the rise of the industrial Internet, deterministic networks have proposed to guarantee deterministic transmission delay for specific messages, guarantee the specific message delay of the industrial Internet, and achieve the purpose of industrial Internet control. In deterministic networks, deterministic messages and ordinary messages are scheduled on the same data forwarding line, and guaranteeing the mixed scheduling of deterministic delay messages and ordinary messages has become a key technology in deterministic network research.
[0003] In traditional message scheduling, in order to achieve mixed scheduling of deterministic messages and ordinary messages, deterministic messages are added to the transmission path of ordinary messages, which complicates the scheduling structure and blurs the transmission order of deterministic messages and high-priority ordinary messages. In addition, in order to reflect the priority of deterministic messages, priority settings are added to the original ordinary message transmission path, but the priority settings are incompatible with the original transmission path. Therefore, efficient mixed scheduling of deterministic messages and ordinary messages cannot be achieved. Summary of the invention
[0004] The purpose of the embodiments of the present invention is to provide a hybrid scheduling method for messages, so as to realize efficient hybrid scheduling of deterministic messages and common messages.
[0005] To solve the above problem, an embodiment of the present invention provides a hybrid scheduling method for messages, comprising the following steps:
[0006] The deterministic messages stored in the first scheduling queue are transmitted to the egress queue, and the ordinary messages stored in the second scheduling queue are transmitted to the egress queue after the preset conditions are met; wherein the preset conditions include: no deterministic messages are stored in the first scheduling queue;
[0007] Send the messages stored in the egress queue.
[0008] An embodiment of the present invention further provides a hybrid scheduling device for messages, including:
[0009] A first transmission unit, configured to transmit the deterministic message stored in the first scheduling queue to the egress queue;
[0010] A second transmission unit is used to transmit the common message stored in the second scheduling queue to the egress queue after a preset condition is met; wherein the preset condition includes: no deterministic message is stored in the first scheduling queue;
[0011] The sending unit is used to send the messages stored in the egress queue.
[0012] An embodiment of the present invention further provides an electronic device, including:
[0013] at least one processor; and,
[0014] a memory communicatively connected to at least one processor; wherein,
[0015] The memory stores instructions that can be executed by at least one processor, and the instructions are executed by at least one processor so that the at least one processor can execute the hybrid scheduling method of the above-mentioned message.
[0016] An embodiment of the present invention further provides a computer-readable storage medium storing a computer program, including: when the computer program is executed by a processor, the hybrid scheduling method of the above-mentioned messages is implemented.
[0017] Compared with the prior art, the implementation method of the present invention divides deterministic messages and ordinary messages into two scheduling queues for storage. By adopting the export mixed queue mode, after combining the preset judgment conditions, the deterministic messages are preferentially scheduled while the ordinary messages can share the scheduling resources of the deterministic messages, and the mixed scheduling of the deterministic messages and the ordinary messages is efficiently realized.
[0018] In addition, the ordinary messages stored in the second scheduling queue are transmitted to the egress queue after the preset conditions are met, including: obtaining the ordinary messages in the second scheduling queue; detecting whether there are deterministic messages in the current first scheduling queue; if there are deterministic messages in the current first scheduling queue, then prohibiting the ordinary messages in the second scheduling queue from being transmitted to the egress queue; if there are no deterministic messages in the current first scheduling queue, then transmitting the ordinary messages in the second scheduling queue to the egress queue. By detecting the existence of deterministic messages in the current first scheduling queue, priority scheduling of deterministic messages and secondary priority scheduling of ordinary messages are guaranteed.
[0019] In addition, detecting whether there is a deterministic message in the current first scheduling queue includes: detecting whether there is a deterministic message in the current first scheduling queue according to a scheduling queue signal generated by the first scheduling queue; wherein the scheduling queue signal is used to indicate that there is a deterministic message in the first scheduling queue. If there is no scheduling signal, it means that there is no deterministic message in the current first scheduling queue. This scheduling queue signal can assist in achieving the purpose of scheduling resources for deterministic messages while ordinary messages share the scheduling resources of deterministic messages while giving priority to the scheduling of deterministic messages.
[0020] In addition, before transmitting the deterministic message stored in the first scheduling queue to the egress queue, the method further includes: transmitting the deterministic message to the first scheduling queue through a time gate wheel.
[0021] In addition, the deterministic message is transmitted to the first scheduling queue through the time gate wheel, including: controlling the opening period of the time gate wheel according to the delay requirement of the deterministic message; transmitting the deterministic message to the first scheduling queue through the opened time gate wheel; wherein, the higher the delay requirement of the deterministic message, the shorter the opening period. The time gate wheel can effectively manage the delay scheduling of the deterministic message, so that the transmission of the deterministic message meets the corresponding delay requirement.
[0022] In addition, the deterministic message stored in the first scheduling queue is transmitted to the egress queue, including: according to a preset scheduling mechanism, the deterministic message stored in the first scheduling queue is transmitted to the egress queue. The preset scheduling method can be targeted at deterministic network requirements and user configuration, so that the transmission process is applicable to actual conditions and improves user experience.
[0023] In addition, the preset scheduling mechanism includes any one of the following scheduling mechanisms: Priority Queueing (PQ) scheduling mechanism, Weighted Fair Queueing (WFQ) scheduling mechanism, Class-Based Weighted Fair Queueing (CBWFQ) scheduling mechanism. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 is a flowchart of a hybrid scheduling method for messages provided according to a first embodiment of the present invention;
[0025] Figure 2 is a schematic diagram of a hybrid scheduling method for messages provided according to a first embodiment of the present invention;
[0026] Figure 3 This is a flowchart executed by a post-scheduler in a hybrid scheduling method for messages provided in a first embodiment of the present invention;
[0027] Figure 4 is a flowchart of a hybrid scheduling method for messages provided according to a second embodiment of the present invention;
[0028] Figure 5 is a schematic diagram of a hybrid scheduling device for messages provided according to a third embodiment of the present invention;
[0029] Figure 6 is a schematic diagram of a hybrid scheduling device for messages provided in an example according to a third embodiment of the present invention;
[0030] Figure 7 is a schematic diagram of an electronic device provided according to a fourth embodiment of the present invention. DETAILED DESCRIPTION
[0031] To make the purpose, technical scheme and advantages of the embodiments of the present invention clearer, the embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings. However, it will be appreciated by those skilled in the art that in the embodiments of the present invention, many technical details are proposed in order to enable the reader to better understand the present application. However, even without these technical details and various changes and modifications based on the following embodiments, the technical scheme claimed in the present application can be implemented. The division of the following embodiments is for the convenience of description, and should not constitute any limitation on the specific implementation of the present invention. The various embodiments can be combined and referenced with each other without contradiction.
[0032] The first embodiment of the present invention relates to a hybrid scheduling method for messages, as shown in the schematic diagram Figure 2 As shown, the process is as Figure 1 As shown, including:
[0033] Step 101, transmit the deterministic messages stored in the first scheduling queue to the egress queue, and transmit the ordinary messages stored in the second scheduling queue to the egress queue after satisfying preset conditions; wherein the preset conditions include: no deterministic messages are stored in the first scheduling queue.
[0034] Step 102: Send the message stored in the egress queue.
[0035] Specifically, Figure 2 As shown, in this embodiment, independent scheduling queues are set for deterministic messages and ordinary messages, respectively. The deterministic message scheduling queue is preceded by a time gate, and the ordinary data message scheduling queue is followed by a scheduling controller. That is to say, the deterministic message is transmitted to the first scheduling queue set for the deterministic message through the time gate, so as to control the delay of the deterministic message and achieve the purpose of ensuring different time delay scheduling for different deterministic messages. The scheduling controller is set after the second scheduling queue set for ordinary data messages to constrain the egress scheduling of ordinary data messages. The constraint condition is the deterministic message scheduling queue signal. As long as the scheduling queue signal is output according to the deterministic message in the first scheduling queue, the scheduling of the ordinary data message must be stopped.
[0036] The implementation mode of the present invention is mainly performed by an electronic device. The processor sends a deterministic message to the first scheduling queue through a time gate wheel, and sends an ordinary message to the second scheduling queue. If there is a deterministic message in the first scheduling queue, the first scheduling queue sends a scheduling queue signal to the scheduling controller, and the scheduling controller restricts the operation of sending ordinary messages in the second scheduling queue to the egress queue. At the same time, the first scheduling queue sends the stored deterministic message to the egress queue; if there is no deterministic message in the first scheduling queue, the scheduling controller sends the ordinary message in the second scheduling queue to the egress queue message. When the egress queue receives the message, the processor sends the message in the egress queue, so that while ensuring the priority scheduling of the deterministic message, the ordinary data message can share the scheduling resources of the deterministic message, ensuring the secondary priority scheduling of the ordinary message.
[0037] The implementation details of the hybrid scheduling method of the message of this implementation mode are specifically described below. The following content is only the implementation details provided for the convenience of understanding and is not necessary for the implementation of this solution.
[0038] In one example, before step 101 is executed, the deterministic message is transmitted to the first scheduling queue through the time gate wheel to achieve the purpose of ensuring the scheduling delay of the deterministic message. Specifically, the opening period of the time gate wheel is controlled according to the delay requirement of the deterministic message; the deterministic message is transmitted to the first scheduling queue through the opened time gate wheel; wherein, the higher the delay requirement of the deterministic message, the shorter the allowed transmission delay time, and the shorter the opening period of the time gate wheel. That is, according to the delay of the deterministic message configured by the user, the time gate wheel is opened at a specific time interval to achieve the purpose of scheduling delay execution.
[0039] During the execution of step 101, the post-scheduling controller is used to transmit the common messages stored in the second scheduling queue to the egress queue. The specific execution flow chart is as follows: Figure 3 As shown:
[0040] Step 1011: Obtain common messages in the second scheduling queue.
[0041] Step 1012: Check whether there is a deterministic message in the current first scheduling queue; if so, execute step 1013; if not, execute step 1014.
[0042] In one example, according to the dispatch queue signal generated by the first dispatch queue, it is detected whether there is a deterministic message in the current first dispatch queue; wherein the dispatch queue signal is used to indicate that there is a deterministic message in the first dispatch queue. If there is a deterministic message in the first dispatch queue, a dispatch queue signal will be generated; if there is no deterministic message in the first dispatch queue, no dispatch queue signal will be generated. Therefore, it is possible to detect whether there is a deterministic message in the current first dispatch queue by detecting the dispatch queue signal.
[0043] Step 1013: prohibiting the transmission of common messages in the second scheduling queue to the egress queue.
[0044] Step 1014: Transmit the common messages in the second scheduling queue to the egress queue.
[0045] Compared with the prior art, this implementation divides deterministic messages and ordinary messages into two scheduling queues for storage. By adopting the egress mixed queue mode, after combining the preset judgment conditions, the deterministic messages are prioritized for scheduling while ordinary messages can share the scheduling resources of deterministic messages, thus efficiently realizing the mixed scheduling of deterministic messages and ordinary messages.
[0046] The second embodiment of the present invention relates to a hybrid scheduling method for messages, the specific process is as follows: Figure 4 As shown, including:
[0047] Step 201: According to a preset scheduling mechanism, the deterministic messages stored in the first scheduling queue are transmitted to the egress queue.
[0048] Step 202, transmitting the common messages stored in the second scheduling queue to the egress queue after satisfying a preset condition; wherein the preset condition includes: no deterministic messages are stored in the first scheduling queue.
[0049] It should be noted that there is no definite order relationship between step 201 and step 202. Step 201 and step 202 are essentially two independent steps that are executed in parallel. Figure 4 This is only an example and does not constitute a constraint on the order of execution.
[0050] Step 203: Send the message stored in the egress queue.
[0051] Step 203 of this embodiment is substantially the same as that of the first embodiment, and will not be described in detail. Step 201 and step 202 of this embodiment are described in detail below.
[0052] In step 201, the deterministic messages stored in the first scheduling queue are transmitted to the egress queue according to a preset scheduling mechanism. The preset scheduling method can be targeted at deterministic network requirements and user configurations, so that the transmission process is applicable to actual conditions and improves user experience.
[0053] The pre-set scheduling mechanism includes any one of the following scheduling mechanisms: PQ scheduling mechanism, WFQ scheduling mechanism, and CBWFQ scheduling mechanism.
[0054] In one example, the PQ scheduling mechanism is used to transmit the deterministic messages in the first scheduling queue to the egress queue using four sub-queues, and the priorities of the four sub-queues are high, medium, normal, and low. The scheduling mechanism will first serve the high-priority deterministic message queue. If there is no data in the high-priority deterministic message queue, it will then serve the medium-priority deterministic message queue, and so on. If PQ is serving the medium-priority deterministic message queue, but data is input into the high-priority deterministic message queue, PQ will interrupt the service of the medium-priority deterministic message queue and serve the high-priority deterministic message queue instead. Using the PQ scheduling mechanism to schedule the deterministic messages stored in the first scheduling queue can give the high-priority deterministic messages absolute priority.
[0055] In one example, the WFQ scheduling mechanism can also be used to transmit the deterministic messages in the first scheduling echelon to the egress queue. Fairness can be ensured between deterministic messages of the same priority, and weighting can be achieved between deterministic messages of different priorities. The number of queues can be pre-configured, and the weights are reflected on the basis of ensuring delay fairness. The size of the weight depends on the IP priority carried in the message header. WFQ classifies deterministic messages by flow, and each deterministic message flow is assigned to a queue. The enqueuing process is automatically completed using the HASH algorithm. When dequeuing, the bandwidth of the egress that each deterministic message flow should occupy is allocated according to the priority. The smaller the priority value, the less bandwidth is obtained. The WFQ scheduling mechanism is used to schedule the deterministic messages stored in the first scheduling queue, and the HASH algorithm autonomously classifies the deterministic messages without user operation; all deterministic message flows have transmission bandwidth.
[0056] In one example, the CBWFQ scheduling mechanism can also be used to transmit the deterministic messages in the first scheduling echelon to the egress queue. CBWFQ usually uses an access control list ACL to define the category of deterministic message flows, which allows the classification of deterministic messages based on standards, such as access control lists, input interface names, protocols, and service quality flags. The CBWFQ scheduling mechanism is an extension of the WFQ scheduling mechanism, supporting user-defined classification of deterministic message flows, and the number of queues and categories are one-to-one corresponding to guarantee bandwidth for each deterministic message flow.
[0057] In this implementation, a scheduling mechanism is pre-set according to deterministic network requirements and user configuration to transmit deterministic messages in the first scheduling echelon, which can ensure the priority of deterministic messages during transmission and reasonably allocate path resources when transmitting deterministic messages to the egress queue.
[0058] A third embodiment of the present invention relates to a hybrid scheduling device for messages, specifically as follows Figure 5 As shown, including:
[0059] The first transmission unit 301 is used to transmit the deterministic message stored in the first scheduling queue to the egress queue.
[0060] The second transmission unit 302 is used to transmit the common message stored in the second scheduling queue to the egress queue after the preset condition is met; wherein the preset condition includes: no deterministic message is stored in the first scheduling queue.
[0061] The sending unit 303 is used to send the message stored in the egress queue.
[0062] In one example, the hybrid scheduling device for messages further includes a third transmission unit 304, such as Figure 6 As shown. The third transmission unit 304 is used to transmit the deterministic message to the first scheduling queue through the time gate wheel, so as to achieve the purpose of ensuring the scheduling delay of the deterministic message. For example, according to the delay requirement of the deterministic message, the opening period of the time gate wheel is controlled; the deterministic message is transmitted to the first scheduling queue through the opened time gate wheel; wherein, the higher the delay requirement of the deterministic message, the shorter the opening period.
[0063] In an example, the second transmission unit 302 is specifically used to obtain ordinary messages in the second scheduling queue; detect whether there are deterministic messages in the current first scheduling queue; if there are deterministic messages in the current first scheduling queue, prohibit the transmission of ordinary messages in the second scheduling queue to the egress queue; if there are no deterministic messages in the current first scheduling queue, transmit the ordinary messages in the second scheduling queue to the egress queue.
[0064] In one example, detecting whether there is a deterministic message in the current first scheduling queue is performed based on a scheduling queue signal generated by the first scheduling queue to detect whether there is a deterministic message in the current first scheduling queue; wherein the scheduling queue signal is used to indicate that there is a deterministic message in the first scheduling queue.
[0065] In addition, transmitting the deterministic message stored in the first scheduling queue to the egress queue includes: transmitting the deterministic message stored in the first scheduling queue to the egress queue according to a preset scheduling mechanism.
[0066] In an example, the preset scheduling mechanism includes any one of the following scheduling mechanisms: a PQ scheduling mechanism, a WFQ scheduling mechanism, and a CBWFQ scheduling mechanism.
[0067] It is not difficult to find that this embodiment is a device embodiment corresponding to the above embodiment, and this embodiment can be implemented in conjunction with the above embodiment. The relevant technical details mentioned in the above embodiment are still valid in this embodiment, and in order to reduce repetition, they are not repeated here. Accordingly, the relevant technical details mentioned in this embodiment can also be applied in the above embodiment.
[0068] A fourth embodiment of the present invention relates to an electronic device, such as Figure 7 As shown, it includes at least one processor 401; and
[0069] A memory 402 communicatively connected to at least one processor 401; wherein the memory 402 stores instructions executable by at least one processor 401, and the instructions are executed by at least one processor 402 so that at least one processor 401 can execute the hybrid scheduling method of the messages of the above-mentioned embodiment.
[0070] Among them, the memory 402 and the processor 401 are connected in a bus manner, and the bus can include any number of interconnected buses and bridges, and the bus connects various circuits of one or more processors and memories together. The bus can also connect various other circuits such as peripherals, voltage regulators, and power management circuits, which are all well known in the art and are therefore not further described herein. The bus interface provides an interface between the bus and the transceiver. The transceiver can be one element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices on a transmission medium. The data processed by the processor is transmitted on a wireless medium via an antenna, and further, the antenna also receives data and transmits the data to the processor.
[0071] The processor 401 is responsible for managing the bus and general processing, and may also provide various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions. The memory 402 may be used to store data used by the processor when performing operations.
[0072] A fifth embodiment of the present invention relates to a computer-readable storage medium storing a computer program, which implements the above method embodiment when executed by a processor.
[0073] That is, those skilled in the art can understand that all or part of the steps in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a program, and the program is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0074] Those skilled in the art will appreciate that the above-mentioned embodiments are specific examples for implementing the present invention, and in actual applications, various changes may be made thereto in form and detail without departing from the spirit and scope of the present invention.
Claims
1. A hybrid scheduling method for messages, comprising: Transmitting the deterministic messages stored in the first scheduling queue to the egress queue, and transmitting the ordinary messages stored in the second scheduling queue to the egress queue after satisfying a preset condition; wherein the preset condition includes: no deterministic messages are stored in the first scheduling queue; Sending the message stored in the egress queue; Before the step of transmitting the deterministic message stored in the first scheduling queue to the egress queue, the following steps are included: Control the opening cycle of the time gate wheel according to the delay requirements of the deterministic message; Transmitting the deterministic message to the first scheduling queue through the opened time gate wheel; The higher the delay requirement of the deterministic message, the shorter the enable period.
2. The hybrid scheduling method of messages according to claim 1, characterized in that: The transmitting the common message stored in the second scheduling queue to the egress queue after satisfying a preset condition comprises: Obtaining common messages in the second scheduling queue; Detecting whether the deterministic message exists in the first scheduling queue; If the deterministic message currently exists in the first scheduling queue, it is prohibited to transmit the ordinary message in the second scheduling queue to the egress queue; If the deterministic message does not currently exist in the first scheduling queue, the common message in the second scheduling queue is transmitted to the egress queue.
3. The hybrid scheduling method of messages according to claim 2, characterized in that: The detecting whether the deterministic message exists in the current first scheduling queue includes: Detecting whether the deterministic message exists in the current first scheduling queue according to a scheduling queue signal generated based on the first scheduling queue; The scheduling queue signal is used to indicate that the deterministic message exists in the first scheduling queue.
4. The hybrid scheduling method for messages according to any one of claims 1 to 3, characterized in that: The step of transmitting the deterministic message stored in the first scheduling queue to the egress queue includes: According to a preset scheduling mechanism, the deterministic messages stored in the first scheduling queue are transmitted to the egress queue.
5. The hybrid scheduling method of messages according to claim 4, characterized in that: The preset scheduling mechanism includes any one of the following scheduling mechanisms: Priority queue scheduling PQ mechanism, weighted fair queue WFQ scheduling mechanism, class-based weighted fair queue CBWFQ scheduling mechanism.
6. A hybrid scheduling device for messages, characterized in that: include: A first transmission unit, configured to transmit the deterministic message stored in the first scheduling queue to the egress queue; A second transmission unit, configured to transmit the common message stored in the second scheduling queue to the egress queue after a preset condition is met; wherein the preset condition includes: no deterministic message is stored in the first scheduling queue; A sending unit, used for sending the message stored in the egress queue; Wherein, the first transmission unit is further used for: Control the opening cycle of the time gate wheel according to the delay requirements of the deterministic message; Transmitting the deterministic message to the first scheduling queue through the opened time gate wheel; The higher the delay requirement of the deterministic message, the shorter the enable period.
7. An electronic device, characterized in that: include: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the hybrid scheduling method for messages as described in any one of claims 1 to 5.
8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the hybrid scheduling method of messages according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Method and system for priority processing of messages
CN104518988A
Trunking communication method, terminal device, and storage medium
CN109089281A