Message processing method and device, electronic equipment and medium
Through redundant processing and flexible addition of redundant labels, the problem of parsing errors caused by inflexible addition of message sequence numbers in TSN communication is solved, the flexibility and accuracy of the communication process are improved, and the reliability of the communication process is enhanced.
Patent Information
- Application Number
- CN202410691245.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-30
- Publication Date
- 2024-09-03
AI Technical Summary
In the field of time-sensitive network (TSN) communication, the method of adding sequence numbers to messages in the existing technology is not flexible enough, resulting in parsing errors during the communication process, unable to adapt to various needs, and affecting the reliability and accuracy of the communication process.
By performing redundant processing on the original message, multiple redundant messages are generated, and a sequence number is set for each redundant message. The designated location is determined based on the characteristic information of the redundant message, a redundant label is generated, and added into the redundant message to form a target message and send it to the receiving end through multiple paths; the receiving end parses the redundant tags to eliminate duplicates and restore the original message.
It improves the flexibility and parsing accuracy of message processing, solves the problem of incorrect parsing of messages, and enhances the reliability of the communication process.
Smart Images

Figure CN118590451A
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, specifically to the field of time sensitive network (TSN) communication technology, and in particular to a message processing method, device, electronic device and medium. Background Art
[0002] In the field of TSN communication, data needs to be transmitted between devices, such as messages can be transmitted between the sender and the receiver. In some cases, a sequence number needs to be added to the message, which indicates the type of message and instructs the receiver how to process the message. When the receiver receives the message, it parses the message to obtain the sequence number and performs relevant processing on the message based on the sequence number.
[0003] However, in the related art, when adding serial numbers to messages, the adding method is not flexible enough and cannot adapt to more needs. In addition, the process of parsing the message to obtain the serial number after receiving the message is prone to errors, which leads to problems in the communication process. Summary of the invention
[0004] The embodiments of the present application aim to solve at least one of the technical problems in the related art to a certain extent. To this end, the embodiment of the present application aims to provide a message processing method, device, electronic device, storage medium and program product.
[0005] The embodiment of the present application provides a message processing method, which is applied to a sending end, and the message processing method includes: performing redundancy processing on an original message to obtain multiple redundant messages, and setting a sequence number for each redundant message to indicate message redundancy; determining a specified position from the redundant message based on message feature information of the redundant message; generating a redundant label based on the sequence number for each redundant message, and adding the redundant label to the specified position of the redundant message to obtain a target message; sending multiple target messages to a receiving end through multiple paths respectively; wherein, after the receiving end receives at least one target message, parsing the redundant label in each target message to obtain the sequence number of each target message, and performing deduplication processing on the at least one target message based on the sequence number to obtain the original message.
[0006] Exemplarily, generating the redundant tag based on the serial number includes: generating the redundant tag based on the serial number and the position information of the designated position.
[0007] Exemplarily, the redundant tag includes a protocol type field, a reserved field and a serial number field; the protocol type field is used to store the protocol type information of the redundant tag, the reserved field is used to store the location information, and the serial number field is used to store the serial number.
[0008] Exemplarily, determining the specified position from the redundant message based on the message characteristic information of the redundant message includes: determining important fields from the redundant message based on the message characteristic information of the redundant message; determining the specified position from any position after the important fields in the redundant message.
[0009] Exemplarily, the message characteristic information of the redundant message is represented by message type information; when the message type information indicates that the message type of the redundant message is an IP message type, the specified position is any position after the IP header in the redundant message; when the message type information indicates that the message type of the redundant message is a UDP message type, the specified position is any position after the UDP header in the redundant message.
[0010] Exemplarily, the redundant message includes, in sequence: a receiving end address field, a sending end address field, a field indicating the type or length of the actual data part, a field of the actual data part, and a redundant check field; the designated position is after the sending end address field.
[0011] Exemplarily, when the redundant message further includes a LAN tag field, the LAN tag field is between the sender address field and the field indicating the type or length of the actual data portion, and the designated position is after the LAN tag field.
[0012] Exemplarily, the adding the redundant tag to the designated position of the redundant message to obtain the target message includes: adding the redundant tag to the designated position of the redundant message to obtain a spliced message; processing the spliced message to obtain a new redundant check code; replacing the original redundant check code in the spliced message with the new redundant check code to obtain the target message.
[0013] Another embodiment of the present application provides a message processing method, which is applied to a receiving end, and the message processing method includes: receiving at least one target message; parsing redundant labels in each target message to obtain a sequence number of each target message; performing deduplication processing on the at least one target message based on the sequence number to obtain an original message; wherein the target message is processed and sent by the sending end based on the above-mentioned message processing method.
[0014] Exemplarily, the redundant tag includes a protocol type field, a reserved field and a serial number field; the protocol type field is used to store the protocol type information of the redundant tag, the reserved field is used to store the location information, and the serial number field is used to store the serial number.
[0015] Exemplarily, parsing the redundant label in each target message to obtain the serial number of each target message includes: parsing the protocol type field and the reserved field in the redundant label to obtain the type information and the position information of the redundant label; verifying the type information and the position information of the redundant label; after successful verification, obtaining the serial number of the target message from the serial number field of the redundant label.
[0016] Exemplarily, the verification of the type information and the position information of the redundant label includes: determining whether the protocol type information of the redundant label is preset information; if so, determining whether the position information in the reserved field is consistent with the position of the redundant label in the target message, and if so, the verification is successful.
[0017] Exemplarily, performing deduplication processing on the at least one target message based on the sequence number to obtain the original message includes: performing deduplication processing on the at least one target message based on the sequence number to obtain a target message; removing redundant labels in the target message to obtain the original message.
[0018] Another embodiment of the present application provides a message processing device, which is applied to a sending end, and the message processing device includes: a redundancy processing module, which is used to perform redundancy processing on an original message to obtain multiple redundant messages, and set a sequence number for each redundant message to indicate the redundancy of the message; a determination module, which is used to determine a specified position from the redundant message based on the message feature information of the redundant message; a generation module, which is used to generate a redundant label based on the sequence number for each redundant message; an adding module, which is used to add the redundant label to the specified position of the redundant message to obtain a target message; a sending module, which is used to send multiple target messages to a receiving end through multiple paths respectively; wherein, after the receiving end receives at least one target message, the redundant label in each target message is parsed to obtain the sequence number of each target message, and the at least one target message is deduplicated based on the sequence number to obtain the original message.
[0019] Exemplarily, the generating module is further used to generate the redundant label based on the serial number and the position information of the designated position.
[0020] Exemplarily, the redundant tag includes a protocol type field, a reserved field and a serial number field; the protocol type field is used to store the protocol type information of the redundant tag, the reserved field is used to store the location information, and the serial number field is used to store the serial number.
[0021] Exemplarily, the determination module is further used to: determine an important field from the redundant message based on message feature information of the redundant message; and determine the designated position from any position after the important field in the redundant message.
[0022] Another embodiment of the present application provides a message processing device, which is applied to a receiving end, and the message processing device includes: a receiving module, used to receive at least one target message; a parsing module, used to parse the redundant tags in each target message to obtain the serial number of each target message; an elimination processing module, used to perform de-duplication processing on the at least one target message based on the serial number to obtain the original message; wherein the target message is processed and sent by the sending end based on the above-mentioned message processing device.
[0023] Exemplarily, the redundant tag includes a protocol type field, a reserved field and a serial number field; the protocol type field is used to store the protocol type information of the redundant tag, the reserved field is used to store the location information, and the serial number field is used to store the serial number.
[0024] Exemplarily, the parsing module is also used to: parse the protocol type field and the reserved field in the redundant label to obtain the type information and the position information of the redundant label; verify the type information and the position information of the redundant label; after successful verification, obtain the serial number of the target message from the serial number field of the redundant label.
[0025] Exemplarily, the verification of the type information and the position information of the redundant label includes: determining whether the protocol type information of the redundant label is preset information; if so, determining whether the position information in the reserved field is consistent with the position of the redundant label in the target message, and if so, the verification is successful.
[0026] Another embodiment of the present application provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the method described in any one of the above embodiments are implemented.
[0027] Another embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the method described in any one of the above embodiments are implemented.
[0028] Another embodiment of the present application provides a computer program product, which includes instructions. When the instructions are executed by a processor of a computer device, the computer device can perform the steps of the method described in any of the above embodiments.
[0029] In the above implementation manner, the original message is processed redundantly to obtain multiple redundant messages, and a sequence number used to indicate message redundancy is set for each redundant message; based on the message feature information of the redundant message, a designated position is determined from the redundant message; for each redundant message, a redundant label is generated based on the sequence number, and the redundant label is added to the designated position of the redundant message to obtain a target message; the multiple target messages are sent to the receiving end through multiple paths respectively; wherein, after the receiving end receives at least one target message, the redundant label in each target message is parsed to obtain the sequence number of each target message, and the at least one target message is deduplicated based on the sequence number to obtain the original message, thereby improving the flexibility of message processing and the accuracy of message parsing. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 A schematic diagram of a message format is shown;
[0031] Figure 2 A schematic diagram showing a frame message format in a virtual local area network is shown;
[0032] Figure 3 A schematic diagram of a redundant tag according to an embodiment of the present application is shown;
[0033] Figure 4 A schematic diagram of a message in which redundant labels are added according to an embodiment of the present application is shown;
[0034] Figure 5 A flowchart of a message processing method provided in an embodiment of the present application;
[0035] Figure 6 A flowchart of a message processing method provided in another embodiment of the present application;
[0036] Figure 7 A schematic diagram showing a redundant tag according to an embodiment of the present application is shown;
[0037] Figure 8 A schematic diagram of a message processing device provided in an embodiment of the present application;
[0038] Fig. 9 A schematic diagram of another message processing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0039] Embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.
[0040] It will be understood that the examples of message content and message size given below are only used to assist in understanding the present application and do not constitute any specific limitation to the present application.
[0041] Figure 1 A schematic diagram showing a message format.
[0042] Figure 1 The figure shows an Ethernet frame message format, which generally includes a destination address DMAC, a source address SMAC, a protocol type Type, actual data Data, and a check code CRC.
[0043] The destination address DMAC stands for Destination MAC Address. The data size can be 6 bytes. It is also called the destination MAC address, indicating the destination device to which the frame message is to be transmitted. In this application, the destination address can also be called the address of the receiving end.
[0044] The source address SMAC stands for Source MAC Address. The data size can be 6 bytes. It is also called the source MAC address, indicating the sender of the frame message. In this application, the source address can also be called the address of the sender.
[0045] The protocol type Type can be used to indicate the protocol of the message.
[0046] The actual data Data represents the actual business data.
[0047] The full name of the check code CRC is Cyclic Redundancy Check, which is a cyclic redundancy check code.
[0048] Figure 2 A schematic diagram showing the frame message format in a virtual local area network is shown.
[0049] like Figure 2 As shown in the figure, the IEEE802.1Q standard Figure 1 The Ethernet frame message format shown in the figure has been modified by adding a 4-byte 802.1Q Tag (a label) between the source MAC address and the protocol type. Figure 2The IEEE802.1Q standard virtual LAN VLAN frame message format shown in the figure. IEEE 802.1Q is a standard for virtual LAN (VLAN) that defines a method for implementing VLAN identification in Ethernet frame messages. The 802.1Q standard modifies the format of Ethernet frames to allow VLAN tag information to be inserted into frame messages, allowing network administrators to implement logical isolation on the physical topology. When a switch receives a frame message with an 802.1Q tag, it assigns the frame message to the corresponding virtual LAN VLAN based on the VLAN identifier in the message. This allows network administrators to implement multiple logically isolated networks on a single physical infrastructure, thereby improving network security and management flexibility.
[0050] The following is a brief introduction to the IEEE 802.1Q VLAN frame format:
[0051] Figure 2 The Destination address indicates the Destination MAC Address, which can be 6 bytes in size. It is the destination MAC address and indicates the destination device to which the frame message is to be transmitted.
[0052] Source address indicates Source MAC Address, which can be 6 bytes in size. It is the source MAC address and indicates the sender of the frame message.
[0053] 802.1Q Tag is a VLAN tag with a size of 4 bytes. It contains the relevant information of the virtual local area network VLAN. The specific content may include Type, PRI, CFI, and VID:
[0054] (1) Type refers to the Tag Protocol Identifier (TPID), which can be 2 bytes (i.e., 16 bits) in size, indicating that the subsequent field is an 802.1Q tag.
[0055] (2) PRI refers to Priority Code Point (PCP), which can be 3 bits in size and is used to specify the priority of the frame message.
[0056] (3) CFI is used to identify the drop priority of the message, and may include a Drop Eligible Indicator (DEI), which may be 1 bit in size and is used to indicate whether the frame message is suitable for being dropped in the event of congestion. Specifically, CFI is the CFI (Canonical Format Indicator) field in the internal drop priority context information VLAN Tag, also known as DEI (Drop Eligible Indicator), which can be used to identify the drop priority of the message.
[0057] (4) VID refers to VLAN Identifier, which can be 12 bits in size and is used to represent the ID of the VLAN identifier.
[0058] Length / Type, the size can be 2 bytes, indicating the type or length of the data field.
[0059] Data means Payload, which can be 42-1500 bytes in size and represents the actual data part.
[0060] Frame Check Sequence (FCS), which can be 4 bytes in size, is a redundant check code used for error detection.
[0061] During the message transmission process, IEEE 802.1CB is a protocol standard in the TSN protocol suite that ensures high-reliability operation of the network. This standard defines a reliable frame replication and elimination mechanism (Frame Replication and Elimination for Reliability, FRER). The FRER mechanism is designed to enhance the reliability of Ethernet networks. FRER uses frame replication and elimination technology to provide redundancy protection and quickly restore communications from connection failures. The FRER mechanism splits (such as copying) the data stream (message) into one or more member streams at the sending end, so that the original stream becomes a composite stream composed of multiple member streams, and copies the original stream data frame to the member streams. These member streams will be sent to the destination node (such as the receiving end) through different redundant paths. Then, these member streams are combined at other nodes (such as the receiving end), duplicate data frames are eliminated, and the reconstructed data stream is obtained.
[0062] To facilitate understanding of the FRER mechanism, the following example is used as a reference: For example, the sender needs to send data A (which can be a message) to the receiver. The sender copies data A into three identical copies A1, A2, and A3, and configures sequence numbers (such as a1, a2, and a3) for A1, A2, and A3 respectively. Sequence numbers a1, a2, and a3 indicate that A1, A2, and A3 are copied data. A1, A2, and A3 are sent to the receiver through three paths respectively. The receiver receives one or more of A1, A2, and A3. For example, after receiving A1, A2, and A3, the receiver parses and obtains sequence numbers a1, a2, and a3. Based on sequence numbers a1, a2, and a3, the receiver knows that A1, A2, and A3 are copied data. The receiver deletes two of the data, such as A2 and A3, and the remaining A1 is the final data. Redundant data transmission through the FRER mechanism can effectively reduce the time consumption of path planning caused by equipment failure.
[0063] When the sender sends a message to the receiver based on the FRER mechanism, the sender needs to add the sequence number to the message for sending, so that the receiver can parse the received message to obtain the sequence number. In one example, the sender saves the sequence number by introducing a redundant tag, and adds the redundant tag to the message before sending the message. The redundant tag can be expressed as R-TAG or RTAG.
[0064] Figure 3 A schematic diagram of a redundant tag according to an embodiment of the present application is shown.
[0065] like Figure 3 As shown, the redundant label RTAG may include three parts, namely, the protocol type field (Ether Type), the reserved field (Reserved), and the sequence number field (Sequence Number). The information stored in the Ether Type field may be a numerical value, and its value may be a hexadecimal value F1C1. The Ether Type field is used to indicate that the redundant label RTAG is a label in a sequence encoding / decoding function format. The receiving end can know whether the message is a duplicate message based on the content in the Ether Type field, so as to eliminate the duplicate message. Reserved occupies the last two octets of RTAG. Sequence Number is used to store the encoded sequence number in the last two bytes of RTAG.
[0066] In one example, when the upper layer (upstream device, such as a transmitter) issues a service request (message sending request), the redundant label sequence encoding / decoding function includes the following functions:
[0067] The sender copies the lower 16 bits of the sequence number to be added to the Sequence Number field of RTAG to create the RTAG information word, fills the Reserved field with 0, and inserts the EtherType. In addition to the destination address and source address, the RTAG information is used as the first byte of the MAC layer service data unit parameters (such as data frames and messages). In this example, the position of the RTAG label is usually fixed, such as Figure 2 As shown, the RTAG tag is usually after the 802.1Q Tag (ie, VLAN tag), and the length of the RTAG tag is usually 6 bytes. Therefore, after the RTAG tag is added to the message, the length of the MAC layer data unit parameter (such as data frame, message) is also increased by 6 bytes accordingly.
[0068] When the lower layer (downstream device, such as the receiving end) issues a service indication (message reception indication), the redundant label sequence encoding / decoding function includes the following functions:
[0069] The receiving end parses the first two bytes of the MAC layer service data unit parameters (such as data frames and messages) (i.e., the first two bytes in the RTAG tag) to see if they are equal to 0xF1C1. If so, and the length of the parsed MAC layer service data unit parameters (such as data frames and messages) is at least 6 bytes, it is determined that the RTAG sequence encoding / decoding function needs to be performed. For example, the first 6 bytes of the MAC layer service data unit parameters (such as data frames and messages) except the destination address and source address need to be deleted (i.e., the RTAG in the message needs to be deleted) to shorten the length of the entire message by 6 bytes, and the serial number in the redundant tag RTAG is parsed to determine whether the message is duplicate data based on the serial number to facilitate the deletion of duplicate data. In this example, the content of the reserved field is ignored.
[0070] Figure 4 A schematic diagram of a message in which redundant labels are added according to an embodiment of the present application is shown.
[0071] like Figure 4As shown, before adding the redundant tag RTAG, each redundant message includes at least the receiving end address field DMAC, the sending end address field SMAC, the field Type / Len indicating the type or length of the actual data part, the field PayLoad Data of the actual data part, and the redundant check field Fcs. In some cases, the redundant tag RTAG is usually added at a fixed position in the message, such as between SMAC and Type / Len. In another example, if the message also includes a local area network tag field VLAN TAG, and the local area network tag field VLAN TAG is usually between SMAC and Type / Len, then the redundant tag RTAG is usually added at a fixed position in the message, such as between VLAN TAG and Type / Len.
[0072] Adding redundant tags at fixed positions in the message will introduce a new problem when the message is forwarded in the network topology. Since the message becomes longer after adding RTAG, and since the redundant tags are added after the VLAN TAG field and before the Type / Len and Payload fields, other devices in the network topology (such as the receiving end) cannot obtain the VLAN TAG field and the subsequent Type / Len or Payload fields of the message in the conventional parsing method, or parsing errors are prone to occur during the parsing process, resulting in the message not being correctly parsed and processed. For example, after receiving the message, the downstream device (receiving end) should parse and transparently transmit the message, but the receiving end may parse the VLAN information or PayLoad information of the message incorrectly during the process of identifying and parsing the message, resulting in error processing.
[0073] In view of this, the present application also proposes a message processing method so as to flexibly add a redundant tag RTAG to the message, which can not only ensure that the redundant tag RTAG can be normally identified, but also solve the problem that the message cannot be correctly parsed.
[0074] Figure 5 A flowchart of a message processing method provided for an implementation mode of the present application.
[0075] like Figure 5 As shown, the message processing method 500 provided in the embodiment of the present application includes, for example, steps S510-S540, and the message processing method 500 is applied to the sending end, for example.
[0076] Step S510, performing redundancy processing on the original message to obtain multiple redundant messages, and setting a sequence number for indicating message redundancy for each redundant message.
[0077] Step S520: determining a designated position from the redundant message based on the message characteristic information of the redundant message.
[0078] Step S530: for each redundant message, generate a redundant tag based on the sequence number, and add the redundant tag to a specified position of the redundant message to obtain a target message.
[0079] Step S540: sending multiple target messages to the receiving end through multiple paths respectively.
[0080] Exemplarily, after receiving at least one target message, the receiving end parses the redundant label in each target message to obtain the sequence number of each target message, and performs deduplication processing on at least one target message based on the sequence number to obtain the original message.
[0081] In this embodiment, the sending end and the receiving end can process the message based on the frame replication and elimination mechanism FRER. Specifically, when the sending end needs to send the original message to the receiving end, the sending end first performs redundancy processing on the original message. The redundancy processing includes replication processing. Of course, the redundancy processing can also include processing such as adding relevant information or adjusting the format of the original message. After the redundant processing, multiple redundant messages are obtained, and the contents of the multiple redundant messages can be the same or at least the actual data is the same. After obtaining multiple redundant messages, a sequence number can be set for each redundant message, and the sequence number can be used to indicate that the multiple redundant messages are obtained through redundant processing.
[0082] Next, the sender determines the designated position from the redundant message based on the message characteristic information of the redundant message. The designated positions corresponding to different message characteristics may be different. After determining the designated position, the sender can add the redundant label generated based on the sequence number to the designated position to obtain the target message. Each redundant message is added with a corresponding redundant label to obtain a target message. The target message includes the content of the redundant message and the newly added redundant label.
[0083] After obtaining multiple target messages, the transmitter can send the multiple target messages to the receiver through multiple paths respectively. The receiver can receive at least one target message. For example, when there are no problems or delays in multiple paths, the receiver can normally receive multiple target messages. If there are problems or delays in some of the multiple paths, the receiver may not be able to receive all the multiple target messages, but the receiver can still normally receive the target messages from the normal paths. After the receiver receives at least one target message, it parses the redundant label of each target message to obtain a sequence number, and knows whether the received target message is a duplicate message based on the sequence number. For example, when the receiver receives a target message, the target message is not a duplicate message at this time, and the target message can be used as the original message or the redundant label in the target message can be deleted to obtain the original message. When the receiving end receives multiple target messages, it is known based on the sequence numbers of the multiple target messages that the multiple target messages are duplicated. At this time, the receiving end deletes the duplicate messages to leave one target message, and uses the remaining target message as the original message or deletes the redundant labels in the target message to obtain the original message.
[0084] It can be understood that the embodiments of the present application determine the designated location for adding redundant labels based on the message characteristic information. Different message characteristic information can correspond to different designated locations, so as to flexibly select the designated location according to actual conditions or actual needs, thereby improving the flexibility of message processing. Different designated locations can be set based on different message characteristic information to avoid the influence of redundant labels on important information in the message as much as possible, thereby improving the accuracy of message parsing.
[0085] In one example, based on the message feature information of the redundant message, the important field can be determined from the redundant message, and the specified position can be determined from any position after the important field in the redundant message. In this way, the redundant tag can be added after the important field to avoid the influence of the redundant tag on the important field in the message, so as to improve the correctness of the analysis of the important field when parsing the message.
[0086] In one example, the message characteristic information of the redundant message can be represented by the message type information, and the designated positions corresponding to different message types can be different. For example, when the message type information indicates that the message type of the redundant message is an IP message type, the designated position can be any position after the IP header in the redundant message, and of course in some examples the designated position can be after the actual data field of the IP message. For another example, when the message type information indicates that the message type of the redundant message is a UDP message type, the designated position can be any position after the UDP header in the redundant message, and of course in some examples the designated position can be after the actual data field of the UDP message.
[0087] Specifically, through the embodiments of the present application, the designated location for adding RTAG can be flexibly selected according to the needs. Any location after the MAC address can be selected, not limited to after the SMAC, and can also be added in the middle of the message or at the end of the message. The selection of the RTAG location can avoid the location of important information or sensitive information in the message from being modified. For example, when transmitting IP messages in the network, the second layer header and IP header information are usually more concerned. The information in this message field cannot usually be changed at will. At this time, you can choose to add RTAG to the PayLoad (actual data part) information after the IP header, or it can be added at the end of the message. When the message is a UDP message, it can also be added to the PayLoad information after the UDP header, or it can be added at the end of the message.
[0088] In another example, a redundant tag may be generated based on the sequence number and the location information of the specified location. That is, the redundant tag includes at least the sequence number and the location information of the specified location, and the location information may indicate the specific location of the redundant tag in the redundant message, such as after which field.
[0089] In one example, reference Figure 3 The redundant tag includes a protocol type field (EtherType), a reserved field (Reserved), and a sequence number field (Sequence number). The protocol type field is used to store the protocol type information of the redundant tag, the reserved field is used to store the location information, and the sequence number field is used to store the sequence number.
[0090] In one example, reference Figure 4 The redundant message includes at least: a receiving end address field (DMAC), a sending end address field (SMAC), a field indicating the type or length of the actual data part (Type / Len), a field of the actual data part (PayLoad Data), and a redundant check field (Fcs); the specified position is after the sending end address field (SMAC), for example, the redundant tag RTAG can be at any position after the sending end address field (SMAC).
[0091] In another example, reference Figure 4In addition to the following sequentially included in the redundant message: the receiving end address field (DMAC), the sending end address field (SMAC), the field indicating the type or length of the actual data part (Type / Len), the field of the actual data part (PayLoad Data), and the redundant check field (Fcs), if the redundant message also includes the LAN tag field VLANTAG, usually the LAN tag field VLAN TAG is between the sending end address field (SMAC) and the field indicating the type or length of the actual data part (Type / Len). At this time, the specified position is after the LAN tag field VLAN TAG. For example, the redundant tag RTAG can be at any position after the LAN tag field VLAN TAG.
[0092] In another example, a redundant tag can be added to a specified position of a redundant message to obtain a spliced message, and the spliced message is processed to obtain a new redundant check code, and then the new redundant check code replaces the original redundant check code in the spliced message to obtain a target message.
[0093] Specifically, when it is necessary to add a redundant tag RTAG to a redundant message, the sender adds a 6-byte RTAG field at a specified position of the redundant message. At this time, the content and length of the message have changed, and the redundant check code Fcs needs to be recalculated. The redundant check code Fcs is a redundant check sequence used for error detection, so that the message after adding the redundant tag can be forwarded from the sender according to the normal process.
[0094] For ease of understanding, an example is given: Assume that the message before adding the redundant label RTAG is n bytes, n is a positive number, for example, the last 4 bytes are the redundant check code Fcs, and Fcs can be obtained by relevant calculation based on the first n-4 bytes in the message. After adding a 6-byte redundant label RTAG, the entire message becomes n+6 bytes long, and a new Fcs can be calculated based on the first (n+6)-4 bytes. The new Fcs is, for example, 4 bytes, and the new Fcs is used as the last 4 bytes of n+6 bytes to replace the original Fcs.
[0095] The message processing method of the present application can realize the flexible addition of the redundant label RTAG to any position after the SMAC of the message, and carry the position information to the RTAG label and send it out with the message. Through this method, the user can flexibly select a suitable position to add RTAG according to the characteristics of the business message or the actual application requirements, and circulate the position information (the position information can be a kind of offset information OFFSET) in the network through the RTAG label, which can not only ensure that the RTAG label can be accurately and quickly recognized normally, but also solve the problem that the message cannot be correctly parsed. In addition, the position information of the redundant label RTAG in the message can be filled in the Reserved field of RTAG, so that the receiving end can avoid the problem of RTAG parsing errors by double checking the RTAG TPID content stored in the protocol type field and the OFFSET content stored in the reserved field in the redundant label.
[0096] Figure 6 A flowchart of a message processing method provided for another embodiment of the present application.
[0097] like Figure 6 As shown, the message processing method 600 provided in the embodiment of the present application includes, for example, steps S610-S630, and the message processing method 600 is applied to the receiving end, for example.
[0098] S610: Receive at least one target message.
[0099] S620, parse the redundant label in each target message to obtain the sequence number of each target message.
[0100] S630: Perform deduplication processing on at least one target message based on the sequence number to obtain an original message.
[0101] Exemplarily, the target message is processed and sent by the sending end based on the above message processing method.
[0102] Exemplarily, the redundant tag includes a protocol type field, a reserved field and a sequence number field. The protocol type field is used to store the protocol type information of the redundant tag, the reserved field is used to store the position information, and the sequence number field is used to store the sequence number.
[0103] Exemplarily, parsing the redundant label in each target message to obtain the serial number of each target message includes: parsing the protocol type field and the reserved field in the redundant label to obtain the type information and position information of the redundant label; verifying the type information and position information of the redundant label; after the verification is successful, obtaining the serial number of the target message from the serial number field of the redundant label, so as to perform deduplication processing on at least one target message based on the sequence number. For example, performing deduplication processing on at least one target message based on the sequence number to obtain a target message, removing the redundant label in the target message, and obtaining the original message.
[0104] In another example, the type information and position information of the redundant label are verified, including: determining whether the protocol type information of the redundant label is preset information. For example, the protocol type information of the redundant label is stored in the protocol type field of the redundant label. The fact that the protocol type information of the redundant label is preset information indicates that the redundant message is copied and needs to be deduplicated. For example, the protocol type information stored in the Ether Type field of the redundant label may be a specific value set, and the preset information may be a specific preset value set (such as 0xf1c1). If the verification finds that the protocol type information of the redundant label is 0xf1c1, it indicates that the redundant message carrying the redundant label is copied, and the position information needs to be further verified. Verifying the position information includes: determining whether the position information in the reserved field of the redundant label is consistent with the position of the redundant label in the target message. If so, the verification is successful. For example, the position information may be an offset information OFFSET, indicating the specific position of the redundant label in the redundant message. If the verification determines that the position information in the reserved field is consistent with the position of the redundant label in the target message, the verification is determined to be successful.
[0105] The message processing method of the present application can realize the flexible addition of the redundant label RTAG to any position after the SMAC of the message, and carry the position information to the RTAG label and send it out with the message. Through this method, the user can flexibly select a suitable position to add RTAG according to the characteristics of the business message or the actual application requirements, and circulate the position information (the position information can be a kind of offset information OFFSET) in the network through the RTAG label, which can not only ensure that the RTAG label can be accurately and quickly recognized normally, but also solve the problem that the message cannot be correctly parsed. In addition, the position information of the redundant label RTAG in the message can be filled in the Reserved field of RTAG, so that the receiving end can avoid the problem of RTAG parsing errors by double checking the RTAG TPID content stored in the protocol type field and the OFFSET content stored in the reserved field in the redundant label.
[0106] Figure 7A schematic diagram of a redundant tag according to an embodiment of the present application is shown.
[0107] like Figure 7 As shown, there is a 2-byte Reserved field in RTAG, and some message processing methods only retain this field but do not use it. In the message processing method of the present application, when it is necessary to flexibly add RTAG to a specified position, the receiving end may have a problem of RTAG mismatch when parsing the message. For example, when the RTAG TPID information stored in the EtherType field of the redundant label coincides with the information of some fields in the ordinary message, RTAG misidentification may occur. Therefore, an embodiment of the present application uses the lower 8 bits of the Reserved field in the message to store position information, and the position information includes, for example, the offset position of the redundant label RTAG in the redundant message, and the offset position can be represented by an OFFSET value. Therefore, the OFFSET value can be filled in the lower 8 bits of the Reserved field. In one example, the OFFSET value can be used to indicate the position of the redundant label RTAG relative to the message header or SMAC.
[0108] Through the message processing method of the present application, the user can flexibly select the appropriate designated location to add the redundant label RTAG according to the message characteristics, and store the designated location information in the relevant field of RTAG to circulate in the network, which can not only ensure that the redundant label RTAG can be accurately and quickly recognized by the receiving end, but also solve the problem that the message cannot be correctly parsed.
[0109] Figure 8 A schematic diagram of a message processing device provided in an embodiment of the present application.
[0110] like Figure 8 As shown, the message processing device 800 includes: a redundancy processing module 810, a determination module 820, a generation module 830, an adding module 840 and a sending module 850.
[0111] The redundancy processing module 810 is used to perform redundancy processing on the original message to obtain multiple redundant messages, and to set a sequence number for each redundant message to indicate message redundancy.
[0112] The determination module 820 is used to determine a designated position from the redundant message based on the message characteristic information of the redundant message.
[0113] The generating module 830 is used to generate a redundant label based on the sequence number for each redundant message.
[0114] The adding module 840 is used to add a redundant label to a specified position of the redundant message to obtain a target message.
[0115] The sending module 850 is used to send multiple target messages to the receiving end through multiple paths respectively.
[0116] After receiving at least one target message, the receiving end parses the redundant label in each target message to obtain the sequence number of each target message, and performs deduplication processing on at least one target message based on the sequence number to obtain the original message.
[0117] Exemplarily, the generating module 830 is further used to generate a redundant tag based on the serial number and the position information of the designated position.
[0118] Exemplarily, the redundant tag includes a protocol type field, a reserved field and a sequence number field; the protocol type field is used to store the protocol type information of the redundant tag, the reserved field is used to store the location information, and the sequence number field is used to store the sequence number.
[0119] Exemplarily, the determination module 820 is further used to: determine the important field from the redundant message based on the message characteristic information of the redundant message; and determine the designated position from any position after the important field in the redundant message.
[0120] Exemplarily, the message characteristic information of the redundant message is represented by message type information; when the message type information indicates that the message type of the redundant message is an IP message type, the specified position is any position after the IP header in the redundant message; when the message type information indicates that the message type of the redundant message is a UDP message type, the specified position is any position after the UDP header in the redundant message.
[0121] Exemplarily, the redundant message includes, in sequence: a receiving end address field, a sending end address field, a field indicating the type or length of the actual data part, a field of the actual data part, and a redundant check field; the designated position is after the sending end address field.
[0122] Exemplarily, when the redundant message further includes a LAN tag field, the LAN tag field is between the sender address field and the field indicating the type or length of the actual data portion, and the designated position is after the LAN tag field.
[0123] Exemplarily, adding a redundant tag to a specified position of a redundant message to obtain a target message includes: adding a redundant tag to a specified position of a redundant message to obtain a spliced message; processing the spliced message to obtain a new redundant check code; replacing the original redundant check code in the spliced message with the new redundant check code to obtain the target message.
[0124] It can be understood that for the specific description of the message processing device 800, reference can be made to the description of the message processing method applied to the sending end in the above text, and no further details will be given here.
[0125] Fig. 9 A schematic diagram of another message processing device provided in an embodiment of the present application.
[0126] like Fig. 9 As shown, another message processing device 900 includes: a receiving module 910, a parsing module 920 and an elimination processing module 930.
[0127] The receiving module 910 is used to receive at least one target message.
[0128] The parsing module 920 is used to parse the redundant labels in each target message to obtain the sequence number of each target message.
[0129] The deduplication processing module 930 is used to perform deduplication processing on at least one target message based on the sequence number to obtain an original message.
[0130] The target message is processed and sent based on a message processing device applied to the sending end.
[0131] Exemplarily, the redundant tag includes a protocol type field, a reserved field and a sequence number field; the protocol type field is used to store the protocol type information of the redundant tag, the reserved field is used to store the location information, and the sequence number field is used to store the sequence number.
[0132] Exemplarily, the parsing module 920 is also used to: parse the protocol type field and reserved field in the redundant label to obtain the type information and position information of the redundant label; verify the type information and position information of the redundant label; after the verification is successful, obtain the serial number of the target message from the serial number field of the redundant label.
[0133] Exemplarily, the type information and position information of the redundant label are verified, including: determining whether the protocol type information of the redundant label is preset information; if so, determining whether the position information in the reserved field is consistent with the position of the redundant label in the target message, if so, the verification is successful.
[0134] Exemplarily, performing deduplication processing on at least one target message based on a sequence number to obtain an original message includes: performing deduplication processing on at least one target message based on a sequence number to obtain a target message; and removing redundant labels in the target message to obtain an original message.
[0135] It can be understood that for the specific description of another message processing device 900, reference can be made to the above description of the message processing method applied to the receiving end, which will not be repeated here.
[0136] An embodiment of the present application provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the method in any one of the above embodiments are implemented.
[0137] An embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the method in any one of the above embodiments are implemented.
[0138] One embodiment of the present application provides a computer program product, which includes instructions. When the instructions are executed by a processor of a computer device, the computer device can perform the steps of the method of any of the above embodiments.
[0139] It should be noted that the logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purposes of this application, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection portion with one or more wirings (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or otherwise processing in a suitable manner if necessary, and then stored in a computer memory.
[0140] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0141] In the description of the present application, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In the present application, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0142] In the description of the present application, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", "clockwise", "counterclockwise", "axial", "radial", "circumferential" and the like indicate orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the referred device or element must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present application.
[0143] In addition, the terms "first", "second", etc. used in the embodiments of the present application are only used for descriptive purposes and should not be understood as indicating or implying relative importance, or implicitly indicating the number of technical features indicated in the present embodiment. Therefore, the features defined by the terms "first", "second", etc. in the embodiments of the present application can explicitly or implicitly indicate that at least one of the features is included in the embodiment. In the description of the present application, the word "multiple" means at least two or two or more, such as two, three, four, etc., unless otherwise clearly and specifically defined in the embodiments.
[0144] In this application, unless otherwise clearly specified or limited in the embodiments, the terms "installed", "connected", "connected" and "fixed" etc. appearing in the embodiments should be understood in a broad sense. For example, the connection can be a fixed connection, a detachable connection, or an integrated connection. It can be understood that it can also be a mechanical connection, an electrical connection, etc.; of course, it can also be a direct connection, or an indirect connection through an intermediate medium, or it can be the internal connection of two elements, or the interaction relationship between two elements. For ordinary technicians in this field, the specific meanings of the above terms in this application can be understood according to the specific implementation situation.
[0145] In the present application, unless otherwise clearly specified and limited, a first feature being “above” or “below” a second feature may mean that the first and second features are in direct contact, or the first and second features are in indirect contact through an intermediate medium. Moreover, a first feature being “above”, “above”, and “above” a second feature may mean that the first feature is directly above or obliquely above the second feature, or simply means that the first feature is higher in level than the second feature. A first feature being “below”, “below”, and “below” a second feature may mean that the first feature is directly below or obliquely below the second feature, or simply means that the first feature is lower in level than the second feature.
[0146] Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limitations on the present application. Ordinary technicians in this field can change, modify, replace and modify the above embodiments within the scope of the present application.
Claims
1. A message processing method, characterized in that: The message processing method is applied to the sending end, and the message processing method includes: Perform redundancy processing on the original message to obtain multiple redundant messages, and set a sequence number for each redundant message to indicate message redundancy; Determining a designated position from the redundant message based on the message characteristic information of the redundant message; For each redundant message, generate a redundant tag based on the sequence number, and add the redundant tag to the designated position of the redundant message to obtain a target message; Send multiple target messages to the receiving end through multiple paths respectively; After the receiving end receives at least one target message, it parses the redundant labels in each target message to obtain the sequence number of each target message, and performs deduplication processing on the at least one target message based on the sequence number to obtain the original message.
2. The message processing method according to claim 1, characterized in that: The generating a redundant tag based on the sequence number comprises: The redundant tag is generated based on the serial number and the position information of the designated position.
3. The message processing method according to claim 2, characterized in that: The redundant tag includes a protocol type field, a reserved field and a sequence number field; the protocol type field is used to store the protocol type information of the redundant tag, the reserved field is used to store the location information, and the sequence number field is used to store the sequence number.
4. The message processing method according to claim 1, characterized in that: The determining the designated position from the redundant message based on the message feature information of the redundant message includes: Determining important fields from the redundant message based on the message characteristic information of the redundant message; The designated position is determined from any position after the important field in the redundant message.
5. The message processing method according to claim 1, characterized in that: The message characteristic information of the redundant message is represented by message type information; When the message type information indicates that the message type of the redundant message is an IP message type, the designated position is any position after the IP header in the redundant message; When the message type information indicates that the message type of the redundant message is a UDP message type, the designated position is any position after the UDP header in the redundant message.
6. The message processing method according to claim 1, characterized in that: The redundant message includes, in sequence: a receiving end address field, a sending end address field, a field indicating the type or length of the actual data part, a field of the actual data part, and a redundant check field; the designated position is after the sending end address field.
7. The message processing method according to claim 6, characterized in that: In the case where the redundant message further includes a LAN tag field, the LAN tag field is located between the sender address field and the field indicating the type or length of the actual data portion, and the designated position is after the LAN tag field.
8. The message processing method according to any one of claims 1 to 7, characterized in that: The adding the redundant label to the designated position of the redundant message to obtain the target message includes: Adding the redundant label to the designated position of the redundant message to obtain a spliced message; Processing the spliced message to obtain a new redundant check code; The new redundant check code replaces the original redundant check code in the spliced message to obtain the target message.
9. A message processing method, characterized in that: The message processing method is applied to a receiving end, and the message processing method includes: receiving at least one target message; Parse the redundant labels in each target message to obtain the sequence number of each target message; Performing deduplication processing on the at least one target message based on the sequence number to obtain an original message; The target message is processed and sent by the sending end based on the message processing method described in any one of claims 1 to 8.
10. The message processing method according to claim 9, characterized in that: The redundant tag includes a protocol type field, a reserved field and a sequence number field; the protocol type field is used to store the protocol type information of the redundant tag, the reserved field is used to store the location information, and the sequence number field is used to store the sequence number.
11. The message processing method according to claim 10, characterized in that: The step of parsing the redundant labels in each target message to obtain the sequence number of each target message includes: Parsing the protocol type field and the reserved field in the redundant label to obtain type information and the position information of the redundant label; Verifying the type information and the location information of the redundant tag; After the verification is successful, the sequence number of the target message is obtained from the sequence number field of the redundant label.
12. The message processing method according to claim 11, characterized in that: The verifying the type information and the location information of the redundant tag includes: Determining whether the protocol type information of the redundant label is preset information; If yes, it is determined whether the position information in the reserved field is consistent with the position of the redundant label in the target message, and if yes, the verification is successful.
13. The message processing method according to any one of claims 10 to 12, characterized in that: The performing deduplication processing on the at least one target message based on the sequence number to obtain the original message includes: performing deduplication processing on the at least one target message based on the sequence number to obtain a target message; The redundant labels in the target message are removed to obtain the original message.
14. A message processing device, characterized in that: The message processing device is applied to the sending end, and the message processing device includes: A redundancy processing module, used for performing redundancy processing on the original message to obtain multiple redundant messages, and setting a sequence number for each redundant message to indicate message redundancy; A determination module, configured to determine a specified position from the redundant message based on message feature information of the redundant message; A generating module, configured to generate a redundant label based on the sequence number for each redundant message; An adding module, used for adding the redundant label to the designated position of the redundant message to obtain a target message; A sending module, used to send multiple target messages to a receiving end through multiple paths respectively; After the receiving end receives at least one target message, it parses the redundant labels in each target message to obtain the sequence number of each target message, and performs deduplication processing on the at least one target message based on the sequence number to obtain the original message.
15. The message processing device according to claim 14, characterized in that: The generation module is also used for: The redundant tag is generated based on the serial number and the position information of the designated position.
16. The message processing device according to claim 15, characterized in that: The redundant tag includes a protocol type field, a reserved field and a sequence number field; the protocol type field is used to store the protocol type information of the redundant tag, the reserved field is used to store the location information, and the sequence number field is used to store the sequence number.
17. The message processing device according to claim 14, characterized in that: The determining module is also used for: Determining important fields from the redundant message based on the message characteristic information of the redundant message; The designated position is determined from any position after the important field in the redundant message.
18. A message processing device, characterized in that: The message processing device is applied to a receiving end, and the message processing device includes: A receiving module, used for receiving at least one target message; A parsing module, used to parse the redundant labels in each target message to obtain the sequence number of each target message; an elimination processing module, configured to perform a duplication elimination process on the at least one target message based on the sequence number to obtain an original message; The target message is processed and sent by the sending end based on the message processing device described in any one of claims 14-17.
19. The message processing device according to claim 18, characterized in that: The redundant tag includes a protocol type field, a reserved field and a sequence number field; the protocol type field is used to store the protocol type information of the redundant tag, the reserved field is used to store the location information, and the sequence number field is used to store the sequence number.
20. The message processing device according to claim 19, characterized in that: The parsing module is also used for: Parsing the protocol type field and the reserved field in the redundant label to obtain type information and the position information of the redundant label; Verifying the type information and the location information of the redundant tag; After the verification is successful, the sequence number of the target message is obtained from the sequence number field of the redundant label.
21. The message processing device according to claim 20, characterized in that: The verifying the type information and the location information of the redundant tag includes: Determining whether the protocol type information of the redundant label is preset information; If yes, it is determined whether the position information in the reserved field is consistent with the position of the redundant label in the target message, and if yes, the verification is successful.
22. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 13 are implemented.
23. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 13 are implemented.
Citation Information
Cited By
Evaluation and detection method of FRER redundant path based on switching delay accumulation function
CN120675929A
Method for detecting 802.1 CB link, 802.1 CB link, electronic equipment and storage medium
CN120896867A
