A method, device and electronic equipment for processing redundant frame packets
By obtaining the sequence number and storage area release flag information of redundant frame packets, determining the sequence number difference and target difference, and sending redundant frame packets only under specific conditions, the switch latency problem is solved, the processing efficiency of redundant frame packets is improved, and the safety of the automotive Ethernet control system is ensured.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING CO WHEELS TECH CO LTD
- Filing Date
- 2022-06-17
- Publication Date
- 2026-08-04
AI Technical Summary
In existing technologies, when using frame duplication and reliability elimination protocols to add redundant paths to process redundant frame packets, the switch latency becomes long and unpredictable, affecting the security of the automotive Ethernet control system.
By obtaining the sequence number of the redundant frame packet and the release flag information in the storage area, the sequence number difference and the target difference are determined. The redundant frame packet is sent only when the sequence number difference is less than or equal to the target difference and the release flag does not indicate release, thereby reducing the time for the switch to process the redundant frame packet.
This improves the efficiency of the switch in processing redundant frame packets and ensures the security of the automotive Ethernet control system.
Smart Images

Figure CN117294771B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of Ethernet technology, and specifically to a method, apparatus, and electronic device for processing redundant frame packets. Background Technology
[0002] With the rapid development of communication technology, the communication rate of a single channel in an in-vehicle system has been significantly improved. This increased rate places higher demands on the reliability of the in-vehicle system. Currently, the Frame Replication and Elimination for Reliability (FRER) protocol is mainly used to improve the reliability of automotive Ethernet control systems. This protocol backs up packets to obtain 2 to N redundant frame packets, increasing the redundancy path for data transmission and thus avoiding errors or data loss during transmission. However, increasing the redundancy path requires the switch to query and modify the data of all redundant frame packets, resulting in long and unpredictable delays. This poses a certain risk to the security of the automotive Ethernet control system. Summary of the Invention
[0003] To address or at least partially address the aforementioned technical problems, this disclosure provides a method, apparatus, and electronic device for processing redundant frame packets, which can improve the efficiency of switches in processing redundant frame packets and ensure the security of automotive Ethernet control systems.
[0004] To achieve the above objectives, the technical solutions provided by the embodiments of this disclosure are as follows:
[0005] In a first aspect, this disclosure provides a method for processing redundant frame messages, the method comprising:
[0006] Obtain the redundant frame message, which includes the first sequence number of the redundant frame message;
[0007] Obtain the second sequence number and the first release tag information corresponding to the second sequence number from the storage area corresponding to the redundant frame message;
[0008] Determine the difference between the first and second serial numbers;
[0009] If the sequence number difference is less than or equal to the target difference, and the target flag bit in the first release flag information indicates that the release has not been made, it is determined to send a redundant frame message. The target difference is the number of flag bits in the first release flag information, and the target flag bits are determined based on the second sequence number and the sequence number difference.
[0010] As an optional implementation of this disclosure, after determining that a redundant frame message will be sent, the method further includes: modifying the target flag bit in the first release flag information to indicate release, thereby obtaining the second release flag information; and updating the first release flag information to the second release flag information.
[0011] As an optional implementation of this disclosure, the target flag bit in the first release flag information is modified to indicate release to obtain the second release flag information, including: generating mask information based on the sequence number difference, wherein the flag bit corresponding to the sequence number difference in the mask information is used to indicate release; and obtaining the second release flag information based on the mask information and the first release flag information.
[0012] As an optional implementation of this disclosure, after determining the sequence number difference between the first sequence number and the second sequence number, the method further includes: if the sequence number difference is greater than a target difference, determining to send a redundant frame message.
[0013] As an optional implementation of this disclosure, after determining to send a redundant frame message when the sequence number difference is greater than the target difference, the method further includes: determining third release flag information based on the sequence number difference and the first release flag information, wherein the release flag bit corresponding to the second sequence number in the third release flag information indicates release, and the release flag bit corresponding to the first sequence number indicates release; and updating the second sequence number to the first sequence number.
[0014] As an optional implementation of this disclosure, after obtaining the second sequence number and the first release flag information corresponding to the second sequence number from the storage area corresponding to the redundant frame message, the method further includes: determining whether the highest flag bit in the first release flag information indicates whether to release; determining the sequence number difference between the first sequence number and the second sequence number, including: determining the sequence number difference between the first sequence number and the second sequence number when the highest flag bit indicates release.
[0015] As an optional implementation of this disclosure, after determining whether the highest flag bit in the first release flag information indicates whether to release, the method further includes: if the highest flag bit indicates that the release is not granted, determining to send a redundant frame message; updating the second sequence number to the first sequence number; and modifying the highest flag bit in the first release flag to indicate release.
[0016] Secondly, this disclosure provides an apparatus for processing redundant frame messages, the apparatus comprising:
[0017] The acquisition module is used to acquire redundant frame packets, which include a first sequence number of the redundant frame packets; and to acquire a second sequence number from the storage area corresponding to the redundant frame packets, as well as a first release tag information corresponding to the second sequence number.
[0018] The processing module is used to determine the sequence number difference between the first sequence number and the second sequence number; if the sequence number difference is less than or equal to the target difference and the target flag bit in the first release flag information indicates that the release has not been made, it determines to send a redundant frame message. The target difference is the number of release flags in the first release flag information, and the target flag bit is determined according to the second sequence number and the sequence number difference.
[0019] As an optional implementation of this disclosure, the processing module is further configured to modify the target marker bit in the first release marker information to indicate release, thereby obtaining the second release marker information; and update the first release marker information to the second release marker information.
[0020] As an optional implementation of this disclosure, the processing module is specifically used to generate mask information based on the sequence number difference, wherein the marker bit corresponding to the sequence number difference in the mask information is used to indicate release; and to obtain second release marker information based on the mask information and the first release marker information.
[0021] As an optional implementation of this disclosure, the processing module is further configured to determine to send a redundant frame message when the sequence number difference is greater than the target difference.
[0022] As an optional implementation of this disclosure, the processing module is further configured to determine third release marker information based on the sequence number difference and the first release marker information, wherein the release marker bit corresponding to the second sequence number in the third release marker information indicates release, and the release marker bit corresponding to the first sequence number indicates release; and update the second sequence number to the first sequence number.
[0023] As an optional implementation of this disclosure, the acquisition module is further configured to determine whether the highest marker bit in the first release marker information indicates whether to release the vehicle;
[0024] The processing module is specifically used to determine the difference between the first sequence number and the second sequence number when the highest marker bit indicates that passage is permitted.
[0025] As an optional implementation of this disclosure, the processing module is further configured to: determine to send a redundant frame message when the highest flag bit indicates that the passage has not been allowed; update the second sequence number to the first sequence number; and modify the highest flag bit in the first passage flag to indicate passage.
[0026] Thirdly, this disclosure provides an electronic device comprising: a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the method for processing redundant frame messages as described in the first aspect or any of its optional embodiments.
[0027] Fourthly, a computer-readable storage medium is provided, comprising: storing a computer program on the computer-readable storage medium, wherein when the computer program is executed by a processor, it implements the method for processing redundant frame messages as described in the first aspect or any of its optional embodiments.
[0028] Fifthly, a vehicle is provided, comprising a vehicle collision detection device as described in the second aspect, or an electronic device as described in the third aspect. The vehicle is used to execute the method for processing redundant frame messages provided in any embodiment of this disclosure.
[0029] The technical solution provided in this disclosure has the following advantages compared with the prior art:
[0030] This disclosure provides a method for processing redundant frame packets. The method first obtains a redundant frame packet, which includes a first sequence number. A second sequence number and corresponding first release flag information are obtained from the storage area corresponding to the redundant frame packet. Then, the sequence number difference between the first and second sequence numbers is determined. If the sequence number difference is less than or equal to a target difference, and the target flag bit in the first release flag information indicates that release has not been granted, the method determines to send the redundant frame packet. The target difference is the number of flag bits in the first release flag information, and the target flag bits are determined based on the second sequence number and the sequence number difference. The redundant frame packet processing method provided in this disclosure can determine whether to send the redundant frame packet corresponding to the first sequence number based on the second sequence number and the first release flag information stored in the storage area. Since the first release flag information represents the historical release records of the second sequence number and the sequence number before the second sequence number, the historical release record corresponding to the redundant frame packet, that is, the target flag bit, can be determined based on the sequence number difference between the first sequence number and the second sequence number, indicating whether to release. If the target flag bit indicates that the packet has not been released, it means that the redundant frame packet has not been released in the past, and the redundant frame packet is sent. This reduces the time for processing redundant frame packets at the switch node, improves the efficiency of the switch in processing redundant frame packets, and ensures the security of the automotive Ethernet control system. Attached Figure Description
[0031] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.
[0032] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0033] Figure 1This is a schematic diagram illustrating an implementation scenario of a method for processing redundant frame messages according to an embodiment of this disclosure.
[0034] Figure 2 The flowchart of a method for processing redundant frame packets as described in the embodiments of this disclosure. Figure 1 ;
[0035] Figure 3 The flowchart of a method for processing redundant frame packets as described in the embodiments of this disclosure. Figure 2 ;
[0036] Figure 4 The flowchart of a method for processing redundant frame packets as described in the embodiments of this disclosure. Figure 3 ;
[0037] Figure 5 This is a structural diagram of a redundant frame message processing apparatus according to an embodiment of the present disclosure;
[0038] Figure 6 This is a structural diagram of an electronic device according to an embodiment of the present disclosure. Detailed Implementation
[0039] To better understand the above-mentioned objectives, features, and advantages of this disclosure, the solutions disclosed herein will be further described below. It should be noted that, unless otherwise specified, the embodiments and features described herein can be combined with each other.
[0040] Numerous specific details are set forth in the following description in order to provide a full understanding of this disclosure, but this disclosure may also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only some, and not all, of the embodiments of this disclosure.
[0041] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the technical terms used in the description of the embodiments or the prior art will be briefly introduced below:
[0042] The IEEE 802.1CB protocol, short for Frame Replication and Elimination for Reliability (FRER), is primarily responsible for redundant data transmission. It utilizes redundancy mechanisms to mitigate information errors or loss that can occur in loop networks due to CRC errors, open circuits, or connector disconnections. During transmission, packets are tagged and sequenced according to the 802.1CB protocol, and copies are transmitted across different paths. At link convergence points, duplicate information is identified and eliminated to prevent upper-layer applications at the receiving node from processing multiple duplicate packets.
[0043] With the rapid development of communication technology, the communication rate of a single Ethernet channel has reached the 10 Gigabit level. This increase in single-port speed in automotive systems, while meeting the demands of large data transmission such as information from vehicle sensors, also increases the pressure on multi-port switches to process parallel data under high bandwidth, and places higher demands on the reliability of automotive Ethernet control systems. For the 802.1CB protocol, the entire automotive Ethernet system forms a redundant topology, with at least one backup path for critical paths, effectively avoiding the risk of loss of control due to the physical link failure of a node. However, for switches with 802.1CB functionality, it is necessary to frequently query and modify the release flag information of ingress redundant frame packets. The faster this process, the shorter the residence time of the redundant frame packets buffered in the switch, thus lowering the probability of packet congestion and loss, and increasing the reliability of redundant frame packet transmission. However, traditional software-based switches have long latency and variable processing time for data querying and modification, which cannot meet the design requirements of high-bandwidth multi-port network switches.
[0044] To address the aforementioned technical problems, this disclosure provides a method for processing redundant frame packets. The method first acquires a redundant frame packet, which includes a first sequence number. A second sequence number and corresponding first release flag information are retrieved from the storage area corresponding to the redundant frame packet. Then, the sequence number difference between the first and second sequence numbers is determined. If the sequence number difference is less than or equal to a target difference, and the target flag bit in the first release flag information indicates that release has not been initiated, the method determines to send the redundant frame packet. The target difference is the number of flag bits in the first release flag information, and the target flag bits are determined based on the second sequence number and the sequence number difference. The redundant frame packet processing method provided in this disclosure can determine whether to send the redundant frame packet corresponding to the first sequence number based on the second sequence number and the first release flag information stored in the storage area. Since the first release flag information represents the historical release records of the second sequence number and the sequence number before the second sequence number, the historical release record corresponding to the redundant frame packet, that is, the target flag bit, can be determined based on the sequence number difference between the first sequence number and the second sequence number, indicating whether to release. If the target flag bit indicates that the packet has not been released, it means that the redundant frame packet has not been released in the past, and the redundant frame packet is sent. This reduces the time for processing redundant frame packets at the switch node, improves the efficiency of the switch in processing redundant frame packets, and ensures the security of the automotive Ethernet control system.
[0045] like Figure 1 As shown, Figure 1 This is a schematic diagram illustrating an implementation scenario of a method for processing redundant frame packets according to an embodiment of this disclosure. Figure 1The system includes a message sending node 101, a switch 102, and a message receiving node 103. The switch 102 stores different types of message sequence numbers and corresponding release flag information in a random access memory (RAM) 104. Each RAM address stores a message sequence number of one type and its corresponding release flag information; that is, one RAM address corresponds to one type of message sequence number.
[0046] Message sending node 101 sends redundant frame packets to message receiving node 103 sequentially through different ports according to the first sequence number of the redundant frame packets, from smallest to largest. During this process, the redundant frame packets pass through switch 102. In this scenario, switch 102 obtains the redundant frame packets, then retrieves the second sequence number and the first release flag information corresponding to the second sequence number from the storage area corresponding to the first redundant frame packet. It determines the sequence number difference between the first and second sequence numbers. If the sequence number difference is less than or equal to the target difference, and the target flag bit in the first release flag information indicates release, it determines to send the redundant frame packets to message receiving node 103.
[0047] The aforementioned method for processing redundant frame messages can be implemented using computer devices, including but not limited to servers, personal computers, laptops, tablets, smartphones, and in-vehicle devices. Computer devices include user equipment and network devices. User equipment includes, but is not limited to, computers, smartphones, and tablets; network devices include, but are not limited to, single network servers, server groups composed of multiple network servers, or clouds composed of a large number of computers or network servers in cloud computing. Cloud computing is a type of distributed computing, consisting of a super virtual computer composed of a group of loosely coupled computers. The computer devices can operate independently to implement this disclosure, or they can connect to a network and implement this disclosure through interaction with other computer devices in the network. The networks in which the computer devices reside include, but are not limited to, the Internet, wide area networks (WANs), metropolitan area networks (MANs), local area networks (LANs), and virtual private networks (VPNs).
[0048] It should be noted that the protection scope of the redundant frame message processing method described in this disclosure is not limited to the execution order of the steps listed in this embodiment. Any solution implemented by adding, subtracting, or replacing steps in the prior art based on the principles of this disclosure is included within the protection scope of this disclosure.
[0049] like Figure 2 As shown, Figure 2 The flowchart of a method for processing redundant frame packets as described in the embodiments of this disclosure. Figure 1The method includes the following steps S201 to S204:
[0050] S201, Obtain redundant frame messages.
[0051] In some embodiments, the method for processing redundant frame packets described in this disclosure is applied to a switch that obtains the previous node (e.g., in the automotive Ethernet system) in the automotive Ethernet system. Figure 1 The redundant frame message sent by the message sending node 101 shown.
[0052] Redundant frame packets are backup packets used in the 802.1CB protocol to prevent errors or loss of the original packets sent from the sending node to the receiving node. "Redundant" is relative to the original packet. During packet transmission, due to differences in transmission path length and other factors, the receiving node may not simultaneously receive redundant frame packets that are backup copies. However, since both the original packet and the redundant frame packets carry the same flow identifier, both the original packet and the redundant frame packets can be used as redundant frame packets in this embodiment.
[0053] The redundant frame message includes the first sequence number of the redundant frame message. In the redundant frame message defined by the IEEE 802.1CB protocol, the first sequence number is generated based on the source Media Access Control Address (MAC).
[0054] S202. Obtain the second sequence number and the first release mark information corresponding to the second sequence number from the storage area corresponding to the redundant frame message.
[0055] In some embodiments, this disclosure utilizes RAM to maintain a release registry for various types of redundant frame packets. The release registry includes storage areas corresponding to different types of redundant frame packets. If the sending node and receiving node of a redundant frame packet are the same, it is determined to be of the same type, and the corresponding data is saved in the same storage area. Each storage area includes a sequence number and the release tag information corresponding to the sequence number.
[0056] The following will use Table 1 as an example to explain the allowed registry information:
[0057] Table 1
[0058] storage area Serial Number Release marker information RAM0 Serial Number 0 Release marker information 0 RAM1 Serial Number 1 Release marker information 1 ··· ··· ··· RAM127 Serial Number 127 Release marker information 127
[0059] As shown in Table 1 above, the switch's RAM stores the allowance registry information in 128 storage areas. Each storage area stores the sequence number of redundant frame packets of the same type and the corresponding allowance flag information. For example, storage area RAM0 includes sequence number 0 as A200, indicating that the sequence number of the redundant frame packet is A200. The number of storage areas mentioned above is only illustrative and can be adjusted according to actual needs; this disclosure does not impose specific limitations on this.
[0060] Taking release flag information 0 as an example, the data structure of the release flag information is illustrated in Table 2. The number of flag bits in the release flag information is set to 64, although not all are shown in Table 2. Release flag information 0 corresponds to the sequence number 0 of the redundant frame message, i.e., A200. The release flag information represents the flag bits of the redundant frame messages corresponding to sequence numbers A200 to A136. The flag bits are used to indicate whether the redundant frame message corresponding to the sequence number is released. For example, if flag bit 63 in release flag information 0 is set to 1, it means that the redundant frame message corresponding to sequence number A200 has been released; if flag bit 0 in release flag information 0 is set to 0, it means that the redundant frame message corresponding to sequence number A136 has not been released.
[0061] Table 2
[0062] Flag bit 63 62 61 60 …… 3 2 1 0 1 0 0 1 …… 0 0 0 0
[0063] It is understandable that when the switch first obtains a redundant frame packet, the registration information for allowing transmission in RAM is empty. After receiving any redundant frame packet, the switch saves the sequence number corresponding to the redundant frame packet to the storage area and sets the flag in the allowance flag information corresponding to the sequence number to 1, indicating that the redundant frame packet corresponding to the sequence number has been allowed. Subsequently, when processing redundant frame packets of the same type, the method described in S203 to S204 and any of the embodiments therein is executed to filter redundant frame packets of the same type.
[0064] In some embodiments, the flow identification information corresponding to the redundant frame packet is first determined based on key fields contained in the redundant frame packet. Then, the storage area corresponding to the redundant frame packet is determined according to the pre-set correspondence between the flow identification information and the storage area. The flow identification information can be a flow identity document (ID), which refers to the identification information of redundant frame packets in the same flow direction, indicating that the redundant frame packets are transmitted from the same packet sending node to the same packet receiving node. The storage area corresponding to the redundant frame packet is any one of the multiple storage areas included in the release registration information table in RAM. The storage area corresponding to the redundant frame packet includes a second sequence number and a first release tag information corresponding to the second sequence number. The redundant frame packet corresponding to the second sequence number and the redundant frame packet corresponding to the first sequence number belong to the same type of redundant frame packet.
[0065] In some embodiments, after determining the storage area corresponding to the redundant frame message, a second sequence number and a first release tag information corresponding to the second sequence number are obtained from the storage area corresponding to the redundant frame message.
[0066] For example, following the previous example, after determining that the storage area corresponding to the redundant frame message is RAM0, the second sequence number A200 and the release tag information 0 corresponding to the second sequence number A200 are obtained from the storage area RAM0.
[0067] In some embodiments, after obtaining the second sequence number and the first release flag information corresponding to the second sequence number, it is determined whether the target flag bit in the first release flag information indicates whether to release the packet. The target flag bit is used to mark whether the switch has released any redundant frame packet of the same type. In the embodiments of this disclosure, the target flag bit is the highest flag bit. If the highest flag bit indicates release, it means that the switch has released any redundant frame packet of the same type, and then S203 is executed.
[0068] If the highest flag indicates no clearance, it means the switch has not cleared any redundant frame packets of the same type. Therefore, the redundant frame packet corresponding to the first sequence number needs to be cleared, and the redundant frame packet is confirmed to be sent. Further, the highest flag is modified to indicate clearance, and the second sequence number is updated to the first sequence number. This ensures that after receiving other redundant frame packets of the same type, steps S201–S204 are executed to avoid duplicate transmission of redundant frame packets.
[0069] For example, the first sequence number in the obtained redundant frame message is B6, the storage area corresponding to the first sequence number is RAM1, and the storage area RAM1 includes the second sequence number B0 and the release tag information 1 corresponding to the second sequence number B0, wherein the release tag information 1 corresponding to the second sequence number B0 is shown in Table 3.
[0070] Table 3
[0071] Flag bit 63 62 61 60 …… 3 2 1 0 0 0 0 0 …… 0 0 0 0
[0072] As shown in Table 3 above, all the flag bits in the release flag information corresponding to the second sequence number B0 indicate that it has not been released. This means that redundant frame packets of the same type as the redundant frame packet corresponding to the first sequence number have not been released. It can be determined that the redundant frame packet corresponding to the first sequence number is being acquired by the switch for the first time and needs to be released. After determining that the redundant frame packet corresponding to the first sequence number B6 should be sent, the highest flag bit 63 is modified to indicate release, and the second sequence number B0 is modified to the first sequence number B6. The data structure of the storage area RAM1 is shown in Table 4, indicating that the second sequence number B6 has been released, and the release is indicated by the flag bit 63 corresponding to the second sequence number B6 in the release flag information 1.
[0073] Table 4
[0074]
[0075] S203. Determine the difference between the first and second serial numbers.
[0076] In some embodiments, the sequence number difference = second sequence number - first sequence number, or the sequence number difference = first sequence number - second sequence number. It is understood that the sequence number difference is a positive integer.
[0077] For example, the first sequence number is A199 and the second sequence number is A200. The operation in the switch is based on binary data format. For ease of understanding, it is explained in decimal here. The difference between the first sequence number A199 and the second sequence number A200 is 1.
[0078] S204. If the sequence number difference is less than or equal to the target difference, and the target flag bit in the first release flag indicates that the release has not been made, determine to send a redundant frame message.
[0079] The target difference is the number of marker bits in the first release marker information, for example, the number of marker bits in the first release marker is 64.
[0080] The target marker is determined based on the second sequence number and the difference between the sequence numbers. The first sequence number is A199, the second sequence number is A200, and the difference between the sequence numbers is 1. The marker bit corresponding to the second sequence number A200 in the first release marker information 0 is 63. Therefore, the target marker is marker bit 62 in the first release marker information.
[0081] For example, the first sequence number is A199 and the second sequence number is A200. The sequence number difference between the first sequence number A199 and the second sequence number A200 is determined to be 1. This sequence number difference is less than the target difference of 64. The flag bit 62 in the first release flag information 0 is queried to indicate whether to release. As shown in Table 2 above, the flag bit 62 in the first release flag information 0 indicates that release has not been made. This means that the redundant frame message corresponding to the first sequence number A199 was not sent before. Further, it is determined to send the redundant frame message corresponding to the first sequence number A199.
[0082] In some embodiments, after determining that a redundant frame message has been sent, to facilitate the processing of subsequent redundant frame messages, this disclosure provides an implementation method for updating the data included in the storage area, including the following S301 to S302:
[0083] like Figure 3 As shown, Figure 3 The flowchart of a method for processing redundant frame packets as described in the embodiments of this disclosure. Figure 2 .
[0084] S301. Modify the target flag bit in the first release flag information to indicate release, and obtain the second release flag information.
[0085] In some embodiments, mask information is generated based on the sequence number difference. Since the first release marker information is stored in the storage area in binary data format, the number of marker bits in the mask information generated based on the sequence number difference is the same as that in the first release marker information, and the marker bits corresponding to the sequence number difference indicate the mask information for release.
[0086] For example, as shown in Table 5, which is a data structure table of mask information, combined with the data structure of the first release mark information shown in Table 1, the number of mark bits in the mask information is the same as that in the first release mark information, both being 64. Taking a sequence number difference of 1 as an example, mark bit 62 in the mask information indicates release.
[0087] Table 5
[0088] Flag bit 63 62 61 60 …… 3 2 1 0 0 1 0 0 …… 0 0 0 0
[0089] In some embodiments, a second release marker is determined based on the mask information and the first release marker information. The target marker bit in the second release marker information indicates release, which is the marker bit corresponding to the first sequence number. This disclosure provides an implementation method where the mask information and the first release marker information are XORed according to their corresponding marker bits to obtain the second release marker information. It can be understood that the target marker bit in the first release marker information is modified to indicate release, while other marker bits remain unchanged, in order to record the release processing of redundant frame packets and avoid repeatedly sending the same redundant frame packet.
[0090] For example, the first release mark information shown in Table 1 and the mask information shown in Table 5 are XORed to obtain the second release mark information, as shown in Table 6.
[0091] Table 6
[0092] Flag bit 63 62 61 60 …… 3 2 1 0 1 1 0 1 …… 0 0 0 0
[0093] S302. Update the first release marker information to the second release marker information.
[0094] In some embodiments, the first release tag information corresponding to the second sequence number included in the storage area is updated to the second release tag information, while the second sequence number remains unchanged.
[0095] For example, following the previous example, as shown in Table 7, Table 7 is a structure table of the storage area. In combination with the fact that the second sequence number A200 in Table 1 remains unchanged, the first release flag information 0 corresponding to the second sequence number A200 is updated to the second release flag information 0. In the second release flag information 0, the flag bit 63 corresponding to the second sequence number A200 still indicates release, and the target flag bit 62 corresponding to the first sequence number is updated to indicate release.
[0096] Table 7
[0097]
[0098] Through the above implementation, when the sequence number difference is less than or equal to the target difference and the target flag bit in the first release flag information indicates no release, it means that no redundant frame packet has been received previously, or that a redundant frame packet has been received previously but has expired and needs to be acquired again. Therefore, it is determined to send a redundant frame packet. Then, the data in the storage area is updated. Since the first release flag information represents the historical release records of the second sequence number and redundant frame packets with a sequence number less than the second sequence number, the target flag bit corresponding to the first sequence number in the first release flag information is updated according to the sequence number difference between the first and second sequence numbers to indicate release. This avoids subsequent repeated release of redundant frame packets corresponding to the first sequence number, improving the efficiency of the switch in processing redundant frame packets.
[0099] During data processing by the switch, the data is unsigned integer. The target difference is equal to the second sequence number minus the first sequence number. The target difference calculated above is defined as the registration sequence number difference. If the registration sequence number difference is greater than the target difference, then steps S401 to S403 are executed.
[0100] like Figure 4 As shown, Figure 4 The flowchart of a method for processing redundant frame packets as described in the embodiments of this disclosure. Figure 3 .
[0101] S401. If the sequence number difference is greater than the target difference, determine to send a redundant frame message.
[0102] In some embodiments, when the sequence number difference (registration sequence number difference) is greater than the target difference, the sequence number difference calculated by sequence number difference = first sequence number - second sequence number is defined as the replacement sequence number difference. If the replacement sequence number difference is less than the target difference, it means that the redundant frame message corresponding to the first sequence number was not previously allowed, or the redundant frame message corresponding to the first sequence number was allowed but has expired and needs to be retransmitted.
[0103] In some embodiments, determining to send a redundant frame packet when the sequence number difference is greater than the target difference can be understood as follows: when the sequence number difference is greater than the target difference, there is no need to detect the target flag bit in the first release flag information corresponding to the second sequence number; the redundant frame packet can be sent directly. Alternatively, it can be understood as follows: when the sequence number difference is greater than the target difference, regardless of whether the target flag bit indicates release, the redundant frame packet corresponding to the first sequence number is sent. This ensures that there are no packet errors or losses during the processing of redundant frame packets, and that expired packets are retransmitted, improving the security of the Ethernet system. Furthermore, reducing the operation of detecting the target flag bit when processing a large number of redundant frames reduces the processing time for redundant frame packets, improving the efficiency of the switch in processing redundant frame packets.
[0104] S402. Determine the third release mark information based on the sequence number difference and the first release mark information.
[0105] Among them, the release flag bit corresponding to the second sequence number in the third release flag information indicates release, and the release flag bit corresponding to the first sequence number also indicates release.
[0106] It is understandable that the first release marking information includes the marking bit corresponding to the second sequence number and the marking bit corresponding to the number of target differences before the second sequence number.
[0107] For example, taking a sequence number difference of 4 as an example, the first release marker information is shifted 4 positions to the right, and the highest marker bit is the marker bit corresponding to the first sequence number, which is set to indicate release, to obtain the third release marker information.
[0108] S403. Update the second serial number to the first serial number.
[0109] In some embodiments, the second sequence number is updated to the first sequence number, so that the first sequence number and the third release mark information are saved to the storage area.
[0110] In summary, this disclosure provides a method for processing redundant frame packets. The method first obtains a redundant frame packet, which includes a first sequence number. A second sequence number and a first release flag corresponding to the second sequence number are obtained from the storage area corresponding to the redundant frame packet. Then, the sequence number difference between the first and second sequence numbers is determined. If the sequence number difference is less than or equal to a target difference, and the target flag bit in the first release flag information indicates that release has not been granted, it is determined that a redundant frame packet will be sent. The target difference is the number of flag bits in the first release flag information, and the target flag bits are determined based on the second sequence number and the sequence number difference. The redundant frame packet processing method provided in this disclosure can determine whether to send the redundant frame packet corresponding to the first sequence number based on the second sequence number and the first release flag information stored in the storage area. Since the first release flag information represents the historical release records of the second sequence number and the sequence number before the second sequence number, the historical release record corresponding to the redundant frame packet, that is, the target flag bit, can be determined based on the sequence number difference between the first sequence number and the second sequence number, indicating whether to release. If the target flag bit indicates that the packet has not been released, it means that the redundant frame packet has not been released in the past, and the redundant frame packet is sent. This reduces the time for processing redundant frame packets at the switch node, improves the efficiency of the switch in processing redundant frame packets, and ensures the security of the automotive Ethernet control system.
[0111] like Figure 5 As shown, Figure 5 This is a structural diagram of a redundant frame message processing apparatus according to an embodiment of the present disclosure. The apparatus includes:
[0112] The acquisition module 501 is used to acquire a redundant frame message, which includes a first sequence number of the redundant frame message; acquire a second sequence number from the storage area corresponding to the redundant frame message, and a first release tag information corresponding to the second sequence number;
[0113] The processing module 502 is used to determine the sequence number difference between the first sequence number and the second sequence number; when the sequence number difference is less than or equal to the target difference and the target flag bit in the first release flag information indicates that the release has not been made, it determines to send a redundant frame message. The target difference is the number of release flags in the first release flag information, and the target flag bit is determined according to the second sequence number and the sequence number difference.
[0114] As an optional implementation of this disclosure, the processing module 502 is further configured to modify the target marker bit in the first release marker information to indicate release, thereby obtaining the second release marker information;
[0115] Update the first release tag information to the second release tag information.
[0116] As an optional implementation of this disclosure, the processing module 502 is specifically used to generate mask information based on the sequence number difference, wherein the flag bit corresponding to the sequence number difference in the mask information is used to indicate permission to pass.
[0117] Based on the mask information and the first release mark information, the second release mark information is obtained.
[0118] As an optional implementation of this disclosure, the processing module 502 is further configured to determine to send a redundant frame message when the sequence number difference is greater than the target difference.
[0119] As an optional implementation of this disclosure, the processing module 502 is further configured to determine the third release marker information based on the sequence number difference and the first release marker information, wherein the release marker bit corresponding to the second sequence number in the third release marker information indicates release, and the release marker bit corresponding to the first sequence number indicates release.
[0120] Update the second serial number to the first serial number.
[0121] As an optional implementation of this disclosure, the acquisition module 501 is further configured to determine whether the highest marker bit in the first release marker information indicates whether to release the vehicle;
[0122] The processing module 502 is specifically used to determine the difference between the first sequence number and the second sequence number when the highest marker bit indicates that passage is allowed.
[0123] As an optional implementation of this disclosure, the processing module 502 is further configured to determine to send a redundant frame message when the highest flag bit indicates that the transmission has not been allowed.
[0124] Update the second serial number to the first serial number;
[0125] Modify the highest flag bit in the first release flag to indicate release.
[0126] This disclosure provides a processing apparatus for redundant frame packets. The apparatus first acquires a redundant frame packet, which includes a first sequence number. A second sequence number and corresponding first release flag information are retrieved from the storage area corresponding to the redundant frame packet. Then, the processing module determines the sequence number difference between the first and second sequence numbers. If the sequence number difference is less than or equal to a target difference, and the target flag bit in the first release flag information indicates no release, the redundant frame packet is determined to be sent. The target difference is the number of flag bits in the first release flag information, and the target flag bits are determined based on the second sequence number and the sequence number difference. The redundant frame packet processing method provided in this disclosure can determine whether to send the redundant frame packet corresponding to the first sequence number based on the second sequence number and the first release flag information stored in the storage area. Since the first release flag information represents the historical release records of the second sequence number and the sequence number before the second sequence number, the historical release record corresponding to the redundant frame packet, that is, the target flag bit, can be determined based on the sequence number difference between the first sequence number and the second sequence number, indicating whether to release. If the target flag bit indicates that the packet has not been released, it means that the redundant frame packet has not been released in the past, and the redundant frame packet is sent. This reduces the time for processing redundant frame packets at the switch node, improves the efficiency of the switch in processing redundant frame packets, and ensures the security of the automotive Ethernet control system.
[0127] like Figure 6 As shown, Figure 6 This is a structural diagram of an electronic device according to an embodiment of the present disclosure. The electronic device includes a processor, a memory, and a computer program stored in the memory and executable on the processor. When executed by the processor, the computer program implements various processes of the redundant frame message processing method in the above-described method embodiments. Since the same technical effects can be achieved, further details are omitted here to avoid repetition.
[0128] This disclosure provides a computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium. When the computer program is executed by a processor, it implements each process of the redundant frame message processing method in the above method embodiments and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0129] The computer-readable storage medium can be a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc.
[0130] This disclosure provides a vehicle that includes the aforementioned redundant frame message processing apparatus or the aforementioned electronic device. The vehicle is used to execute the redundant frame message processing method provided in any embodiment of this disclosure.
[0131] This disclosure provides a computer program product that stores a computer program. When the computer program is executed by a processor, it implements the various processes of the vehicle-based multimedia data synchronization method described in the above-described method embodiments and achieves the same technical effect. To avoid repetition, it will not be described again here.
[0132] Those skilled in the art will understand that embodiments of this disclosure can be provided as methods, systems, or computer program products. Therefore, this disclosure can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this disclosure can take the form of a computer program product embodied on one or more computer-usable storage media containing computer-usable program code.
[0133] It should be understood, in the several embodiments provided in this disclosure, that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative; for example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0134] In this disclosure, the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.
[0135] In this disclosure, memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, like read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0136] In this disclosure, computer-readable media includes both permanent and non-permanent, removable and non-removable storage media. Storage media can store information using any method or technology; the information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient media, such as modulated data signals and carrier waves.
[0137] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the term "comprising" or any other variations thereof is intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0138] The above are merely specific embodiments of this disclosure, enabling those skilled in the art to understand or implement this disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this disclosure. Therefore, this disclosure is not to be limited to these embodiments, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for processing redundant frame packets, characterized in that, include: Obtain a redundant frame message, wherein the redundant frame message includes the first sequence number of the redundant frame message; Obtain the second sequence number and the first release tag information corresponding to the second sequence number from the storage area corresponding to the redundant frame message; Determine the difference between the first sequence number and the second sequence number; If the sequence number difference is less than or equal to the target difference, and the target flag bit in the first release flag information indicates that the release has not been made, it is determined to send the redundant frame message. The target difference is the number of flag bits in the first release flag information, and the target flag bit is determined based on the second sequence number and the sequence number difference.
2. The method of claim 1, wherein, After determining to send the redundant frame message, the method further includes: Modify the target flag bit in the first release flag information to indicate release, and obtain the second release flag information; Update the first release tag information to the second release tag information.
3. The method of claim 2, wherein, The step of modifying the target flag bit in the first release flag information to indicate release, thereby obtaining the second release flag information, includes: Mask information is generated based on the sequence number difference, and the flag bit corresponding to the sequence number difference in the mask information is used to indicate permission to pass. Based on the mask information and the first release mark information, the second release mark information is obtained.
4. The method of claim 1, wherein, After determining the difference between the first sequence number and the second sequence number, the method further includes: If the sequence number difference is greater than the target difference, it is determined to send the redundant frame message.
5. The method of claim 4, wherein, After determining to send the redundant frame message when the sequence number difference is greater than the target difference, the method further includes: The third release marker information is determined based on the sequence number difference and the first release marker information. In the third release marker information, the release marker bit corresponding to the second sequence number indicates release, and the release marker bit corresponding to the first sequence number also indicates release. Update the second sequence number to the first sequence number.
6. The method of claim 1, wherein, After obtaining the second sequence number and the first release tag information corresponding to the second sequence number from the storage area corresponding to the redundant frame message, the method further includes: Determine whether the highest flag bit in the first release flag information indicates whether to release the vehicle; Determining the sequence number difference between the first sequence number and the second sequence number includes: If the highest marker bit indicates permission to proceed, determine the difference between the first sequence number and the second sequence number.
7. The method of claim 6, wherein, After determining whether the highest flag bit in the first release flag information indicates whether to release, the process further includes: If the highest flag bit indicates that passage is not permitted, determine to send the redundant frame message; Update the second sequence number to the first sequence number; Modify the highest flag bit in the first release flag to indicate release.
8. A processing device of redundant frame packets, characterized in that, include: The acquisition module is used to acquire redundant frame packets, wherein the redundant frame packets include the first sequence number of the redundant frame packets; Obtain the second sequence number and the first release tag information corresponding to the second sequence number from the storage area corresponding to the redundant frame message; The processing module is used to determine the difference between the first sequence number and the second sequence number; If the sequence number difference is less than or equal to the target difference, and the target flag bit in the first release flag information indicates that the release has not been made, it is determined to send the redundant frame message. The target difference is the number of release flags in the first release flag information, and the target flag bit is determined based on the second sequence number and the sequence number difference.
9. An electronic device, comprising: include: A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the method for processing redundant frame messages as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, include: A computer program is stored on the computer-readable storage medium, which, when executed by a processor, implements the method for processing redundant frame messages as described in any one of claims 1 to 7.
11. A vehicle characterized by comprising: include: The redundant frame message processing apparatus as described in claim 8, or the electronic device as described in claim 9.