A Hybrid Scheduling Method for Wait-Free Time-Sensitive Network Traffic

Through the hybrid scheduling method of network traffic without waiting time sensitive, the genetic algorithm is used to optimize the GCL length, and the problem of existing TSN scheduling algorithm reducing the TT streaming effect is solved, real-time and deterministic of TT streaming are realized.

CN116389277BActive Publication Date: 2025-07-01GUILIN UNIV OF ELECTRONIC TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310298083.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-24
Publication Date
2025-07-01
Estimated Expiration
2043-03-24

AI Technical Summary

Technical Problem

The existing time-sensitive network (TSN) scheduling algorithms fail to effectively consider the traffic type, TT stream period and length value range, resulting in a reduction in the TT streaming effect.

Method used

A hybrid scheduling method for network traffic without waiting time is proposed. By inputting TSN network topology information and TT stream sets, a network node adjacency link list is generated, feasible routing of TT streams is calculated, and the GCL length is optimized based on the genetic algorithm to ensure the real-time and deterministic TT stream transmission.

Benefits of technology

While shortening GCL, it ensures real-time and deterministic TT streaming transmission, solving the problem of existing scheduling algorithms reducing the effect of TT streaming transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116389277B_ABST
    Figure CN116389277B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of network communication technologies, and particularly relates to a method for hybrid scheduling of wait-free time-sensitive network traffic, including: S1 inputting TSN network topology information and a set of TT flows; S2 using the TSN network topology information to generate an adjacency linked list of network nodes, calculating all feasible routes of the TT flows in the set of TT flows, and obtaining a set of feasible routes; S3 generating TT flow index information based on the set of TT flows; S4 creating an initial population based on the set of feasible routes and the TT flow index information; S5 evaluating the individuals in the initial population and selecting the next-generation initial population; S6 determining whether the evaluation process terminates. If it terminates, a gating list is output. If it does not terminate, genetic operations are performed on the next-generation initial population and then the process returns to step S5. The present invention can shorten the GCL while ensuring the quality of the solution, ensuring the real-time and deterministic nature of TT flow transmission, and solving the problem that existing scheduling algorithms reduce the transmission effect of TT flows.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of network communication technologies, and in particular, to a method for hybrid scheduling of wait-free time-sensitive network traffic. Background Art

[0002] In the current high-speed development of social informatization, the industrial Internet has achieved the interconnection of all elements of people, machines, and things. Existing real-time communication protocols have poor compatibility with each other and require dedicated devices, resulting in high costs; traditional Ethernet technologies have strong scalability and moderate prices, but lack effective real-time control. The Time-Sensitive Network (TSN), based on a series of extensions to IEEE 802.1Q, adds transmission real-time and determinism to Ethernet, but users need to plan the transmission of time-triggered (TT) flows by themselves. In the industrial Internet, traffic can be divided into 8 categories according to priority, with the priority increasing from 0 to 7 in sequence. Among them, real-time synchronization flows (priority 6) and cyclic flows (priority 5) generally use the Time-Aware Shaper (TAS) as the transmission selection algorithm, generate a Gate Control List (GCL) using the characteristics of TT flows, and then use the GCL to control the transmission behavior of the transmission queue of the Network Interface Card (NIC). The key to TT flow scheduling in the industrial Internet lies in how to generate a reasonable GCL, and both the GCL length and the buffer time of data frames should be as short as possible.

[0003] Existing TSN scheduling algorithms do not well consider the traffic type, as well as the value ranges of the TT flow period and length. The TT flow period is in the range of 100 microseconds to 20 milliseconds, and the length generally does not exceed the Maximum Transmission Unit (MTU) of Ethernet. Traditional solutions assume that the length exceeds the MTU and require complex constraint specifications, while the data frames of real-time flows and cyclic flows are usually very short and do not need to consider fragmented transmission of data frames. At the same time, the applicable business scenarios of these scheduling algorithms also vary, and there are different emphases on the trade-off between GCL length, transmission real-time, and determinism. The schemes with short GCL lengths have poor transmission real-time and determinism, while the schemes with high transmission real-time and determinism have overly long GCLs, reducing the transmission effect of TT flows. Summary of the Invention

[0004] The purpose of the present invention is to provide a method for hybrid scheduling of wait-free time-sensitive network traffic, aiming to solve the problem that existing scheduling algorithms reduce the transmission effect of TT flows.

[0005] To achieve the above purpose, the present invention provides a method for hybrid scheduling of wait-free time-sensitive network traffic, including the following steps:

[0006] S1 inputs the TSN network topology information and the TT flow set;

[0007] S2 uses the TSN network topology information to generate a network node adjacency linked list, calculates all feasible routes of the TT flows in the TT flow set, and obtains a set of feasible routes;

[0008] S3 generates TT flow index information based on the TT flow set;

[0009] S4 creates an initial population based on the set of feasible routes and the TT flow index information;

[0010] S5 evaluates the individuals in the initial population and selects the next-generation initial population;

[0011] S6 determines whether the evaluation process terminates. If it terminates, it outputs a gating list. If it does not terminate, it performs genetic operations on the next-generation initial population and then returns to step S5.

[0012] Among them, the TSN network topology information includes network nodes and a link set;

[0013] The network nodes include TSN switch nodes and end-system nodes;

[0014] The TSN switch nodes include switch processing delay and multiple NICs;

[0015] The end-system nodes include end-system processing delay and 1 NIC;

[0016] Each link in the link set connects two NICs, and there are two logical links in opposite directions between the two connected nodes.

[0017] Among them, the step of using the TSN network topology information to generate a network node adjacency linked list, calculating all feasible routes of the TT flows in the TT flow set, and obtaining a set of feasible routes includes:

[0018] S21 records the adjacent nodes of the TSN network topology information to obtain a network node adjacency linked list;

[0019] S22 uses the depth-first search algorithm to start searching from the source node of the TT flow set in the network node adjacency linked list, and saves all the passed nodes into a path list;

[0020] S23 during the depth-first search process, when the destination node of the TT flow set is encountered, the path list is saved and traced back to the previous node;

[0021] After S24 traverses the adjacency list of the network nodes, all the routes from the source node to the destination node are saved in the path list. Thus, all the feasible route information of the TT flow is obtained, and the feasible route set is obtained.

[0022] Among them, generating the TT flow index information based on the TT flow set includes:

[0023] S31 Initializes the index value;

[0024] S32 Traverses each TT flow in the TT flow set to obtain multiple TT flow identifiers;

[0025] S33 Records the mapping relationship between the TT flow identifier and the initialized index value in the position index;

[0026] S34 Records the mapping relationship between the incremented index value by 1 and the next TT flow identifier in the position index;

[0027] S35 Repeats step S34 until the recording of the mapping relationship between all the TT flow identifiers and the corresponding index values is completed, and the TT flow index information is obtained.

[0028] Among them, creating the initial population based on the feasible route set and the TT flow index information includes:

[0029] S41 Sets the length of the TT flow set to obtain the set length;

[0030] S42 Initializes the genetic algorithm individual composed of a route array with the set length and an initial transmission time array;

[0031] S43 Randomly selects a route from the feasible route set for the TT flow based on the TT flow index information to obtain a route index value, and saves the route index value at the position corresponding to each TT flow in the initial transmission time array of the initialized genetic algorithm individual;

[0032] S44 Groups all the TT flows using the breadth-first search algorithm, and sorts them in ascending order of the period of the TT flow in each group;

[0033] S45 Sets the transmission time of the first TT flow in each group to 0, saves it at the corresponding position in the route array of the initialized genetic algorithm individual, randomly sets a transmission time for other TT flows in each group, and saves it at the corresponding position in the route array of the initialized genetic algorithm individual to obtain a population individual;

[0034] S46 Repeats steps S42 to S45 until 100 population individuals are generated to obtain the initial population.

[0035] Among them, evaluating individuals in the initial population and selecting the initial population of the next generation includes:

[0036] S51 Calculate the base period (BP) of each link in the link set, and define the base period as the least common multiple of the periods of all real-time synchronization flows passing through the current link. If only cyclic flows pass through the current link, the link period is the period of the cyclic flow with the smallest period among the cyclic flows passing through the current link;

[0037] S52 According to the routing scheme selection and the initial transmission time array of individuals in the initial population, calculate the transmission time slots of real-time synchronization flows, and save the transmission time slots in the correspondence between links and time slots;

[0038] S53 Judge whether the time when the real-time synchronization flow arrives at the destination node meets the deadline requirement;

[0039] S54 Judge whether there are conflicts in the transmission time slots in the correspondence between the scheduled links and time slots;

[0040] S55 Try to schedule cyclic flows using the time slot mapping and multiplexing strategy, and judge whether the existing schedule is damaged during the scheduling process. If the existing schedule is damaged, reject the current individual, otherwise accept the current individual;

[0041] S56 Iterate steps S51 to S55, and select some individuals from the accepted individuals as the initial population of the next generation.

[0042] Among them, judging whether the evaluation process terminates. If it terminates, output the gating list. If it does not terminate, perform genetic operations on the initial population of the next generation and then return to step S5, including:

[0043] Judge whether the number of iterations reaches the set number of times. If it reaches the set number of times, deduce the gating list of all links according to the information in the correspondence between the links and time slots. If it does not reach the set number of times, perform genetic operations on the initial population of the next generation and then return to step S5.

[0044] A method for hybrid scheduling of wait-free time-sensitive network traffic according to the present invention includes: inputting TSN network topology information and a set of TT flows through S1; generating an adjacency list of network nodes using the TSN network topology information to calculate all feasible routes of the TT flows in the set of TT flows, obtaining a set of feasible routes; generating TT flow index information based on the set of TT flows; creating an initial population based on the set of feasible routes and the TT flow index information; evaluating individuals in the initial population and selecting the initial population for the next generation; determining whether the evaluation process terminates. If it terminates, a gating list is output. If it does not terminate, genetic operations are performed on the initial population for the next generation and then the process returns to step S5. The present invention can ensure the quality of the solution while shortening the GCL, ensuring the real-time and deterministic transmission of TT flows, and solving the problem that existing scheduling algorithms reduce the transmission effect of TT flows. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0046] Figure 1 is a step diagram of a method for hybrid scheduling of wait-free time-sensitive network traffic provided by the present invention.

[0047] Figure 2 is a schematic diagram of gene coding.

[0048] Figure 3 is a schematic diagram of grouping.

[0049] Figure 4 is a schematic diagram of the storage structure of the gating list and transmission information.

[0050] Figure 5 is a flowchart of a method for hybrid scheduling of wait-free time-sensitive network traffic provided by the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0051] The following will describe in detail the embodiments of the present invention. The examples of the embodiments are shown in the drawings, where the same or similar reference numerals represent the same or similar elements or elements with the same or similar functions throughout. The embodiments described below by referring to the drawings are exemplary and are intended to explain the present invention, and should not be construed as a limitation of the present invention.

[0052] Please refer to Figures 1 to 5 , the present invention provides a method for hybrid scheduling of wait-free time-sensitive network traffic, including the following steps:

[0053] S1 inputs TSN network topology information G(V,E) and TT flow set S;

[0054] Specifically, the TSN network topology information includes network nodes and link sets; the network nodes include TSN switch nodes and end system nodes; the TSN switch nodes include processing delays and multiple NICs; the end system nodes include processing delays and 1 NIC; each link in the link set connects two NICs, and the two connected nodes contain two logical links in opposite directions.

[0055] S2 uses the TSN network topology information to generate a network node adjacency list to calculate all feasible routes of the TT flows in the TT flow set to obtain a feasible route set;

[0056] The specific method is:

[0057] S21 records the adjacent nodes of the TSN network topology information to obtain a network node adjacency list;

[0058] S22 uses a depth-first search algorithm to search from the source node of each TT flow in the network node adjacency list, and saves all passed nodes into a path list;

[0059] S23, during the depth-first search process, when encountering the destination node of the TT flow, saving the path list and tracing back to the previous node;

[0060] After traversing the network node adjacency linked list in S24, all routes from the source node to the destination node are saved in the path list, and thus all feasible route information of the TT flow is obtained, and a feasible route set is obtained.

[0061] S3 generates TT stream index information based on the TT stream set;

[0062] The specific method is:

[0063] S31 initializes the index value;

[0064] Specifically, the index value pos is initialized to 0.

[0065] S32 traverses each TT flow in the TT flow set to obtain multiple TT flow identifiers;

[0066] S33 records the mapping relationship between the TT stream identifier and the initialized index value in the SP;

[0067] Specifically, the mapping relationship between the TT stream identifier id and the index value pos is recorded in the SP.

[0068] Record the mapping relationship between the incremented-by-1 initialized index value and the next TT stream identifier in the SP;

[0069] Repeat step S34 until the mapping relationships between all the TT stream identifiers and the corresponding index values are recorded, obtaining the TT stream index information.

[0070] Create an initial population based on the feasible routing set and the TT stream index information;

[0071] The specific method is as follows:

[0072] Set the length of the TT stream set to obtain a set length;

[0073] Specifically, let the length of the TT stream set S be S.len.

[0074] Initialize a genetic algorithm individual composed of a routing array and an initial transmission time array with the set length;

[0075] Specifically, initialize two arrays Φ and to form an individual of the genetic algorithm, and set the initial values of all elements in the two arrays to 0.

[0076] Based on the TT stream index information, randomly select a route for each TT stream from the feasible routing set to obtain a route index value, and save the route index value at the position corresponding to each TT stream in the initialized initial transmission time array of the genetic algorithm individual;

[0077] Specifically, assign values to the elements in . Use the mapping relationship in the SP to randomly select a route for the TT stream corresponding to each id from its feasible routing set R i and save the route index value at the position corresponding to each TT stream in .

[0078] Group all the TT streams using the breadth-first search algorithm, and sort them in ascending order of the period of each TT stream within each group;

[0079] Set the transmission time of the first TT stream in each group to 0, save it at the corresponding position in the initialized routing array of the genetic algorithm individual, randomly set a transmission time for the other TT streams in each group, and save it at the corresponding position in the initialized routing array of the genetic algorithm individual, obtaining a population individual;

[0080] Repeat steps S42 to S45 until 100 such population individuals are generated, obtaining the initial population.

[0081] S5 evaluates the individuals in the initial population and selects the initial population for the next generation;

[0082] The specific method is as follows:

[0083] S51 calculates the BP of each link in the link set, and defines the BP as the least common multiple of all real-time synchronization flow cycles passing through the current link. If only cyclic flows pass through the current link, the link period is the period of the cyclic flow with the smallest period among the cyclic flows passing through the current link;

[0084] S52 calculates the transmission time slots of the real-time synchronization flows according to the routing scheme selection and the initial transmission time array of the individuals in the initial population, and saves the transmission time slots in the link-time slot correspondence;

[0085] Specifically, according to the routing scheme selection array and the initial transmission time array, calculate the transmission time slots of the real-time synchronization flows. The number of times a real-time synchronization flow is sent / forwarded on each routing link is equal to the quotient of the link base period and the real-time synchronization flow period. At the source node, the transmission time each time is equal to the sum of the transmission time, the source node processing delay, and the corresponding multiple of the period. At other routing nodes, the first forwarding time is equal to the sum of the transmission time of the previous hop, the transmission delay, the propagation delay, and the processing delay of the current node. The forwarding times of other times are equal to the sum of the first forwarding time and the corresponding multiple of the period; during the calculation process, save the transmission time slots and the TT flow send / forward information in the link-time slot correspondence. The transmission time slots include the start time point of the time slot, the end time point of the time slot, and the time slot gating value. The gating value consists of 8 identifiers representing the on / off state. The TT flow send / forward information includes the start time point of the send / forward, the end time point of the send / forward, and the TT flow identifier.

[0086] S53 determines whether the time when the real-time synchronization flow reaches the destination node meets the deadline requirement;

[0087] S54 determines whether there are conflicts in the scheduled transmission time slots in the LTS;

[0088] S55 attempts to schedule the cyclic flows using the time slot mapping and multiplexing strategy, and determines whether the existing schedule is damaged during the scheduling process. If the existing schedule is damaged, reject the current individual; otherwise, accept the current individual;

[0089] Specifically, the time slot mapping and multiplexing strategy is used to attempt to schedule the cyclic flow. In the time slot mapping and multiplexing strategy, the number of times the cyclic flow is sent / forwarded on all its routing nodes is equal to the quotient of the group period and the cyclic flow period. The value of the group period is equal to the least common multiple of the periods of all TT flows in the packet. When calculating each send / forward time, it is necessary to determine whether the existing schedule is disrupted. If the existing schedule is disrupted, the current individual is rejected. Without disrupting the existing schedule, the send / forward time is modulo-operated with the link base period to complete the mapping, and the result is used as the start time of the time slot. The end time of the time slot is equal to the sum of the start time and the TT flow transmission delay. The time slot is compared with the saved time slots to obtain the queuing delay. When the queuing delay is not 0, the start and end times of the time slot are updated and saved. If the difference between the end time of the previous time slot and the start time of the next time slot is equal to the Ethernet frame spacing, the two time slots are merged. If the time slot information obtained through modulo operation mapping already exists, it indicates that multiplexing can be performed, and the TT flow send / forward information is added to the time slot information.

[0090] Iterate steps S51 to S55 in S56, and select some individuals from the accepted individuals as the initial population of the next generation.

[0091] S6 determines whether the evaluation process terminates. If it terminates, the gating list is output. If it does not terminate, genetic operations are performed on the initial population of the next generation and then return to step S5.

[0092] Specifically, it is determined whether the number of iterations reaches the set number. If it reaches the set number, the gating list of all links is deduced based on the information in the LTS. If it does not reach the set number, genetic operations are performed on the initial population of the next generation and then return to step S5.

[0093] The implementation method of performing genetic operations on the initial population of the next generation is as follows:

[0094] Mutation operation: For a selected mutant individual, first perform a mutation operation on the routing selection scheme array of this individual, add a random number to each element in to form a new routing selection scheme. Secondly, regroup the TT flows. Finally, set the transmission time of the TT flow with the smallest period in each group to 0, and accumulate a random number for the transmission times of the remaining TT flows as the new transmission time.

[0095] Crossover operation: For two selected parent individuals P1 and P2, and the offspring individual offspring, first generate two random coefficients λ and δ between 0 and 1. Secondly, generate the routing selection array , the elements at the same positions in the routing arrays of P1 and P2 are multiplied by the crossover coefficient λ and (1 - λ) respectively, and the results are accumulated to form the routing array of the offspring. For the elements at the corresponding positions, then regroup the TT flows of the offspring. Finally, set the transmission time of the TT flow with the minimum period in each group to 0. The elements at the same positions in the transmission time arrays Φ of P1 and P2 are multiplied by the crossover coefficient δ and (1 - δ) respectively and accumulated, and the result is used as the element at the corresponding position of the transmission time array Φ of the offspring.

[0096] Embodiment:

[0097] The present invention provides a time-sensitive network traffic hybrid scheduling method based on a base period slot mapping and multiplexing mechanism and a wait-free scheduling. The invention has a total of seven steps: input, calculate routing, generate data stream indexes, create an initial population, select, detect termination conditions, genetic operations (such as Figure 1 shown). The symbols used in the present invention are shown in the following table:

[0098]

[0099] Global variables: S, SP, R. Once the global variables are assigned values during the entire calculation, they will no longer change and are used to quickly index some information; Intermediate results: D, G, LS, LTS. The intermediate variables and individuals are in one-to-one correspondence. Each individual has its own unique intermediate variables. The intermediate results are created when the individuals are created and disappear when the individuals disappear.

[0100] Input: Input the TSN network topology information G(V, E): Input the set V of network nodes, including TSN switch nodes and end system nodes. Each node contains two attributes, the processing delay d pr and network interface cards (NICs). The switch node contains several NICs, and the set of NICs is represented by P. The end system node has only one NIC, represented by p; Input the link set E. Each link connects two NICs. The link has a directionality, and there are two logical links between the two connected nodes with opposite directions. Input the TT flow set S, where each TT flow is an attribute set A = {id, φ, t, l, p, s, d}.

[0101] Calculate routing: Use G(V, E) to generate the adjacency list adj of the TSN network nodes, and then calculate all feasible routes for each TT flow; The specific steps are shown in Algorithm 1. get_routes_helper is used to initialize and call get_routes. Starting from line 1, traverse S. Line 2 initializes the access status of each TT flow to false. Line 3 initializes the TT flow si routing set R i is an empty set. In the 4th line, an empty route r is initialized to save the route. In the 5th line, h is initialized to 0 to record the route hop count information. In the 6th line, get_routes is called to start calculating the route, and the input parameters are the source node, the destination node, the access status array v, the empty route r, and the empty routing set R i , and the hop count record h. After calculating the routes of all TT flows, the 7th line returns the set of feasible routes R; in the first line of get_routes, the access status of the current visited node is marked as true indicating it has been visited. In the second line, the current node is put into the route r. In the third line, the route hop count is incremented. In the fourth line, it is determined whether the current node is the destination node. If it is the destination node, it means r is already a route from the source node to the destination node. In the fifth line, r is added to the routing set R i of flow s i ; otherwise, starting from the 7th line, the nodes adj[src][i] in the adjacency list adj[src] of the current node are traversed. In the 8th line, it is determined whether the node has been visited. If not, get_routes is called again in the 9th line with the source node being adj[src][i]. After visiting the adjacency list of src, it starts to backtrack to the previous hop. In the 10th line, the hop count h is decremented by one. In the 11th line, src is marked as unvisited.

[0102]

[0103]

[0104] Generating an index: Sorting is involved in the process of processing TT flows. The intermediate result saves the TT flows by saving their identifiers id. Therefore, by establishing the index SP, the original TT flow information can be quickly found. The identifier of each TT flow and its position in the set S are in one-to-one correspondence. As shown in the index part of Figure 2 , each element in the index records the position of flow s i in S.

[0105] Creating the initial population: The structure of an individual is as shown in Figure 2 , which contains two genes, represented by two arrays for the route and the initial transmission time Φ. First, for each flow s i , a routing index is randomly selected, and the index value should not be greater than the length of its set of feasible routes R i . Then the TT flows are grouped, and the grouping structure is as shown in Figure 3The specific operation is shown in Algorithm 2: Lines 1 to 4 of the algorithm traverse SP, then traverse the route of each TT flow, and store the flows that use the same link in LS. LS is a map with the key as the link and the value as a set of TT flows passing through the link; Lines 5 to 6 of the algorithm initialize the variable v that records the access status of all TT flows. i is false; Line 7 of the algorithm initializes the group identifier gid to 0, and lines 8 to 22 begin to use breadth-first search to group S. Line 8 begins to traverse the index SP, and line 9 obtains the stream s i Line 10 determines the access status of the flow. If it is not accessed, line 11 creates a group g. Line 12 initializes an empty access queue Q and adds flow s i Marked as visited, line 13 will stream s i Add group g, and line 14 will flow s i Add to the access queue Q. Line 15 determines the state of queue Q. If it is not empty, line 16 obtains the stream s at the head of the queue. j , obtain its route R according to SP j,m , then traverse R j,m Link Get For other TT flows in SP, lines 20 to 22 mark these TT flows as visited and add them to the grouping and access queues; repeat lines 15 to 22 to obtain all related TT flows and add them all to group g. When the queue is empty, it means that there is no TT flow and the TT flow in the current group has a route intersection. Line 23 records group g in D, and its group identifier is gid. Line 24 increases the group identifier. When all the TT flows in SP are traversed, line 25 returns the group record D. After grouping, the TT flow identifiers in each group are sorted in ascending order according to the period, mainly to determine the TT flow with the smallest period, and set the value of its corresponding position in Φ to 0, stipulating that the flow with the smallest period in each group is sent at time 0 of the group period. Set a random sending time for other TT flows, with flow s i For example, the initial sending time should be in [0,S i,1 -S i,2 ×M i ), if the generated random number is not within this range, regenerate until it is satisfied. In the present invention, the initial population is defined to include 100 individuals, and the above process is repeated 100 times to generate 100 individuals.

[0106]

[0107]

[0108] Evaluate individuals in the population: (1) Calculate the BP of each link. The least common multiple of all real-time synchronization flow cycles passing through each link is used as the BP of the link. If only cyclic flows pass through the link, the BP is the period of the cyclic flow with the smallest period. If no TT flow passes through, it is 0.

[0109] (2) Calculate the transmission time of real-time synchronization flows at each hop using formula (1) based on the initial transmission time and the routing selection scheme:

[0110]

[0111] Suppose [p a , p x' and [p x , p b are two adjacent links in the route R i of flow s i,m respectively. p x' and p x are two different NICs of the same switch respectively. Flow s i is sent / forwarded times at each hop, where is the link BP. When r = 0, it means at the source node. Calculate the transmission time for each time in sequence using the selected transmission time in Φ. When r > 0 and α = 0, the transmission time of the current node is obtained by adding the transmission delay, propagation delay, and the processing delay of the current node to the transmission time of the previous hop. When r > 0 and α > 0, the transmission time is equal to the time of the first forwarding of the current node plus α times the flow period. Record the time slot information and transmission time into LTS. The structure of LTS is as Figure 4 shown. The first column is the link information, and the second column is the gating information, representing the start time point, end time point, and gating state respectively. The third column represents the information of the TT flow, representing the start time point, end time point, and TT flow identifier of the TT flow sending / forwarding respectively. For real-time synchronization flows, is the start time of the time slot and the start time of sending / forwarding, is the end time of the time slot and the end time of sending / forwarding, the gating state is "01000000", the time slot information is saved in LTS, and the start time point and end time point of the real-time synchronization flow sending / forwarding are both within the range of the start time point and end time point of the time slot. The sending / forwarding time of the cyclic flow is calculated using formula (2):

[0112]

[0113] The start and end times of the time slot are and respectively, and the gating state is "00100000".

[0114] (3) Determine whether the Deadline of the real-time synchronization stream meets the requirements. The specific method is to determine whether the time when each real-time synchronization stream arrives at the destination node is greater than its period. If it is not greater, the Deadline requirement is met; otherwise, it is not met.

[0115] (4) Sort the time slots in the LTS in ascending order according to the start time of the time slot, and then judge one by one whether the end time of the previous time slot is greater than the start time of the next time slot. If it is greater, it indicates that there is a conflict; if it is less, there is no conflict; if they are equal, it means that the two time slots are adjacent, and these two time slots can be merged into one time slot.

[0116] (5) The process of scheduling the cyclic stream is shown in Algorithm 3. Starting from line 1 of the algorithm, traverse the cyclic streams in S'. Each cyclic stream is sent G k / S i,2 times within the group period, and obtain the transmission time of the current network interface according to formula (2). Lines 5 to 9 set appropriate values for the time slot s i _time_slot and the transmission time information s i _transmit_interval of the stream s. Lines 10 to 11 check the start and end times of the time slot. Since the first-frame transmission time of the stream with the smallest period within each packet is 0 in the BP, it is not allowed for the start time and end time of any time slot to be located in two adjacent BPs respectively. Starting from line 13, traverse the set I of time slots corresponding to the link. In line 14, obtain an element s i _time_slot. In line 21, calculate d and d'. d is the shortest distance allowed by s j _transmit_interval and s i _time_slot, and its value is equal to the sum of half of the lengths of the two time slots. The time slot length is equal to the time slot end time minus the time slot start time. d' is the actual distance between the midpoints of the two time slots, which is equal to the absolute value of the difference between the mid-time points of the two time slots. In lines 16 to 17, use the midpoint of the time slot to judge the distance. After the loop ends, if there is no conflict, go to lines 34 to 35 and record s j _time_slot and s i _time_slot into the LTS; if there is a conflict, then at this time s i _time_slot is the first time slot that will conflict with s j _time_slot. In line 19, merge s i _time_slot and s j _time_slot, and s i _time_slot iThe start time of the time slot of _time_slot is updated to the smaller value of the start times of the two time slots, s i The end time of the time slot of _time_slot is updated to the larger value of the end times of the two time slots. Starting from line 20, traverse s j The information of stream sending / forwarding of _time_slot. If the original scheduling is disrupted from lines 21 to 22, return false. Otherwise, the stream s i The midpoint t of the sending time period ω and Compare with the sending time of the TT stream recorded in within the group period. If s j _transmit_interval records the real-time synchronization stream. At line 24, use t ω as the midpoint for comparison. If s j _transmit_interval records the cyclic stream. At line 26, the midpoint t’ of the actual sending time within the group period is required ω for comparison. The value of t’ ω is equal to half of the sum of the sending time and the end time in s i _transmit_interval. On the premise of not disrupting the already determined scheduling, there can only be two cases: 1) The end time of s i is equal to the start time of s j ; 2) The start time of s i is greater than or equal to the start time of s j . In the second case, s i is postponed for sending, and the queuing delay δ is obtained and accumulated to t s , t ω and t e , and modify the start and end times corresponding to s i _time_slot and s i _transmit_interval. Finally, at lines 30 to 32, add s i _time_slot and s i _transmit_interval to LTS, and add all the stream sending information in to as well. Delete s j _time_slot in LTS. Return true at line 36 to indicate that the candidate solution is feasible.

[0117]

[0118]

[0119] Judgment termination conditions: (1) Judge the population iteration times. The iteration times are defaulted to 50. If the set times are reached, the GCL of each link is deduced according to the time slot information in LTS. The gating state used for the GCL entries separated by two time slots is set to "10011111", that is, queues 5 and 6 are closed and other queues are open. (2) If the iteration times are not reached, genetic operations are performed on the individuals in the population again.

[0120] Perform genetic operations on the individuals in the population: (1) Mutation operation: First, perform a mutation operation on the routing selection scheme array Φ of this individual. Add a random number to each element in Φ. The value of the random number is equal to the product of the size of R i and a random decimal number (between [0, 1]). After addition, take the modulus of the size of R i . After grouping, set the initial transmission time of the TT flow with the smallest period in each group to 0, and add a random value to the remaining elements. The added value should be within the range of [0, S i,1 -S i,2 ×M i ). If it does not meet the requirement, generate a new random number for addition until it is within the range of [0, S i,1 -S i,2 ×M i .

[0121] (2) Crossover operation: For the two selected parent individuals P1 and P2, and the offspring individual, first generate two random coefficients λ and δ between 0 and 1, and generate the routing selection array of the offspring individual Group using Algorithm 2, and finally set the transmission time of the TT flow with the smallest period in each group to 0.

[0122] The present invention provides a no-wait time-sensitive network traffic hybrid scheduling method based on time slot mapping and genetic algorithm. First, no-wait scheduling is used to schedule real-time synchronous flows. Secondly, the transmission time of cyclic flows is mapped to the unused bandwidth resources between the transmission time slots of real-time synchronous flows by using modulo base period operations. During the process of scheduling cyclic flows, adjacent gating operations are merged to shorten the GCL. The whole process combines the global search and optimization capabilities of the genetic algorithm to find the optimal solution. The optimization objectives are set to minimize the single network port GCL, minimize the total length of the GCL, minimize the cyclic flow cache time, maximize the number of packets, and maximize the number of merged gating operations. The present invention can ensure the quality of the solution while shortening the GCL, and ensure the real-time and deterministic nature of TT flow transmission.

[0123] Beneficial effects

[0124] 1. The present invention strictly differentiates traffic priorities, taking into account the TT flow period and packet length, which helps traffic flows with a wide range of cycle range values to be transmitted simultaneously in the TSN network, and has a wider applicable service range.

[0125] 2. The present invention allocates the transmission time slot length according to the packet length, reduces the waste of network bandwidth resources, further improves the bandwidth utilization rate through time slot mapping and multiplexing, and shortens the GCL.

[0126] 3. The present invention saves some intermediate calculation results of each individual during the iteration process of the genetic algorithm, and after the iteration of the genetic algorithm ends, the GCL can be directly derived according to the intermediate results.

[0127] The above-disclosed is only a preferred embodiment of a wait-free time-sensitive network traffic hybrid scheduling method of the present invention. Of course, the scope of the rights of the present invention cannot be limited thereby. Those of ordinary skill in the art can understand all or part of the processes of implementing the above embodiments, and the equivalent changes made according to the claims of the present invention still fall within the scope covered by the invention.

Claims

1. A hybrid scheduling method for wait-free time-sensitive network traffic, characterized in that It includes the following steps: S1 Input the TSN network topology information and the TT flow set; S2 Use the TSN network topology information to generate a network node adjacency linked list, calculate all feasible routes of the TT flows in the TT flow set, and obtain a set of feasible routes; S3 Generate TT flow index information based on the TT flow set; S4 Create an initial population based on the set of feasible routes and the TT flow index information; S5 Evaluate the individuals in the initial population and select the next-generation initial population; S6 Determine whether the evaluation process terminates. If it terminates, output the gating list. If it does not terminate, perform genetic operations on the next-generation initial population and then return to step S5; The creating of the initial population based on the set of feasible routes and the TT flow index information includes: S41 Set the length of the TT flow set to obtain a set length; S42 Initialize a genetic algorithm individual composed of a routing array and an initial transmission time array with the set length; S43 Based on the TT flow index information, randomly select a route for each TT flow from the set of feasible routes to obtain a route index value, and save the route index value at the position corresponding to each TT flow in the initial transmission time array of the initialized genetic algorithm individual; S44 Group all TT flows using the breadth-first search algorithm, and sort them in ascending order of the period of each TT flow within each group; S45 Set the transmission time of the first TT flow in each group to 0 and save it at the corresponding position in the routing array of the initialized genetic algorithm individual. Randomly set a transmission time for the other TT flows in each group and save it at the corresponding position in the routing array of the initialized genetic algorithm individual to obtain a population individual; S46 Repeat steps S42 to S45 until 100 such population individuals are generated to obtain the initial population.

2. The no-wait time-sensitive network traffic hybrid scheduling method according to claim 1, wherein the TSN network topology information includes network nodes and a link set; the network nodes include TSN switch nodes and end-system nodes; the TSN switch nodes include switch processing delays and multiple network interfaces; the end-system nodes include end-system processing delays and 1 network interface; each link in the link set connects two network interfaces, and there are two logical links in opposite directions between the two connected nodes.

3. The no-wait time-sensitive network traffic hybrid scheduling method according to claim 2, wherein the using of the TSN network topology information to generate a network node adjacency linked list, calculate all feasible routes of the TT flows in the TT flow set, and obtain a set of feasible routes includes: S21 Record the adjacent nodes of the TSN network topology information to obtain a network node adjacency linked list; S22 Use the depth-first search algorithm to start searching from the source node of the TT flow set in the network node adjacency linked list, and save all the passed nodes in a path list; S23 During the depth-first search process, when the destination node of the TT flow set is encountered, save the path list and backtrack to the previous node; After S24 traverses the adjacency list of the network nodes, all routes from the source node to the destination node are saved in the path list. Thus, all feasible route information of the TT flow is obtained, and a set of feasible routes is obtained.

4. The no-wait time-sensitive network traffic hybrid scheduling method according to claim 3, wherein generating TT flow index information based on the set of TT flows includes: S31 Initialize the index value; S32 Traverse each TT flow in the set of TT flows to obtain multiple TT flow identifiers; S33 Record the mapping relationship between the TT flow identifier and the initialized index value in the position index; S34 Record the mapping relationship between the incremented index value by 1 and the next TT flow identifier in the position index; S35 Repeat step S34 until the mapping relationship between all TT flow identifiers and their corresponding index values is recorded to obtain TT flow index information.

5. The no-wait time-sensitive network traffic hybrid scheduling method according to claim 4, wherein evaluating individuals in the initial population and selecting the next-generation initial population includes: S51 Calculate the base period of each link in the link set. Define the base period as the least common multiple of the periods of all real-time synchronization flows passing through the current link. If only cyclic flows pass through the current link, the link base period is the period of the cyclic flow with the smallest period among the cyclic flows passing through the current link; S52 Calculate the transmission time slots of the real-time synchronization flows according to the route selection and the initial transmission time array of the individuals in the initial population, and save the transmission time slots in the correspondence between the link and the time slot; S53 Determine whether the arrival time of the real-time synchronization flow at the destination node meets the deadline requirement; S54 Determine whether there are conflicts in the transmission time slots in the correspondence between the link and the time slot; S55 Try to schedule cyclic flows using the time slot mapping and multiplexing strategy. During the scheduling process, determine whether the existing scheduling is disrupted. If the existing scheduling is disrupted, reject the current individual, otherwise accept the current individual; S56 Iterate steps S51 to S55, and select some individuals from the accepted individuals as the next-generation initial population.

6. The no-wait time-sensitive network traffic hybrid scheduling method according to claim 5, wherein determining whether the judgment and evaluation process terminates. If it terminates, output the gating list. If it does not terminate, perform genetic operations on the next-generation initial population and then return to step S5, including: Determine whether the number of iterations reaches the set number. If it reaches the set number, deduce the gating list of all links according to the information in the correspondence between the link and the time slot. If it does not reach the set number, perform genetic operations on the next-generation initial population and then return to step S5.