[ detailed description ] of the invention
The present invention will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present invention more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
For the understanding of the embodiments, the description of message scheduling in the prior art is provided herein, and there are mainly two modes of LDN scheduling and CQF scheduling in the prior art, where the CQF scheduling model is shown in fig. 1, and the global time is divided into equal-length time slots, i.e. periods, and the following rules are required for data transmission:
The time slot of the message transmitted by the upstream node is the same as the time slot of the message received by the downstream neighbor node;
the message received by each node in a certain time slot is necessarily transmitted in the next time slot;
the network nodes are time synchronized, and the link delay is less than 1 period.
The LDN scheduling method is extended on the basis of CQFs in order to support large-scale deterministic networks. In the LDN model, as shown in fig. 2, the global time is still divided into equal-length time slots, i.e. periods, and the data transmission needs to follow the following rules:
all data packets sent by the upstream node in the period X are received in the period Y of the downstream node and sent out in the period Y+1 to form a period map X- (Y+1);
when the upstream node sends, the sending period X is marked in the message, and after the downstream node receives the message, the period Y+1 is marked in the message and sent out similarly to label switching.
The network node clock is synchronous, the period is equal, and the invention is marked as T.
When the upstream node continuously transmits the data stream to the downstream node in the period X, the downstream node continuously receives the data stream in a period of time and is completely received in the period Y of the downstream node.
In addition, the technical features of the embodiments of the present invention described below may be combined with each other as long as they do not collide with each other.
Example 1:
the embodiment 1 of the invention provides a message scheduling method, as shown in fig. 3, including:
in step 201, when a message is sent, a preset sending period and an actual sending period of the message are carried in the message.
The preset sending period of the carrying message may be an exact time period, or may be carried in the message in a period number, a period mark or the like, so as to reduce the bit size occupied by the period in the message.
The preset sending period is obtained by the skilled person according to the sending period of the data stream to which the message belongs and the analysis of the message forwarding path. A specific implementation is provided herein as follows: when a source node transmits a message, the actual transmission period of the message is taken as a preset transmission period to be carried in the message, and a preset transmission period mapping relation of each node is established by a person skilled in the art according to joint analysis and formulation of forwarding capacity of each node and transmission rate of a sub-link or by a controller or a network self-learning mode. And according to the preset period mapping relation, mapping sequentially to obtain the preset sending period of the message at each node.
Wherein a data stream is sent by one or more message bearers.
In step 202, when a message is received, it is determined whether the received message is a delayed message according to a preset transmission period and an actual transmission period of the message.
The delayed message is generally caused by inconsistent forwarding capability of the upstream and downstream nodes, unexpected delay of the network or retransmission of the message, so that the message cannot be sent at a preset time or arrives at the preset time.
In step 203, if the message is a delayed message, fault-tolerant forwarding is performed on the message after the message is received.
The fault-tolerant forwarding is a distinguishing expression for distinguishing from a normal message forwarding process, and the fault-tolerant forwarding is still a message forwarding process.
One implementation manner of the fault-tolerant forwarding is as follows: and dispatching and forwarding the delay message in the first period after the message is received.
The embodiment of the invention is used for judging whether the message is a delay message or not when the message is received by carrying the preset sending period and the actual sending period in the message, and carrying out fault-tolerant forwarding on the delay message after the receiving is finished so as to realize fault-tolerant scheduling of the message, ensure normal transmission of data streams and ensure end-to-end deterministic scheduling.
The delay of the message generally includes a sending delay and a receiving delay, and in the above embodiment, one implementation of determining whether the received message is a delayed message according to the preset sending period of the message is:
comparing a preset sending period carried in a message with an actual sending period, if the preset sending period and the actual sending period are different, the message is considered to be a delayed message, the judging mode is to judge according to the sending period of the message, although the judging mode can identify the message with delayed sending, but cannot accurately judge the condition of delayed receiving, in the actual condition, there may be no delay of the sending period of the message when the message is sent, but the message receiving delay is caused by the delay in the link transmission process, and the fault-tolerant scheduling is required to be carried out on the message, so that, in combination with the above embodiment, the following preferred embodiment exists, namely, judging whether the received message is the delayed message according to the preset sending period and the actual sending period of the message, as shown in fig. 4, specifically including:
in step 301, if the preset sending period of the message is different from the actual sending period, the message is a delay message.
In step 302, if not, a preset arrival period of the message at the node is obtained according to a preset period mapping relationship and a preset transmission period carried in the message.
In step 303, it is determined whether the received message is a delayed message according to the preset arrival period of the message.
The preset period mapping relation is formulated by common analysis of forwarding capacity of each node and transmission rate of a sub-link by a person skilled in the art, or is established by a controller or a network self-learning mode. In practical situations, although there is a transmission delay in a packet, due to different transmission rates of links, the packet can be received in a preset arrival period, that is, the packet has only a transmission delay but no reception delay, which is also commonly referred to as packet jitter. The preferred embodiment also ensures the accuracy of the delayed arrival judgment of the message by comparing the preset arrival period of the message with the actual arrival period of the message so as to ensure the correct forwarding of the subsequent message Wen Rongcuo. In the preferred embodiment, the preset arrival period of the next node is obtained through the preset sending period of the previous node, so that the preset arrival period of the message is associated with the passed node, and a precise preset arrival period is obtained, and the accuracy of the delayed arrival judgment of the message is further ensured.
In practical situations, forwarding of the deterministic data stream is usually implemented in a cyclic queue, that is, each node required for forwarding the data stream keeps clock synchronization, and uses the same clock length as a period value, and when a message is transmitted, the period carried in the message is obtained by circularly numbering a time line with the period value as an interval, for example, with T as the period value, and the time line of each node is circularly numbered with n periods, which is expressed as: in the period of T to nT, there are n periods, each period having a length of T, the number of periods being sequentially 1 to n, and in the period of nt+1 to 2nT there are also n periods, each period having a length of T as well, the number of periods being sequentially 1 to n as well.
In the case of cycle number circulation, how to determine the delayed sending of the message, with respect to this problem, in combination with the foregoing embodiment, there are the following preferred embodiments, where determining, according to the preset arrival cycle of the message, whether the received message is a delayed message, as shown in fig. 5, specifically includes:
in step 401, when the actual arrival period of the message is less than or equal to the preset arrival period, the message is not a delay message.
In step 402, when the actual arrival period of the message is greater than the preset arrival period, a judgment is made according to the actual arrival period of the first message of the data stream to which the message belongs, and if the actual arrival period of the first message is greater than the preset arrival period and the difference between the actual arrival period of the first message and the preset arrival period is greater than or equal to the preset difference, the message is not a delay message.
In step 403, otherwise, the message is a delay message.
When the period is not numbered circularly, the effect of judging the delayed transmission can be achieved only by judging whether the actual arrival period is smaller than or equal to the preset arrival period.
The preset difference is analyzed by a person skilled in the art according to the cycle number.
However, the cycle number does not increase infinitely due to the cycle number, and when the maximum number of cycles is reached, the timeline will then return to the beginning of the cycle. In this embodiment, the actual arrival period of the first packet of the data stream is taken into consideration, and the overall time period of arrival of the data stream is constructed by the currently received packet and the first packet of the data stream, and when the overall time period is far greater than the preset arrival period, the packet is considered not to be a delay packet. Thereby realizing message delay judgment under the periodic cycle condition.
In the above embodiment, the first transmission period after the end of the packet reception of the delayed packet is forwarded in a fault-tolerant manner, which can maximally reduce the transmission delay of the data stream, but in practical situations, the output interface of the node usually has a bandwidth limitation in a single transmission period, so that the packet cannot be forwarded without limitation. In this case, in combination with the above embodiment, there is a preferred embodiment, that is, after the end of receiving the packet, performing fault-tolerant forwarding on the packet, where the forwarding time of the packet is further determined according to the bandwidth capability of the node, specifically including:
if the reserved bandwidth of the corresponding outgoing interface of the node in the first sending period is larger than the total bandwidth of all messages waiting for normal forwarding, after forwarding all the messages waiting for normal forwarding, forwarding the messages waiting for fault-tolerant forwarding in the first sending period in sequence according to the receiving sequence of the messages waiting for fault-tolerant forwarding until the reserved bandwidth of the corresponding outgoing interface is exhausted, or forwarding all the messages waiting for fault-tolerant forwarding.
If the message waiting for fault-tolerant forwarding still exists after the first sending period, taking the next sending period of the first sending period as a new first sending period, and carrying out fault-tolerant forwarding on the message waiting for fault-tolerant forwarding in the new first sending period, wherein when the fault-tolerant forwarding is carried out for the first time, the first sending period after the end of receiving the message is taken as the first sending period.
The term "first" is not specifically defined, and is used merely for convenience in describing different individuals within a class of objects and should not be construed as being in order or otherwise with a specifically defined meaning.
The preferred embodiment determines the number of the messages capable of fault-tolerant forwarding according to the reserved bandwidth of the outgoing interface of the node and forwards the messages after the receiving is finished. And forwarding the message which is sent by the last node in a delayed manner as soon as possible within the bandwidth tolerance range, thereby ensuring the normal forwarding of the message and reducing the end-to-end time delay. Meanwhile, in the preferred embodiment, after the priority scheduling of the normal message is finished, the delayed message is scheduled and forwarded, so that when the message with jitter is received, the forwarding of the normal message is preferentially ensured, and then the forwarding of the delayed message is performed according to the forwarding capability of the node.
In practical situations, the time delay that can be reduced when the message is forwarded in a fault-tolerant manner still depends on the arrival period of the message, when the message is delayed for too long, the time delay from end to end still cannot be maintained in a normal range even if the message is forwarded in a fault-tolerant manner, and for this situation, in combination with the above embodiment, the following implementation manners are provided, which specifically include:
And presetting a unified delay tolerance value for all messages in a single data stream according to network conditions and requirements by a person skilled in the art, and not forwarding the messages when the delay period of the messages exceeds the delay tolerance value, otherwise, performing fault-tolerant forwarding on the messages.
There is also an implementation manner that the delay tolerance value can also be preset by a person skilled in the art according to the network condition and the requirement for the sub-link between each segment of adjacent nodes, when the message is received, if the delay of the message exceeds the corresponding delay tolerance value, the message is not forwarded, otherwise, the message is forwarded in a fault-tolerant manner.
The above two implementation manners are mainly implemented through judging the delay tolerance value of a single node, but in the actual situation, when the delay time of a message in the single node is shorter, but the number of nodes with delay is larger, the transmission efficiency of the message is affected, the end-to-end delay is increased, and in combination with the above embodiment, there is the following preferred embodiment for the problem, namely, after the message is received, the message is forwarded in a fault-tolerant manner, and the method further includes:
the message carries a delay tolerance value, and the delay tolerance value is reduced according to the number of periods delayed in the fault-tolerant forwarding every time the fault-tolerant forwarding is carried out, until the message reaches a destination node or until the delay tolerance value carried in the message is smaller than or equal to a preset minimum value, the message is not forwarded; the source node carries an initial delay tolerance value in the message.
The initial delay tolerance value and the preset minimum value are obtained by common analysis by a person skilled in the art according to the data stream to which the message belongs and the end-to-end delay requirement in the network.
When message jitter occurs, that is, when a message is delayed to be sent at the previous node, but when the message is sent at the current node in a preset sending period, the delay tolerance value is determined according to the number of delayed periods in fault-tolerant forwarding, and when the message is sent at the preset sending period, no delayed period exists, so that the delay tolerance value is not changed.
According to the preferred embodiment, the time delay tolerance value is carried in the message, and is processed when the message is forwarded each time, so that the time delay tolerance value in the message changes in real time along with the time of delay forwarding and the period of delay, the whole delay in the message transmission process is taken into consideration, the fault-tolerant scheduling of the message is more accurate, and the end-to-end time delay is ensured not to exceed the range.
In practical situations, there is not only delay and jitter of a message, but also retransmission of the message, and for this problem, in combination with the above embodiment, there is the following preferred embodiment, that is, when a node needs to retransmit the message, the method further includes:
And determining a new delay tolerance value according to the delay tolerance value carried in the message sent last time and the overtime period of the message, wherein the new delay tolerance value is carried in the retransmitted message and is used for fault-tolerant forwarding judgment in the subsequent forwarding process.
In the embodiment, the time delay tolerance value of the message is updated during the retransmission of the message, so that the fault-tolerant scheduling of the message can be realized during the retransmission of the message.
To facilitate scheduling, there are also the following preferred implementations:
and each forwarding node is provided with a fault-tolerant receiving queue and a fault-tolerant sending queue, and the fault-tolerant receiving queues and the fault-tolerant sending queues are used for realizing the dispatch forwarding of the delay messages.
When a delay message is received, the message is added into a fault-tolerant receiving queue, and the message is moved from the fault-tolerant receiving queue to the fault-tolerant transmitting queue in the next transmitting period of the received delay message so as to perform fault-tolerant forwarding on the message.
The realization mode realizes the fault-tolerant forwarding scheduling of the message through the fault-tolerant receiving queue and the fault-tolerant sending queue, thereby ensuring the orderly forwarding of the message.
In order to further ensure the stability of message forwarding, the message further includes one or more of a source address, a destination address, a sending period, a size of a data stream to which the message belongs, and a deterministic path.
The message is carried with the information so as to ensure the stable transmission of the message.
Before forwarding the message, the method further comprises the following steps:
the clock synchronization of each node required in the configuration forwarding process; basic properties of the data stream are determined. Determining a delay tolerance value of each message in the data stream; and calculating a deterministic path of the data flow according to the source address and the destination address of the data flow, and forwarding the message carrying the data flow.
The basic attribute of the data stream comprises the source address, the destination address, the sending period and the size of the data stream of the message which are equal to the information carried in the message or required to be used for forwarding the message, and the delay tolerance value of each message in the data stream is obtained by decomposing the delay upper limit of the data stream.
One implementation way of calculating the deterministic path through the source address and the destination address of the data stream is as follows: and (3) formulating a corresponding objective function and constraint functions, and planning and calculating through a mathematical model to obtain a deterministic path, wherein the deterministic path of the data flow is the deterministic path of each message used for bearing the data flow.
Example 2:
the invention is based on the method described in embodiment 1, and combines specific application scenes, and the implementation process in the characteristic scene of the invention is described by means of technical expression in the relevant scene.
In this embodiment, a link shown in fig. 6 in a CQF (cyclic queue forwarding, cyclic Queuing and Forwarding) scheduling scenario is taken as an example, where a node a is a source node for forwarding a message, and a node D is a destination node for forwarding a message.
Before forwarding the message, i.e. in the initialization phase of the network, the following steps are executed, as shown in fig. 7, and specifically include:
in step 501, clock synchronization of each network node is configured.
In step 502, a data stream f is determined i Basic attributes of (1) including data stream f i Source address, destination address, transmission period, size and upper delay limit, and calculates data flow f in single period T i Transmitted data traffic f i .band。
In step 503, the path of the data stream is determined and the upper delay bound f is resolved i Labency. And the controller calculates a deterministic path according to the source address, the destination address and the corresponding constraint parameters of the data stream, and decomposes the upper limit of the time delay to obtain a time delay tolerance value. Decomposing the upper delay of the data stream into an expected delay f according to a deterministic path i Latency. Exp and delay tolerance value f i And (2) two parts of latency, wherein the time delay tolerance value obtained by decomposition is an initial time delay tolerance value.
In step 504, the network node attributes are set and the controller determines the bandwidth that each node needs to reserve for deterministic forwarding and issues. Each CQF queue, fault-tolerant receive queue, and fault-tolerant transmit queue of the network node is initialized. Wherein, each CQF queue is a queue in the original CQF scheduling and is used for normal message forwarding scheduling.
In step 505, a periodic mapping relationship between network nodes is established. And establishing a periodic mapping relation by a controller or a network self-learning mode.
And after the network initialization is finished, forwarding the message of the data stream. For a source node, before a message of a data stream is sent, a message mark (S, C) and a delay tolerance value f are carried in the message i And (3) the latency.et, wherein the delay tolerance value carried by the source node is an initial delay tolerance value, the S mark and the C mark adopt the same value, the message is put into a CQF queue with corresponding numbers, and the message is waited for the arrival of the forwarding time. In the message Wen Biaoji (S, C), S is a preset sending period flag of the corresponding message, and C is an actual sending period flag of the corresponding message.
In each period, each node needs to schedule the transmission of the message to each CQF queue, fault-tolerant receive queue and fault-tolerant transmit queue under the node, as shown in fig. 8, and specifically includes:
in step 601, the bandwidth accumulation value BW is initialized to 0, and the process proceeds to step 602.
In step 602, sequentially accessing the messages in the CQF transmission queue, and accumulating the bandwidth i.band required for transmitting the message i into BW for each access to one message i, i.e. letting bw=bw+i.band; step 603 is entered.
In step 603, it is determined whether BW is equal to or less than v.band, which is the bandwidth reserved by the corresponding outgoing interface of the node, and if BW is equal to or less than v.band, step 604 is entered, otherwise step 606 is entered.
In step 604, the accessed message i is normally sent in the present sending period; the normal sending is specifically to remove the message from the CQF sending queue and send the message directly; step 605 is entered.
In step 605, it is determined whether all the messages in the CQF transmission queue have been transmitted normally, if so, step 607 is entered to perform fault-tolerant scheduling of the messages in the fault-tolerant transmission queue; otherwise, go to step 602 to continue to access the messages in the CQF send queue.
In step 606, the transmission of the message i is not performed, and the C in the (S, C) flag in all the messages in the CQF transmission queue is marked as a reserved value, and is put into the fault-tolerant transmission queue, waiting for the scheduling transmission in the next week, and ending the scheduling transmission flow of the present period.
In step 607, sequentially accessing the messages in the fault-tolerant transmission queue, and accumulating the bandwidth i.band required for transmitting the message i into BW for each message i access, i.e. letting bw=bw+i.band; step 608 is entered.
In step 608, it is determined whether BW is equal to or less than v.band, which is the bandwidth reserved by the corresponding outgoing interface of the node, and if BW is equal to or less than v.band, step 609 is entered; otherwise, step 610 is entered.
In step 609, in the present transmission period, the accessed message i is marked as C in the (S, C) mark in the message to be the current period number for taking the remainder of N, and the message is removed from the fault-tolerant transmission queue and directly transmitted; wherein, N is a fixed value set by a person skilled in the art according to the requirement of the message sending period, and is used for numbering the period in a circulating way; step 610 is entered.
In step 610, it is determined whether all the messages in the fault-tolerant transmission queue are transmitted, and if all the messages are transmitted, the scheduled transmission process of the present period is ended; otherwise, go to step 607 to continue to access the message in the fault tolerant send queue.
In step 611, the transmission of the message i and the subsequent messages in the fault-tolerant transmission queue is not performed, the scheduling transmission flow of the present period is ended, and the message is reserved to the next transmission period and then is scheduled.
In each period, each node also needs to perform packet receiving scheduling on each CQF queue, fault-tolerant receiving queue and fault-tolerant sending queue under the node, as shown in fig. 9, and specifically includes:
In step 701, according to the cycle mapping relationship of the interface, the S label of the message label (S, C) in the received message is mapped to obtain a preset sending cycle S ', and then a preset arrival cycle S' -1 is obtained.
In step 702, the marks (S, C) carried by the messages are checked, and the arrival period t of the first message with the same S mark in each message is recorded f 。
In step 703, it is determined whether the message is a delayed message according to the arrival period of the message. The judging method of the sent message specifically includes that if S and C in the message mark are different, the message is a delay message, otherwise, judging is carried out according to the arrival period of the message, specifically including: when the arrival period t of the message curr Less than S' and t curr Greater than t f Or t curr Greater than S' and (t) f -S') is equal to or greater than a preset difference, the message is not a delayed message, otherwise the message is a delayed message. If the message is a delay message, go to step 704; otherwise, step 706 is entered.
In step 704, the delay tolerant value is modified. Counting the number of cycles of delay, when t curr When the delay is greater than S', the cycle number of the delay is t curr - (S' -1), when t curr When the delay is less than S', the cycle number of the delay is t curr +N- (S' -1), reducing the delay tolerance value by the cycle number of the delay, judging whether the delay tolerance value is smaller than or equal to a preset minimum value, if the delay tolerance value is smaller than or equal to the preset minimum value, entering step 707, otherwise, entering step 705; wherein N is a fixed value set by a person skilled in the art according to the requirement of the message sending period, and is used for numbering the period in a circulating way.
In step 705, the message label is replaced, the corresponding (S, C) label is replaced with (S ', X'), X 'is a reserved value, X' is filled in when the message is to be sent, and is placed in a fault-tolerant receiving queue, waiting for the sending period to arrive and performing fault-tolerant forwarding.
In step 706, the message label is replaced, the corresponding message label is modified to (S ', S'), and placed in the corresponding CQF queue, waiting for normal scheduled transmission of the message.
In step 707, the transmission fails, the message is discarded, the message is not forwarded any more, and the transmission scheduling of the message is ended.
In the receiving and transmitting scheduling of the messages of the nodes, the role conversion of each CQF queue is also involved, and the method specifically comprises the following steps:
when the cycle is entered from the previous cycle, the CQF queue used for receiving the message in the previous cycle is converted into a CQF sending queue, and other CQF queues are used as receiving queues.
Fig. 10 is a schematic diagram of an intermediate node, such as CQF queues, fault-tolerant receive queues, and fault-tolerant receive queues in the packet sending and receiving process of the node B in fig. 10, where the queue 1, the queue 2, and the queue 3 are CQF queues, and there is a fault-tolerant receive queue and a fault-tolerant send queue.
In the first period (i.e., t period), among the 3 CQF message queues corresponding to the node B output ports, the queue 1 and the queue 2 are message receiving queues, and the queue 3 is a message sending queue. And in the corresponding 2 fault-tolerant queues, the fault-tolerant message receiving queues store node B judgment delay messages, such as delay messages M1 and M2, and the fault-tolerant message sending queues are empty.
In the second period (i.e. t+1 period), among the 3 CQF message queues corresponding to the node B output ports, the queue 2 and the queue 3 are message receiving queues, and the queue 1 is a message sending queue. I.e. queue 1 is converted from the last cycle (t cycle) of the receive queue to the transmit queue and queue 3 is converted from the message transmit queue to the message receive queue. The error message receiving queue stores the abnormal message M3 received in the current period. M1 and M2 messages received in a previous period (t period) of the error-tolerant message receiving queue are linked into the error-tolerant message sending queue and wait for dispatch forwarding.
In the third period (i.e. t+2 period), among the 3 CQF message queues corresponding to the node B output ports, the queue 1 and the queue 3 are message receiving queues, and the queue 2 is a message sending queue. I.e. queue 2 is converted from the receive queue of the previous cycle (t +1 cycle) to the transmit queue, and queue 1 is converted from the message transmit queue to the message receive queue. In this period, no abnormal message is received, and the fault-tolerant message receiving queue is empty. M3 messages received in the previous period (t+1 period) of the error-tolerant message receiving queue are linked to the error-tolerant message sending queue, and waiting for scheduling and forwarding.
When the source node generates timeout retransmission of the message, the embodiment further includes: the source node is based on f in the message i The latency et value and the message timeout time mark a new delay tolerance value, the new delay tolerance value is f i The value after the message timeout time is subtracted from latency. And generating message marks (S, C) by taking the actual sending period when the source node retransmits the message as S and C, and carrying the message marks in the message. And the node A marks a new delay tolerance value according to the delay tolerance value carried in the last message and the message overtime time. Typically, this is: the delay tolerance value minus the number of message timeout periods. And placing the message into a corresponding CQF queue to wait for the arrival of the message retransmission time.
The fault-tolerant scheduling effect according to the embodiment of the present invention will be demonstrated by the transmission process of the data stream in fig. 6, specifically, as shown in fig. 11, the data stream f A From node a via node B to node C, data stream f A Carried by a plurality of messages. Node a, node B and node C take the same period value T and maintain clock synchronization.
The cycle number of each cycle of the node A is t A ,t A +1,t A +2,…,t A +n; the period numbers of the periods of the node B are t respectively B ,t B +1,t B +2,…,t B +n; the period number of each period of the node C is t C ,t C +1,t C +2,…,t C +n。
Data flow f of node a A Data flow f from node B to node C, node A A At period number t A Is sent out in a period of (C) and the corresponding message mark (S, C) is (X) A ,X A ) The cycle numbers of all nodes are sequentially numbered in turn, and the message marks are circularly numbered according to the cycle numbers, namely the message marks are made to be the remainder of the cycle numbers for N, namely X A =t A mod (N), N being the maximum value of the numbers in the cyclic period numbers.
Data stream f A Transmission time range at node aIs T A I.e., a rectangular box filled with diagonal lines at node a in fig. 11. T (T) A A period of less than one period T, the period number of which is T A In general, the transmission time range of the node a is T A Is a data stream f of (1) A The carried message is marked as X A ,X A The method can be carried in a message label, VLAN ID, reserved byte or other positions, and the method does not limit the positions of the message marks in the message.
The invention adopts a mode of two layers of message marks (S, C) to identify the sending period of the message, wherein the S mark represents the preset sending period sent by the node, namely the mark corresponding to the expected period mapping relation, for example, the sending period mapping relation between the node A and the node B is X A →X B Wherein X is A Is a preset sending periodic mark, X, sent by a message from a node A B Is a preset sending periodic marker sent by the node B. The C-tag represents the actual sending cycle tag when the message is actually sent out. Normally, the S flag and the C flag are the same value, and when an abnormal condition such as a delay occurs, a difference may occur between the two.
In data stream f A For example, the source node a is sending out a bearer data flow f A When the message of (2) is carried with a mark (X A ,X A ). As shown in fig. 11, when node a is at T A When the data stream is continuously transmitted to the node B in the time range, the node B receives the data stream f due to network delay in the transmission process A In the time range T A ' time period
Node B at T A Continuously receiving data stream f in' time range A . According to the preset period mapping relation X of the A node and the B node A →X B Mapping to obtain the current X A At t A When X is B Period number t B +2, i.e. data stream f A It is expected that the period number should be t B And (4) finishing the receiving in the period of +1. Whereas in practice the data stream f A At t B The +1 cycle is received and a portion of the message is received at t B And is received within +2 cycles. I.e. node B receivesIs marked as (X) A ,X A ) Is a data stream f of (1) A According to the expected periodic mapping relation X A →X B Is divided into two parts, one part is a normally arrived message, i.e. the message is numbered t in the period B The +1 cycle and the previous cycle are received and preset at t B A message sent in a +2 cycle; another part of the messages being numbered t in the period B Received in +2 cycle, the transmission cycle t cannot be set to be the preset transmission cycle t B Transmission in +2 cycle, so in cycle t B +3 or period t B After +3, at period t B And carrying out fault-tolerant forwarding on the message received in the +2 cycle.
If the time delay tolerance value in the message and the preset bandwidth of the output interface of the node B are judged to be enabled to be t B Messages received in the +2 cycle are at t B Being forwarded for +3 cycles, node B is transmitting data stream f A When the message of (2) arrives normally, i.e. at t B Message labels in +1 received messages are replaced with (X B ,X B ) And at t B Forwarding in +2 cycle; will delay the message, i.e. at t B Message labels in +2 received messages are replaced by (X B ,X B ') and at t B And forwarding in +3 cycles. Corresponding X B =(t B +2) mod (N), and X B ′=(t B +3)mod(N)。
As shown in fig. 11, node C continues to receive data stream f A In the time range T B ’。T B ' cycle number t falling on node C C +4 and t C In +5. Wherein node C receives a signal marked (X B ,X B ) The corresponding period number of the message is t C +4 and t C +5, receive label (X) B ,X B The period number corresponding to the message of') is t C +5. The expected periodic mapping relation of the corresponding interface received by the node C from the node B is X B →X C Wherein X is C =(t C +6) mod (N). I.e. according to the mapping, node C should be at t C After receiving the message in +5 cycle, and at t C And forwarding the message in a +6 period. Since the mark is (X B ,X B ) The messages and labels of (1) are (X) B ,X B ') messages are all at t C After the +5 cycle of receiving the message, both messages can be received at t C And carrying out normal forwarding of the message in a +6 period.
I.e. in data stream f A In the process of being transmitted from node A to node C via node B, data flow f A Delay occurs in the transmission process from the node A to the node B, but after the delayed message is subjected to fault-tolerant forwarding, when the delayed message reaches the node C, the delayed message can still be forwarded in the same transmission period together with the normally arrived message, so that the time delay in the transmission process of the message can be subjected to fault tolerance, and the time delay from end to end is ensured not to exceed the normal range through the time delay tolerance value.
Example 3:
fig. 12 is a schematic diagram of a packet scheduling system according to an embodiment of the present invention, where the packet scheduling system includes an upstream node and a downstream node, and the method includes:
when an upstream node sends a message, the message carries a preset sending period and an actual sending period of the message;
when receiving a message, a downstream node judges whether the received message is a delay message according to a preset sending period and an actual sending period of the message; if the message is a delay message, performing fault-tolerant forwarding on the message after the message is received.
In order to implement forwarding scheduling of the message, the message scheduling system may be further divided into the following modules according to functions, as shown in fig. 13, and specifically includes a clock synchronization module, a preprocessing module, and a timing processing module, where:
the clock synchronization module is used for performing clock synchronization or frequency synchronization on each node.
The preprocessing module is used for configuring the network node before forwarding the message and comprises a data stream attribute setting module, a network node setting module and a period mapping relation generating module. The data stream attribute setting module is used for finishing setting of data stream attributes, including source address, destination address, period, size, deterministic path, expected time delay from end to end, etc., and setting time delay tolerance value of message carrying data stream. The network node setting module is used for determining the reserved bandwidth of the network node corresponding to the output interface, and establishing a CQF queue, a fault-tolerant receiving queue, a fault-tolerant sending queue and the like at the initial stage. The periodic mapping relation generating module is used for establishing a periodic mapping table of the connected interfaces between the network nodes through a controller or a self-learning mode.
The timing processing module is used for processing role transformation of the CQF queue, message migration from the fault-tolerant receiving queue to the fault-tolerant sending queue, delay tolerant value processing in the message, message overtime notification of the source node and the like in each period, and comprises a sending processing module and a receiving processing module. The sending processing module is used for dispatching and sending the messages in the CQF queue and the fault-tolerant sending queue according to the reserved flow of the outgoing interface in each period, and the receiving processing module is used for judging the delayed sending of the received messages in each period and placing the delayed messages in the fault-tolerant receiving queue for waiting to be dispatched.
Example 4:
fig. 14 is a schematic architecture diagram of a fault-tolerant processing device for deterministic scheduling of messages according to an embodiment of the present invention. The fault-tolerant processing device for deterministic scheduling of messages in this embodiment includes one or more processors 21 and a memory 22. In fig. 14, a processor 21 is taken as an example.
The processor 21 and the memory 22 may be connected by a bus or otherwise, which is illustrated in fig. 14 as a bus connection.
The memory 22 is used as a non-volatile computer readable storage medium for storing non-volatile software programs and non-volatile computer executable programs, such as the fault-tolerant processing method of deterministic scheduling of messages in embodiment 1. The processor 21 performs a fault tolerant processing method of deterministic scheduling of messages by running non-volatile software programs and instructions stored in the memory 22.
The memory 22 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, memory 22 may optionally include memory located remotely from processor 21, which may be connected to processor 21 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The program instructions/modules are stored in the memory 22, which when executed by the one or more processors 21, perform the fault-tolerant processing method of deterministic scheduling of messages in embodiment 1 described above, e.g., performing the various steps shown in fig. 3-5 and fig. 7-9 described above.
It should be noted that, because the content of information interaction and execution process between modules and units in the above-mentioned device and system is based on the same concept as the processing method embodiment of the present invention, specific content may be referred to the description in the method embodiment of the present invention, and will not be repeated here.
Those of ordinary skill in the art will appreciate that all or a portion of the steps in the various methods of the embodiments may be implemented by a program that instructs associated hardware, the program may be stored on a computer readable storage medium, the storage medium may include: read Only Memory (ROM), random access Memory (RAM, random Access Memory), magnetic or optical disk, and the like.
The foregoing description of the preferred embodiments of the invention is not intended to be limiting, but rather is intended to cover all modifications, equivalents, and alternatives falling within the spirit and principles of the invention.