Time-sensitive network traffic scheduling method based on constrained programming
By defining cycle capability optimization time-sensitive network traffic scheduling methods, the shortcomings of existing algorithms in ensuring optimality and avoiding congestion are solved, and higher scheduling rate and network performance are achieved, meeting the strict timing requirements of the industrial Internet.
Patent Information
- Application Number
- CN202411712910.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-03-28
AI Technical Summary
Existing time-sensitive network traffic scheduling algorithms are difficult to ensure optimality, which easily leads to congestion and scheduling failures, and fails to effectively consider how time-triggered streams are combined for different cycles, resulting in conflicts and load imbalance.
By defining periodic ligability, optimize the routing objective function, ensuring that the same or highly ligable periodic traffic is preferred to route on the same link, reducing conflicts and improving scheduling rate. The method includes system modeling, defining constraints and optimizing objective functions, obtaining the results of traffic scheduling problems through solvers, and adjusting the routing and scheduling schemes iteratively to improve the scheduling rate of the system.
By optimizing routing and scheduling solutions, we reduce conflicts, improve scheduling rate, significantly reduce the risk of link congestion, improve the overall performance of the network, and meet the strict timing requirements of the industrial Internet for data transmission.
Smart Images

Figure CN119728586A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of industrial Internet and relates to a time-sensitive network traffic scheduling method based on constraint planning. Background Art
[0002] Ethernet has become the main communication solution for most industries due to its high speed, low cost and strong versatility. As the demand for industrial system functions increases, data communication in industrial systems faces many challenges. For example, in autonomous vehicles and smart factories, many complex smart sensors and cameras are widely used, which requires a large amount of communication bandwidth while meeting their timing requirements. With high data exchange volume, it is necessary to ensure deterministic transmission of communication. Although Ethernet has made progress over the years, especially in terms of speed, its development is mainly dominated by the "best effort" principle and lacks determinism. The IEEE Time-Sensitive Networking (TSN) Task Group has proposed a set of standards that define mechanisms for time-sensitive data transmission over Ethernet to achieve determinism and timeliness guarantees. TSN mainly responds to these recent challenges of increased demand for industrial system functions through deterministic flow scheduling (IEEE802.1Qbv), enhanced time synchronization (IEEE802.1AS), etc. Among them, flow scheduling is the core mechanism in the TSN standard. The scheduling algorithm determines the data frame transmission order and time at all switch output ports to meet the respective delay and bandwidth requirements of the flow and optimize the transmission performance at the same time.
[0003] Most existing algorithms use heuristic algorithms. Although they can find solutions in a relatively short time, they can usually only find approximate solutions and cannot guarantee optimality. In addition, most existing routing algorithms use the shortest path algorithm. Although it can optimize the path length and shorten the end-to-end delay, it may cause too much traffic to be transmitted on the same link, which is prone to congestion. If the congestion level is too high, it will not be possible to find a feasible gating schedule, which means scheduling failure. Although the load balancing algorithm takes into account the average distribution of the load and can reduce congestion, it does not consider how to combine time-triggered flows of different periods, which is prone to conflicts. Summary of the invention
[0004] In view of this, the purpose of the present invention is to provide a method for scheduling time-sensitive network traffic based on constraint programming. By defining periodic associativity, the routing objective function is optimized to ensure that periodic traffic with the same or high associativity is preferentially routed on the same link to reduce conflicts and improve the schedulability. The method mainly includes: systematically modeling time-sensitive network traffic; defining relevant constraints and optimization objectives; and obtaining the result of the traffic scheduling problem through a solver.
[0005] In order to achieve the above object, the present invention provides the following technical solutions:
[0006] A method for scheduling time-sensitive network traffic based on constraint programming, the method comprising the following steps:
[0007] S1. Abstract the time-sensitive network topology into a network directed graph, and establish a network model and a traffic model;
[0008] S2, establish a routing objective optimization function and corresponding routing constraints, and find the optimal route of the routing objective function in the feasible solutions under the current routing constraints;
[0009] S3: According to the determined optimal route, establish a scheduling optimization objective function and corresponding scheduling constraints, and find the best scheduling solution of the scheduling optimization objective function in the feasible solutions under the current scheduling constraints;
[0010] S4: Establish new routing constraints based on the solution of the scheduling optimization objective function, and iterate the routing and scheduling solutions again until all routes are traversed or the iteration round is reached, and output the final scheduling solution.
[0011] Furthermore, for the network model in step S1, the TSN network topology is abstracted into a network directed graph:
[0012] G=(V,E)
[0013] Wherein, V represents a set of communication nodes in the network, which includes all TSN switch sets SW and terminal device sets ES, that is, V = ES ∪ SW; E represents the set of communication links between any two nodes in the network, that is, E = {(a, b) | a, b∈V};
[0014] Each physical link (a, b)∈E and (b, a)∈E connecting two devices a and b (a, b∈V) is regarded as two independent directed links. Each unidirectional link (a, b)∈E is represented by a three-dimensional tuple, namely:
[0015] (a, b) = a,b , d a,b , d a >
[0016] Among them, q a,b is the number of queues in the egress port for time-triggered flows transmitted to link (a, b)∈E, d a,b is the link delay, d a is the processing delay of switch a∈V;
[0017] Network devices perform time synchronization, and the maximum difference between the local clocks of any two network devices is δ.
[0018] Further, for the traffic model in step S1, a flow refers to periodic data transmission from one terminal station to another terminal station, and a time-triggered flow is modeled as a set of message tuples from a source node to a destination node, and the set of time-triggered flows is F;
[0019] For each time-triggered stream i, the following parameters are defined:
[0020] t i ∈ES represents the source node; l i ∈ES represents the destination node;
[0021] T i Indicates the transmission period of each time-triggered stream, which is used to indicate the frequency of data transmission;
[0022] L i represents the transmission duration, i.e., the time it takes for flow i∈F to be transmitted from any node to its neighboring nodes;
[0023] r i Indicates the release date of the flow, that is, the earliest time when the source node can start sending data;
[0024] Indicates the transmission deadline of the flow, that is, the latest time point at which the destination node must obtain data. If the flow successfully receives the data frame sent from the source node from the destination node within the deadline, it is considered to be scheduled successfully, otherwise it is considered to be scheduled failed;
[0025] The hyperperiod HP is defined as the least common multiple of the periods of all flows:
[0026] HP=LCM{T i |i∈F}
[0027] Wherein, LCM{·} is the function for finding the least common multiple.
[0028] Further, in step S2, first, a load balancing routing strategy that minimizes the traffic load on each link is adopted to establish a load balancing optimization target:
[0029]
[0030] In the formula, ρ i,a,b is a Boolean variable that determines whether flow i passes through link (a, b). i is the transmission duration of flow i from any node to its adjacent nodes, T i is the period of flow i;
[0031] Secondly, consider minimizing the ratio of the least common multiple of the traffic cycle to the greatest common divisor as the routing optimization goal:
[0032]
[0033] Where, j represents flow j different from flow i, lcm{} is the function for finding the least common multiple, and gcd{} is the function for finding the greatest common divisor;
[0034] Finally, a trade-off factor λ is set to balance the relative importance between the load balancing objective and the combined optimization objectives of different cycles, and the final routing optimization objective function is obtained:
[0035]
[0036] The constraints of the routing optimization objective function include at least: path uniqueness constraint, path continuity constraint, routing loop constraint, and single path constraint.
[0037] Furthermore, the constraints of the route optimization objective function in step S2 are specifically:
[0038] Path uniqueness constraint:
[0039]
[0040] This constraint is used to ensure that for each flow i∈F in the network and each node a∈V except the source node, node a can only have one previous node b on the path of flow i;
[0041] Path continuity constraints:
[0042]
[0043] This constraint is used to ensure that the flow path is continuous, that is, each node a∈V has only one direct successor node b on the flow path;
[0044] Routing loop constraints:
[0045]
[0046] This constraint is used to ensure that there are no cycles in the path of any flow. For each flow i and all nodes a except the source node, the flow from a back to the source node t i Routing variables Must be 0, ensuring that the path from source to destination for each flow is unidirectional;
[0047] Single path constraint:
[0048]
[0049] This constraint is used to ensure that for each flow i, only one path is followed in the network and flow i only leaves from one link when passing through the intermediate node a.
[0050] Furthermore, in the process of solving the routing optimization objective function in step S2, first, a feasible solution of the routing is found in the solution space provided by the CP solver according to the routing constraint conditions; then, the feasible solution of the routing is brought into the routing objective function, the optimal value of the routing objective function of the feasible solution is obtained, and the best route is obtained;
[0051] If there is no feasible routing solution, the algorithm is terminated; if the best route is obtained, the scheduling phase is entered.
[0052] Further, in step S3, a scheduling optimization objective function is established with minimizing the maximum end-to-end delay of the time-triggered flow as the optimization goal:
[0053]
[0054] in, The sending link of flow i is the first link of the routing path (t i ,t i ') transmission offset; represents the last link before the receiving node of flow i (l i ,l′ i )'s transmission offset; Indicates that stream i is from l i Node to l′ i The transmission duration of the node; Indicates that flow i is on link (l i ,l′ i )’s propagation delay;
[0055] The scheduling constraints of time-triggered flows include data frame constraints, non-overlapping constraints, transmission order constraints, end-to-end delay constraints, queue allocation constraints, and frame isolation constraints.
[0056] Furthermore, the scheduling constraints in step S3 are:
[0057] Data frame constraints:
[0058]
[0059] The data frame constraint is proposed for the periodicity of each TT flow i. If i is sent periodically, the transmission frame on the first link of its routing path must be sent out within the frame period and must be completed on the last link before the deadline, otherwise the periodicity is not met;
[0060] Non-overlapping constraints:
[0061]
[0062] The non-overlapping constraint means that two different frames on the same link must not overlap in time during transmission. For each pair of different frames on the same link, the transmission of one frame must be completed before the transmission of the other frame begins. In addition, due to the zero jitter requirement, the transmission offset of the kth frame of the stream i∈F on the link (a, b)∈E is equal to φ i,a,b +(k-1)·T i ;
[0063] Transmission order constraints:
[0064]
[0065] The transmission order constraint stipulates the priority relationship of each link on the frame path. The frame can only be transmitted from the switch after it is completely transmitted to the switch and processed. It defines that the transmission offset of each data packet must be greater than or equal to the transmission offset of the previous data packet on the previous link.
[0066] End-to-end delay constraint:
[0067]
[0068] The end-to-end delay constraint specifies that the difference between the arrival time and the sending time of a flow must be less than or equal to a specified maximum value, namely the maximum end-to-end delay;
[0069] Queue allocation constraints:
[0070]
[0071] The queue allocation constraint limits the number of available queues per port to no more than 1, ensuring that queues are correctly allocated on each egress port for each frame;
[0072] Frame Isolation Constraints:
[0073]
[0074] Frame isolation constraints are used to ensure that the state of the queue is deterministic, that is, a queue can only receive frames from one flow at the same time. Frame isolation constraints isolate two frames so that one frame can reach the shared queue only after the other frame is released from the queue.
[0075] Furthermore, in the process of solving the scheduling optimization objective function in step S3, first, the CP solver is used to find a feasible scheduling solution in the solution space provided by the scheduling constraints; then, the feasible scheduling solution is brought into the scheduling objective function to obtain the optimal value of the scheduling objective function of the feasible solution, and the optimal scheduling plan is obtained.
[0076] Further, in step S4, a new routing constraint is established according to the solution of the scheduling solution, and the new routing constraint is added back to the constraint condition of the routing optimization objective function for iterative solution until the iteration ends, wherein:
[0077] If there is a feasible scheduling solution in the scheduling solution, the newly added routing constraint is used to ensure that the route obtained by re-iteration is inconsistent with the current route; if there is no feasible scheduling solution in the scheduling solution, the constraints that cannot be satisfied at the same time are retrieved, and a new routing constraint is constructed based on this;
[0078] The iteration ends when the time limit is reached or all feasible routes are traversed.
[0079] The beneficial effects of the present invention are:
[0080] The present invention optimizes the routing objective function by defining periodic associativity, ensuring that periodic flows with the same or high associativity are preferentially routed on the same link to reduce conflicts and improve the schedulability. And through the comprehensive consideration of load balancing and periodic associativity, the uniform distribution of network traffic is ensured, the risk of link congestion is significantly reduced, and the overall performance of the network is improved. Then, according to the determined optimal route, the scheduling optimization objective function and its constraints are established to find the best scheduling scheme. By minimizing the maximum end-to-end delay, the real-time and reliability of time-sensitive flows are ensured, and the strict timing requirements of the industrial Internet for data transmission are met. Finally, new routing constraints are established based on the solution results of the scheduling scheme, and iterative solutions are performed. This iterative process ensures the adaptability and flexibility of the final output scheduling scheme under different traffic conditions by continuously adjusting the routing and scheduling schemes, further improving the schedulability of the system.
[0081] Other advantages, objectives and features of the present invention will be described in the following description to some extent, and to some extent, will be obvious to those skilled in the art based on the following examination and study, or can be taught from the practice of the present invention. The objectives and other advantages of the present invention can be realized and obtained through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0082] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention will be described in detail below in conjunction with the accompanying drawings, wherein:
[0083] Figure 1 It is a schematic diagram of the overall process of the method for time-sensitive network traffic scheduling based on constraint planning of the present invention;
[0084] Figure 2 Schematic diagram of the conflict situation of time-triggered flows with different periods. DETAILED DESCRIPTION
[0085] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments only illustrate the basic concept of the present invention in a schematic manner, and the following embodiments and features in the embodiments can be combined with each other without conflict.
[0086] Among them, the drawings are only used for illustrative explanations, and they only represent schematic diagrams rather than actual pictures, and should not be understood as limitations on the present invention. In order to better illustrate the embodiments of the present invention, some parts of the drawings may be omitted, enlarged or reduced, and do not represent the size of actual products. For those skilled in the art, it is understandable that some well-known structures and their descriptions in the drawings may be omitted.
[0087] The same or similar numbers in the drawings of the embodiments of the present invention correspond to the same or similar parts; in the description of the present invention, it should be understood that if the terms "upper", "lower", "left", "right", "front", "rear", etc. indicate the orientation or position relationship, they are based on the orientation or position relationship shown in the drawings, which is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operate in a specific orientation. Therefore, the terms describing the position relationship in the drawings are only used for illustrative purposes and cannot be understood as limiting the present invention. For ordinary technicians in this field, the specific meanings of the above terms can be understood according to specific circumstances.
[0088] See also Figure 1-2 , which is a time-sensitive network traffic scheduling method based on constraint programming.
[0089] Example
[0090] This embodiment provides a detailed implementation method of a time-sensitive network traffic scheduling method based on constraint programming, such as Figure 1 As shown, the following steps are included:
[0091] S1: Formalize the time-sensitive network traffic scheduling problem, abstract the TSN network topology into a network directed graph, and establish a network model and traffic model;
[0092] S2: Establish a routing objective optimization function and corresponding routing constraints, and find the optimal route of the routing objective function among the feasible solutions under the current routing constraints;
[0093] S3: According to the determined optimal route, establish a scheduling optimization objective function and corresponding scheduling constraints, and find the best scheduling solution of the scheduling optimization objective function in the feasible solutions under the current scheduling constraints;
[0094] S4: Establish new routing constraints based on the solution of the scheduling optimization objective function, and iterate the routing and scheduling solutions again until all routes are traversed or the iteration round is reached, and output the final scheduling solution.
[0095] In step S1 of this embodiment, for the network model, the TSN network topology is abstracted as a network directed graph G = (V, E), where V represents a set of communication nodes in the network, which includes all TSN switch sets SW and terminal device sets ES, that is, V = ES ∪ SW; E represents the set of communication links between any two nodes in the network, that is, E = {(a, b) | a, b ∈ V}, and the transmission link in the network is a full-duplex link, that is, each physical link connecting two devices a and b, (a, b ∈ V) can be regarded as two independent directed links (a, b) ∈ E and (b, a) ∈ E. Each unidirectional link (a, b) ∈ E is represented by a three-dimensional tuple, that is, a,b , d a,b , d a >. Among them, q a,b is the number of queues available at the egress port for time-triggered flow transmission to link (a,b)∈E, d a,b is the link delay, i.e. the propagation delay on the medium, d a is the processing delay of switch a∈V. To implement TT scheduling, network devices are time synchronized (using the 802.1ASRev standard), where δ is the maximum difference between the local clocks of any two network devices.
[0096] For the traffic model, in a time-sensitive network, a flow is a periodic data transmission from one terminal station to another. The time-triggered flow is modeled as a set of message tuples from the source node to the destination node. The set of time-triggered flows is F. For each time-triggered flow i, the following parameters are defined: t i ∈ES represents the source node; l i ∈ES represents the destination node; T i Indicates the transmission period of each time-triggered stream, which is used to indicate the frequency of data transmission; L i represents the transmission duration, i.e., the time it takes for flow i∈F to be transmitted from any node to its neighboring nodes; r i Indicates the release date of the flow, that is, the earliest time when the source node can start sending data; Indicates the transmission deadline of the flow, that is, the latest time point when the destination node must obtain data. If the flow successfully receives the data frame sent from the source node from the destination node within the deadline, it is considered to be scheduled successfully, otherwise it is considered to be scheduled failed.
[0097] The hyperperiod HP is defined as the least common multiple (LCM) of the periods of all flows:
[0098] HP=LCM{T i ∣i∈F}
[0099] The parameter definitions in this embodiment are shown in Table 1:
[0100] Table 1
[0101]
[0102]
[0103] In step S2 of the present embodiment, a routing optimization objective function and corresponding routing constraints are established. Most existing routing algorithms use the shortest path algorithm. Although it can optimize the path length and shorten the end-to-end delay, it may cause too much traffic to be transmitted on the same link, which is prone to congestion. If the congestion level is too high, it will not be possible to find a feasible gating schedule, which means scheduling failure. Therefore, it faces the risk of increased congestion and traffic blocking time. In order to overcome the above obstacles, the present invention adopts a routing strategy that ensures load balancing, that is, the load of each flow is evenly distributed to each link of the network as much as possible, which can reduce congestion.
[0104] Minimizing the traffic load on each link is a method to achieve network load balancing, which focuses on reducing the total load on any single link, thereby avoiding the situation where some links are overloaded while other links are idle. That is, the load balancing optimization goal can be expressed as follows:
[0105]
[0106] In the formula, ρ i,i,b is a Boolean variable that determines whether flow i passes through link (a, b). i is the transmission duration of flow i from any node to its adjacent nodes, T i is the period of flow i.
[0107] However, the existing load balancing algorithms only consider the uniform distribution of the load, but do not consider how to combine time-triggered flows with different periods. The present invention proposes a concept of periodic combinability for the combinability between time-triggered flows with different periods. That is, the higher the periodic combinability between flows, the less likely they are to conflict when sharing bandwidth on the same link, the more the bandwidth can be fully utilized, and the more flows the link can accommodate; conversely, the lower the periodic combinability, the more likely conflicts will occur, and there will be some unusable residual bandwidth, resulting in a reduction in the number of flows that a link can accommodate. In other words, if the traffic routed through the same link has the same period or higher combinability, it is easier to schedule than traffic whose periods cannot be combined. In other words, the present invention hopes to route traffic with the same period or a smaller ratio of the least common multiple (Least Common Multiple, LCM) of the period to the greatest common divisor (Greatest Common Divisor, GCD) on the same link, because such traffic is more likely to meet the strict timing requirements of the time-sensitive network (TSN) when scheduled. Figure 2 As shown, the ratio of the least common multiple to the greatest common divisor of the periods of F1 and F2 is 2, which is less than the ratio of the least common multiple to the greatest common divisor of the periods of F1 and F3, which is 12. It is obvious that F1 and F2 are less likely to conflict than F1 and F3. Therefore, the periods of F1 and F2 are more combinable than those of F1 and F3. Therefore, this embodiment gives priority to routing F1 and F2 on the same link.
[0108] Therefore, for the problem of how to combine time-triggered flows with different periods, we can consider minimizing the ratio of the least common multiple of the traffic period to the greatest common divisor as the routing optimization goal. The specific formula is designed as follows:
[0109]
[0110] In summary, if we want to consider the combination of load balancing and time-triggered flows of different periods at the same time, we can set a trade-off factor λ to balance the relative importance between the load balancing goal and the optimization goal of different period combinations. That is, the specific routing optimization goals are as follows:
[0111]
[0112] This routing optimization objective function combines load balancing and periodic matching to find a balance point that takes into account both network load balancing and flow periodic matching. By adjusting the value of λ, a trade-off can be made between these two objectives to adapt to different network needs and performance requirements.
[0113] In the above routing objective optimization function, the following constraints are included: path uniqueness constraint, path continuity constraint, routing loop constraint, and single path constraint.
[0114] Among them, the path uniqueness constraint is used to ensure that for each flow i∈F in the network and each node a∈V except the source node, node a can only have one predecessor node b on the path of flow i. This means that in any given flow, the way data reaches node a is unique, preventing the existence of multiple predecessor nodes.
[0115]
[0116] The path continuity constraint is used to ensure that the flow path is continuous, that is, each node a∈V has only one direct successor node b on the flow path. This ensures that each flow has exactly one output link when passing through each node.
[0117]
[0118] Routing loop constraints are used to ensure that there are no loops in the path of any flow. For each flow i and all nodes a except the source node, the flow from a back to the source node t i Routing variables Must be 0, ensuring that the path from source to destination for each flow is unidirectional, avoiding loops in routing.
[0119]
[0120] The single path constraint is used to ensure that for each flow i, only one path is followed in the network and that the flow does not leave through multiple links when passing through an intermediate node a.
[0121]
[0122] The CP solver is used to find a feasible solution for the route based on the solution space provided by the route constraints. The feasible solution for the route is brought into the route objective function to obtain the optimal value of the route objective function of the feasible solution and obtain the best route.
[0123] If the routing model reports "infeasible", the algorithm terminates because there is no solution and the problem cannot be solved. If a feasible route is found, it goes to the scheduling phase.
[0124] In step S3 of this embodiment, a scheduling optimization objective function and corresponding scheduling constraints are established. The objective is set to minimize the maximum end-to-end delay of the time-triggered flow. The end-to-end delay is usually defined as the total transmission time of a data packet from a source node to a destination node. The specific optimization objective function is expressed as follows:
[0125]
[0126] in, The sending link of flow i is the first link of the routing path (t i ,t′ i )'s transmission offset; Represents flow i i The last link before the receiving node (l i ,l′ i )'s transmission offset; Indicates that stream i is from l i Node to l′ i The transmission duration of the node; Indicates that flow i is on link (l i ,l′ i ) propagation delay.
[0127] In order to ensure that the time-triggered flow has low latency and low jitter, it is necessary to set certain scheduling constraints for the transmission of the time-triggered flow in the time-sensitive network and find a feasible solution that satisfies these constraints. The scheduling constraints for the time-triggered flow in the present invention include data frame constraints, non-overlapping constraints, transmission order constraints, end-to-end delay constraints, queue allocation constraints, and frame isolation constraints. The specific constraints are defined as follows:
[0128] The data frame constraint is proposed for the periodicity of each TT flow i. Since i is sent periodically, the transmission frame must be sent out within the frame period at its source node (i.e., the first link of the routing path), that is, it cannot be started before the release date and must be completed on the last link before the deadline. Otherwise, the periodicity is not met. Let (t i ,t′ i ) and (l i ,l′ i ) represent the first and last links of the routing path of flow i respectively. Then the sending time of the frame of flow i is defined as follows:
[0129]
[0130] The non-overlapping constraint states that the transmission of two different frames on the same link must not overlap in time. Specifically, for each pair of different frames on the same link, the transmission of one frame must be completed before the transmission of the other frame begins, and vice versa. This constraint ensures that at any given time, no more than one frame is transmitted on the same link, thus avoiding transmission conflicts and potential data loss. This constraint must take into account all frames that appear in the supercycle. Due to the zero jitter requirement, the transmission offset of the kth frame of stream i on link (a, b)∈E is equal to φ i,a,v +(k-1)·T iTherefore, the specific constraints are expressed as follows:
[0131]
[0132] Where ∨ represents logical OR.
[0133] The transmission order constraint specifies the priority relationship of each link on the frame's path. The frame cannot be scheduled from the node before it is completely delivered to the node and processed. That is, the frame can only be transmitted from the switch after it is completely transmitted to the switch and processed. It defines that the transmission offset of each data packet must be greater than or equal to the transmission offset of the previous data packet on the previous link to ensure the correct order of data packets:
[0134]
[0135] The end-to-end delay constraint stipulates that the difference between the arrival time and the sending time of the flow must be less than or equal to the specified maximum value, namely the maximum end-to-end delay. This ensures that all flows can be transmitted from the source node to the destination node within the specified time, meeting the real-time requirements. i ,t′ i ) represents stream i i The sending link is the first link of the routing path, using (l i ,l′ i ) represents the last link before the receiving node, D max represents the maximum end-to-end delay, then the end-to-end delay constraint of flow i is defined as follows:
[0136]
[0137] The queue allocation constraint limits the number of available queues per port to a maximum, ensuring that queues are correctly allocated on each egress port for each frame.
[0138]
[0139] Frame isolation constraint means that the network may encounter frame loss or periodic changes in payload size during system operation, which may cause problems such as stream transmission uncertainty and jitter. Since the IEEE802.1Qbv specification controls the opening and closing of the queue timing gate, rather than the sending and receiving of a single frame. Therefore, it is necessary to ensure that the state of the queue is deterministic, that is, a queue can only receive frames from one stream at the same time. If two frames from different streams arrive one after another, both are placed in the same queue in the required order. If the first frame is lost, the second frame from the second stream takes a position in the queue and will be transmitted in the time slot reserved by the first stream, resulting in uncertainty and jitter.
[0140] To ensure deterministic end-to-end latency, the frame isolation constraint isolates the two frames so that one frame can arrive at the shared queue only after the other frame is released from the queue.
[0141]
[0142] The CP solver is used to find a feasible solution for scheduling in the solution space provided by the scheduling constraints. The feasible solution for scheduling is brought into the scheduling objective function to obtain the optimal value of the scheduling objective function of the feasible solution and obtain the optimal scheduling solution.
[0143] In step S4 of this embodiment, it is necessary to establish a new routing constraint to repeat steps S2 and S3 for iteration, wherein, if a feasible scheduling solution is found in step S3, the newly added routing constraint is used to limit the route obtained by the re-iteration to be different from the current route; if no feasible scheduling solution is found in step S3, the constraints that cannot be satisfied at the same time are retrieved, and a new routing constraint is constructed based on this, to ensure that the new routing solution generated by the subsequent iteration will not be repeated, resulting in the inability to find a feasible scheduling solution.
[0144] Specifically, this embodiment provides the following implementation process:
[0145] In most current constraint programming-based models, it is necessary to find both the flow path and the frame transmission offset. The TSN scheduling method proposed in this invention decomposes the problem into two stages: first, the flow path is calculated, that is, the variable ρ i,a,b Assignment; then, scheduling is performed based on the obtained path, that is, the variable φ i,a,b and λ i,a,b After the second stage, it returns to the first stage to find another route and repeats. The workflow diagram is as follows Figure 2 The specific implementation steps are as follows:
[0146] 1. Initialization phase:
[0147] Define information such as network topology, link transmission delay, switch processing delay, decision variables, etc.
[0148] 2. Routing problem modeling:
[0149] Build a model for the routing problem, which consists of the routing variable ρ i,a,b , routing constraints and routing objective functions.
[0150] Routing variable ρ i,a,b , used to indicate whether data flow i passes through link (a, b).
[0151] Routing constraints: Ensure that each flow has a path from sender to receiver.
[0152] Routing objective function: considers both the balance of network load and the different cycles of flows.
[0153] 3. Solve the routing problem:
[0154] Combined with the user's demand for network topology, the network information such as switches, terminal devices, link parameters and flow parameters are input according to the network model and traffic model, and the source node and destination node of the traffic are confirmed according to the input traffic information. Then, the CP solver is used to find a feasible solution for the route according to the solution space provided by the routing constraints. The feasible solution of the route is brought into the routing objective function, and the optimal value of the routing objective function of the feasible solution is obtained to obtain the best route.
[0155] If the routing model reports "infeasible", the algorithm is terminated because there is no solution and the problem cannot be solved. If a feasible route is found, go to step 4 to enter the scheduling stage.
[0156] 4. Scheduling Problem Modeling:
[0157] According to the determined route, a scheduling problem model is constructed, which consists of variables φ i,a,b , i,a,b As well as related scheduling constraints and scheduling objective functions.
[0158] Transmission offset φ i,a,b , indicating the time when the data flow starts transmitting on the link.
[0159] Queue Allocation λ i,a,b , indicating in which queue the data flow is stored.
[0160] Scheduling constraints: frame constraints, link constraints, flow transmission constraints, queue allocation constraints, and frame isolation constraints.
[0161] Scheduling objective function: Minimize the maximum end-to-end delay of all time-triggered flows.
[0162] 5. Solve the scheduling problem:
[0163] The CP solver is used to find a feasible solution for scheduling in the solution space provided by the scheduling constraints. The feasible solution for scheduling is brought into the scheduling objective function to obtain the optimal value of the scheduling objective function of the feasible solution and obtain the optimal scheduling solution.
[0164] If the scheduling subproblem finds a feasible schedule, then add a new constraint to enforce that the new route is different from the current route. If the scheduling subproblem is not feasible, retrieve a set of constraints that cannot be satisfied simultaneously and build a new constraint based on them, excluding routing configurations that cause conflicts.
[0165] 6. Iteration process:
[0166] New constraints are added to the routing problem model to avoid repeating the same mistakes in future iterations.
[0167] Resolve the routing problem and find a new routing solution.
[0168] If a new feasible route is found, repeat steps 4 to 7.
[0169] If the time limit is reached or there are no other routes to try, the iteration ends.
[0170] 7. Evaluate and select solution:
[0171] If a feasible schedule is found, the quality of the solution is evaluated and compared with the previously found solutions. The best solution that optimizes the objective function value is selected from all the tried solutions or further iterations are chosen as needed.
[0172] 8. Termination conditions:
[0173] The time limit was reached or there were no more routes to try.
[0174] 9. Output results:
[0175] Output the best schedule found.
[0176] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the purpose and scope of the technical solution, which should be included in the scope of the claims of the present invention.
Claims
1. A method for scheduling time-sensitive network traffic based on constraint programming, characterized in that: The method comprises the following steps: S1. Abstract the time-sensitive network topology into a network directed graph, and establish a network model and a traffic model; S2, establish a routing objective optimization function and corresponding routing constraints, and find the optimal route of the routing objective function in the feasible solutions under the current routing constraints; S3: According to the determined optimal route, establish a scheduling optimization objective function and corresponding scheduling constraints, and find the best scheduling solution of the scheduling optimization objective function in the feasible solutions under the current scheduling constraints; S4: Establish new routing constraints based on the solution of the scheduling optimization objective function, and iterate the routing and scheduling solutions again until all routes are traversed or the iteration round is reached, and output the final scheduling solution.
2. According to claim 1, a method for time-sensitive network traffic scheduling based on constraint programming is characterized in that: For the network model in step S1, the TSN network topology is abstracted into a network directed graph: G=(V,E) Wherein, V represents a set of communication nodes in the network, which includes all TSN switch sets SW and terminal device sets ES, that is, V = ES ∪ SW; E represents the set of communication links between any two nodes in the network, that is, E = {(a, b) | a, b ∈ V}; Each physical link (a, b) ∈ E and (b, a) ∈ E connecting two devices a and b (a, b ∈ V) is regarded as two independent directed links. Each unidirectional link (a, b) ∈ E is represented by a three-dimensional tuple, namely: (a,b)=<q a,b ,d a,b ,d a > Among them, q a,b is the number of queues in the egress port for time-triggered flows transmitted to link (a, b)∈E, d a,b is the link delay, d a is the processing delay of switch a∈V; Network devices perform time synchronization, and the maximum difference between the local clocks of any two network devices is δ.
3. The method for time-sensitive network traffic scheduling based on constraint programming according to claim 2 is characterized in that: For the traffic model in step S1, a flow refers to periodic data transmission from one terminal station to another terminal station. The time-triggered flow is modeled as a set of message tuples from the source node to the destination node. The set of time-triggered flows is F; For each time-triggered stream i, the following parameters are defined: t i ∈ES represents the source node; l i ∈ES represents the destination node; T i Indicates the transmission period of each time-triggered stream, which is used to indicate the frequency of data transmission; L i represents the transmission duration, i.e., the time it takes for flow i∈F to be transmitted from any node to its neighboring nodes; r i Indicates the release date of the flow, that is, the earliest time when the source node can start sending data; Indicates the transmission deadline of the flow, that is, the latest time point at which the destination node must obtain data. If the flow successfully receives the data frame sent from the source node from the destination node within the deadline, it is considered to be scheduled successfully, otherwise it is considered to be scheduled failed; The hyperperiod HP is defined as the least common multiple of the periods of all flows: HP=LCM{T i ∣i∈F} Wherein, LCM{·} is the function for finding the least common multiple.
4. The method for time-sensitive network traffic scheduling based on constraint programming according to claim 3 is characterized by: In step S2, first, a load balancing routing strategy that minimizes the traffic load on each link is adopted to establish a load balancing optimization target: In the formula, ρ i,a,b is a Boolean variable that determines whether flow i passes through link (a, b). i is the transmission duration of flow i from any node to its adjacent nodes, T i is the period of flow i; Secondly, consider minimizing the ratio of the least common multiple of the traffic cycle to the greatest common divisor as the routing optimization goal: Where, j represents flow j different from flow i, lcm{} is the function for finding the least common multiple, and gcd{} is the function for finding the greatest common divisor; Finally, a trade-off factor λ is set to balance the relative importance between the load balancing objective and the combined optimization objectives of different cycles, and the final routing optimization objective function is obtained: The constraints of the routing optimization objective function include at least: path uniqueness constraint, path continuity constraint, routing loop constraint, and single path constraint.
5. The method for time-sensitive network traffic scheduling based on constraint programming according to claim 4 is characterized in that: The constraints of the route optimization objective function in step S2 are specifically: Path uniqueness constraint: This constraint is used to ensure that for each flow i∈F in the network and each node a∈V except the source node, node a can only have one previous node b on the path of flow i; Path continuity constraints: This constraint is used to ensure that the flow path is continuous, that is, each node a∈V has only one direct successor node b on the flow path; Routing loop constraints: This constraint is used to ensure that there are no cycles in the path of any flow. For each flow i and all nodes a except the source node, the flow from a back to the source node t i Routing variables Must be 0, ensuring that the path from source to destination for each flow is unidirectional; Single path constraint: This constraint is used to ensure that for each flow i, only one path is followed in the network and flow i only leaves from one link when passing through the intermediate node a.
6. The method for time-sensitive network traffic scheduling based on constraint programming according to claim 5 is characterized by: In the process of solving the routing optimization objective function in step S2, first, a feasible solution of the routing is found in the solution space provided by the routing constraint conditions through the CP solver; then, the feasible solution of the routing is brought into the routing objective function, the optimal value of the routing objective function of the feasible solution is obtained, and the best route is obtained; If there is no feasible routing solution, the algorithm is terminated; if the best route is obtained, the scheduling phase is entered.
7. The method for time-sensitive network traffic scheduling based on constraint programming according to claim 6 is characterized by: In step S3, a scheduling optimization objective function is established with minimizing the maximum end-to-end delay of the time-triggered flow as the optimization goal: in, The sending link of flow i is the first link of the routing path (t i ,t′ i )'s transmission offset; represents the last link before the receiving node of flow i (l i ,l′ i )'s transmission offset; Indicates that stream i is from l i Node to l′ i The transmission duration of the node; Indicates that flow i is on link (l i ,l′ i )’s propagation delay; The scheduling constraints of time-triggered flows include data frame constraints, non-overlapping constraints, transmission order constraints, end-to-end delay constraints, queue allocation constraints, and frame isolation constraints.
8. The method for time-sensitive network traffic scheduling based on constraint programming according to claim 7 is characterized in that: The scheduling constraints in step S3 are: Data frame constraints: The data frame constraint is proposed for the periodicity of each TT flow i. If i is sent periodically, the transmission frame on the first link of its routing path must be sent out within the frame period and must be completed on the last link before the deadline, otherwise the periodicity is not met; Non-overlapping constraints: The non-overlapping constraint means that two different frames on the same link must not overlap in time during transmission. For each pair of different frames on the same link, the transmission of one frame must be completed before the transmission of the other frame begins. In addition, due to the zero jitter requirement, the transmission offset of the kth frame of the stream i∈F on the link (a, b)∈E is equal to φ i,a,b +(k-1)·T i ; Transmission order constraints: The transmission order constraint stipulates the priority relationship of each link on the frame path. The frame can only be transmitted from the switch after it is completely transmitted to the switch and processed. It defines that the transmission offset of each data packet must be greater than or equal to the transmission offset of the previous data packet on the previous link. End-to-end delay constraint: The end-to-end delay constraint specifies that the difference between the arrival time and the sending time of a flow must be less than or equal to a specified maximum value, namely the maximum end-to-end delay; Queue allocation constraints: The queue allocation constraint limits the number of available queues per port to no more than 1, ensuring that queues are correctly allocated on each egress port for each frame; Frame Isolation Constraints: Frame isolation constraints are used to ensure that the state of the queue is deterministic, that is, a queue can only receive frames from one flow at the same time. Frame isolation constraints isolate two frames so that one frame can reach the shared queue only after the other frame is released from the queue.
9. The method for time-sensitive network traffic scheduling based on constraint programming according to claim 8, characterized in that: In the process of solving the scheduling optimization objective function in step S3, first, the CP solver is used to find a feasible scheduling solution in the solution space provided by the scheduling constraints; then, the feasible scheduling solution is brought into the scheduling objective function to obtain the optimal value of the scheduling objective function of the feasible solution, and the optimal scheduling plan is obtained.
10. The method for time-sensitive network traffic scheduling based on constraint programming according to claim 9, characterized in that: In step S4, a new routing constraint is established according to the solution of the scheduling solution, and the new routing constraint is added back to the constraint condition of the routing optimization objective function for iterative solution until the iteration ends, wherein: If there is a feasible scheduling solution in the scheduling solution, the newly added routing constraint is used to ensure that the route obtained by re-iteration is inconsistent with the current route; if there is no feasible scheduling solution in the scheduling solution, the constraints that cannot be satisfied at the same time are retrieved, and a new routing constraint is constructed based on this; The iteration ends when the time limit is reached or all feasible routes are traversed.