Data stream scheduling method, system, medium, program product and device
By generating a time-sensitive network and adopting a daisy-chain topology and graph theory method based on a target constraint mathematical model, the problems of insufficient scalability and optimization of existing data flow scheduling algorithms are solved, and fast and efficient data flow scheduling is achieved, which is suitable for networked cyber-physical systems under the Industry 4.0 paradigm.
Patent Information
- Application Number
- CN202411570765.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-05
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2044-11-05
AI Technical Summary
Existing data flow scheduling algorithms have deficiencies in scalability and optimization, and cannot effectively address the needs of deterministic communication in complex systems, especially in networked cyber-physical systems under the Industry 4.0 paradigm, where it is difficult to ensure the determinism of network latency and jitter.
By obtaining the network information configuration file, generating a time-sensitive network, planning the transmission path under the linear topology, and analyzing the scheduling scheme based on the target constraint mathematical model, the daisy chain topology and graph theory method are used to calculate the wait-free scheduling to ensure that the data flow is transmitted within the minimum number of time slots without conflict.
It achieves the rapid and efficient calculation of data flow scheduling solutions that meet application requirements based on low jitter and low latency. It has stronger scalability and accuracy and can handle scenarios with a large number of data flows and diverse periods and frame lengths.
Smart Images

Figure CN120186025B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a data stream scheduling method, system, medium, program product and device. Background Art
[0002] The rapid advancement of communications technology in recent years has revolutionized various industries, enabling the development of complex systems with demanding real-time requirements. From industrial automation, in-vehicle communications, and avionics to multimedia data streaming and telecommunications networks, the demand for reliable and deterministic communications is increasing to ensure the timely delivery of critical data. In particular, a core feature of the Industry 4.0 paradigm is networked cyber-physical systems, in which physical processes are controlled by computers. This often requires a real-time communications network with deterministically bounded network latency and jitter to maintain control of these physical systems.
[0003] Determining whether an efficient schedule exists for a set of data flows is a very difficult combinatorial optimization problem: even when restricted to various special classes of instances, it is NP-hard. Current scheduling algorithms can be categorized as exact methods and heuristic methods. These methods formulate the scheduling problem as a Satisfiability Modulo Theory (SMT) problem, an Integer Linear Programming (ILP) problem, or a Constraint Programming (CP) problem, and then employ corresponding solvers to find the optimal solution. However, these methods fail to scale beyond very small problem instances. In addition to exact methods, many heuristic algorithms, such as those based on tabu search or simulated annealing, have been developed to attempt to find reasonably good schedules in a short time. However, heuristic methods cannot infer whether a problem instance is infeasible, nor can they guarantee that a solution, if one exists, will be found. In summary, existing scheduling algorithms either have poor scalability or are suboptimal. Summary of the Invention
[0004] The purpose of this application is to provide a data flow scheduling method, system, medium, program product and device that can quickly and efficiently output a data flow scheduling solution.
[0005] To solve the above technical problems, this application provides a data flow scheduling method, the specific technical solutions are as follows:
[0006] Obtaining a network information configuration file; the network information configuration file includes a plurality of hierarchical network nodes;
[0007] Generating a time-sensitive network corresponding to the network information configuration file; the time-sensitive network is used to describe the spatiotemporal progress of data flow transmission;
[0008] Planning a transmission path under a linear topology structure according to the time-sensitive network;
[0009] Establishing a target constraint mathematical model based on the transmission path;
[0010] The target constraint mathematical model is parsed to obtain a scheduling scheme, and the scheduling scheme is applied to perform data flow scheduling.
[0011] Optionally, before obtaining the network information configuration file, the following steps are also included:
[0012] Determine a node architecture; the node architecture includes a first-level node for algorithm operation, a network topology, and a first-level node for communication services; the first-level node for algorithm operation, the network topology, and the first-level node for communication services include a plurality of sub-level nodes;
[0013] A network information configuration file is generated by applying extensible markup language based on the node architecture.
[0014] Optionally, generating a time-sensitive network corresponding to the network information configuration file includes:
[0015] Read the data packet sending time, link transmission delay, data packet receiving time, switch data flow assistance time and closing delay between network nodes at each level in the network information configuration file;
[0016] A time-sensitive network is generated according to the data packet sending time, the link transmission delay, the data packet receiving time, the switch assisting data flow time and the gate closing delay.
[0017] Optionally, establishing a target constraint mathematical model based on the transmission path includes:
[0018] Set model building conditions;
[0019] Under the model establishment conditions, a daisy chain topology is used to connect all switches in the order of data flow;
[0020] For each switch in the daisy-chain topology, determining that the switch has a left egress port and a right egress port;
[0021] For any data flow belonging to the set of data flows to be scheduled, determining a period of the data flow;
[0022] Assume that each terminal device can only send or receive one data stream at a time, consider each data stream as an edge in a graph, and consider the switch and the terminal device as vertices in the graph;
[0023] The objective constraint mathematical model is to find the minimum number of time slots so that all data streams can be transmitted within the minimum number of time slots without causing conflicts; wherein, for each data stream, sufficient number of time slots needs to be allocated within its corresponding cycle to meet the transmission requirements.
[0024] Optionally, analyzing the target constraint mathematical model to obtain a scheduling solution includes:
[0025] Determining an analytical objective of the objective constraint mathematical model, wherein the analytical objective is to calculate a wait-free schedule for the set of data flows and the daisy-chain topology;
[0026] The analytical algorithm is called to solve the analytical target and output a scheduling solution.
[0027] Optionally, calling a parsing algorithm to solve the parsing target and outputting a scheduling solution includes:
[0028] Calculate the binary logarithm of the maximum value of the period of all data streams.
[0029] Calculate the data traffic load index of each switch port; the data traffic load index is used to measure the amount of data flow passing through the port;
[0030] If the load on a particular switch port exceeds the port capacity, the no-wait scheduling is returned as non-existent;
[0031] If the load of all ports does not exceed the capacity of the corresponding port, the recursive program is called to perform scheduling calculations and output the scheduling plan.
[0032] Optionally, calculating the data traffic load index of the port of each switch includes:
[0033] The weight of each data flow passing through the port is calculated, and the data flows of different periods are accumulated to obtain the data flow load index of each switch port.
[0034] Optionally, a recursive program is called to perform scheduling calculations, and the output scheduling solutions include:
[0035] If the data stream set is empty, return the empty measurement result;
[0036] If the periods of all data flows are the same, a unique time period is allocated to each data flow; the unique time period is used to ensure that the data flows do not conflict during scheduling;
[0037] When data flows have different periods, the current data flow set is divided into two subsets according to the load of the switch port, and the periods of the data flows of the two subsets are readjusted;
[0038] Recursively call each function to continue looking for scheduling solutions for the two subsets;
[0039] After recursively calculating the scheduling results of the two subsets, the scheduling results are combined as a scheduling solution for the data flow set;
[0040] Output includes a dictionary structure of the scheduling scheme, wherein the dictionary structure includes a scheduling time point allocated to each data flow, and all the scheduling time points and corresponding data flows serve as the scheduling scheme.
[0041] Optionally, allocating a unique time period to each data stream includes:
[0042] The first step is to represent each data flow as a node in the greedy graph coloring algorithm;
[0043] Step 2: Initialize the colors of all vertices to uncolored;
[0044] Step 3: traverse all vertices, and for each uncolored target vertex, select a minimum color that is not used by any adjacent vertex and assign it to the target vertex;
[0045] Step 4: If no available color can be found, it indicates a conflict and a unique time period cannot be assigned;
[0046] Step 5. Repeat steps 3 and 4 until all vertices are colored, and determine the unique time period based on the colored color.
[0047] Optionally, dividing the current data flow set into two subsets according to the load of the switch port further includes:
[0048] Constructing a linear programming problem; the linear programming problem is used to balance the loads of different switch ports;
[0049] The data flow division corresponding to each switch port is solved based on the linear programming problem.
[0050] Optionally, applying the scheduling scheme to perform data flow scheduling includes:
[0051] Generate a network scheduling table configuration file corresponding to the scheduling scheme; the network scheduling table configuration file includes an algorithm operation level 1 node and a train time sensitive network subnet level 1 node;
[0052] Data flow scheduling is performed based on the network scheduler configuration file.
[0053] Optionally, generating a network scheduling table configuration file corresponding to the scheduling scheme includes:
[0054] Determine the algorithm-running secondary node managed by the algorithm-running primary node; the algorithm-running secondary node includes a scheduling algorithm solution strategy, a maximum end-to-end transmission delay allowed for a data flow, a maximum end-to-end transmission jitter allowed for a data flow, a single door opening delay, a maximum acceptable scheduling-type data flow bandwidth occupancy ratio, and a data flow assist time when a data frame passes through a switch;
[0055] Determine the train time-sensitive network level-2 nodes, train time-sensitive network level-3 nodes, train time-sensitive network level-4 nodes, and train time-sensitive network level-5 nodes managed by the train time-sensitive network subnet level-1 node. The train time-sensitive network level-2 nodes include the time scheduling table level-2 nodes on the network ports of each switch and the time scheduling table level-2 nodes on the network ports of each terminal device; the time scheduling table level-2 nodes on the network ports of each switch include the total number of time-sensitive network switches in the subnet and the time scheduling table level-3 nodes on the network ports of a single switch; the time scheduling table level-3 nodes on the network ports of a single switch include the time scheduling table level-4 nodes for a single network port on a single switch; the time scheduling table level-4 nodes for a single network port on a single switch include at least a single scheduling level-5 node for a single network port on a single switch.
[0056] The present application also provides a data flow scheduling system, comprising:
[0057] A file acquisition module is used to acquire a network information configuration file; the network information configuration file includes a plurality of hierarchical network nodes;
[0058] A time-sensitive network generation module, configured to generate a time-sensitive network corresponding to the network information configuration file; the time-sensitive network is used to describe the spatiotemporal progress of data flow transmission;
[0059] A path planning module, configured to plan a transmission path under a linear topology structure according to the time-sensitive network;
[0060] A model building module, configured to build a target constraint mathematical model based on the transmission path;
[0061] The scheme output module is used to analyze the target constraint mathematical model, obtain a scheduling scheme, and apply the scheduling scheme to perform data flow scheduling.
[0062] The present application also provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the above-described method when executed by a processor.
[0063] The present application also provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps of the above-mentioned method when calling the computer program in the memory.
[0064] The present application also provides a computer program product, comprising a computer program, which implements the steps of the data flow scheduling method described above when the computer program is executed.
[0065] The present application provides a data flow scheduling method, comprising: obtaining a network information configuration file; the network information configuration file includes a plurality of hierarchical network nodes; generating a time-sensitive network corresponding to the network information configuration file; the time-sensitive network is used to describe the spatiotemporal progress of data flow transmission; planning a transmission path under a linear topology structure based on the time-sensitive network; establishing a target constraint mathematical model based on the transmission path; parsing the target constraint mathematical model to obtain a scheduling scheme, and applying the scheduling scheme to perform data flow scheduling.
[0066] This application targets scenarios with a large number of data streams and a variety of periods and frame lengths. It uses a time-sensitive network for data stream scheduling, which can clearly describe the transmission status of each data stream and convert it into a target-constrained mathematical model. While retaining the low jitter and low latency of the time-sensitive network, it can quickly and efficiently calculate results that meet application requirements and has stronger scalability.
[0067] The present application also provides a data stream scheduling system, a computer-readable storage medium, a computer program product, and an electronic device, which have the above-mentioned beneficial effects and are not described in detail here. BRIEF DESCRIPTION OF THE DRAWINGS
[0068] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without any creative work.
[0069] Figure 1 A flowchart of a data flow scheduling method provided in an embodiment of the present application;
[0070] Figure 2 A schematic diagram of data flow transmission in a time-sensitive network provided in an embodiment of the present application;
[0071] Figure 3 A schematic diagram of a series topology structure provided in an embodiment of the present application;
[0072] Figure 4 A schematic diagram of a data stream set provided in an embodiment of the present application;
[0073] Figure 5 A schematic diagram of a routing path in a data stream set provided in an embodiment of the present application;
[0074] Figure 6 A schematic diagram of a first undirected graph provided in an embodiment of the present application;
[0075] Figure 7A schematic diagram of a second undirected graph provided in an embodiment of the present application;
[0076] Figure 8 A Gantt chart describing no-wait scheduling provided in an embodiment of the present application;
[0077] Figure 9 A Gantt chart corresponding to each data flow in the data flow set provided in an embodiment of the present application;
[0078] Figure 10 A schematic diagram of the structure of a data flow scheduling system provided in an embodiment of the present application;
[0079] Figure 11 This is a structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0080] To make the purpose, technical solutions, and advantages of the embodiments of this application more clear, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0081] The object information involved in this application, including but not limited to the object device information, the object personal information, etc., and data, including but not limited to data used for analysis, stored data, displayed data, etc., are all information and data authorized by the object or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the laws, regulations and standards of relevant countries and regions.
[0082] See also Figure 1 , Figure 1 A data flow diagram of a data stream scheduling method provided in an embodiment of the present application, the method comprising:
[0083] S101: Obtain a network information configuration file; the network information configuration file includes several hierarchical network nodes;
[0084] S102: Generate a time-sensitive network corresponding to the network information configuration file; the time-sensitive network is used to describe the spatiotemporal progress of data flow transmission;
[0085] S103: Planning a transmission path under a linear topology structure according to the time-sensitive network;
[0086] S104: establishing a target constraint mathematical model based on the transmission path;
[0087] S105: Analyze the target constraint mathematical model to obtain a scheduling solution, and apply the scheduling solution to perform data flow scheduling.
[0088] First, a network information configuration file is obtained, which describes the network environment information required for data flow scheduling. While there are no specific limitations on how the network information configuration file is generated, one feasible implementation involves first determining a node architecture and then generating the network information configuration file using Extensible Markup Language (XML) based on this node architecture. The node architecture includes a first-level node for algorithm execution, a first-level node for network topology, and a first-level node for communication services. These nodes, including the algorithm execution node, the network topology node, and the communication service node, comprise several sub-level nodes.
[0089] An exemplary network information configuration file structure and content may be as follows:
[0090] The network information configuration file is described using Extensible Markup Language (XML), and includes two first-level nodes: the algorithm operation first-level node (hereinafter referred to as Algorithm) and the communication service first-level node (hereinafter referred to as SubNetwork).
[0091] A. Algorithm first-level node includes:
[0092] (1) scheduleStrategy attribute, that is, the scheduling algorithm solution strategy.
[0093] (2) maxTlrTransDelay attribute, the maximum transmission delay allowed from end to end of the data flow.
[0094] (3) maxTlrTransJitter attribute, the maximum transmission jitter allowed for the data flow from end to end.
[0095] (4) gateDurationDelay attribute, the delay of a single door opening.
[0096] (5) maxPercentOfSch attribute, the maximum acceptable bandwidth occupancy ratio of scheduled data flows.
[0097] (6) CTLatency attribute, the time it takes for a data frame to pass through a switch.
[0098] B. SubNetwork Level 1 nodes include:
[0099] (1) Type attribute, the type of subnet.
[0100] (2) serialNumber attribute, the subnet number.
[0101] (3) Four types of secondary nodes: switches, end devices, communication links, and data flows.
[0102] The Switches secondary node contains:
[0103] (1) switchNumber attribute, the total number of switches in the subnet.
[0104] (2) Single switch (Switch) third-level node.
[0105] The Switch level 3 nodes include:
[0106] (1) Type attribute, the type of switch.
[0107] (2) mane attribute, the name of the switch.
[0108] (3) Idendity attribute, the identification code of the switch.
[0109] (4) Plane attribute: the communication plane where the switch is located.
[0110] (5) portNumber: the number of ports on the switch.
[0111] (6) Port of a single switch is a fourth-level node.
[0112] The fourth-level port node includes:
[0113] (1) Identity attribute, the port identification code.
[0114] (2) transBandwidth attribute, the transmission bandwidth of the port.
[0115] (3) Media attribute, port medium.
[0116] The EndDevices secondary node contains:
[0117] (1) endDeviceNumber attribute, the total number of terminal devices in the subnet.
[0118] (2) Single terminal device (EndDevice) third-level node.
[0119] The EndDevice level 3 node includes:
[0120] (1) Type attribute, the type of subnet.
[0121] (2) name attribute, the name of the terminal device.
[0122] (3) Identity attribute, the identification code of the terminal device.
[0123] (4) portNumber attribute, the port number of the terminal device.
[0124] (5) Port level 4 node of a single terminal device.
[0125] The fourth-level port node includes:
[0126] (1) Identity attribute, the port identification code.
[0127] (2) transBandwidth attribute, the transmission bandwidth of the port.
[0128] (3) Media attribute, port medium.
[0129] The Links secondary node contains:
[0130] (1) linkNumber attribute, the number of communication links.
[0131] (2) Single communication link (Link) third-level node.
[0132] Link level 3 nodes include:
[0133] (1) Name attribute, the name of the communication link.
[0134] (2) Identity attribute, the identification code of the communication link.
[0135] (3) Port attribute: the ports at both ends of the communication link.
[0136] (4) Media attribute, link medium.
[0137] The Flows secondary node includes:
[0138] (1) flowNumber attribute, the number of business data flows.
[0139] (2) The third-level node of a single multicast group (Group) includes two types of fourth-level nodes: a single multicast group port (GroupPorts) and a single multicast group's periodic data flow (GroupFlows).
[0140] The GroupPorts level 4 node includes:
[0141] (1) portNumber attribute, the number of ports in the multicast group.
[0142] (2) A single port level 5 node for a single multicast group.
[0143] The five-level Port nodes include:
[0144] (1) Value attribute, port attribute.
[0145] The four-level GroupFlows nodes include:
[0146] (1) flowNumber attribute, the number of periodic data flows in the multicast group.
[0147] (2) Single periodic data flow (Flow) level 5 node of a single multicast group.
[0148] The five-level Flow nodes include:
[0149] (1) Identity attribute, the identification code of the data stream.
[0150] (2) schPriority attribute, the scheduling priority of the data flow.
[0151] (3) Cycle attribute, the communication cycle of the data flow.
[0152] (4) vldLength attribute, the effective frame length of the data stream.
[0153] Afterward, a time-sensitive network needs to be generated. This can be achieved by reading the packet transmission time, link transmission delay, packet reception time, switch data flow time, and closing delay between network nodes at each level from the network information configuration file and generating the time-sensitive network accordingly. Specifically, the spatial relationship between network nodes at each level in the network information configuration file, i.e., the hierarchical relationship, can be plotted on the horizontal axis of the time-sensitive network, i.e., the spatial axis. The communication processes of network nodes at each level can be plotted in chronological order on the vertical axis, i.e., the temporal axis.
[0154] See also Figure 2 , Figure 2 This is a schematic diagram of data flow transmission in a time-sensitive network (TSN) according to an embodiment of this application. In the actual use of TSN, considering its efficiency and reliability in carrying data flows, the network topology should not be overly complex. Therefore, this application primarily considers data flow path planning within a linear flutter structure. A target constraint mathematical model is then constructed.
[0155] First, let's establish the modeling conditions. It is assumed that the switch forwarding time for a flow (i.e., the time from when the switch receives the first bit of the flow to when the next node receives the first bit) is the same for all flows and all switches and is set to 1 unit time. Forwarding time consists of transmission time and several types of delay: the propagation delay of the signal along the link, the processing delay of the port that decides to forward the incoming packet, and the queuing delay of the packet in the outgoing port queue (which is zero in the wait-free scheme). The forwarding time intervals of two flows at the same egress port can overlap slightly, but the transmission time intervals must not overlap, otherwise their electrical signals will interfere. Here, the modeling conditions stipulate that the forwarding time intervals of two flows at the same egress port must not overlap. The assumption of uniform forwarding time is reasonable because forwarding time is primarily determined by package size and link bandwidth. In real-world time-sensitive networks, the package size and bandwidth of links are typically similar.
[0156] Under the model establishment conditions, a daisy chain topology is used to connect all switches in the order of data flow;
[0157] For each switch in the daisy-chain topology, determining that the switch has a left egress port and a right egress port;
[0158] For any data flow belonging to the set of data flows to be scheduled, determining a period of the data flow;
[0159] Assume that each terminal device can only send or receive one data stream at a time, consider each data stream as an edge in a graph, and consider the switch and the terminal device as vertices in the graph;
[0160] The objective constraint mathematical model is to find the minimum number of time slots so that all data streams can be transmitted within the minimum number of time slots without causing conflicts; wherein, for each data stream, sufficient number of time slots needs to be allocated within its corresponding cycle to meet the transmission requirements.
[0161] See also Figure 3 , Figure 3 A schematic diagram of the series topology structure provided in an embodiment of the present application. Figure 3 In the figure, solid circles represent switches and hollow circles represent terminal stations.
[0162] For two integers a≤b, define [a,b]:={a,a+1···,b}. As a shorthand, [1,n]={1,2,···,n} is denoted as [n]. Figure 3 shows a daisy chain topology. Figure 3 There are n switches connected in sequence, and SW1, SW2, ···, SW n Name from left to right. Use To express The right egress port, which takes data from Send to SW i+1 and use express The left exit port, which takes data from Send to . Let E[i] represent Directly connected terminal equipment. For example, Figure 3 In , E[1]={ED1,ED2}, E[2]={ED3,ED4,ED5}. S is used to represent the set of data streams to be scheduled. Figure 4 and Figure 5 , Figure 4 This is a schematic diagram of a data stream set provided in an embodiment of the present application. Figure 5 A schematic diagram of the routing path in the data stream set provided in an embodiment of the present application.
[0163] For data stream s Data stream set S, with p s N represents the period of data stream s (that is, the period of data stream s is p s unit time), and a s ,b s [n] is defined as the data stream s from The terminal station in the Another terminal station in the. Focus on Flow. , divide S into two groups:
[0164] (i) A set of all flows s from right to left S composition, that is ;
[0165] (ii) Another set consists of all the reverse flows s S composition, that is .
[0166] The transmissions of the two groups involve different egress ports and can therefore be scheduled separately. Therefore, for ease of demonstration, assume that for any s The data stream set S has It should be noted that the data stream s will pass through the egress port in order. .
[0167] Let p S Denotes the superperiod of a data stream set S, defined as the least common multiple LCM of the flow period in the data stream set S ( ). No-wait scheduling with super cycle As its period is executed regularly. The schedule of S contains s replications, each with a super-period as its period.
[0168] The wait-free scheduling problem can now be recast as a graph coloring problem. For each data stream s S, and compare it with the interval In addition, associate S with the first undirected graph G S Associated, the G S :
[0169] (i) For each stream s S creates a vertex v s;
[0170] (ii) if and only if When adding edges (v s ,v s ') (i.e., the transmission of s and s' will use the common egress port).
[0171] A useful observation is that the first undirected graph G S is an interval graph. In addition, S is combined with the second undirected graph Related, the :
[0172] (i) For each flow create vertex ;
[0173] (ii) if and only if Add edges when .
[0174] in other words, Each v s copy times, thus from G S Please note that It is also an interval graph. S and For an example, see Figure 6 and Figure 7 , Figure 6 This is a schematic diagram of a first undirected graph provided in an embodiment of the present application. Figure 7 This is a schematic diagram of a second undirected graph provided in an embodiment of the present application.
[0175] See also Figure 8 , Figure 8The Gantt chart provided in the embodiment of the present application describes no-wait scheduling. No-wait scheduling can be described graphically using a Gantt chart. Specifically, in the Gantt chart, the horizontal axis corresponds to time and is divided into a series of bars of 1 unit time. Among them, 1 unit time is the time for the switch to forward the flow. The vertical axis corresponds to n-1 egress ports. Stream s corresponds to Horizontal bars, each bar lasting 1 unit of time, gradually decreasing from left to right, see Figure 9 , Figure 9 The Gantt chart corresponding to each data stream in the data stream set provided in the embodiment of the present application. The "no wait" restriction corresponds to the end time of the previous bar being the start time of the next bar.
[0176] A Gantt chart can be viewed as a Dimension table. Divide the table into parallelograms: each parallelogram contains p S Layers, each layer is defined as a descending ladder. In this case, the bars of a data flow are all contained in the same layer. Therefore, wait-free scheduling is equivalent to assigning a given set of descending shape bars (e.g. Figure 9 The "bricks" in the box fit into a parallelogram where the constraints are such that at all s and In the case of Layer and There is replication of s between layers. For example, Figure 8 Successfully Figure 9 The "bricks" in fit into a parallelogram, so there is a wait-free schedule.
[0177] Based on the Gantt chart description, wait-free scheduling can be reformulated as a variant of the graph coloring problem, where some restrictions are imposed on the available colors for each vertex. Specifically, the graph The correct q-coloring of is a function , so that no two adjacent vertices share the same color, i.e., for any , both .
[0178] For the second undirected graph The appropriate p S Coloring, if for all and all , both , then it is called good. Assume that the second undirected graph Allow a good p S Color C. Then, by placing the ith copy of s in the ith layer, a wait-free schedule can be obtained.
[0179] On the other hand, assuming that the data stream set S allows a wait-free schedule, then we can set The number of the layer containing the i-th copy of the data stream s to get a good p S Coloring. To sum up, the following conclusions are drawn:
[0180] There exists a wait-free schedule for a set of data streams S if and only if there exists the first undirected graph Good p S Furthermore, a wait-free schedule can be obtained from a good p S Obtained in coloring.
[0181] After constructing the above-mentioned target constraint mathematical model, the target constraint mathematical model can be analyzed to obtain a scheduling scheme, and the scheduling scheme can be applied to perform data flow scheduling.
[0182] In a preferred embodiment, the following steps may be included:
[0183] The first step is to calculate the binary logarithm of the maximum value of the period of all data streams.
[0184] Step 2: Calculate the data traffic load index of each switch port. The data traffic load index is used to measure the amount of data flow passing through the port.
[0185] Step 3: If the load on a specific switch port exceeds the port capacity, it returns that no-wait scheduling does not exist;
[0186] Step 4: If the load of all ports does not exceed the capacity of the corresponding port, call the recursive program to perform scheduling calculations and output the scheduling plan.
[0187] The third and fourth steps are parallel conditional decisions. The schedules computed using this algorithm are compared with those generated by a SATModulo Theory (SMT) solver, which accurately solves the SMT formulation of the corresponding problem. The SMT solver returns a wait-free schedule only if Algorithm 1 returns a wait-free schedule. Furthermore, the average execution time of the SMT solver on these instances is approximately three minutes, while the algorithm described above solves the instances in an average of two seconds and exhibits strong scalability.
[0188] The complete algorithm implementation process is as follows:
[0189] Input: A data flow set, which contains multiple flows, each of which has information such as its source, destination, and transmission period.
[0190] A daisy-chain (linear) topology network in which switches are connected in sequence with endpoint devices located at either end of the switch.
[0191] Objective: Compute a wait-free schedule (i.e., a schedule where the data flows never wait in queues at any switch) for a given network and set of flows, and output a schedule (if one exists) in finite time.
[0192] Main steps:
[0193] Step 1. Calculate the maximum period logarithm value: Calculate the binary logarithm of the maximum value of the period of all data streams.
[0194] Step 2. Traverse each switch port: Calculate a traffic load metric for each switch port to measure the number of data flows passing through that port. This step is achieved by calculating the weight of each data flow passing through the port and accumulating the data flows over different periods.
[0195] Step 3. Check whether the load exceeds the capacity: If it is found that the load of a switch port exceeds its capacity, it returns "No wait scheduling does not exist".
[0196] Step 4. Call the Find subroutine: If the load of all ports does not exceed the capacity limit, call the subroutine in Algorithm 2 to perform the actual scheduling calculation.
[0197] The algorithm implementation process of the Find subroutine is as follows:
[0198] enter:
[0199] A set of data streams and their maximum period logarithmic value.
[0200] Target:
[0201] Recursively find a suitable wait-free scheduling scheme based on the current cycle information and topology.
[0202] Specific steps may include:
[0203] Step 1. Check for an empty data flow set: If the input data flow set is empty, an empty scheduling result is directly returned (that is, no flow needs to be scheduled).
[0204] Step 2. Handle the case where all flows have the same period: If all data flows have the same period, simply assign each flow a unique time slot to ensure they do not conflict during scheduling. This can be achieved using a greedy graph coloring algorithm, as in this case the problem is simplified to the classic interval graph coloring problem, which can be solved in linear time.
[0205] Step 3. Processing Data Flows with Different Periods: When data flows have different periods, the current data flow set is divided into two subsets based on the switch port load. The periods of the flows in these two subsets are then adjusted. Recursive calls are made to each subset to continue searching for scheduling solutions.
[0206] Step 4. Recursively merge the results: After recursively calculating the scheduling results for the two subsets, merge them into the scheduling solution for the entire set of flows. To ensure the correctness of wait-free scheduling, it is necessary to allocate appropriate time periods for the multiple periodic transmissions of each data flow.
[0207] Step 5. Linear Programming: During the subset partitioning process, a linear programming problem is constructed to balance the loads of different switch ports to ensure that an appropriate scheduling solution is found. Specifically, a linear programming problem is used to partition traffic across ports so that the load on each port remains within an acceptable range.
[0208] Output: Returns a dictionary structure that assigns a specific scheduling time point to each data flow, forming the final wait-free scheduling plan.
[0209] Here's how to use the greedy graph coloring algorithm to assign unique time slots:
[0210] The first step is to represent each data flow as a node in the greedy graph coloring algorithm;
[0211] Step 2: Initialize the colors of all vertices to uncolored;
[0212] Step 3: traverse all vertices, and for each uncolored target vertex, select a minimum color that is not used by any adjacent vertex and assign it to the target vertex;
[0213] Step 4: If no available color can be found, it indicates a conflict and a unique time period cannot be assigned;
[0214] Step 5. Repeat steps 3 and 4 until all vertices are colored, and determine the unique time period based on the colored color.
[0215] In addition, when executing data flow scheduling, a network scheduling table configuration file corresponding to the scheduling scheme can be generated, so that data flow scheduling is performed based on the network scheduling table configuration file. The network scheduling table configuration file includes the algorithm operation level node and the train time-sensitive network subnet level node.
[0216] Specifically, the algorithm running second-level node managed by the algorithm running first-level node can be determined; the algorithm running second-level node includes the scheduling algorithm solution strategy, the maximum transmission delay allowed from end to end for data flow, the maximum transmission jitter allowed from end to end for data flow, the delay of a single door opening, the maximum acceptable scheduling data flow bandwidth occupancy ratio, and the auxiliary data flow time when the data frame passes through the switch;
[0217] Determine the train time-sensitive network level-2 nodes, train time-sensitive network level-3 nodes, train time-sensitive network level-4 nodes, and train time-sensitive network level-5 nodes managed by the train time-sensitive network subnet level-1 nodes. The train time-sensitive network level-2 nodes include the time scheduling table level-2 nodes on each switch's network port and the time scheduling table level-2 nodes on each terminal device's network port; the time scheduling table level-2 nodes on each switch's network port include the total number of time-sensitive network switches in the subnet and the time scheduling table level-3 nodes for each switch's network port; the time scheduling table level-3 nodes for each switch's network port include the time scheduling table level-4 nodes for each network port on the single switch; and the time scheduling table level-4 nodes for each network port on the single switch include at least a single scheduling level-5 node for each network port on the single switch.
[0218] The following is an exemplary structure and content of a network scheduling table configuration file:
[0219] The network scheduling table configuration file is also described in XML, including two first-level nodes: the algorithm operation first-level node (hereinafter referred to as Algorithm) and the train time-sensitive network subnet first-level node (hereinafter referred to as SubNetwork).
[0220] A. Algorithm node:
[0221] (1) scheduleStrategy attribute, scheduling algorithm solution strategy;
[0222] (2) maxTlrTransDelay attribute, the maximum transmission delay allowed from end to end of the data flow;
[0223] (3) maxTlrTransJitter attribute, the maximum transmission jitter allowed from end to end of the data flow;
[0224] (4) gateDurationDelay attribute, the delay of a single door opening;
[0225] (5) maxPercentOfSch attribute, the maximum acceptable scheduling data flow bandwidth occupancy ratio;
[0226] (6) CTLatency attribute, the time it takes for a data frame to pass through a switch.
[0227] B. SubNetwork Node:
[0228] (1) type attribute, the type of subnet;
[0229] (2) serialNumber attribute, the subnet number;
[0230] (3) The time schedule table (Switches) secondary node on each network port of each switch;
[0231] (4) The time schedule (EndDevice) secondary node on each network port of each terminal device;
[0232] The Switches secondary node includes:
[0233] (1) switchNumber attribute, the total number of time-sensitive network switches in the subnet;
[0234] (2) The time schedule table (Switch) on each network port of a single switch is a third-level node.
[0235] The Switch level 3 nodes include:
[0236] (1) name attribute, the name of the switch;
[0237] (2) Identity attribute, the identification code of the switch;
[0238] (3) Time schedule table (Port) on a single network port of a single switch, level 4 node.
[0239] The fourth-level port node includes:
[0240] (1) Identity attribute, the identification code of the port where the time-sensitive network switch sends data;
[0241] (2) operCycleTime attribute, the macro cycle of port scheduling;
[0242] (3) operControlListLength attribute, the number of entries in the time schedule table;
[0243] (4) operBaseTime attribute, the time when the schedule starts to execute;
[0244] (5) A single scheduling (Entry) level 5 node on a single network port of a single switch.
[0245] The five-level Entry node includes:
[0246] (1) timeIntervalValue attribute, which is the duration of execution of this table entry;
[0247] (2) gateStatesValue attribute, which is the gate operation sequence in this table entry.
[0248] The EndDevices secondary node contains:
[0249] (1) endDeviceNumber attribute, the total number of time-sensitive network end devices in the subnet;
[0250] (2) The time schedule (EndDevice) level 3 node on each network port of a single terminal device.
[0251] The EndDevice level 3 node includes:
[0252] (1) name attribute, the name of the terminal device;
[0253] (2) Identity attribute, the identification code of the terminal device;
[0254] (3) Time schedule table (Port) on a single port of a single terminal device, level 4 node.
[0255] The fourth-level port node includes:
[0256] (1) Identity attribute, the identification code of the network port;
[0257] (2) operCycleTime attribute, the macro cycle of the network port;
[0258] (3) operControlListLength attribute, the number of entries in the time schedule table;
[0259] (4) operBaseTime attribute, the time when the schedule starts to execute;
[0260] (5) A single scheduling (Entry) level 5 node on a single network port of a single terminal device.
[0261] The five-level Entry node includes:
[0262] (1) timeIntervalValue attribute, the duration of execution of this table entry;
[0263] (2) gateStatesValue attribute, the gate operation sequence in this table entry.
[0264] This embodiment uses a time-sensitive network for data stream scheduling in scenarios with a large number of data streams and various periods and frame lengths. It can clearly describe the transmission status of each data stream, thereby converting it into a target-constrained mathematical model. While retaining the low jitter and low latency of the time-sensitive network, it can quickly and efficiently calculate results that meet application requirements and has stronger scalability.
[0265] See also Figure 11 , Figure 11 A schematic diagram of the structure of a data flow scheduling system provided in an embodiment of the present application, the system includes:
[0266] A file acquisition module is used to acquire a network information configuration file; the network information configuration file includes a plurality of hierarchical network nodes;
[0267] A time-sensitive network generation module, configured to generate a time-sensitive network corresponding to the network information configuration file; the time-sensitive network is used to describe the spatiotemporal progress of data flow transmission;
[0268] A path planning module, configured to plan a transmission path under a linear topology structure according to the time-sensitive network;
[0269] A model building module, configured to build a target constraint mathematical model based on the transmission path;
[0270] The scheme output module is used to analyze the target constraint mathematical model, obtain a scheduling scheme, and apply the scheduling scheme to perform data flow scheduling.
[0271] This application also provides a computer-readable storage medium having a computer program stored thereon. When executed, the computer program can implement the steps provided in the above embodiments. The storage medium may include: a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, among other media capable of storing program code.
[0272] The present application also provides a computer program product, comprising a computer program, which implements the steps of the data flow scheduling method described above when the computer program is executed.
[0273] This application also provides an electronic device, see Figure 11 , a structural diagram of an electronic device provided in an embodiment of the present application, such as Figure 11 As shown, a processor 1410 and a memory 1420 may be included.
[0274] The processor 1410 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 1410 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), or PLA (Programmable Logic Array). The processor 1410 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 1410 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 1410 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0275] The memory 1420 may include one or more computer-readable storage media, which may be non-transitory. The memory 1420 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 1420 is at least used to store the following computer program 1421, wherein, after the computer program is loaded and executed by the processor 1410, it can implement the relevant steps in the method performed by the electronic device side disclosed in any of the aforementioned embodiments. In addition, the resources stored in the memory 1420 may also include an operating system 1422 and data 1423, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 1422 may include Windows, Linux, Android, etc.
[0276] In some embodiments, the electronic device may further include a display screen 1430 , an input / output interface 1440 , a communication interface 1450 , a sensor 1460 , a power supply 1470 , and a communication bus 1480 .
[0277] certainly, Figure 11 The structure of the electronic device shown does not constitute a limitation on the electronic device in the embodiment of the present application. In actual applications, the electronic device may include Figure 11 More or fewer components than shown, or combinations of certain components.
[0278] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Reference can be made to the common and similar parts between the various embodiments. For the systems provided in the embodiments, since they correspond to the methods provided in the embodiments, the description is relatively simple, and the relevant parts can be referred to the method description.
[0279] This document uses specific examples to illustrate the principles and implementation methods of this application. The description of the above examples is only intended to help understand the method and core ideas of this application. It should be noted that for those skilled in the art, without departing from the principles of this application, various improvements and modifications can be made to this application, and such improvements and modifications also fall within the scope of protection of the claims of this application.
[0280] It should also be noted that, in this specification, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variants thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus comprising the element.
Claims
1. A data flow scheduling method, characterized in that: include: Obtaining a network information configuration file; the network information configuration file includes a plurality of hierarchical network nodes; Generate a time-sensitive network corresponding to the network information configuration file; The time-sensitive network is used to describe the spatiotemporal progress of data flow transmission; Planning a transmission path under a linear topology structure according to the time-sensitive network; Establishing a target constraint mathematical model based on the transmission path; Analyzing the target constraint mathematical model to obtain a scheduling solution, and applying the scheduling solution to perform data flow scheduling; The analytical algorithm is called to solve the analytical target of the target constraint mathematical model, and the output scheduling solution includes: Calculate the binary logarithm of the maximum value of the period of all data streams; Calculate the data traffic load index of each switch port; the data traffic load index is used to measure the amount of data flow passing through the port; If the load on a particular switch port exceeds the port capacity, the no-wait scheduling is returned as non-existent; If the load of all ports does not exceed the capacity of the corresponding port, call the recursive program to perform scheduling calculation and output the scheduling plan; Among them, the recursive program is called to perform scheduling calculation, and the output scheduling plan includes: If the data stream set is empty, return the empty measurement result; If the periods of all data flows are the same, a unique time period is allocated to each data flow; the unique time period is used to ensure that the data flows do not conflict during scheduling; When data flows have different periods, the current data flow set is divided into two subsets according to the load of the switch port, and the periods of the data flows of the two subsets are readjusted; Recursively call each other to continue looking for scheduling solutions for the two subsets; After recursively calculating the scheduling results of the two subsets, the scheduling results are combined as a scheduling solution for the data flow set; Output includes a dictionary structure of the scheduling scheme, wherein the dictionary structure includes a scheduling time point allocated to each data flow, and all the scheduling time points and corresponding data flows serve as the scheduling scheme.
2. The data flow scheduling method according to claim 1, characterized in that: Before obtaining the network information configuration file, it also includes: Determine a node architecture; the node architecture includes a first-level node for algorithm operation, a network topology, and a first-level node for communication services; the first-level node for algorithm operation, the network topology, and the first-level node for communication services include a plurality of sub-level nodes; A network information configuration file is generated by applying extensible markup language based on the node architecture.
3. The data flow scheduling method according to claim 2, characterized in that: Generating a time-sensitive network corresponding to the network information configuration file includes: Read the data packet sending time, link transmission delay, data packet receiving time, switch data flow assistance time and closing delay between network nodes at each level in the network information configuration file; A time-sensitive network is generated according to the data packet sending time, the link transmission delay, the data packet receiving time, the switch assisting data flow time and the gate closing delay.
4. The data flow scheduling method according to claim 1, characterized in that: Establishing a target constraint mathematical model based on the transmission path includes: Set model building conditions; Under the model establishment conditions, a daisy chain topology is used to connect all switches in the order of data flow; For each switch in the daisy-chain topology, determining that the switch has a left egress port and a right egress port; For any data flow belonging to the set of data flows to be scheduled, determining a period of the data flow; Assume that each terminal device can only send or receive one data stream at a time, consider each data stream as an edge in a graph, and consider the switch and the terminal device as vertices in the graph; The objective constraint mathematical model is to find the minimum number of time slots so that all data streams can be transmitted within the minimum number of time slots without causing conflicts; wherein, for each data stream, sufficient number of time slots needs to be allocated within its corresponding cycle to meet the transmission requirements.
5. The data flow scheduling method according to claim 4, characterized in that: Analyzing the target constraint mathematical model, the scheduling solution obtained includes: Determining an analytical objective of the objective constraint mathematical model, wherein the analytical objective is to calculate a wait-free schedule for the set of data flows and the daisy-chain topology; The analytical algorithm is called to solve the analytical target and output a scheduling solution.
6. The data flow scheduling method according to claim 1, characterized in that: Calculating the data traffic load index of each switch port includes: The weight of each data flow passing through the port is calculated, and the data flows of different periods are accumulated to obtain the data flow load index of each switch port.
7. The data flow scheduling method according to claim 1, characterized in that: Allocating a unique time period to each of the data streams includes: The first step is to represent each data flow as a node in the greedy graph coloring algorithm; Step 2: Initialize the colors of all vertices to uncolored; Step 3: traverse all vertices, and for each uncolored target vertex, select a minimum color that is not used by any adjacent vertex and assign it to the target vertex; Step 4: If no available color can be found, it indicates a conflict and a unique time period cannot be assigned; Step 5. Repeat steps 3 and 4 until all vertices are colored, and determine the unique time period based on the colored color.
8. The data flow scheduling method according to claim 1, characterized in that: The step of dividing the current data flow set into two subsets according to the load of the switch port further includes: Constructing a linear programming problem; the linear programming problem is used to balance the loads of different switch ports; The data flow division corresponding to each switch port is solved based on the linear programming problem.
9. The data flow scheduling method according to claim 1, characterized in that: Applying the scheduling scheme to perform data flow scheduling includes: Generate a network scheduling table configuration file corresponding to the scheduling scheme; the network scheduling table configuration file includes an algorithm operation level 1 node and a train time sensitive network subnet level 1 node; Data flow scheduling is performed based on the network scheduler configuration file.
10. The data flow scheduling method according to claim 9, characterized in that: Generating a network scheduling table configuration file corresponding to the scheduling scheme includes: Determine the algorithm-running secondary node managed by the algorithm-running primary node; the algorithm-running secondary node includes a scheduling algorithm solution strategy, a maximum end-to-end transmission delay allowed for a data flow, a maximum end-to-end transmission jitter allowed for a data flow, a single door opening delay, a maximum acceptable scheduling-type data flow bandwidth occupancy ratio, and a data flow assist time when a data frame passes through a switch; Determine the train time-sensitive network level-2 nodes, train time-sensitive network level-3 nodes, train time-sensitive network level-4 nodes and train time-sensitive network level-5 nodes managed by the train time-sensitive network subnet level-1 node; the train time-sensitive network level-2 nodes include the time scheduling table level-2 nodes on the network ports of each switch and the time scheduling table level-2 nodes on the network ports of each terminal device; the time scheduling table level-2 nodes on the network ports of each switch include the total number of time-sensitive network switches in the subnet and the time scheduling table level-3 nodes of the network ports of a single switch; the time scheduling table level-3 nodes of the network ports of a single switch include the time scheduling table level-4 nodes of a single network port on a single switch; the time scheduling table level-4 nodes of a single network port on a single switch include at least a single scheduling level-5 node of a single network port on a single switch.
11. A data flow scheduling system, characterized in that: include: A file acquisition module is used to acquire a network information configuration file; the network information configuration file includes a plurality of hierarchical network nodes; A time-sensitive network generation module, configured to generate a time-sensitive network corresponding to the network information configuration file; the time-sensitive network is used to describe the spatiotemporal progress of data flow transmission; A path planning module, configured to plan a transmission path under a linear topology structure according to the time-sensitive network; A model building module, configured to build a target constraint mathematical model based on the transmission path; A program output module for parsing the target constraint mathematical model to obtain a scheduling program and applying the scheduling program to perform data flow scheduling; The solution output module is further configured to perform the following steps: Calculate the binary logarithm of the maximum value of the period of all data streams; Calculate the data traffic load index of each switch port; the data traffic load index is used to measure the amount of data flow passing through the port; If the load on a particular switch port exceeds the port capacity, the no-wait scheduling is returned as non-existent; If the load of all ports does not exceed the corresponding port capacity and the data flow set is empty, the empty measurement result is returned; If the periods of all data flows are the same, a unique time period is allocated to each data flow; the unique time period is used to ensure that the data flows do not conflict during scheduling; When data flows have different periods, the current data flow set is divided into two subsets according to the load of the switch port, and the periods of the data flows of the two subsets are readjusted; Recursively call each other to continue looking for scheduling solutions for the two subsets; After recursively calculating the scheduling results of the two subsets, the scheduling results are combined as a scheduling solution for the data flow set; Output includes a dictionary structure of the scheduling scheme, wherein the dictionary structure includes a scheduling time point allocated to each data flow, and all the scheduling time points and corresponding data flows serve as the scheduling scheme.
12. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which, when executed, implements the steps of the data stream scheduling method according to any one of claims 1 to 10.
13. A computer program product, characterized in that The method comprises a computer program, which implements the steps of the data flow scheduling method according to any one of claims 1 to 10 when the computer program is executed.
14. An electronic device, characterized in that: include: memory for storing computer programs; A processor, configured to implement the steps of the data stream scheduling method according to any one of claims 1 to 10 when executing the computer program.
Citation Information
Patent Citations
Real-time data flow scheduling method and device for time-sensitive network
CN116781522A