Message processing method and device

文档序号:1314620 发布日期:2020-07-10 浏览:12次 中文

阅读说明:本技术 报文处理方法和装置 (Message processing method and device ) 是由 李广鹏 于德雷 刘冰洋 于 2019-01-03 设计创作,主要内容包括:本申请提供了一种报文处理方法和装置,能够避免因底层时延异常导致的异常报文对不定目标流的连锁影响。该方法包括:第一设备接收第二设备发送的第一报文,第一报文携带第一标签,第一标签是根据发送第一报文时第二设备的周期确定的;第一设备根据第一标签确定第一报文是否为正常报文;若确定第一报文为正常报文,第一设备根据第一报文确定第二报文,第二报文携带第二标签;第一设备在第一周期向第三设备发送第二报文,第二标签是根据第一周期确定的。(The application provides a message processing method and a message processing device, which can avoid the linkage influence of abnormal messages on an uncertain target stream caused by abnormal time delay of a bottom layer. The method comprises the following steps: the method comprises the steps that first equipment receives a first message sent by second equipment, wherein the first message carries a first label, and the first label is determined according to the period of the second equipment when the first message is sent; the first equipment determines whether the first message is a normal message or not according to the first label; if the first message is determined to be a normal message, the first equipment determines a second message according to the first message, and the second message carries a second label; the first device sends a second message to the third device at a first period, and the second label is determined according to the first period.)

1. A message processing method is characterized by comprising the following steps:

a first device receives a first message sent by a second device, wherein the first message carries a first label, and the first label is determined according to the period of the second device when the first message is sent;

the first equipment determines whether the first message is a normal message or not according to the first label;

if the first message is determined to be a normal message, the first equipment determines a second message according to the first message, and the second message carries a second label;

and the first equipment sends the second message to third equipment in a first period, and the second label is determined according to the first period.

2. The method of claim 1, wherein the determining, by the first device, whether the first packet is a normal packet according to the first label comprises:

the first device determines whether the first packet is a normal packet according to the first tag and a second cycle of the first device, where the second cycle is a cycle in which the first device receives the first packet, or a cycle that is temporally after and temporally before the cycle in which the first device receives the first packet.

3. The method of claim 2, wherein the period value indicated by the first tag is a period of the second device when the first packet is transmitted;

wherein, the determining, by the first device, whether the first packet is a normal packet according to the first tag and the second cycle of the first device includes:

the first device determines whether the period value indicated by the first tag is located in a first window corresponding to the second period, wherein the first windows corresponding to different periods of the first device are different;

if the period value indicated by the first label is located in the first window, the first device determines that the first packet is a normal packet, otherwise, determines that the first packet is an abnormal packet.

4. The method of claim 2, wherein the period value indicated by the second tag is the first period;

wherein, the determining, by the first device, whether the first packet is a normal packet according to the first tag and the second cycle of the first device includes:

the first device determines the second label according to the first label;

the first device determines whether the period value indicated by the second tag is located in a second window corresponding to the second period, wherein the second windows corresponding to different periods of the first device are different;

if the period value indicated by the second label is located in the second window, the first device determines that the first packet is a normal packet, otherwise, determines that the first packet is an abnormal packet.

5. The method of claim 3, wherein the first window is [ C1- Δ + S, C1+ (w-1) × S- Δ ], wherein Δ is an adjustment value corresponding to the second device, the adjustment value being used to determine the second label, C1 is the second period, w ≧ 3, and w is an integer, and S is an integer other than 0.

6. The method of claim 4, wherein the second window is [ C1+ S, C1+ (w-1) × S ], C1 is the second period, w ≧ 3, and w is an integer, and S is an integer other than 0.

7. The method of any of claims 1 to 6, further comprising:

and if the first message is determined to be an abnormal message, the first device performs abnormal processing on the first message, wherein the abnormal processing comprises discarding the first message or performing repair processing on the first message.

8. The method of any of claims 1-7, wherein the second tag is determined from the first tag and an adjustment value corresponding to the second device.

9. The method of claim 8, wherein the method further comprises:

and the first equipment updates the adjustment value when the period of the first equipment jumps.

10. The method of claim 8 or 9, wherein the method further comprises:

the first equipment receives an update message, wherein the update message is sent under the condition that the period of the second equipment jumps;

and the first equipment updates the adjustment value according to the updating message.

11. A message processing apparatus, comprising:

a receiving module, configured to receive a first packet sent by a second device, where the first packet carries a first tag, and the first tag is determined according to a period of the second device when the first packet is sent;

the processing module is used for determining whether the first message is a normal message according to the first label;

the processing module is further configured to determine a second message according to the first message if the first message is a normal message, where the second message carries a second tag;

a sending module, configured to send the second packet to a third device in a first period, where the second label is determined according to the first period.

12. The apparatus of claim 11, wherein the processing module is specifically configured to:

and determining whether the first message is a normal message according to the first label and a second period of the device, wherein the second period is a period when the device receives the first message, or a period which is after the period when the device receives the first message and before the first period.

13. The apparatus of claim 12, wherein the period value indicated by the first tag is a period of the second device when the first packet is sent;

wherein the processing module is specifically configured to:

determining whether the period value indicated by the first tag is located in a first window corresponding to the second period, wherein the first windows corresponding to different periods of the device are different;

and if the period value indicated by the first label is located in the first window, determining that the first message is a normal message, otherwise, determining that the first message is an abnormal message.

14. The apparatus of claim 12, wherein the period value indicated by the second tag is the first period;

wherein the processing module is specifically configured to:

determining the second label according to the first label;

determining whether the period value indicated by the second tag is located in a second window corresponding to the second period, wherein the second windows corresponding to different periods of the device are different;

and if the period value indicated by the second label is located in the second window, determining that the first message is a normal message, otherwise, determining that the first message is an abnormal message.

15. The apparatus of claim 13, wherein the first window is [ C1- Δ + S, C1+ (w-1) × S- Δ ], wherein Δ is an adjustment value corresponding to the second device, the adjustment value being used to determine the second label, C1 is the second period, w ≧ 3, and w is an integer, and S is an integer other than 0.

16. The apparatus of claim 14, wherein the second window is [ C1+ S, C1+ (w-1) × S ], C1 is the second period, w ≧ 3, and w is an integer, and S is an integer other than 0.

17. The apparatus of any of claims 11 to 16, wherein the processing module is further to:

and if the first message is determined to be an abnormal message, performing abnormal processing on the first message, wherein the abnormal processing comprises discarding the first message or performing repair processing on the first message.

18. The apparatus of any of claims 11-17, wherein the second tag is determined from the first tag and an adjustment value corresponding to the second device.

19. The apparatus of claim 18, wherein the processing module is further to:

updating the adjustment value in case of a transition of a period of the apparatus.

20. The apparatus of claim 18 or 19,

the receiving module is further configured to receive an update message, where the update message is sent when the period of the second device hops;

the processing module is further configured to update the adjustment value according to the update message.

Technical Field

The present application relates to the field of communications, and in particular, to a method and an apparatus for processing a packet.

Background

Deterministic networks aim to provide services capable of guaranteeing deterministic latency data transmission. In the deterministic network, each output interface of the device supporting the deterministic network characteristics is provided with a plurality of queues for caching the upstream messages arriving in the corresponding scheduling period, only 1 queue is in a state of sending the messages at any time, and other queues only receive the upstream messages. The upstream messages each carry a "period" field, and this field value (denoted as X) identifies which period of the upstream device the message was sent.

In an actual network, there are cases where the underlying delay is abnormal. For example, queuing delay introduced by a buffer queue of a link layer device/interface, delay variation caused by switching of a bottom layer transmission network path in an internet protocol plus (internet protocol +, IP +) bottom layer transmission network scenario, and the like. Underlying delay anomalies will likely have an impact on the traffic of the deterministic network. For example, assuming that the number of queues set by the egress interface of the local device for sending the packet of the upstream device is 3, normally, the queues 1, 2, and 3 may be used to buffer packets with X ═ 4, X ═ 5, and X ═ 6 sent by the upstream device, respectively. After sending the packet with X ═ 4, queue 1 may be used to buffer the packet with X ═ 7. However, if the link delay between the upstream device and the local device is abnormal, so that the X-4 packet and the X-7 packet arrive at the local device together, the local device will not know how to process the packet, or the local device may discard some packets, which may affect an uncertain upstream packet, and thus the service quality cannot be guaranteed.

Disclosure of Invention

The application provides a message processing method and device, which can avoid the linkage influence of abnormal messages on an uncertain target stream caused by abnormal time delay of a bottom layer.

In a first aspect, a method for processing a packet is provided, where the method includes: a first device receives a first message sent by a second device, wherein the first message carries a first label, and the first label is determined according to the period of the second device when the first message is sent; the first equipment determines whether the first message is a normal message or not according to the first label; if the first message is determined to be a normal message, the first equipment determines a second message according to the first message, and the second message carries a second label; and the first equipment sends the second message to third equipment in a first period, and the second label is determined according to the first period.

In this application, the normal packet refers to a packet that does not affect reception of other packets except for the first packet, or a packet that is sent when delay jitter is within a certain range. The normal message is an abnormal message, that is, a message affecting the reception of other messages except the first message is an abnormal message, or a message transmitted when the delay jitter exceeds a certain range.

Optionally, the first device may obtain the second message by replacing the first tag in the first message with the second tag. Alternatively, the first device may obtain the second packet by adding the second tag to the first packet. It should be understood that the second packet at this time carries both the first tag and the second tag.

Optionally, the first tag indicates a period of the first device when the first packet is sent; accordingly, a second label indicates the second periodicity. In other words, the period value indicated by the first tag is the period of the first device when the first packet is sent, and the period value indicated by the second tag is the first period.

Further, the value of the period indicated by the first period or the second tag may be determined according to the adjustment value Δ corresponding to the second device in the first device. For example, the period value indicated by the second tag is equal to the period value + Δ indicated by the first tag.

According to the message processing method, the message detection mechanism is provided, and normal sending processing is performed only when the message is detected to be a normal message, so that the linkage influence of an abnormal message on an undetermined target flow caused by abnormal time delay of a bottom layer can be avoided, and the service quality is favorably improved.

In a possible implementation manner, the determining, by the first device, whether the first packet is a normal packet according to the first label includes: the first device determines whether the first packet is a normal packet according to the first tag and a second cycle of the first device, where the second cycle is a cycle in which the first device receives the first packet, or a cycle that is temporally after and temporally before the cycle in which the first device receives the first packet.

In a possible implementation manner, the period value indicated by the first tag is a period of the second device when the first packet is sent; wherein, the determining, by the first device, whether the first packet is a normal packet according to the first tag and the second cycle of the first device includes: the first device determines whether the period value indicated by the first tag is located in a first window corresponding to the second period, wherein the first windows corresponding to different periods of the first device are different; if the period value indicated by the first label is located in the first window, the first device determines that the first packet is a normal packet, otherwise, determines that the first packet is an abnormal packet.

In one possible implementation, the period value indicated by the second tag is the first period; wherein, the determining, by the first device, whether the first packet is a normal packet according to the first tag and the second cycle of the first device includes: the first device determines the second label according to the first label; the first device determines whether the period value indicated by the second tag is located in a second window corresponding to the second period, wherein the second windows corresponding to different periods of the first device are different; if the period value indicated by the second label is located in the second window, the first device determines that the first packet is a normal packet, otherwise, determines that the first packet is an abnormal packet.

In one possible implementation, the first window is [ C1- Δ + S, C1+ (w-1) × S- Δ ], where Δ is an adjustment value corresponding to the second device, the adjustment value being used to determine the second label, C1 is the second period, w ≧ 3, and w is an integer, and S is an integer other than 0.

In one possible implementation manner, the second window is [ C1+ S, C1+ (w-1) × S ], C1 is the second period, w is greater than or equal to 3, w is an integer, and S is an integer different from 0.

In one possible implementation, the method further includes: and if the first message is determined to be an abnormal message, the first device performs abnormal processing on the first message, wherein the abnormal processing comprises discarding the first message or performing repair processing on the first message.

According to the message processing method, the abnormal message is repaired instead of simply discarded, so that retransmission delay caused by discarding can be reduced.

In one possible implementation, the second tag is determined according to the first tag and an adjustment value corresponding to the second device.

In one possible implementation, the method further includes: and the first equipment updates the adjustment value when the period of the first equipment jumps.

According to the message processing method, the value of the representative period in a certain range can be recycled by updating the adjustment value, so that the infinite increase of the period of the first device can be avoided, the bit occupied by the label carried by the message sent from the first device can be reduced, and the cost is reduced.

In one possible implementation, the method further includes: the first equipment receives an update message, wherein the update message is sent under the condition that the period of the second equipment jumps; and the first equipment updates the adjustment value according to the updating message.

In a second aspect, a message processing apparatus is provided, where the apparatus is configured to perform the method in the first aspect or any possible implementation manner of the first aspect. In particular, the apparatus may comprise means for performing the method of the first aspect or any possible implementation manner of the first aspect.

In a third aspect, a message processing apparatus is provided, where the apparatus includes a memory and a processor, the memory is configured to store instructions, and the processor is configured to call the instructions stored in the memory to execute the first aspect or the method of any possible implementation manner of the first aspect.

In particular, the apparatus further comprises a transceiver or a communication interface for performing the signal (e.g. message) receiving/sending actions in the method of the first aspect or any possible implementation manner of the first aspect.

In a fourth aspect, there is provided a message processing apparatus comprising at least one processing element (or chip) configured to perform the method of any one of the possible implementations of the first aspect.

In a fifth aspect, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a computer, causes the computer to carry out the method of the first aspect or any possible implementation of the first aspect.

A sixth aspect provides a computer program product comprising instructions which, when executed by a computer, cause the computer to carry out the method of the first aspect or any possible implementation of the first aspect.

Drawings

Fig. 1 is a schematic structural diagram of a network provided in the present application.

Fig. 2 is an exemplary flowchart of a message processing method provided in the present application.

Fig. 3 is a schematic diagram of an updated adjustment value provided in the present application.

Fig. 4 is a schematic structural diagram of a message processing apparatus according to the present application.

Fig. 5 is another schematic structural diagram of a message processing apparatus according to the present application.

Detailed Description

The technical solution in the present application will be described below with reference to the accompanying drawings.

Fig. 1 is a schematic structural diagram of a network provided in the present application. Referring to fig. 1, the network includes a node 101, a node 102, and a node 103. Node 101 is connected via its interface 11 to interface 21 of node 102 and interface 22 of node 102 is connected to interface 31 of node 103. For example, the node 101 may send a message to the node 102 through the interface 11, and the interface 21 of the node 102 may send the message to the node 103 through the interface 22 after receiving the message sent by the node 101. Node 101 may be an ingress edge node, node 102 may be a core node (or referred to as an intermediate node), and node 103 may be an egress edge node. Alternatively, node 101 may be a host device, node 102 may be one core node, and node 103 may be another core node. Alternatively, node 101, node 102, and node 103 may all be core nodes. It should be understood that the positions or roles of the nodes in the network listed above are only exemplary, and should not limit the present application in any way.

Each node shown in fig. 1 maintains a clock locally, and the clocks of the nodes may not be synchronized, and the following description will take node 101 and node 102 as an example.

Node 101 and node 102 may autonomously generate an initial count value at initialization, for example, the initial count value of node 101 may be denoted as CAThe initial count value of node 102 may be denoted as CB. According to the clock of node 101, every T time (e.g., 10us), CAAnd accumulating S, wherein S is an integer which is not 0 and is a constant, and S can be a positive number or a negative number. For example, S may be-1, and after T time has elapsed, CAIs changed into CA-1. If S can be 2, then C after T time has elapsedAIs changed into CA+2. Similarly, according to the clock of node 102, every T times, CBAnd accumulating the S. CAAnd CBAnd may or may not be equal, and the present application is not limited thereto.

It should be noted that, in the following description, the meaning of the description that the similar node 101 sends the message in the period X is that the node 101 sends the message in the period corresponding to the count value X. For example, the meaning of node 101 sending a message in cycle 3 is that node 101 is at CASending messages in the period corresponding to 3, or CAWhen it is 3, node 101 sends the message. It is to be understood that if CAWith an initial value of 3 and S of 2, it is only possible for node 101 to send messages in cycles 3, 5, or 7, etc., but not in cycles 2, 4, or 6, etc.

When node 101 sends a packet to node 102, it may be atThe message carries a label, which is determined according to the period when the node 101 sends the message. For example, the tag may indicate a period when the node 101 sends the packet, that is, the period value indicated by the tag is X, where X is equal to CA. In addition, the label may be CARelevant values, e.g. X ═ CA+ a preset value, which may be, for example, Δ X or other possible values as described below, and is not limited in this application. For the sake of understanding, hereinafter, without being particularly described, X ═ C is consideredA. Also, without being particularly described, the tag P indicates that the period value indicated by the tag is P, which is any possible period value.

After receiving the message sent by the node 101, the node 102 caches the message to the corresponding queue Q according to XXAnd at period Y of node 102 (i.e., Y ═ C)B) And sending the messages in the queue. Wherein, the queue QXFor transmitting X ═ C in node 102AFor example, interface 22 shown in FIG. 1 may be the interface corresponding to one of the U (U ≧ 3) queues.

In one implementation, queue QXThe index (or number) in the above U queues may be% U orA queue of% U of the number of bits,expressing the rounding-down, | | takes the absolute value, and% expresses the remainder. Or, queue QXOther queues in the above U queues may also be used, which is not limited in this application. It should be noted that in the present application, the node 102 can only send one queue at any cycle, but cannot send multiple queues at the same time, and when sending a queue, the queue cannot receive a packet. It should be understood that what is referred to as a send queue in this application is the same concept as a message in a send queue.

In one implementation, Y is X + Δ X, and Δ X is an adjustment value stored by node 102 and corresponding to node 101, and used to calculate at which cycle in node 102 any packet sent from node 101 needs to be sent. The adjustment value may be calculated according to the length of the optical fiber between the node 102 and the node 101, or may be obtained by sending a test packet. For example, the node 101 sends a test packet at the end of the period X, and carries the label X, and if the node 102 is in the period y when receiving the test packet, Δ X is y + 1-X; or, the node 101 sends a test packet at the beginning of the period X, and carries the label X, and if the node 102 is in the period y when receiving the test packet, Δ X is y + 2-X.

It is understood that in one possible implementation, y +1-X ≦ Δ X < y + U-X, or, y +1-X ≦ Δ X ≦ y + U-X, and Δ X is an integer, U is defined as described above. Wherein, if the periods of the node 101 and the node 102 are updated synchronously, C isAAnd CBUpdating at the same time, wherein y +1-X is more than or equal to delta X is more than or equal to y + U-X; if the periods of the node 101 and the node 102 are updated asynchronously, i.e. CAAnd CBWhen the updating is not performed at the same time, y +1-X is not more than or equal to delta X and is less than y + U-X.

Under normal conditions, that is, when the delay jitter of the bottom layer is within a limited range, the node 102 sends the packet according to the above rule. In an actual network, there is a case where the underlying delay is abnormal. For example, queuing delay introduced by a buffer queue of a link layer device/interface, delay variation caused by switching of a bottom layer transmission network path in an IP + bottom layer transmission network scenario, and the like. These delay anomalies may cause the packet to arrive at the next node ahead of time or delayed for a longer time, thereby affecting the quality of service.

For example, assume that the queue index corresponding to the packet with the tag indicating the period value X is% U, U is 3, then normally, messages with X-4, X-5 and X-6 sent by node 101 should enter queues 1, 2 and 3, respectively. After node 102 sends the packet with X-4, queue 1 may be used to buffer the packet with X-7. But do notIf the X-4 packet and the X-7 packet arrive at the node 102 due to the abnormal link delay between the node 101 and the node 102, the node 102 will not know how to process the packet, or the node 102 may discard some packets, which may affect an uncertain upstream packet, and thus the service quality cannot be guaranteed.

In view of this, the present application provides a message processing method, which performs normal sending processing when determining that a message is a normal message by providing a message detection mechanism, and can avoid the chain influence of an abnormal message on an indefinite target stream due to abnormal bottom layer delay, thereby being beneficial to improving service quality.

Hereinafter, the method of the present application will be described in detail by taking the first device detecting the first packet as an example without loss of generality. The first message may be any message sent by the second device to the first device. The first device may be node 102 shown in fig. 1 and the second device may be node 101 shown in fig. 1.

Fig. 2 is a schematic flow chart of a message processing method provided in the present application. Hereinafter, each step of fig. 2 will be described in detail.

S210, the first equipment receives the first message.

The first message carries a first label, and the first label is determined according to the period of the second device when the first message is sent. For example, the first tag may indicate a period of the second device when the first packet is transmitted, in other words, the period value indicated by the first tag is a period of the second device when the first packet is transmitted. In addition, the period value indicated by the first tag may also be a value related to but not equal to the period of the second device when the first packet is transmitted. For example, the period value indicated by the first tag is the sum of the period of the second device when the first packet is sent and a preset value, which may be, for example, the adjustment value Δ in the following, but the present application does not limit this.

Hereinafter, the present application will be described by taking only the period value indicated by the first tag as the period of the second device when the first packet is sent as an example. And, for ease of understanding and description, the first label will be referred toThe indicated period value, i.e. the period of the second device when sending the first packet, is recorded as: x1. That is, the second device transmits the first message at the period X1. It should be understood that, referring to the foregoing description, the count value of the second period corresponding to the period X1 is X1. For example, if X1 ═ 5 denotes C, taking the second device as node 101AWhen it is 5, node 101 transmits the first packet. The following description is similar to the case where the first device receives the first packet and sends the second packet, and will not be repeated.

S220, the first equipment determines whether the first message is a normal message or not according to the first label.

For example, the first device may determine whether the first packet is a normal packet according to the period value indicated by the first tag, i.e., X1.

The normal packet is a packet that does not affect reception of other packets except for the first packet, or a packet that is transmitted when delay jitter is within a certain range. The normal message is an abnormal message, that is, a message affecting the reception of other messages except the first message is an abnormal message, or a message transmitted when the delay jitter exceeds a certain range.

S230, if it is determined that the first message is a normal message, the first device determines a second message according to the first message. Wherein the second message carries a second label.

For example, the first device may obtain the second message by replacing the first tag in the first message with the second tag.

For another example, the first device may obtain the second packet by adding the second tag to the first packet. It should be understood that the second packet at this time carries both the first tag and the second tag.

It should be understood that the first device may also determine the second packet according to other manners, which is not limited in this application.

S240, the first device sends a second packet to the third device in the first period.

Wherein the second tag in the second message is determined according to the first period. For example, the second tag may indicate a period of the first device when the second packet is sent, in other words, the period value indicated by the second tag is a period of the first device when the second packet is sent, that is, the period value indicated by the second tag is the first period. In addition, the period value indicated by the second label may also be a value related to but not equal to the first period. For example, the period value indicated by the second label is the sum of the first period and a preset value, but the application is not limited thereto.

Hereinafter, the present application will be described by taking only the period value indicated by the second label as the first period as an example. Also, hereinafter, for ease of understanding and description, the period value indicated by the second label, i.e., the second period, is written as: x2.

In one possible implementation, the value of the period indicated by the first period or the second tag may be determined according to the adjustment value Δ corresponding to the second device in the first device. For example, X2 ═ X1+ Δ. The manner of determining Δ may refer to the manner of determining Δ X described above, and will not be described herein.

As can be seen from the above description, after receiving the first packet, the first device needs to buffer the packet into the corresponding queue. The caching operation may be performed after S220, but the application is not limited thereto. For example, the first device may buffer the message after S230 and before S240. If the first device executes the caching operation after S220, if it is determined that the first packet is a normal packet, the first device may cache the first packet in a corresponding queue, and then process the first packet to obtain a second packet, or the first device may cache the obtained second packet in a corresponding queue.

In a possible implementation manner, the queue for buffering the first packet or the second packet may be determined according to the number of buffer queues that can be used by an interface (denoted as a first interface) in the first device for sending the packet of the second device.

In this application, for ease of understanding and description, the number of buffer queues that can be used by the first interface is referred to as: w, w is not less than 3, and w is an integer.

Then, the queue for buffering the first packet or the second packet may be the w queuesIndex in the column of% w or% w of the queue. It should be understood that w is less than or equal to the total number of buffer queues corresponding to the first interface, for example, if the first device is node 102 and the second device is node 101, then w is greater than or equal to 3 and less than or equal to U. w may be set at the time of initialization of the first device, or may be set at any time before the second device sends the message, which is not limited in this application. Further, w may be set autonomously by the first device or may be set by the control plane.

According to the message processing method, the message detection mechanism is provided, and normal sending processing is performed only when the message is detected to be a normal message, so that the linkage influence of an abnormal message on an undetermined target flow caused by abnormal time delay of a bottom layer can be avoided, and the service quality is favorably improved.

Optionally, as an embodiment of the present application, the method may further include:

and S250, if the first message is determined to be an abnormal message, the first equipment performs abnormal processing on the first message.

For example, the first device may discard the first packet, or the first device may perform repair processing on the first packet. The repairing process may be to increase or decrease the delay time correspondingly in the subsequent forwarding process according to the number of cycles of the first packet in advance or in delay so as to correct the time for forwarding the abnormal packet.

According to the message processing method, the abnormal message is repaired instead of simply discarded, so that retransmission delay caused by discarding can be reduced.

Hereinafter, how the first device determines whether the first packet is a normal packet according to the first tag will be described in detail.

Optionally, as an embodiment of the present application, the first device may determine whether the first packet is a normal packet according to the first tag and a second cycle of the first device.

For example, the first device may determine whether the first packet is a normal packet according to the period value (i.e., X1) indicated by the first tag and the second period of the first device.

The second period is a period in which the first device receives the first packet, or a period that is temporally after the period in which the first device receives the first packet and is temporally before the first period. For example, the second cycle may be a cycle in which the first device determines whether the first packet is a normal packet, where the first device may determine whether the first packet is a normal packet in the cycle in which the first packet is received, or may determine whether the first packet is a normal packet in any cycle before the first cycle. Hereinafter, for ease of understanding and explanation, the second period is written as: C1.

further, the first device may specifically determine whether the first packet is a normal packet by using the first mode or the second mode.

In a first mode

The first equipment determines whether the period value indicated by the first label is positioned in a first window corresponding to the second period; if the period value indicated by the first tag is located in the first window, the first device may determine that the first packet is a normal packet, otherwise, may determine that the first packet is an abnormal packet. The first windows corresponding to different periods of the first device are different. That is, the first window is updated with periodic updates of the first device.

In one possible implementation, the first window is [ C1- Δ + S, C1+ (w-1) × S- Δ ].

That is, when S is a positive number, if the following formula (1) is satisfied, the first packet is a normal packet, otherwise, the first packet is an abnormal packet.

C1-Δ+S≤X1≤C1+(w-1)*S-Δ (1)

Wherein Δ, w, C1 have the meaning as defined above.

And under the condition that the S is a negative number, if the following formula (2) is established, the first message is a normal message, otherwise, the first message is an abnormal message.

C1+(w-1)*S-Δ≤X1≤C1-Δ+S (2)

Wherein Δ, w, C1 have the meaning as defined above.

It is understood that the first window may also be a window smaller than [ C1- Δ + S, C1+ (w-1) × S- Δ ]. Alternatively, the first window may be a window slightly larger than [ C1- Δ + S, C1+ (w-1) × S- Δ ], depending on the tolerance of the system. In addition, the first windows corresponding to some cycles may also be configured manually, that is, the first windows corresponding to other cycles may be smaller or larger than [ C1- Δ + S, C1+ (w-1) × S- Δ ].

Equation (1) is illustrated below in conjunction with table 1. The following assumptions are made in the following description: s is 1, Δ is 6, X2 is X1+ Δ, w is 5, and C1 is a period when the first device receives the first packet.

Referring to table 1, table 1 shows a case where a first device receives a packet sent by a second device. The second column represents the period of the second device when the message is sent, the first column represents the period of the first device when the message carrying the corresponding label is received, and the third column represents the queue into which the message carrying the corresponding label should enter.

TABLE 1

Example one: suppose C1 is 12

Then, X1 is greater than or equal to 7 and less than or equal to 10, that is, if the period value indicated by the label of the message received by the first device in the period 12 belongs to [7, 10], it indicates that these messages are normal messages, otherwise, these messages are abnormal messages.

Specifically, when C1 is 12, the first device will send the message that the first device sent in cycle 6, that is, the first device will send Q1, and Q2, Q3, Q4, and Q0 can receive. As can be seen from table 1, the periods of the second devices corresponding to Q2, Q3, Q4, and Q0 are 7, 8, 9, and 10, respectively, and the first device sends Q2, Q3, Q4, and Q0 only in the period after the period 12, so if X1 is greater than or equal to 7 and less than or equal to 10, the first message is considered to be a normal message. It should be understood that although the queue corresponding to the message sent by the second device in the period 5 is Q0, since the first device will send the message sent by the second device in the period 5 in the 11 th period, if the message sent by the second device in the period 5 is received in C1 ═ 12, the message is considered to be an abnormal message.

Example two: suppose X1 is 8

Then 10 ≦ C1 ≦ 13. That is, if the first device receives the message with X1 ═ 8 in any one of the periods 12 to 15, the message is considered to be a normal message, otherwise, the message is considered to be an abnormal message.

Specifically, the first device sends a message with X1 ═ 8 in the cycle 14, the queue into which the message with X1 ═ 8 enters is Q3, and if the first device receives the message with X1 ═ 8 in a certain cycle before the cycle 14 and corresponding to which Q3 is empty, the message is considered to be a normal message. As can be seen from table 1, when the first device receives the message with X1 ═ 8 in any period from period 10 to period 13, the message with X1 ═ 8 is considered to be a normal message.

More specifically, as can be seen from table 1, normally, the message with X1 ═ 8 arrives at cycle 12 or 13. Then, it can be determined that the messages received in cycles 12 and 13 with X1 being 8 are normal messages.

Since Q3 is used to buffer the X1-8 packet in 4 periods between the period 10 and the period 13, as can be seen from table 1, even if the packet with X1-8 arrives earlier in the period 10 or 11, it will not affect the reception and transmission of other packets, so the packet with X1-8 received in the periods 10 and 11 is also a normal packet.

However, if a message with X1 being 8 is received in a period before the period 10, or if a message with X1 being 8 is received in a period after the period 13, the received message is considered as an abnormal message. Specifically, in cycle 9 or cycle 14, the first device is transmitting the packet buffered in Q3, and the packet is not allowed to be received while transmitting, so that if the packet with X1 ═ 8 is received, it is considered to be an abnormal packet. For the period 6 to the period 8, the Q3 needs to buffer the message sent by the first device in the period 3, and if the message with the X1 being 8 is received at this time, it is considered to be an abnormal message. For the later periods of the period 15, the period 16, and the like, since the first device has sent the message with X1 ═ 8 in the period 14, if the message with X1 ═ 8 is received again, on one hand, buffering the message into Q3 will affect the reception of the message in the period 17 by the first device, on the other hand, the message will cause delayed sending, and thus the message may be considered as an abnormal message.

It is readily understood that example one and example two describe the meaning of equation (1) from both points of view of equation (1).

It should be understood that the principle of determining whether the first packet is a normal packet through the first window when S is other than 1 is similar to the principle of determining whether the first packet is a normal packet through the first window when S is 1, and details are not described herein.

Mode two

The first device determines a second tag according to the first tag, and then determines whether a period value indicated by the second tag is located in a second window corresponding to a second period. If the period value indicated by the second tag is located in the second window, the first device may determine that the first packet is a normal packet, otherwise, determine that the first packet is an abnormal packet. And the second windows corresponding to different periods of the first equipment are different. That is, the second window is updated with periodic updates of the first device.

As described above, the period value indicated by the second label may be determined according to Δ, e.g., X2 ═ X1+ Δ, but the application does not limit the specific determination manner of the second label.

In one possible implementation, the second window is [ C1+ S, C1+ (w-1) × S ].

That is, when S is a positive number, if the following formula (3) is satisfied, the first packet is a normal packet, otherwise, the first packet is an abnormal packet.

C1+S≤X2≤C1+(w-1)*S (3)

Wherein Δ, w and C1 have the meanings given above.

That is, when S is a negative number, if the following formula (4) is satisfied, the first packet is a normal packet, otherwise, the first packet is an abnormal packet.

C1+(w-1)*S≤X2≤C1+S (4)

Wherein Δ, w and C1 have the meanings given above.

It is to be understood that the second window may also be a window smaller than [ C1+ S, C1+ (w-1) × S ]. Alternatively, the second window may be a slightly larger window than [ C1+ S, C1+ (w-1) × S ], depending on the tolerance of the system. In addition, the second windows corresponding to some cycles may also be configured manually, that is, the second windows corresponding to other cycles may be smaller or larger than [ C1+ S, C1+ (w-1) × S ].

Equation (3) is illustrated below in conjunction with table 1 above, where it is also assumed that: s is 1, Δ is 6, X2 is X1+ Δ, w is 5, and C1 is a period when the first device receives the first packet.

Example three: suppose C1 is 12

Then 13 ≦ X2 ≦ 16. That is, if the first device receives a message that needs to be sent in any one of the periods 13 to 16 in the period 12, the message is considered to be a normal message.

Specifically, in the period 12, the first device will send a packet with X1 ═ 6, and the queue corresponding to the packet with X1 ═ 6 is Q1, at this time, the first device may receive the packets corresponding to the queues Q2, Q3, Q4, and Q0. As can be seen from table 1, the messages of X1 ═ 7/8/9/10 correspond to Q2, Q3, Q4 and Q0, respectively, and the messages of X1 ═ 7/8/9/10 correspond to periods of transmission required of 13, 14, 15 and 16, respectively. Therefore, if the first device receives a message that needs to be sent in any one of the periods 13 to 16 in the period 12, the message is considered to be a normal message.

It should be understood that the principle of determining whether the first packet is a normal packet through the second window when S is other than 1 is similar to the principle of determining whether the first packet is a normal packet through the second window when S is 1, and details are not described herein.

Those skilled in the art will appreciate that any equivalent variations of equations (1) through (4) in practice are intended to fall within the scope of the present application.

Optionally, as an embodiment of the present application, the method may further include: in case of a transition of the period of the first device, the first device updates Δ.

Specifically, the period (or period count/period value) of the first device starts from its initial period value (i.e., initial count value), and the period is accumulated by S every fixed length of time. If S is positive, the maximum value C is reached in the cyclemaxIf S is accumulated again, the period jumps to the minimum value Cmin,Cmax>Cmin. For example, the maximum period is 11, and if the re-accumulation S is 1, the period jumps to 1, where the period 0 may be prohibited. If S is negative, the minimum value C is reached in the periodminIf S is accumulated again, the period jumps to the maximum value Cmax. In case of a cycle jump, the first device updates Δ. It is to be understood that this application is for CminThe value of (A) is not limited.

In one possible implementation, Δ is updated to Δ', andas described above, CminIs the minimum value of the period (i.e., count value) of the first device, CmaxIs the maximum value of the period of the first device. Cmax-CminAnd k is an integer, wherein k is not less than 1.

In addition, the first device also updates the adjustment values corresponding to the other devices, such as also updating the adjustment values corresponding to the third device.

According to the message processing method, the value of the representative period in a certain range can be recycled by updating the adjustment value, so that the infinite increase of the period of the first device can be avoided, the bit occupied by the label carried by the message sent from the first device can be reduced, and the cost is reduced.

Optionally, in case that the first device jumps in a cycle, the first device further sends the first device to the devices (e.g. the third device and the first device) connected to the first deviceAn update message (e.g., denoted as a first update message) is sent that is used by the other device to update the adjustment value corresponding to the first device. The first update message may include CminAnd CmaxEach apparatus according to CminAnd CmaxThe respective adjustment values are updated.

For example, the second device may update its adjustment value corresponding to the first device to Δ'1WhereinΔ1The adjustment value of the second device corresponding to the first device before updating. Similarly, the third device may update its adjustment value corresponding to the first device to Δ'2WhereinΔ2The adjustment value of the third device corresponding to the first device before updating.

By updating the adjustment value corresponding to the first device by the other device, the other device can be ensured to correctly judge whether the message received from the first device is a normal message.

It should be understood that in the present application, C of the first device, the second device and the third deviceminAnd CmaxMay be the same, but this application does not limit this.

The updating of the adjustment value by each device will be described below with reference to fig. 3.

Assuming that S is 1, the adjustment value of the first device before updating with respect to the second device is 6, i.e., the adjustment value of the interface 21 is 6, the adjustment value with respect to the third device is 8, i.e., the adjustment value of the interface 22 is 8, Cmin=1,Cmax15, the second device has an adjustment value of-4 for the first device, i.e., an adjustment value of-4 for the interface 11, and the third device has an adjustment value of-2 for the first device, i.e., an adjustment value of-2 for the interface 31. Then, when an out-of-range occurs, the first device updates its adjustment value corresponding to the second device to-9 and its adjustment value corresponding to the third device to-7. Upon the occurrence of a boundary crossing, the first device transmits to the second device and the third deviceA first update message, according to which the second device can update its adjustment value corresponding to the first device to 11, and according to which the third device can update its adjustment value corresponding to the first device to 13.

Further, in case of a cycle hop of the first device, the first device may also stop receiving the reservation request message. The reservation request message is used to reserve resources.

In addition, as an embodiment of the present application, the method further includes:

the first device receives an update message (for example, written as: a second update message) which is sent when the period of the second device jumps; the first device updates the adjustment value corresponding to the second device according to the second update message.

It should be understood that the updating of the adjustment value corresponding to the second device by the first device according to the second update message is similar to the updating of the adjustment value corresponding to the first device by the second device according to the first update message, and is not described herein again.

Fig. 4 is a message processing apparatus 400 according to an embodiment of the present invention, where the message processing apparatus 400 implements part or all of the functions of the first device through software, hardware, or a combination of the software and the hardware. The message processing apparatus may be the first device, and may also be a chip applied to the first device. As shown in fig. 4, the message processing apparatus 400 includes a receiving module 410, a processing module 420 and a sending module 430.

A receiving module 410, configured to receive a first packet sent by a second device, where the first packet carries a first tag, and the first tag is determined according to a period of the second device when the first packet is sent;

a processing module 420, configured to determine whether the first packet is a normal packet according to the first label;

the processing module 420 is further configured to determine a second packet according to the first packet if the first packet is a normal packet, where the second packet carries a second tag;

a sending module 430, configured to send the second packet to a third device in a first period, where the second label is determined according to the first period.

In a possible implementation manner, the processing module 420 is specifically configured to:

and determining whether the first message is a normal message according to the first label and a second period of the device, wherein the second period is a period when the device receives the first message, or a period which is after the period when the device receives the first message and before the first period.

In a possible implementation manner, the period value indicated by the first tag is a period of the second device when the first packet is sent;

wherein the processing module 420 is specifically configured to:

determining whether the period value indicated by the first tag is located in a first window corresponding to the second period, wherein the first windows corresponding to different periods of the device are different;

and if the period value indicated by the first label is located in the first window, determining that the first message is a normal message, otherwise, determining that the first message is an abnormal message.

In one possible implementation, the period value indicated by the second tag is the first period;

wherein the processing module 420 is specifically configured to:

determining the second label according to the first label;

determining whether the period value indicated by the second tag is located in a second window corresponding to the second period, wherein the second windows corresponding to different periods of the device are different;

and if the period value indicated by the second label is located in the second window, determining that the first message is a normal message, otherwise, determining that the first message is an abnormal message.

In one possible implementation, the first window is [ C1- Δ + S, C1+ (w-1) × S- Δ ], where Δ is an adjustment value corresponding to the second device, the adjustment value being used to determine the second label, C1 is the second period, w ≧ 3, and w is an integer, and S is an integer other than 0.

In one possible implementation, the second window is [ C1+ S, C1+ (w-1) × S ], C1 is the second period of the device, w ≧ 3, and w is an integer, and S is an integer other than 0.

In one possible implementation manner, the processing module 420 is further configured to:

and if the first message is determined to be an abnormal message, performing abnormal processing on the first message, wherein the abnormal processing comprises discarding the first message or performing repair processing on the first message.

In one possible implementation, the second tag is determined according to the first tag and an adjustment value corresponding to the second device.

In one possible implementation manner, the processing module 420 is further configured to:

updating the adjustment value in case of a transition of a period of the apparatus.

In a possible implementation manner, the receiving module 410 is further configured to receive an update message, where the update message is sent when the period of the second device is hopped;

the processing module 420 is further configured to update the adjustment value according to the update message.

The above-mentioned apparatus is used for executing the foregoing method embodiments, and the implementation principle and technical effect are similar, which are not described herein again. In addition, the sending module in the above embodiment may be a sender, the receiving module may be a receiver, and the processing module may be a processor, which is not described herein again.

As shown in fig. 5, the present application also provides a message processing apparatus 500, and it should be understood that the message processing apparatus may correspond to the message processing apparatus 400 described above, and may also correspond to the first device in the foregoing method embodiment.

Referring to fig. 5, the message processing apparatus 500 includes a processor 510 and a transceiver 520. Optionally, the message processing apparatus 500 further includes a memory 530. Wherein the processor 510, the transceiver 520 and the memory 530 communicate with each other via the internal connection path to transmit control and/or data signals, the memory 530 is used for storing a computer program, and the processor 510 is used for calling and running the computer program from the memory 530 to control the transceiver 520 to transmit and receive signals.

The processor 510 and the memory 530 may be combined into a single processing device, and the processor 510 is configured to execute the program code stored in the memory 530 to implement the functions described above. In particular implementations, the memory 530 may be integrated with the processor 510 or may be separate from the processor 510.

When the program instructions stored in the memory 530 are executed by the processor 510, the processor 510 is configured to control the transceiver 530 to receive a first packet sent by a second device, where the first packet carries a first tag, and a period value indicated by the first tag is a period of the second device when the first packet is sent; determining whether the first message is a normal message or not according to the first label; if the first message is a normal message, determining a second message according to the first message, wherein the second message carries a second label; the transceiver 530 is controlled to send the second packet to the third device at the first period, where the period value indicated by the second tag is the first period.

It will be appreciated that the processor 510 described above may be used to perform the actions described in the previous method embodiments as being implemented internally by the first device, while the transceiver 520 may be used to perform the receiving or transmitting actions of the first device of the network described in the previous method embodiments. Please refer to the description of the previous embodiment of the method, which is not repeated herein.

Embodiments of the present application also provide a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a computer, the computer causes the computer to implement the method provided by the above method embodiments.

Embodiments of the present application also provide a computer program product containing instructions, which when executed by a computer, cause the computer to implement the method provided by the above method embodiments.

For the explanation and beneficial effects of the related content in the message processing apparatus, reference may be made to the corresponding method embodiments provided above, and details are not repeated here.

It should be understood that the processor mentioned in the embodiments of the present Application may be a Central Processing Unit (CPU), and may also be other general purpose processors, Digital Signal Processors (DSP), Application Specific Integrated Circuits (ASIC), Field Programmable Gate Arrays (FPGA) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, and the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.

It should also be understood that the memories referred to in the embodiments of the present application may be either volatile Memory or nonvolatile Memory, or may include both volatile and nonvolatile Memory, where nonvolatile Memory may be Read-Only Memory (ROM), Programmable Read-Only Memory (PROM), Erasable Programmable Read-Only Memory (EPROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), or flash Memory volatile Memory may be Random Access Memory (RAM), which serves as external cache Memory, and many forms of RAM are available, such as Static Random Access Memory (Static RAM, SRAM), Dynamic Random Access Memory (Dynamic DRAM, DRAM), Synchronous Dynamic Random Access Memory (Synchronous DRAM, SDRAM), Double data rate Synchronous Dynamic Random Access Memory (Double data rate, DDR), Enhanced Synchronous Dynamic Random Access Memory (Enhanced SDRAM), SDRAM, or SDRAM, Direct Access Memory (SDRAM, L).

It should be noted that when the processor is a general-purpose processor, a DSP, an ASIC, an FPGA or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component, the memory (memory module) is integrated in the processor.

The above embodiments may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, the above-described embodiments may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded or executed on a computer, cause the flow or functions according to embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored on a computer readable storage medium or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains one or more collections of available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., Digital Versatile Disk (DVD)), or a semiconductor medium. The semiconductor medium may be a solid state disk.

Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.

It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.

It should be understood that "and/or" in the present application, describing an association relationship of associated objects, means that there may be three relationships, for example, a and/or B, may mean: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. "at least one" means one or more than one; "at least one of a and B", similar to "a and/or B", describes an association relationship of associated objects, meaning that three relationships may exist, for example, at least one of a and B may mean: a exists alone, A and B exist simultaneously, and B exists alone.

In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.

The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.

In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.

The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a read-only memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.

The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

22页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种数据调度方法、装置及存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!