Bridge behavior test method and device, electronic equipment and storage medium

By extracting and analyzing specific field values ​​in Ethernet packets, testing the functional behavior of the bridge and proxy mode switching, the problem of the bridge affecting time synchronization is solved, ensuring the accuracy and stability of time synchronization.

CN119814603AActive Publication Date: 2025-04-11GREAT WALL MOTOR CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202411915811.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-24
Publication Date
2025-04-11
Estimated Expiration
2044-12-24

AI Technical Summary

Technical Problem

In vehicle-mounted Ethernet, due to the performance of the bridge affecting time synchronization, it is impossible to accurately determine whether the bridge will affect time synchronization through manpower, resulting in poor time synchronization.

Method used

Provide a bridge behavior testing method, which determines the bridge's functional behavior, proxy opening and proxy closing behavior by extracting specific field values ​​in messages sent by the master node and the bridge, ensuring that the bridge can work normally during the time synchronization process.

Benefits of technology

By testing the behavior of the bridge, it ensures that it can perform the data forwarding function normally during the time synchronization process, avoid time synchronization failure, and automatically enter proxy mode in the event of a master node failure to maintain time synchronization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119814603A_ABST
    Figure CN119814603A_ABST
Patent Text Reader

Abstract

The invention provides a bridge behavior test method and device, electronic equipment and a storage medium, and aims to test whether a data forwarding function of a bridge can be normally executed or not through a first correction field value and a first field value so as to ensure the accuracy of time synchronization. And then, by disconnecting the connection of the main node, whether the bridge automatically enters the proxy mode within the specified time is tested according to the first duration of keeping the default mode of the bridge, so that whether the proxy function of the bridge is normal is tested, and the time synchronization of different nodes in the Ethernet can be maintained when the main node has a fault. The connection of the main node is recovered, whether the bridge will exit the proxy mode within the specified time is tested according to the second duration of keeping the proxy mode after the bridge receives the message of the main node, and the data forwarding function is continued to be executed, so that the bridge can exit the proxy mode smoothly when the fault of the main node is repaired; and the data forwarding function is correctly executed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of vehicle technology, and in particular to a bridge behavior testing method, device, electronic device and storage medium. Background Art

[0002] There are more and more electronic control units (ECU) on the automotive Ethernet. Under normal circumstances, it is difficult to take the main node ECU offline. Even if the main node ECU is offline, because the Ethernet data transmission rate is very fast, a large amount of data flow will be generated in the network instantly, and time synchronization is required between nodes. The performance of the bridge during the time synchronization process affects the effect of time synchronization, so it is necessary to ensure that the bridge functions normally. However, it is impossible to accurately locate the time to the millisecond level through human power, resulting in the inability to manually determine whether the bridge will affect the time synchronization. Summary of the invention

[0003] In view of this, the purpose of the present application is to propose a bridge behavior testing method, device, electronic device and storage medium for testing the performance of the bridge to ensure time synchronization during Ethernet node data transmission.

[0004] Based on the above purpose, the present application provides a bridge behavior test method, which is applied to a behavior test device, wherein the behavior test device is connected to a CANOE hardware device, and the CANOE hardware device is connected to a controller node via Ethernet, and the controller node includes a master node and a slave node connected via a bridge; the bridge behavior test method includes:

[0005] Extracting a first field value in the general message sent by the master node and a first revised field value in the general message sent by the bridge;

[0006] determining a functional behavior test result of the bridge according to the first correction field value and the first field value;

[0007] Disconnecting the master node, determining a first duration for the bridge to maintain a default mode, and determining a proxy start behavior test result of the bridge according to the first duration;

[0008] The connection of the master node is restored, a second duration for the bridge to maintain the proxy mode after receiving the master node message is determined, and a proxy shutdown behavior test result of the bridge is determined according to the second duration.

[0009] Based on the same inventive concept, the present application also provides a bridge behavior test device, which is applied to a behavior test device, wherein the behavior test device is connected to a CANOE hardware device, wherein the CANOE hardware device is connected to a controller node via Ethernet, wherein the controller node includes a master node and a slave node connected via a bridge; the bridge behavior test device includes:

[0010] A field extraction module is configured to: extract a first field value in the general message sent by the master node and a first modified field value in the general message sent by the bridge;

[0011] a functional behavior test module, configured to: determine a functional behavior test result of the bridge according to the first correction field value and the first field value;

[0012] The proxy start test module is configured to: disconnect the master node, determine a first duration for the bridge to maintain a default mode, and determine a proxy start behavior test result of the bridge according to the first duration;

[0013] The proxy shutdown test module is configured to: restore the connection of the master node, determine the second duration for the bridge to maintain the proxy mode after receiving the master node message, and determine the proxy shutdown behavior test result of the bridge according to the second duration.

[0014] Based on the same inventive concept, the present application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable by the processor, wherein the processor implements the method as described above when executing the computer program.

[0015] Based on the same inventive concept, the present application also provides a non-transitory computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable a computer to execute the method as described above.

[0016] As can be seen from the above, the bridge behavior test method, device, electronic device and storage medium provided by the present application can extract the first field value in the general message sent by the master node and the first correction field value in the general message sent by the bridge; determine the functional behavior test result of the bridge according to the first correction field value and the first field value; disconnect the connection of the master node, determine the first duration of the bridge to maintain the default mode, and determine the proxy start behavior test result of the bridge according to the first duration; restore the connection of the master node, determine the second duration of the bridge to maintain the proxy mode after receiving the master node message, and determine the proxy shutdown behavior test result of the bridge according to the second duration. Determine whether there is time synchronization when the bridge forwards data through the first correction field value and the first field value to test whether the data forwarding function of the bridge can be performed normally and ensure the accuracy of time synchronization. Then, by disconnecting the connection of the master node, test whether the bridge will automatically enter the proxy mode within the specified time according to the first duration of the bridge to maintain the default mode, so as to test whether the proxy function of the bridge is normal, so as to ensure that the time synchronization of different nodes in the Ethernet can be maintained when the master node fails. And by restoring the connection of the master node and maintaining the proxy mode for a second duration after receiving the message from the master node, the bridge is tested to see whether it will exit the proxy mode within the specified time and continue to perform the data forwarding function, to ensure that when the master node failure is repaired, the bridge can smoothly exit the proxy mode and correctly perform the data forwarding function. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the present application or related technologies, the drawings required for use in the embodiments or related technical descriptions are briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0018] Figure 1 A schematic diagram of a system layout for testing a bridge according to an embodiment of the present application;

[0019] Figure 2 This is a flow chart of the bridge behavior testing method according to an embodiment of the present application;

[0020] Figure 3a A schematic diagram of a frequency synchronization process according to an embodiment of the present application;

[0021] Figure 3b A schematic diagram of path delay measurement in an embodiment of the present application;

[0022] Figure 3c A schematic diagram of synchronization time calculation according to an embodiment of the present application;

[0023] Figure 3d A schematic diagram of message transmission when a Bridge is used for data forwarding in an embodiment of the present application;

[0024] Figure 4 A flow chart for determining the functional behavior test results of the bridge according to an embodiment of the present application;

[0025] Figure 5 This is a flow chart of determining the proxy start behavior test result of the bridge according to the first duration in an embodiment of the present application;

[0026] Figure 6 This is a flow chart of an embodiment of the present application for determining a proxy shutdown behavior test result of a bridge according to a second duration;

[0027] Figure 7 This is a schematic diagram of the structure of a bridge behavior testing device according to an embodiment of the present application;

[0028] Figure 8 It is a schematic diagram of the structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0029] In order to make the objectives, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.

[0030] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present application should be the usual meanings understood by people with ordinary skills in the field to which the present application belongs. The "first", "second" and similar words used in the embodiments of the present application do not represent any order, quantity or importance, but are only used to distinguish different components. "Including" or "comprising" and similar words mean that the elements or objects appearing in front of the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0031] It should be understood herein that any number of elements in the drawings is for illustration rather than limitation, and any naming is only for distinction rather than having any limiting meaning.

[0032] Based on the description of the above background technology, the related technology also has the following situations:

[0033] As more and more functions are deployed in vehicles, more and more controls are installed in the vehicles. The data stream transmission between different controllers uses the generalized Precision Time Protocol (gPTP). gPTP provides a more sophisticated clock performance measurement and monitoring mechanism, which helps to improve the clock synchronization accuracy and stability of the overall network. It is an Ethernet-based time synchronization protocol defined by the IEEE 802.1AS standard, which is used to maintain time synchronization between nodes in Ethernet with time-sensitive applications. That is, the gPTP protocol sends the initial reference clock by specifying a node as the master clock in the system, and other nodes form a tree structure with the master clock as the root to receive clock signals and align with the master clock to achieve the goal of time synchronization.

[0034] The gPTP protocol works on the second layer of the seven-layer network model (Open System Interconnection, OSI) of the International Organization for Standardization (ISO), namely the Media Access Control Address (MAC) layer. Therefore, the nodes in the network can mark timestamps through hardware, thereby avoiding problems such as software scheduling time, protocol stack processing speed and cache that affect the accuracy of timestamps, greatly improving the effect of time synchronization. According to the standard, the accuracy of time synchronization between any two nodes within 7 hops (with six gPTP nodes in the middle) on the network that implements gPTP is less than 1μs. In addition, since it works on the second layer, it can be applied to networks with different physical layer transmission media, such as point-to-point full-duplex Ethernet, WIFI, optical fiber, etc., and it is also applicable to local area networks mixed with different media.

[0035] There are two types of devices in a gPTP time synchronization system:

[0036] A PTP terminal node is a terminal node that sends (as a master node of a master clock) or receives (as a slave node of a non-master clock) time synchronization information and utilizes it.

[0037] A PTP relay node is a node that receives time synchronization information, compensates for the delays on the network and itself, and then forwards it.

[0038] Regardless of the type of device, all devices have local clocks, which are timed by the oscillation cycle of the crystal oscillator. Both types of devices may serve as the grandmaster clock of the entire system to provide the clock reference for the entire system. Generally, they have the most accurate clock source in the entire system. The determination of the master clock can be dynamic competition or static allocation. The ports of the gPTP device are divided into master ports and slave ports. The master port is responsible for sending clock synchronization messages, and the slave port is responsible for receiving clock synchronization messages. The bridge has both master ports and slave ports, but a node device has and can only have one slave port. In a time synchronization system, there may be multiple time domains, each of which performs time synchronization independently. The same node can also belong to multiple time domains at the same time, and each time domain will have an independent clock source.

[0039] Among them, the bridge refers to a device used to connect different parts in the network and is responsible for the transmission and processing of time signals. Therefore, if the function of the bridge is abnormal, it will cause problems with the time synchronization of the Ethernet node and cause failures in the control of the entire vehicle. However, it is impossible to accurately locate the time to the millisecond level through human power, resulting in the inability to manually determine whether the bridge will affect the time synchronization.

[0040] The bridge behavior test method, device, electronic device and storage medium provided by the present application can extract the first field value in the general message sent by the master node and the first correction field value in the general message sent by the bridge; determine the functional behavior test result of the bridge according to the first correction field value and the first field value; disconnect the connection of the master node, determine the first duration of the bridge to maintain the default mode, and determine the proxy start behavior test result of the bridge according to the first duration; restore the connection of the master node, determine the second duration of the bridge to maintain the proxy mode after receiving the master node message, and determine the proxy shutdown behavior test result of the bridge according to the second duration. Determine whether there is time synchronization when the bridge forwards data through the first correction field value and the first field value to test whether the data forwarding function of the bridge can be performed normally and ensure the accuracy of time synchronization. Then, by disconnecting the connection of the master node, test whether the bridge will automatically enter the proxy mode within the specified time according to the first duration of the bridge to maintain the default mode, so as to test whether the proxy function of the bridge is normal, so as to ensure that the time synchronization of different nodes in the Ethernet can be maintained when the master node fails. And by restoring the connection of the master node and maintaining the proxy mode for a second duration after receiving the message from the master node, the bridge is tested to see whether it will exit the proxy mode within the specified time and continue to perform the data forwarding function, to ensure that when the master node failure is repaired, the bridge can smoothly exit the proxy mode and correctly perform the data forwarding function.

[0041] The bridge behavior testing method provided by the embodiments of the present application is described in detail below with reference to the accompanying drawings.

[0042] In some embodiments, the bridge behavior test method is applied to a behavior test device, the behavior test device is connected to a CANOE hardware device, the CANOE hardware device is connected to a controller node via Ethernet, and the controller node includes a master node and a slave node connected via a bridge.

[0043] Among them, the system layout for testing the bridge, such as Figure 1 As shown, the test device can be a PC device that deploys the Bridge behavior test system script program. The PC end is connected to the CAN development environment (CAN open environment, CANOE) device through USB, and the CANOE hardware device supports Ethernet data acquisition. The Ethernet channel of CANOE is connected to the Ethernet ECU through an Ethernet two-way line of corresponding speed. The Ethernet ECU includes a Master as a master node, a bridge Bridge and a Slave as a slave node. The PC end integrates the system test script, and calculates and timestamps of the ECU internal timestamp through the Configuration-Profibus Architectures Library (CPAL) program, automatically captures the timestamp information in the Follow up message sent by the Master, and whether the correction field is incremented. At the same time, it will also determine whether the Bridge can enter the proxy mode at the specified time when the Master fails.

[0044] Specific steps for arranging the test system:

[0045] 1. Ensure that the CANOE software and license are correctly installed on the PC, as well as the Bridge behavior test engineering script with the gPTP protocol.

[0046] 2. Use the USB cable and CANOE hardware device to correctly configure the Ethernet channel to facilitate data collection and transmission.

[0047] 3. Connect CANOE and Ethernet ECU via Ethernet.

[0048] 4. Configure the MAC and port number (portnumber) of Master, Bridge, and Slave in the test system.

[0049] After the test system is arranged, the bridge behavior test process is performed. The specific test method is as follows:

[0050] In some embodiments, Figure 2 As shown, the bridge behavior test method includes:

[0051] Step 201: extracting a first field value in a general message sent by a master node and a first revised field value in a general message sent by a bridge.

[0052] During the specific implementation, a connectivity test is first required to determine whether the connections between the ECUs are normal, to ensure that there are no connectivity failures between the Master, Bridge, and Slave, and to ensure the accuracy of the subsequent test process. After the connectivity test determines that the connections between the ECUs are normal, the corresponding bridge behavior test method is executed.

[0053] The messages in the gPTP protocol are divided into event-type messages (such as Sync messages, Pdelay Req messages, Pdelay Resp messages) and general messages (such as Follow up messages, Announce messages, Signaling messages). When receiving or sending event-type messages, the MAC layer will trigger the sampling of the local clock, and combine the oscillation cycle count value with the clock oscillation frequency and the reference time to generate a timestamp. When the device receives or sends general messages, it will not trigger the hardware to sample the hardware technology device, and will not generate a timestamp, but it will carry timestamp information. Among them, Sync and Follow up are a group of messages, and the master clock information of the master node Master is transmitted through this group of messages.

[0054] Among them, Master: As the main node, it sends Sync messages and Follow UP messages to tell all Slave nodes how to set the time information.

[0055] Bridge: Non-clock node, acts as a transparent clock. After entering the Bridge, the gPTP message will have a processing time, called the residence time. The protocol requires that the bridge must have the ability to test the residence time.

[0056] Slave: As a slave node, it synchronizes frequency and calculates delay according to the Sync and Follow UP messages sent by the Master to achieve time synchronization.

[0057] Time synchronization requires four steps: host election → frequency synchronization → delay measurement → time calculation. In the test scenario, the master node has been determined, and the host election process can be ignored. Figure 3a The frequency synchronization process shown in the figure is mainly calculated by the timestamp between the master node and the slave node during time synchronization calculation, so the Bridge forwarding process is omitted when introducing time synchronization, but the residence time of the Bridge forwarding is already included in the final message. The frequency synchronization process includes:

[0058] 1. The Master sends a Sync message. When the message leaves the Master's MAC layer, the Master is triggered to record the time T1.

[0059] 3. The Slave receives the Sync message. When the message reaches the MAC layer of the Slave, the Slave is triggered to record the time T2 at this time.

[0060] 4. The Master sends a Follow UP message and attaches the t1 value to the Follow UP message.

[0061] 4. The Master sends a Sync message. When the message leaves the Master's MAC layer, the Master is triggered to record the timestamp T3 at this time.

[0062] 5. The Slave receives the Sync message. When the message reaches the MAC layer of the Slave, it triggers the Slave to record the timestamp T4 at this time.

[0063] 6. The Master sends a Follow UP message and attaches the T3 value to the message.

[0064] 7. The Slave calculates the deviation R between its own clock frequency and the Master clock frequency using the following formula.

[0065]

[0066] Furthermore, the process of path delay measurement is as follows: Figure 3b As shown:

[0067] 1. The slave sends a Pdelay Req message. When the message leaves the MAC layer of the slave, the slave is triggered to record the timestamp T5 at that time.

[0068] 2. The Master receives the Pdelay_Req message. When the message reaches the MAC layer of the Master, the Master is triggered to record the timestamp T6 at this time.

[0069] 3. The Master sends a Pdelay_Resp message and attaches the value of T5 to the message. When the message leaves the MAC layer of the Master, the Master is triggered to record the timestamp T7 at this time.

[0070] 4. The Slave receives the Pdelay Resp message. When the message reaches the MAC layer of the Slave, it triggers the Slave to record the timestamp T8 at this time.

[0071] 5. The Master sends a Pdelay Resp Follow UP message and attaches the value of T7 to the message.

[0072] 6. The slave can calculate the path delay between adjacent devices using the following formula.

[0073]

[0074] Furthermore, the process of synchronization time calculation is as follows Figure 3c As shown:

[0075] 1. The Master sends a Sync message. When the message leaves the Master's MAC layer, the Master is triggered to record the timestamp T9 at this time.

[0076] 2. The Slave receives the Sync message. When the message reaches the MAC layer of the Slave, it triggers the Slave to record the timestamp T10 at this time.

[0077] 3. The Master sends a Follow UP message and attaches the T9 value to the message.

[0078] 4. The Slave can calculate the timestamp Ta on the Master based on the local timestamp Tb using the following formula, thus completing time synchronization.

[0079] Ta=T9+delay+R×(Tb-T10).

[0080] It can be seen that if there is a problem with the function of the Bridge that forwards messages between the Master and Slave nodes, the time at the Slave node will be incorrect, which will lead to time synchronization failure.

[0081] It should be noted that FFFE (hexadecimal representation of binary 111111111111110) must be added in the middle of the MAC configuration. The reason why FFFE is added in the middle of the MAC of the GPTP protocol is to insert an extra bit in the 16-bit MAC address so that the 48-bit MAC address can be identified in the 64-bit timestamp. This is because the GPTP protocol uses the synchronous Ethernet protocol in the IEEE 802.1AS specification, which specifies a 64-bit timestamp format that contains a 48-bit MAC address. Therefore, when identifying the MAC address in the timestamp, the MAC address needs to be extended to 64 bits. By inserting FFFE in the middle of the MAC address, it can be converted to a 64-bit address because FFFE occupies two bytes, i.e. 16 bits, in 16 bits, resulting in a 64-bit address.

[0082] When Bridge is used for data forwarding, the transmission process of a group of Sync messages and Follow UP messages is as follows: Figure 3d As shown, the following steps are included:

[0083] 1. The Master sends a Sync message. When the message leaves the Master's MAC layer, the Master is triggered to record the time cutoff t1.

[0084] 2. The Bridge receives a Sync message. When the message reaches the MAC layer of the Bridge, the Bridge is triggered to record the time t2. After the residence delay, the Bridge sends a Sync message. When the message leaves the MAC layer of the Bridge, the Bridge is triggered to record the time t3. If the residence time is Δt, then t3 = t2 + Δt.

[0085] 3. The Slave receives the Sync message. When the message reaches the MAC layer of the Slave, the Slave is triggered to record the time cutoff t4 at this time.

[0086] 4. The Master sends a Follow UP message and attaches the t1 value to the Follow UP message. When the Follow UP message leaves the MAC layer of the Master, it does not trigger the Master to perform clock sampling and does not generate a timestamp.

[0087] 5. After receiving the Follow UP message, the Bridge attaches the t3 value to the Follow UP message and sends it. The Follow UP message does not trigger clock collection, and the Bridge does not generate a timestamp when sending the Follow UP message.

[0088] 6. The slave receives the Follow UP message and reads the timestamps t1 and t3 in the Follow UP message. When the Follow UP message reaches the MAC layer of the slave, it does not trigger clock collection and does not generate a timestamp.

[0089] The path delay between the Master and the Bridge can be expressed as follows: Figure 3b The determination is performed in the manner shown and will not be repeated here.

[0090] According to Figure 3dIn the message transmission process shown in FIG. 1 , the test device can determine time t1 by extracting the first field value of the first correction field correctionField(1) in the general message (Follow up message) sent by the master node. The test device can also determine time t3 by extracting the first correction field value of the second correction field correctionField(2) in the general message (Follow up message) sent by the bridge.

[0091] Step 202: Determine a functional behavior test result of the bridge according to the first correction field value and the first field value.

[0092] In specific implementation, according to Figure 3d It can be seen that, under the premise that the Bridge does not have any faults, t3 = t1 + delay + Δt. Therefore, it is necessary to determine the path delay. The time when the event message is received can be determined by reading the timestamp obtained when the Bridge receives the event message. The time t2 corresponding to the timestamp and the time t1 corresponding to the first field value. Then the path delay (delay) = t2-t1, which can determine the path delay more efficiently and accurately. You can also use the following method: Figure 3b The path delay is determined in the manner shown. However, if there is a problem with the Bridge itself, a large error will occur in the path delay.

[0093] After determining the path delay, use ScaledNS (delay mod 2 16 )Determine the compensation field value T.

[0094] Here, mod is the modulus operator in mathematics, which is used to obtain the remainder. A mod B means the remainder after A is divided by B.

[0095] 2 16 : This is a number, equal to 65536. In binary representation, this is the maximum value of a 16-bit number. So delay mod 2 16 This means taking the remainder of delay divided by 65536 to convert the timestamp into a compensation field value with the same number of bits as the first field value, thus achieving nanosecond-level time synchronization testing.

[0096] The Scaled Network Stability (ScaledNS) mechanism in the GPTP protocol is used to evaluate the stability of the network and provides a mechanism to ensure clock synchronization in the network. It is usually achieved by calculating the offset and jitter of the clock in the network. ScaledNS can also be used to detect faults and anomalies in the network, thereby helping to maintain the stability and reliability of the network.

[0097] After delay is converted, the time t1 and value corresponding to the compensation field value T and the first field value are determined as the second correction field value t5=T+t1. During the same message transmission, t5=t2.

[0098] The first correction field value t3 = t5 + Δt (the more links the Bridge passes through, the larger the value of Δt), so t3 should be later than t5. Therefore, when it is determined that t3 is greater than t5, it is determined that the Bridge has performed internal data processing, and the functional behavior test result is determined to be normal. If t3 is less than or equal to t5, it is determined that the Bridge has performed internal data processing, and the time is disordered. This will cause errors in time synchronization.

[0099] Step 203: disconnect the main node, determine a first duration for the bridge to maintain the default mode, and determine a proxy start behavior test result of the bridge according to the first duration.

[0100] In the specific implementation, during the actual use process, in order to avoid time synchronization failure after the master node is disconnected, the bridge needs to enter the proxy mode after the master node is disconnected, and send a constant and precise origin timestamp and Sync / Follow Up message on behalf of the master clock of the master node.

[0101] Under normal circumstances, the bridge is required to enter the proxy mode within 500ms, and replace the master clock of the master node to send a message with a constant and accurate origin timestamp and Sync / Follow Up within 20S, so the proxy start behavior test result can be determined based on the first duration of the bridge maintaining the default mode. If the bridge fails to enter the proxy mode within 500ms, it means that the bridge has a proxy start failure; if the bridge successfully enters the proxy mode within 500ms, it means that the bridge can enter the proxy mode smoothly, and the time when the message is sent can be used to determine whether the bridge entering the proxy mode has the ability to replace the master node.

[0102] If the master clock of the master node is replaced within 20 seconds to send a message with a constant and accurate origin timestamp and Sync / Follow Up message, it means that the bridge has the ability to replace, and the proxy start behavior test result is determined to be normal. If the master clock of the master node cannot be replaced within 20 seconds to send a message with a constant and accurate origin timestamp and Sync / FollowUp message, it means that the bridge does not have the ability to replace, and the proxy start behavior test result is determined to be a proxy start behavior failure.

[0103] Step 204: Restore the connection of the master node, determine the second duration for the bridge to maintain the proxy mode after receiving the message from the master node, and determine the proxy shutdown behavior test result of the bridge according to the second duration.

[0104] In specific implementation, during the actual use process, the master node may be restored at any time after being disconnected, so the bridge is tested whether it can exit the proxy mode normally by restoring the connection of the master node. Under normal circumstances, the master node is required to exit the proxy mode within 125ms after the connection is restored, so the second duration of the bridge maintaining the proxy mode after receiving the master node message can be used to determine whether the bridge's function of exiting the proxy mode is normal. If the proxy mode is exited within 125ms, the proxy shutdown behavior test result is determined to be normal. If the proxy mode is not exited within 125ms, the proxy shutdown behavior test result is determined to be a proxy shutdown behavior failure.

[0105] Finally, the test equipment outputs and displays the functional behavior test results, the proxy on behavior test results, and the proxy off behavior test results, providing the user with the test results and providing data support for the user's subsequent use or maintenance.

[0106] This causes time synchronization failure. The bridge needs to enter proxy mode after the master node is disconnected, and send Sync / Follow Up messages with constant and precise origin timestamps instead of the master clock of the master node.

[0107] In summary, the bridge behavior test method provided by the present application. It is possible to determine whether time synchronization exists when the bridge forwards data through the first correction field value and the first field value, so as to test whether the data forwarding function of the bridge can be performed normally and ensure the accuracy of time synchronization. Then, by disconnecting the connection of the master node, the bridge is tested whether it will automatically enter the proxy mode within the specified time according to the first duration of the bridge maintaining the default mode, so as to test whether the proxy function of the bridge is normal, and ensure that the time synchronization of different nodes in the Ethernet can be maintained when the master node fails. And by restoring the connection of the master node, and according to the second duration of the bridge maintaining the proxy mode after receiving the master node message, it is tested whether the bridge will exit the proxy mode within the specified time and continue to perform the data forwarding function, so as to ensure that the bridge can smoothly exit the proxy mode and correctly perform the data forwarding function when the master node failure is repaired.

[0108] In some embodiments, Figure 4 As shown, determining the functional behavior test result of the bridge according to the first correction field value and the first field value includes:

[0109] Step 401: Determine the timestamp collected when the bridge receives the master node event message.

[0110] In specific implementation, the timestamp collected when the bridge receives the event message from the master node is the time when the bridge receives the event message. The path delay can be determined based on the time for subsequent multiple tests.

[0111] Step 402: Correct the first field value according to the timestamp to obtain a second corrected field value.

[0112] In specific implementation, the time of the timestamp is not represented in 16 bits, so the timestamp needs to be converted into a 16-bit compensation field value T. The compensation field value is the time corresponding to the path delay, and the first field value represents the time when the master node sends the event-type message. The sum of the first field value and the compensation field value is the second correction field value.

[0113] In some embodiments, modifying the first field value according to the timestamp to obtain a second modified field value includes:

[0114] Step 4021: Determine time conversion parameters.

[0115] In the specific implementation, the timestamp needs to be converted into a 16-bit representation, and 2 16 To represent the maximum value of a 16-bit number in binary, you can use 2 16 Determined as time conversion parameter.

[0116] Step 4022: Determine the time difference between the timestamp and the first field value as the path delay, determine the remainder after dividing the path delay by the time conversion parameter, and convert the remainder into a compensation field value through network stability calculation.

[0117] In a specific implementation, the time difference between the timestamp and the first field value is determined as the path delay, and the delay mod 2 16 The operation determines the remainder after dividing the path delay by the time conversion parameter. Finally, ScaledNS(delay mod 2 16 )Determine the 16-bit compensation field value T.

[0118] Step 4023: Determine the sum of the compensation field value and the first field value as the second correction field value.

[0119] In specific implementation, the first field value is corrected according to the compensation field to obtain a second corrected field value, that is, the sum of the compensation field value and the first field value is determined as the second corrected field value, and the second corrected field value represents the field value of the added path delay.

[0120] Step 403: Determine a functional behavior test result according to the second correction field value and the first correction field value.

[0121] In some embodiments, step 403 includes:

[0122] Step 4031: In response to the second correction field value being less than the first correction field value, determining that the functional behavior test result is normal.

[0123] In specific implementation, since it takes a certain amount of time for the bridge point to perform internal data processing, namely the residence time of the bridge, the time when the bridge sends the event-type message must be later than the time when it receives the event-type message. Therefore, when the value of the second correction field is less than the value of the first correction field, it means that the bridge has performed internal processing and successfully added the residence time to the general message, and the functional behavior test result is determined to be normal.

[0124] Step 4032: In response to the second correction field value being greater than or equal to the first correction field value, determining that the functional behavior test result is a functional behavior failure.

[0125] In specific implementation, since it takes a certain amount of time for the bridge point to perform internal data processing, namely the residence time of the bridge, the time when the bridge sends the event-type message must be later than the time when it receives the event-type message. Therefore, when the second correction field value is greater than or equal to the first correction field value, it means that there is an error in the second correction field value in the general message sent by the bridge. The bridge may not have performed time correction according to the residence time and failed to perform the correct bridge function, and the functional behavior test result is determined to be a functional behavior failure.

[0126] In some embodiments, Figure 5 As shown, determining the proxy start behavior test result of the bridge according to the first duration includes:

[0127] Step 501: In response to a first duration being greater than a preset duration threshold, determining that a proxy start behavior test result is a proxy start behavior failure.

[0128] In specific implementation, after the master node is disconnected, the non-faulty bridge will enter the proxy mode within 500ms, and send a Sync / Follow Up message with a constant and precise origin timestamp instead of the master clock of the master node within 20S.

[0129] Therefore, the proxy activation behavior test result can be determined according to the first duration of the bridge maintaining the default mode. If the first duration is greater than the preset duration threshold (e.g., 500ms), it means that the bridge has not entered the proxy mode within 500ms, indicating that the bridge has a proxy activation failure.

[0130] Step 502: In response to the first duration being less than or equal to a preset duration threshold, determining a third duration during which the bridge does not perform the proxy function, and determining a proxy activation behavior test result according to the third duration.

[0131] In specific implementation, if the proxy mode is successfully entered within 500ms, it means that the bridge can enter the proxy mode smoothly. However, it is necessary to further test whether the bridge entering the proxy mode has the ability to replace the master node. A bridge without faults will replace the master clock of the master node within 20S to send a message with a constant and accurate origin timestamp and Sync / Follow Up, so it can be judged whether the bridge has the proxy capability based on the third duration of the bridge not performing the proxy function.

[0132] In some embodiments, determining the agent start-up behavior test result according to the third duration includes:

[0133] Step 5021: In response to the third duration being greater than a preset maximum proxy interval duration, determining that the proxy start behavior test result is a proxy start behavior failure.

[0134] In specific implementation, if the third duration is greater than the preset maximum proxy interval (for example, 20S), it means that the bridge cannot replace the master clock of the master node to send a message with a constant and precise origin timestamp and Sync / Follow Up within 20S, which means that the bridge does not have the replacement capability, and the proxy startup behavior test result is determined to be a proxy startup behavior failure.

[0135] Step 5022: In response to the third duration being less than or equal to the preset maximum proxy interval duration, determining that the proxy start behavior test result is that the proxy start behavior is normal.

[0136] In specific implementation, if the third duration is less than or equal to the preset maximum proxy interval, it means that the bridge can replace the master clock of the master node to send a message with a constant and precise origin timestamp and Sync / Follow Up within 20S, which means that the bridge has the replacement capability and determines that the proxy startup behavior test result is normal.

[0137] In some embodiments, Figure 6 As shown, determining the proxy closing behavior test result of the bridge according to the second duration includes:

[0138] Step 601: In response to the second duration being greater than a preset recovery duration threshold, determining that the proxy shutdown behavior test result is a proxy shutdown behavior failure.

[0139] In specific implementation, during the actual use process, the master node may be restored at any time after being disconnected, so the bridge is tested whether it can exit the proxy mode normally by restoring the connection of the master node. Under normal circumstances, the master node is required to exit the proxy mode within 125ms after restoring the connection, so the second duration of the bridge maintaining the proxy mode after receiving the master node message can be used to determine whether the bridge's function of exiting the proxy mode is normal. If the second duration is greater than the preset recovery duration threshold, it means that the bridge has not exited the proxy mode within 125ms, and the proxy shutdown behavior test result is determined to be a proxy shutdown behavior failure.

[0140] Step 602: In response to the second duration being less than or equal to a preset recovery duration threshold, a new functional behavior test result is determined.

[0141] In specific implementation, if the second duration is less than or equal to the preset recovery duration threshold, it means that the bridge has exited the proxy mode within 125ms, and it is necessary to further verify whether the bridge exiting the proxy mode can smoothly perform the data forwarding function. The function of the bridge after exiting the proxy mode can be verified by determining the new functional behavior test result.

[0142] Step 603: In response to the new function test result being a function behavior failure, determining that the proxy shutdown behavior test result is a proxy shutdown behavior failure.

[0143] During specific implementation, if the new functional test result is a functional behavior failure, it means that the bridge cannot perform correct forwarding of message data after exiting the proxy mode, which will cause time data errors when forwarding message data, resulting in large errors in time synchronization, indicating that entering the proxy mode disrupts the normal function of the bridge, and determines that the proxy shutdown behavior test result is a proxy shutdown behavior failure.

[0144] Step 604: In response to the new function test result being that the function behavior is normal, determining that the proxy shutdown behavior test result is that the proxy shutdown behavior is normal.

[0145] During specific implementation, if the new functional test result is that the functional behavior is normal, it means that the bridge can normally perform the correct forwarding of message data after exiting the proxy mode, and the time data is added normally when forwarding the message data, ensuring the time synchronization between the master node and the slave node, and determining that the proxy shutdown behavior test result is a proxy shutdown behavior failure.

[0146] It should be noted that the method of the embodiment of the present application can be performed by a single device, such as a computer or server. The method of this embodiment can also be applied to a distributed scenario and completed by multiple devices cooperating with each other. In the case of such a distributed scenario, one of the multiple devices can only perform one or more steps in the method of the embodiment of the present application, and the multiple devices will interact with each other to complete the described method.

[0147] It should be noted that the above describes some embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the above embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0148] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present application also provides a bridge behavior testing device, which is applied to a behavior testing device, the behavior testing device is connected to a CANOE hardware device, the CANOE hardware device is connected to a controller node via Ethernet, and the controller node includes a master node and a slave node connected via a bridge.

[0149] refer to Figure 7 , the bridge behavior test setup includes:

[0150] The field extraction module 10 is configured to: extract a first field value in the general message sent by the master node and a first modified field value in the general message sent by the bridge;

[0151] The functional behavior test module 20 is configured to: determine a functional behavior test result of the bridge according to the first correction field value and the first field value;

[0152] The proxy start test module 30 is configured to: disconnect the master node, determine a first duration for the bridge to maintain the default mode, and determine a proxy start behavior test result of the bridge according to the first duration;

[0153] The proxy shutdown test module 40 is configured to: restore the connection of the master node, determine the second duration for the bridge to maintain the proxy mode after receiving the master node message, and determine the proxy shutdown behavior test result of the bridge according to the second duration.

[0154] For the convenience of description, the above device is described in terms of functions divided into various modules. Of course, when implementing the present application, the functions of each module can be implemented in the same or multiple software and / or hardware.

[0155] The device of the above embodiment is used to implement the corresponding bridge behavior testing method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.

[0156] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments, the present application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the bridge behavior test method described in any of the above embodiments is implemented.

[0157] Figure 8 A more specific schematic diagram of the hardware structure of an electronic device provided in this embodiment is shown, and the device may include: a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040 are connected to each other through the bus 1050 in the device.

[0158] The processor 1010 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.

[0159] The memory 1020 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1020 may store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program codes are stored in the memory 1020 and are called and executed by the processor 1010.

[0160] The input / output interface 1030 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.

[0161] The communication interface 1040 is used to connect a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through a wired mode (such as USB, network cable, etc.) or a wireless mode (such as mobile network, WIFI, Bluetooth, etc.).

[0162] The bus 1050 includes a path that transmits information between the various components of the device (eg, the processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040).

[0163] It should be noted that, although the above device only shows the processor 1010, the memory 1020, the input / output interface 1030, the communication interface 1040 and the bus 1050, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include the components necessary for implementing the embodiments of the present specification, and does not necessarily include all the components shown in the figure.

[0164] The electronic device of the above embodiment is used to implement the corresponding bridge behavior test method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.

[0165] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present application also provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the bridge behavior testing method described in any of the above embodiments.

[0166] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, 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 technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.

[0167] The computer instructions stored in the storage medium of the above embodiment are used to enable the computer to execute the bridge behavior testing method described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0168] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, the present application also provides a vehicle, including the electronic device or bridge behavior testing device of the above-mentioned embodiment, and the bridge behavior testing method described in any of the above embodiments is executed through the electronic device or bridge behavior testing device of the above-mentioned embodiment, and has the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0169] It is understandable that before using the technical solutions of each embodiment of the present application, the type, scope of use, usage scenarios, etc. of the personal information involved will be informed to the user in an appropriate manner, and the user's authorization will be obtained.

[0170] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly remind the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can independently choose whether to provide personal information to the electronic device, application, server, storage medium or other software or hardware that performs the operation of the technical solution of the present application according to the prompt message.

[0171] As an optional but non-limiting implementation, in response to receiving the user's active request, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0172] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation method of this application. Other methods that meet relevant laws and regulations may also be applied to the implementation method of this application.

[0173] A person skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present application is limited to these examples. In line with the concept of the present application, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of the different aspects of the embodiments of the present application as described above, which are not provided in detail for the sake of simplicity.

[0174] In addition, to simplify the description and discussion, and in order not to make the embodiments of the present application difficult to understand, the known power supply / ground connection with the integrated circuit (IC) chip and other components may or may not be shown in the provided drawings. In addition, the device can be shown in the form of a block diagram to avoid making the embodiments of the present application difficult to understand, and this also takes into account the fact that the details of the implementation of these block diagram devices are highly dependent on the platform to be implemented in the embodiments of the present application (that is, these details should be fully within the scope of understanding of those skilled in the art). In the case of elaborating specific details (e.g., circuits) to describe exemplary embodiments of the present application, it is obvious to those skilled in the art that the embodiments of the present application can be implemented without these specific details or when these specific details are changed. Therefore, these descriptions should be considered to be illustrative rather than restrictive.

[0175] Although the present application has been described in conjunction with specific embodiments of the present application, many replacements, modifications and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may use the embodiments discussed.

[0176] The embodiments of the present application are intended to cover all such substitutions, modifications and variations that fall within the broad scope of the present application. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present application should be included in the protection scope of the present application.

Claims

1. A bridge behavior testing method, characterized in that: Applied to a behavior test device, the behavior test device is connected to a CANOE hardware device, the CANOE hardware device is connected to a controller node via Ethernet, and the controller node includes a master node and a slave node connected via a bridge; The bridge behavior testing method comprises: Extracting a first field value in the general message sent by the master node and a first revised field value in the general message sent by the bridge; determining a functional behavior test result of the bridge according to the first correction field value and the first field value; Disconnecting the master node, determining a first duration for the bridge to maintain a default mode, and determining a proxy-on behavior test result of the bridge according to the first duration; The connection of the master node is restored, a second duration for the bridge to maintain the proxy mode after receiving the master node message is determined, and a proxy shutdown behavior test result of the bridge is determined according to the second duration.

2. The method according to claim 1, characterized in that The step of determining a functional behavior test result of the bridge according to the first correction field value and the first field value includes: Determine the timestamp collected when the bridge receives the master node event message; Correcting the first field value according to the timestamp to obtain a second corrected field value; The functional behavior test result is determined according to the second correction field value and the first correction field value.

3. The method according to claim 2, characterized in that The determining the functional behavior test result according to the magnitude relationship between the second correction field value and the first correction field value includes: In response to the second correction field value being less than the first correction field value, determining that the functional behavior test result is that the functional behavior is normal; In response to the second correction field value being greater than or equal to the first correction field value, determining that the functional behavior test result is a functional behavior failure.

4. The method according to claim 1, characterized in that: The step of determining the proxy start behavior test result of the bridge according to the first duration includes: In response to the first duration being greater than a preset duration threshold, determining that the proxy start behavior test result is a proxy start behavior failure; In response to the first duration being less than or equal to a preset duration threshold, a third duration during which the bridge does not perform an agent function is determined, and the agent activation behavior test result is determined according to the third duration.

5. The method according to claim 4, characterized in that The step of determining the proxy activation behavior test result according to the third duration includes: In response to the third duration being greater than a preset maximum proxy interval duration, determining that the proxy start behavior test result is a proxy start behavior failure; In response to the third duration being less than or equal to a preset maximum proxy interval duration, it is determined that the proxy start behavior test result is that the proxy start behavior is normal.

6. The method according to claim 1, characterized in that The step of determining the proxy shutdown behavior test result of the bridge according to the second duration includes: In response to the second duration being greater than a preset recovery duration threshold, determining that the proxy shutdown behavior test result is a proxy shutdown behavior failure; In response to the second duration being less than or equal to a preset recovery duration threshold, determining a new functional behavior test result; In response to the new functional test result being a functional behavior failure, determining that the proxy shutdown behavior test result is a proxy shutdown behavior failure; In response to the new functional test result being that the functional behavior is normal, determining that the proxy shutdown behavior test result is that the proxy shutdown behavior is normal.

7. The method according to claim 2, characterized in that: The method of correcting the first field value according to the timestamp to obtain a second corrected field value comprises: Determine time conversion parameters; Determine a time difference between the timestamp and the first field value as a path delay, determine a remainder after dividing the path delay by a time conversion parameter, and convert the remainder into a compensation field value through network stability calculation; The sum of the compensation field value and the first field value is determined as the second correction field value.

8. A bridge behavior testing device, characterized in that: Applied to a behavior test device, the behavior test device is connected to a CANOE hardware device, the CANOE hardware device is connected to a controller node via Ethernet, and the controller node includes a master node and a slave node connected via a bridge; The bridge behavior test device comprises: A field extraction module is configured to: extract a first field value in the general message sent by the master node and a first modified field value in the general message sent by the bridge; a functional behavior test module, configured to: determine a functional behavior test result of the bridge according to the first correction field value and the first field value; The proxy start test module is configured to: disconnect the master node, determine a first duration for the bridge to maintain a default mode, and determine a proxy start behavior test result of the bridge according to the first duration; The proxy shutdown test module is configured to: restore the connection of the master node, determine the second duration for the bridge to maintain the proxy mode after receiving the master node message, and determine the proxy shutdown behavior test result of the bridge according to the second duration.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the program, the method according to any one of claims 1 to 7 is implemented.

10. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to enable a computer to execute the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method and apparatus for providing time synchronization in in-vehicle ethernet communication network

    CN105634636A

  • Method for testing response time of time synchronization message, device and test device

    CN106549822A

  • Automatic testing system for automobile electrical-appliance power supply variation, and testing method thereof

    CN108918991A

  • Network equipment testing method, system and device, storage medium and electronic equipment

    CN116112413A

  • Time synchronization test method, electronic equipment and storage medium

    CN117997463A