CN106452695A - Redundant message processing method, apparatus and system - Google Patents
Redundant message processing method, apparatus and system Download PDFInfo
- Publication number
- CN106452695A CN106452695A CN201610890858.9A CN201610890858A CN106452695A CN 106452695 A CN106452695 A CN 106452695A CN 201610890858 A CN201610890858 A CN 201610890858A CN 106452695 A CN106452695 A CN 106452695A
- Authority
- CN
- China
- Prior art keywords
- message
- serial number
- parameter
- received
- sequence number
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000003672 processing method Methods 0.000 title abstract description 5
- 238000012545 processing Methods 0.000 claims abstract description 53
- 238000000034 method Methods 0.000 claims abstract description 40
- 238000013461 design Methods 0.000 abstract description 11
- 238000012356 Product development Methods 0.000 abstract description 8
- 238000004904 shortening Methods 0.000 abstract description 6
- 238000010586 diagram Methods 0.000 description 11
- 238000004590 computer program Methods 0.000 description 7
- 230000006870 function Effects 0.000 description 4
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 238000003860 storage Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 2
- 230000002035 prolonged effect Effects 0.000 description 2
- 230000032683 aging Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000018109 developmental process Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L1/00—Arrangements for detecting or preventing errors in the information received
- H04L1/22—Arrangements for detecting or preventing errors in the information received using redundant apparatus to increase reliability
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention provides a redundant message processing method, apparatus and system for determining whether received messages are repeated messages according to a one-to-one correspondence relation between sequence numbers in messages and the messages, thereby simplifying the process of determining whether the messages are repeated messages, shortening the product development period, reducing the number of occupied logic resources and reducing the power consumption; and no table needs to be established for each message, then no external processing chip needs to be used, so that the hardware design cost is reduced. The method comprises the following steps: receiving a message, and comparing whether the sequence number of the received message is greater than a sequence number parameter, wherein the sequence number parameter is used for identifying the maximum value of the sequence number of the forwarded message; if so, forwarding the message according to a destination address of the message, and updating the sequence number parameter as the sequence number of the message; and if not, deleting the message.
Description
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method, an apparatus, and a system for processing a redundant packet.
Background
With the progress of industrial technology, in order to further improve the reliability of the ethernet, the IEC62439-3 protocol specifies that at the sending end, each message to be sent is copied to obtain two identical messages; the two messages are sent to a receiving end through different ports; and receiving the message sent by the sending end at the receiving end side, and judging that the received message is an original message or a repeated message according to a preset judgment rule. The original message is the message received by the receiving end for the first time, and the repeated message is the message with the same content as the received message. If the received message is an original message, forwarding the received message according to a target IP (Internet Protocol, inter-network interconnection Protocol) address in the message; if the received message is a repeated message, the received message is discarded, so that the problem of message loss caused by network reasons in the transmission process is avoided, and the reliability of the network is improved.
In the prior art, a TCAM (Ternary Content Addressable Memory) is used in combination with a RAM (Random Access Memory) to perform table lookup, so as to determine whether a received message is a repeated message. The specific operation flow is as follows: a receiving end receives a message sent by a sending end, determines whether the message is a repeated message or not according to keywords in the message, determines that the message is not the repeated message if the keywords are not recorded in a stored table by searching, and establishes a table for storing the keywords; because each message is subjected to the table look-up process, even the table building and aging table processing process, the process consumes a plurality of clock cycles, the message processing delay is large, the system design complexity is high, the product development period is correspondingly prolonged, the occupied logic resource quantity is large, and the power consumption is correspondingly large. If an external TCAM chip is used, the design cost is correspondingly increased.
In summary, in the prior art, a TCAM is used in combination with a RAM to perform table lookup, so as to determine whether a received message is a repeated message, and this process consumes several clock cycles, which results in a large processing delay of the message, and the system design complexity is high, the development cycle of the product is correspondingly prolonged, the amount of occupied logic resources is large, the power consumption is correspondingly large, and the use of an external TCAM chip also results in an increase in the design cost.
Disclosure of Invention
The embodiment of the invention provides a redundant message processing method, a device and a system, which are used for simplifying the process of determining whether the message is a repeated message, improving the message processing efficiency, shortening the product development period, reducing the number of occupied logic resources and reducing the power consumption; the table does not need to be established for each message, and an external TCAM chip does not need to be used, so that the design cost of hardware is reduced.
The method for processing the redundant message based on the IEC62439-3 protocol provided by the embodiment of the invention comprises the following steps:
receiving a message, and comparing whether the serial number of the received message is greater than a serial number parameter, wherein the serial number parameter is the maximum value of the serial number used for identifying the forwarded message;
if so, forwarding the message according to the target address of the message, and updating the serial number parameter into the serial number of the message; otherwise, deleting the message.
In the embodiment of the invention, because the serial number in each message is unique, the invention determines whether the received message is a repeated message by storing the maximum value of the serial number of the forwarded message and comparing the serial number of the received message with the maximum value, thereby simplifying the process of determining the repeated message, improving the message processing efficiency, shortening the product development period, reducing the number of occupied logic resources and reducing the power consumption; because the table does not need to be established aiming at each message, an external TCAM chip does not need to be used, and the design cost of hardware is reduced.
Preferably, after receiving the message, the method further includes:
and detecting whether the serial number parameter is a default value, if so, updating the serial number parameter to the serial number of the received message, and forwarding the received message, otherwise, comparing whether the serial number of the received message is greater than the serial number parameter.
Preferably, comparing whether the sequence number of the received packet is greater than the sequence number parameter includes:
updating a cache parameter for storing the serial number of the received message into the serial number of the received message;
and comparing whether the updated cache parameter is larger than the sequence number parameter.
Preferably, after detecting whether the sequence number parameter is a default value, the method further comprises:
acquiring a serial number of the received message;
updating the serial number parameter to the serial number of the received message, including:
assigning the obtained serial number to the serial number parameter;
updating a cache parameter for storing the serial number of the received message to the serial number of the received message, including:
and assigning the acquired serial number to a cache parameter, wherein the cache parameter is the serial number used for storing the received message.
Preferably, receiving a message, detecting whether a serial number parameter is a default value, if so, determining that the received message is an initial message, acquiring a serial number of the received initial message, updating the serial number parameter and a buffer parameter to the serial number of the initial message, and forwarding the initial message; otherwise, determining that the received message is a second message, acquiring the serial number of the received second message, updating the cache parameter to the serial number of the second message, and comparing the updated cache parameter with the serial number parameter;
if the updated cache parameter is larger than the serial number parameter, forwarding the second message according to the target address of the second message, and updating the serial number parameter to the serial number of the message; and if the updated cache parameter is less than or equal to the serial number parameter, deleting the second message.
The device for processing the redundant message based on the IEC62439-3 protocol provided by the embodiment of the invention comprises:
the comparison module is used for receiving the message and comparing whether the serial number of the received message is greater than the serial number parameter, wherein the serial number parameter is the maximum value of the serial number used for identifying the forwarded message;
if yes, forwarding the message according to the target address of the message, and updating the serial number parameter to the serial number of the message; otherwise, deleting the message.
In the embodiment of the invention, because the serial number in each message is unique, the invention determines whether the received message is a repeated message by storing the maximum value of the serial number of the forwarded message and comparing the serial number of the received message with the maximum value, thereby simplifying the process of determining the repeated message, improving the message processing efficiency, shortening the product development period, reducing the number of occupied logic resources and reducing the power consumption; because the table does not need to be established aiming at each message, an external TCAM chip does not need to be used, and the design cost of hardware is reduced.
Preferably, after receiving the message, the comparing module is further configured to:
and detecting whether the serial number parameter is a default value, if so, updating the serial number parameter to the serial number of the received message, and forwarding the received message, otherwise, comparing whether the serial number of the received message is greater than the serial number parameter.
Preferably, the comparing module is configured to compare whether the sequence number of the received packet is greater than the sequence number parameter, and specifically:
updating a cache parameter for storing the serial number of the received message into the serial number of the received message;
and comparing whether the updated cache parameter is larger than the sequence number parameter.
Preferably, after detecting whether the serial number parameter is a default value, the comparing module is further configured to:
acquiring a serial number of the received message;
updating the serial number parameter to the serial number of the received message, wherein the comparing module is specifically configured to:
assigning the obtained serial number to the serial number parameter;
updating a cache parameter for storing a sequence number of the received packet to the sequence number of the received packet, where the comparing module is specifically configured to:
and assigning the acquired serial number to a cache parameter, wherein the cache parameter is the serial number used for storing the received message.
Preferably, the comparing module receives a message, detects whether a serial number parameter is a default value, if so, determines that the received message is an initial message, obtains a serial number of the received initial message, updates both the serial number parameter and a buffer parameter to the serial number of the initial message, and forwards the initial message; otherwise, determining that the received message is a second message, acquiring the serial number of the received second message, updating the cache parameter to the serial number of the second message, and comparing the updated cache parameter with the serial number parameter;
if the updated cache parameter is greater than the serial number parameter, the processing module forwards the second message according to the target address of the second message, and updates the serial number parameter to the serial number of the message; and if the updated cache parameter is less than or equal to the serial number parameter, deleting the second message by the processing module.
The system for processing the redundant message based on the IEC62439-3 protocol provided by the embodiment of the invention comprises: the device for processing the redundant message based on the IEC62439-3 protocol; wherein,
the processing device comprises: memory and one or more processors, wherein the processing device further comprises: one or more units and a first register for storing a sequence number parameter; the one or more units stored in the memory and configured to be executed by the one or more processors, the one or more units comprising instructions for:
receiving a message, and comparing whether the serial number of the received message is greater than the serial number parameter in the first register, wherein the serial number parameter is the maximum value of the serial number used for identifying the forwarded message;
if so, forwarding the message according to the target address of the message, and updating the serial number parameter into the serial number of the message; otherwise, deleting the message.
In the embodiment of the invention, because the serial number in each message is unique, the invention determines whether the received message is a repeated message by storing the maximum value of the serial number of the forwarded message and comparing the serial number of the received message with the maximum value, thereby simplifying the process of determining the repeated message, improving the message processing efficiency, shortening the product development period, reducing the number of occupied logic resources and reducing the power consumption; because the table does not need to be established aiming at each message, an external TCAM chip does not need to be used, and the design cost of hardware is reduced.
Preferably, after receiving the message, the method further includes:
and detecting whether the serial number parameter in the first register is a default value, if so, updating the serial number parameter in the first register to the serial number of the received message, and forwarding the received message, otherwise, comparing whether the serial number of the received message is greater than the serial number parameter in the first register.
Preferably, the processing apparatus further comprises: the second register is used for storing caching parameters, wherein the caching parameters are serial numbers used for storing received messages;
comparing whether the sequence number of the received message is larger than the sequence number parameter in the first register includes:
updating the cache parameter in the second register to the serial number of the received message;
and comparing whether the updated cache parameter is larger than the sequence number parameter in the first register.
Preferably, after detecting whether the sequence number parameter in the first register is a default value, the method further includes:
acquiring a serial number of the received message;
updating the serial number parameter in the first register to the serial number of the received message, including:
assigning the obtained serial number to a serial number parameter in the first register;
updating the cache parameter in the second register to the sequence number of the received packet, including:
and assigning the acquired serial number to the cache parameter in the second register.
Drawings
Fig. 1 is a schematic flowchart of a method for processing a redundant packet based on an IEC62439-3 protocol according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of a method for receiving and transmitting a redundant message based on an IEC62439-3 protocol according to an embodiment of the present invention;
fig. 3 is a schematic diagram of a combined topology structure of an HSR loop topology and a PRP parallel topology according to an embodiment of the present invention;
fig. 4 is a schematic flowchart of a method for receiving and transmitting a redundant message based on the IEC62439-3 protocol according to a third embodiment of the present invention;
fig. 5 is a schematic structural diagram of a device for processing a redundant packet based on the IEC62439-3 protocol according to an embodiment of the present invention.
Detailed Description
The invention provides a redundant message processing method, a redundant message processing device and a redundant message processing system, which are used for simplifying the process of determining whether the message is a repeated message or not, improving the message processing efficiency, shortening the product development period, reducing the number of occupied logic resources and reducing the power consumption; the table does not need to be established for each message, and an external TCAM chip does not need to be used, so that the design cost of hardware is reduced.
The technical solutions in the present invention will be described clearly and completely with reference to the accompanying drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The invention utilizes the uniqueness of the serial number in the message to determine whether the message is a repeatedly sent message, the IEC62439-3 protocol stipulates that the message to be sent is copied, and the original message and the copied message are sequentially sent to a receiving end through different ports according to the sequence of the serial number from small to large; the receiving end compares the serial number of the received message with the maximum value of the serial number of the forwarded message, so as to determine whether the received message is a repeated message, thereby simplifying the process of determining whether the received message is the repeated message and improving the message processing efficiency.
Referring to fig. 1, at a receiving end, an embodiment of the present invention provides a method for processing a redundant packet based on an IEC62439-3 protocol, where the method includes:
s101, receiving a message, and comparing whether the serial number of the received message is greater than a serial number parameter, wherein the serial number parameter is the maximum value of the serial number used for identifying the forwarded message;
s102, if yes, forwarding the message according to the target address of the message, and updating the serial number parameter into the serial number of the message; otherwise, deleting the message.
Specifically, after receiving the message in step S101, the method further includes:
and detecting whether the serial number parameter is a default value, if so, updating the serial number parameter to the serial number of the received message, and forwarding the received message, otherwise, comparing whether the serial number of the received message is greater than the serial number parameter.
Specifically, comparing whether the sequence number of the received packet is greater than the sequence number parameter includes:
updating a cache parameter for storing the serial number of the received message into the serial number of the received message;
and comparing whether the updated cache parameter is larger than the sequence number parameter.
After detecting whether the sequence number parameter is a default value, the method further comprises:
acquiring a serial number of the received message;
updating the sequence number parameter and the cache parameter to the sequence number of the received message, which specifically comprises:
and updating the serial number parameter and the cache parameter by assigning the acquired serial number.
At this time, the method for processing the redundant message based on the IEC62439-3 protocol specifically includes:
receiving a message, detecting whether a serial number parameter is a default value, if so, determining that the received message is an initial message, acquiring the serial number of the received initial message, updating the serial number parameter and a buffer parameter into the serial number of the initial message, and forwarding the initial message; otherwise, determining that the received message is a second message, acquiring the serial number of the received second message, updating the cache parameter to the serial number of the second message, and comparing the updated cache parameter with the serial number parameter;
if the updated cache parameter is larger than the serial number parameter, forwarding the second message according to the target address of the second message, and updating the serial number parameter to the serial number of the message; and if the updated cache parameter is less than or equal to the serial number parameter, deleting the second message. And repeating the steps until all the messages sent by the sending end are received.
For ease of understanding, the scheme of the present invention will be further explained by examples below. The method for processing the packet provided in the embodiment is applied to HSR (High-availability Seamless Redundancy) and PRP (Parallel Redundancy Protocol).
Referring to fig. 2, a first embodiment of the present invention provides an overall process for receiving and transmitting a redundancy packet based on an IEC62439-3 protocol, where the method includes:
s201, a sending end copies an original message to be sent to obtain a message with the same sequence number as the original message;
s202, a sending end sends an original message and a message with the same sequence number as the original message to a receiving end through different ports;
s203, the receiving end receives the message sent by the sending end and detects whether the serial number parameter is a preset default value;
s204, if so, determining that the message received by the receiving end is an initial message, acquiring a serial number of the initial message, initializing a serial number parameter and a cache parameter, namely updating the serial number parameter and the cache parameter of the initial message by the serial number of the initial message in an assignment mode, and forwarding the initial message; the sequence number parameter is the maximum value of the sequence number used for identifying the forwarded message, and the cache parameter is the sequence number used for identifying the received message;
s205, otherwise, determining the message received by the receiving end as a second message, acquiring the serial number of the second message, and executing the step S203 until all the messages sent by the sending end are received;
s206, the receiving end updates the cache parameter by assigning the serial number of the second message, and compares the updated cache parameter with the serial number parameter;
s207, if the cache parameter is larger than the serial number parameter, determining that the second message is the original message, and executing the step S208; otherwise, determining that the second message is a repeated message, and executing step S209;
s208, updating the serial number parameter to the serial number in the second message, forwarding the second message according to the target address in the second message, and executing the step S203 until all messages sent by the sending end are received;
s209, deleting the second message, and executing the step S203 until all the messages sent by the sending end are received.
Example two:
when the sequence number in the message acquired by the receiving end for the first time is '0', detecting whether the sequence number parameter is null, if so, assigning the sequence number parameter to '0', and assigning the cache parameter to '0'; if the serial number in the message acquired by the receiving end for the second time is '1', updating the cache parameter to '1', comparing the serial number parameter with the cache parameter, if the cache parameter '1' is greater than the serial number parameter '0', determining that the message received for the second time is an original message, forwarding the message received for the second time according to the target address in the message received for the second time, and updating the serial number parameter to '1'; and receiving the message again, wherein the sequence number parameter is '1' and the buffer parameter is '1'.
If the serial number in the message acquired by the receiving end for the third time is '0', namely the message which is repeated with the message received for the first time, updating the cache parameter to '0', comparing the serial number parameter with the cache parameter, and determining that the message received for the third time is the message which is repeated with a certain forwarded message because the serial number parameter '1' is less than the cache parameter '0', and deleting the message received for the third time; and receiving the message again, wherein the sequence number parameter is '1' and the buffer parameter is '0'.
If the serial number in the message acquired by the receiving end for the fourth time is '1', namely the message which is repeated with the message received for the second time, updating the cache parameter to '1', comparing the serial number parameter with the cache parameter, and determining that the message received for the fourth time is a repeated message of a forwarded message because the serial number parameter '1' is equal to the cache parameter '1', and deleting the message received for the fourth time; and receiving the message again, wherein the sequence number parameter is '1' and the buffer parameter is '1'.
Since the IEC62439-3 protocol specifies that the sending end sends the messages to the receiving end in the order of the sequence numbers from small to large, the sending embodiment does not have the situation that the original file of the second message and/or the file repeated with the original message are received first, and then the original file of the first message and/or the file repeated with the original message are received.
Referring to fig. 3, a schematic structural diagram of a combined topology of an HSR loop topology and a PRP parallel topology is shown, where a sending end is a PRP device node 310, a receiving end is an HSR device node 320, and a redundant device is 330. Two registers are arranged on the HSR device, wherein a first register curr _ seq is used for storing serial number parameters, and a second register recv _ seq is used for storing cache parameters;
referring to fig. 4, a flow for processing a packet according to the structure shown in fig. 3 provided by the third embodiment of the present invention includes the following steps: after the PRP device and the HSR device are both powered on, it is assumed that the sending node 310 sends a message with a sequence number of "0" to the receiving node 320;
if the port a of the receiving node 320 receives the packet with the sequence number of "0", detecting whether the sequence number parameter is a preset default value; if yes, determining that the received message is an initial message, acquiring a serial number of the initial message, updating a serial number parameter stored in a first register curr _ seq and a cache parameter stored in a second register recv _ seq to be 0, and forwarding the message with the serial number of 0 received by a port A according to a target address in the message;
if the port B of the receiving node 320 receives the packet with the sequence number of "0", detecting whether the sequence number parameter is a preset default value; if not, determining that the received message is a second message, acquiring the serial number of the second message, updating the cache parameter stored in the second register recv _ seq to be '0', comparing the updated cache parameter with the serial number parameter, determining that the message with the serial number of '0' received by the port B is a message which is repeated with a certain forwarded message as the cache parameter '0' is equal to the serial number parameter '0', and deleting the message;
if the port a of the receiving node 320 receives the message with the sequence number of "1", detecting whether the sequence number parameter is a preset default value; if not, determining that the received message is a second message, acquiring the serial number of the second message, updating the cache parameter stored in the second register recv _ seq to be '1', comparing the updated cache parameter with the serial number parameter, updating the serial number parameter stored in the first register curr _ seq to be '1' because the cache parameter '1' is greater than the serial number parameter '0', determining that the message with the serial number of '1' received by the port A is an original message, and forwarding the message according to the target address in the message;
before the port B of the receiving node 320 receives the message with the sequence number of "1", the port a of the receiving node 320 receives the message with the sequence number of "2", the cache parameter stored in the second register recv _ seq is updated to "2", the updated cache parameter is compared with the sequence number parameter, since the cache parameter "2" is greater than the sequence number parameter "1", the sequence number parameter stored in the first register curr _ seq is updated to "2", the message with the sequence number of "2" received by the port a is determined to be the original message, and the message is forwarded according to the target address in the message;
at this time, the receiving node 320 has forwarded the packet with sequence number "0", the packet with sequence number "1", and the packet with sequence number "2".
Then, if the port B of the receiving node 320 receives the packet with the sequence number "1", detecting whether the sequence number parameter is a preset default value; if not, determining that the received message is a second message, acquiring the serial number of the second message, updating the cache parameter stored in the second register recv _ seq to be '1', comparing the updated cache parameter with the serial number parameter, determining that the message with the serial number of '1' received by the port B is a message which is repeated with a certain forwarded message because the cache parameter '1' is less than the serial number parameter '2', and deleting the message;
according to the above rules, all messages sent by the sending node 310 are compared and processed.
Referring to fig. 5, an embodiment of the present invention provides a device for processing a redundant packet based on IEC62439-3 protocol, including,
a comparing module 501, configured to receive a packet and compare whether a sequence number of the received packet is greater than a sequence number parameter, where the sequence number parameter is a maximum value of a sequence number used for identifying a forwarded packet;
a processing module 502, configured to forward the packet according to the destination address of the packet and update the serial number parameter to the serial number of the packet if the packet is a packet in the destination address of the packet; otherwise, deleting the message.
Specifically, after receiving the packet, the comparing module 501 is further configured to:
and detecting whether the serial number parameter is a default value, if so, updating the serial number parameter to the serial number of the received message, and forwarding the received message, otherwise, comparing whether the serial number of the received message is greater than the serial number parameter.
Specifically, the comparing module 501 is configured to compare whether the sequence number of the received packet is greater than the sequence number parameter, and specifically:
updating a cache parameter for storing the serial number of the received message into the serial number of the received message;
and comparing whether the updated cache parameter is larger than the sequence number parameter.
Specifically, the comparing module 501 is specifically configured to: messages are received from at least two ports.
Specifically, after detecting whether the serial number parameter is a default value, the comparing module 501 is further configured to:
acquiring a serial number of the received message;
the sequence number parameter is updated to the sequence number of the received packet, and the comparing module 501 is specifically configured to:
assigning the obtained serial number to the serial number parameter;
the comparing module 501 is specifically configured to update a cache parameter for storing a serial number of the received packet to the serial number of the received packet:
and assigning the acquired serial number to a cache parameter, wherein the cache parameter is the serial number used for storing the received message.
In particular, the processing device may be a PRP device or an HSR device.
The system for processing the redundant message based on the IEC62439-3 protocol provided by the embodiment of the invention comprises: the device for processing the redundant message based on the IEC62439-3 protocol; wherein,
the processing device comprises: memory and one or more processors, wherein the processing device further comprises: one or more units and a first register for storing a sequence number parameter; the one or more units stored in the memory and configured to be executed by the one or more processors, the one or more units comprising instructions for:
receiving a message, and comparing whether the serial number of the received message is greater than the serial number parameter in the first register, wherein the serial number parameter is the maximum value of the serial number used for identifying the forwarded message;
if so, forwarding the message according to the target address of the message, and updating the serial number parameter into the serial number of the message; otherwise, deleting the message.
Specifically, the processing apparatus further includes: the second register is used for storing caching parameters, wherein the caching parameters are serial numbers used for storing received messages;
comparing whether the sequence number of the received message is larger than the sequence number parameter in the first register includes:
updating the cache parameter in the second register to the serial number of the received message;
and comparing whether the updated cache parameter is larger than the sequence number parameter in the first register.
In summary, embodiments of the present invention provide a method, an apparatus, and a system for processing a redundant packet, so as to simplify a process of determining whether the packet is a repeated packet, improve efficiency of packet processing, shorten a product development period, reduce the number of occupied logic resources, and reduce power consumption; the table does not need to be established for each message, and an external TCAM chip does not need to be used, so that the design cost of hardware is reduced.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.
Claims (10)
1. A method for processing a redundant message, wherein the redundant message is a message based on IEC62439-3 protocol, comprising:
receiving a message, and comparing whether the serial number of the received message is greater than a serial number parameter, wherein the serial number parameter is the maximum value of the serial number used for identifying the forwarded message;
if so, forwarding the message according to the target address of the message, and updating the serial number parameter into the serial number of the message; otherwise, deleting the message.
2. The method of claim 1, wherein after receiving the message, the method further comprises:
and detecting whether the serial number parameter is a default value, if so, updating the serial number parameter to the serial number of the received message, and forwarding the received message, otherwise, comparing whether the serial number of the received message is greater than the serial number parameter.
3. The method of claim 2, wherein comparing whether the sequence number of the received packet is greater than the sequence number parameter comprises:
updating a cache parameter for storing the serial number of the received message into the serial number of the received message;
and comparing whether the updated cache parameter is larger than the sequence number parameter.
4. The method of claim 3, wherein after detecting whether the sequence number parameter is a default value, the method further comprises:
acquiring a serial number of the received message;
updating the serial number parameter to the serial number of the received message, including:
assigning the obtained serial number to the serial number parameter;
updating a cache parameter for storing the serial number of the received message to the serial number of the received message, including:
and assigning the acquired serial number to a cache parameter, wherein the cache parameter is the serial number used for storing the received message.
5. A device for processing redundant messages, wherein the redundant messages are messages based on IEC62439-3 protocol, comprising,
the comparison module is used for receiving the message and comparing whether the serial number of the received message is greater than the serial number parameter, wherein the serial number parameter is the maximum value of the serial number used for identifying the forwarded message;
if yes, forwarding the message according to the target address of the message, and updating the serial number parameter to the serial number of the message; otherwise, deleting the message.
6. The processing apparatus as claimed in claim 5, wherein after receiving the packet, the comparing module is further configured to:
and detecting whether the serial number parameter is a default value, if so, updating the serial number parameter to the serial number of the received message, and forwarding the received message, otherwise, comparing whether the serial number of the received message is greater than the serial number parameter.
7. The processing apparatus according to claim 6, wherein the comparing module is configured to compare whether a sequence number of the received packet is greater than a sequence number parameter, and specifically:
updating a cache parameter for storing the serial number of the received message into the serial number of the received message;
and comparing whether the updated cache parameter is larger than the sequence number parameter.
8. The processing apparatus as claimed in claim 7, wherein after detecting whether the sequence number parameter is a default value, the comparing module is further configured to:
acquiring a serial number of the received message;
updating the serial number parameter to the serial number of the received message, wherein the comparing module is specifically configured to:
assigning the obtained serial number to the serial number parameter;
updating a cache parameter for storing a sequence number of the received packet to the sequence number of the received packet, where the comparing module is specifically configured to:
and assigning the acquired serial number to a cache parameter, wherein the cache parameter is the serial number used for storing the received message.
9. A system for processing a redundant message, wherein the redundant message is a message based on IEC62439-3 protocol, comprising: the processing apparatus of any one of claims 5-8; wherein,
the processing device comprises: memory and one or more processors, wherein the processing device further comprises: one or more units and a first register for storing a sequence number parameter; the one or more units stored in the memory and configured to be executed by the one or more processors, the one or more units comprising instructions for:
receiving a message, and comparing whether the serial number of the received message is greater than the serial number parameter in the first register, wherein the serial number parameter is the maximum value of the serial number used for identifying the forwarded message;
if so, forwarding the message according to the target address of the message, and updating the serial number parameter into the serial number of the message; otherwise, deleting the message.
10. The processing system of claim 9, wherein the processing device further comprises: the second register is used for storing caching parameters, wherein the caching parameters are serial numbers used for storing received messages;
comparing whether the sequence number of the received message is larger than the sequence number parameter in the first register includes:
updating the cache parameter in the second register to the serial number of the received message;
and comparing whether the updated cache parameter is larger than the sequence number parameter in the first register.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610890858.9A CN106452695A (en) | 2016-10-12 | 2016-10-12 | Redundant message processing method, apparatus and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610890858.9A CN106452695A (en) | 2016-10-12 | 2016-10-12 | Redundant message processing method, apparatus and system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN106452695A true CN106452695A (en) | 2017-02-22 |
Family
ID=58173594
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610890858.9A Pending CN106452695A (en) | 2016-10-12 | 2016-10-12 | Redundant message processing method, apparatus and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106452695A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114553969A (en) * | 2020-11-20 | 2022-05-27 | 比亚迪股份有限公司 | Data transmission method, electronic device and storage medium |
CN115102673A (en) * | 2022-04-29 | 2022-09-23 | 中国船舶重工集团公司第七一六研究所 | PRP protocol repeated frame distinguishing and processing method and system based on frame memory pool |
WO2023221117A1 (en) * | 2022-05-20 | 2023-11-23 | 北京小米移动软件有限公司 | Message receiving method, apparatus, storage medium and electronic device |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101247253A (en) * | 2008-03-21 | 2008-08-20 | 清华大学 | Multicast Transmission Method Based on Virtual Distribution Network in IP Network |
CN102201903A (en) * | 2011-06-07 | 2011-09-28 | 合肥华云通信技术有限公司 | Simple and reliable remote file transmission method |
CN105871737A (en) * | 2016-04-29 | 2016-08-17 | 北京东土科技股份有限公司 | Communication flow control device used for communication between redundant networks |
CN105978762A (en) * | 2016-04-27 | 2016-09-28 | 刘巍 | Redundant Ethernet data transmission device, system and method thereof |
-
2016
- 2016-10-12 CN CN201610890858.9A patent/CN106452695A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101247253A (en) * | 2008-03-21 | 2008-08-20 | 清华大学 | Multicast Transmission Method Based on Virtual Distribution Network in IP Network |
CN102201903A (en) * | 2011-06-07 | 2011-09-28 | 合肥华云通信技术有限公司 | Simple and reliable remote file transmission method |
CN105978762A (en) * | 2016-04-27 | 2016-09-28 | 刘巍 | Redundant Ethernet data transmission device, system and method thereof |
CN105871737A (en) * | 2016-04-29 | 2016-08-17 | 北京东土科技股份有限公司 | Communication flow control device used for communication between redundant networks |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114553969A (en) * | 2020-11-20 | 2022-05-27 | 比亚迪股份有限公司 | Data transmission method, electronic device and storage medium |
CN114553969B (en) * | 2020-11-20 | 2024-01-30 | 比亚迪股份有限公司 | Data transmission method, electronic device and storage medium |
CN115102673A (en) * | 2022-04-29 | 2022-09-23 | 中国船舶重工集团公司第七一六研究所 | PRP protocol repeated frame distinguishing and processing method and system based on frame memory pool |
CN115102673B (en) * | 2022-04-29 | 2023-11-03 | 中国船舶集团有限公司第七一六研究所 | PRP protocol repeated frame discrimination processing method and system based on frame memory pool |
WO2023221117A1 (en) * | 2022-05-20 | 2023-11-23 | 北京小米移动软件有限公司 | Message receiving method, apparatus, storage medium and electronic device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10742722B2 (en) | Server load balancing | |
CN102104541B (en) | Header processing engine | |
US9875126B2 (en) | Hash-based load balancing for bonded network interfaces | |
WO2015114473A1 (en) | Method and apparatus for locality sensitive hash-based load balancing | |
CN108632165B (en) | Message processing method, device and equipment | |
CN109639579B (en) | Multicast message processing method and device, storage medium and processor | |
WO2024007844A1 (en) | Packet forwarding method and apparatus, computing device, and offload card | |
CN106878194A (en) | A kind of message processing method and device | |
CN109921995B (en) | A method for configuring address table, FPGA and network device applying the FPGA | |
WO2014138004A1 (en) | Forwarding ethernet packets | |
US20160050145A1 (en) | Table-based load balancing for bonded network interfaces | |
CN106452695A (en) | Redundant message processing method, apparatus and system | |
WO2016177191A1 (en) | Packet processing method and device | |
CN111193756B (en) | VXLAN tunnel load balancing method and related equipment | |
CN107046503B (en) | Message transmission method, system and device | |
CN108566344B (en) | Message processing method and device | |
CN109286584B (en) | Fragmentation recombination method, device and equipment in multi-core system | |
CN103428185B (en) | Packet filtering/method for limiting speed, system and device | |
CN109005116B (en) | Message forwarding method and device | |
CN108259348B (en) | A message transmission method and device | |
US9979650B1 (en) | Forwarding packets using a probabilistic filter and a grouping technique | |
CN108092896B (en) | Stacking system and aggregation group creation apparatus | |
CN108200221B (en) | Method and device for synchronizing conversion rules in network address conversion environment | |
CN104252504A (en) | Method, equipment and system for inquiring data | |
CN106878356B (en) | Scheduling method and computing node |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20170222 |