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

By extracting and analyzing the field values ​​in the bridge message, the behavior of the bridge when the master node fails is tested to ensure the accuracy and stability of time synchronization, and solve the problem of bridge anomalies affecting time synchronization.

CN119814603BActive Publication Date: 2025-10-17GREAT WALL MOTOR CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In a vehicle, malfunctioning bridges can affect the time synchronization of Ethernet nodes. However, existing technologies make it difficult to accurately determine the impact within milliseconds, making it impossible to manually determine whether the bridge will affect time synchronization.

Method used

By extracting the field values ​​in the universal messages sent by the master node and the bridge, the functional behavior test results of the bridge are determined. After the master node connection is disconnected, the bridge is tested to see whether it can enter or exit the proxy mode within the specified time to ensure the accuracy of time synchronization.

Benefits of technology

The data forwarding and proxy functions of the bridge are tested to ensure that the time synchronization of the Ethernet nodes is maintained when the master node fails, and to ensure that the bridge can perform the data forwarding function normally after the fault is repaired.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119814603B_ABST
    Figure CN119814603B_ABST
Patent Text Reader

Abstract

The application provides a bridge behavior test method and device, electronic equipment and a storage medium. The bridge behavior test method and device can test whether the data forwarding function of the bridge can be normally executed through a first modified field value and a first field value, and ensure the accuracy of time synchronization. Then, the connection of the master node is disconnected, and whether the bridge will automatically enter the proxy mode within a specified time according to a first duration that the bridge remains in the default mode is tested, 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. Then, the connection of the master node is restored, and whether the bridge will exit the proxy mode within a specified time according to a second duration that the bridge remains in the proxy mode after receiving the message of the master node is tested, so as to continue to execute the data forwarding function, ensure that the bridge can smoothly exit the proxy mode and correctly execute the data forwarding function when the master node failure is repaired.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of vehicles, in particular to a bridge behavior test method and device, electronic equipment and storage medium. BACKGROUND

[0002] More and more electronic controller units (ECUs) are carried on the vehicle Ethernet. Under normal circumstances, it is difficult to make the master node ECU offline. Even if the master 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 instantaneously, so time synchronization needs to be performed between nodes. The performance of the bridge affects the effect of time synchronization, so the function of the bridge needs to be ensured to be normal. However, it is impossible to accurately locate the time to the millisecond level by manpower, so it is impossible to artificially judge whether the bridge will affect the time synchronization. SUMMARY

[0003] Therefore, the present application aims to provide a bridge behavior test method and device, electronic equipment and storage medium for testing the performance of the bridge and ensuring time synchronization during Ethernet node data transmission.

[0004] To achieve the above purpose, the present application provides a bridge behavior test method applied to a behavior test device, wherein the behavior test device is connected with a CANOE hardware device, the CANOE hardware device is connected with a controller node through Ethernet, and the controller node includes a master node and a slave node connected through a bridge; the bridge behavior test method includes the following steps.

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

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

[0007] disconnecting the master node, determining a first duration that the bridge remains in a default mode, and determining a proxy start behavior test result of the bridge according to the first duration;

[0008] restoring the connection of the master node, determining a second duration that the bridge remains in a proxy mode after receiving the master node message, and determining a proxy close behavior test result of the bridge according to the second duration.

[0009] Based on the same inventive concept, the application further provides a bridge behavior testing device, applied to a behavior testing equipment, wherein the behavior testing equipment is connected with a CANOE hardware device, the CANOE hardware device is connected with a controller node through Ethernet, and the controller node comprises a master node and a slave node connected through a bridge; the bridge behavior testing device comprises:

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

[0011] a function behavior testing module configured to determine a function behavior testing result of the bridge according to the first modified field value and the first field value;

[0012] a proxy start testing module configured to disconnect the master node, determine a first duration during which the bridge keeps a default mode, and determine a proxy start behavior testing result of the bridge according to the first duration;

[0013] a proxy close testing module configured to restore the connection of the master node, determine a second duration during which the bridge keeps a proxy mode after receiving a master node message, and determine a proxy close behavior testing result of the bridge according to the second duration.

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

[0015] Based on the same inventive concept, the application further provides a non-transitory computer readable storage medium storing computer instructions for causing a computer to execute the method described above.

[0016] From the above, it can be seen that the bridge behavior test method, device, electronic equipment and storage medium provided by the application can extract the first field value in the general message sent by the master node and the first modified field value in the general message sent by the bridge; determine the function behavior test result of the bridge according to the first modified field value and the first field value; disconnect the connection of the master node, determine the first duration that the bridge keeps 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 that the bridge keeps the proxy mode after receiving the master node message, and determine the proxy close behavior test result of the bridge according to the second duration. Whether there is time synchronization when the bridge forwards data is determined through the first modified field value and the first field value, so as to test whether the data forwarding function of the bridge can be normally executed, and ensure the accuracy of time synchronization. Then, by disconnecting the connection of the master node, whether the bridge will automatically enter the proxy mode within a specified time is tested according to the first duration that the bridge keeps 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, whether the bridge will exit the proxy mode within a specified time and continue to execute the data forwarding function is tested according to the second duration that the bridge keeps the proxy mode after receiving the master node message, so as to ensure that the bridge can smoothly exit the proxy mode and correctly execute the data forwarding function when the master node fault is repaired. BRIEF DESCRIPTION OF DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the present application or related art, the drawings needed to be used in the embodiments or related art description will be briefly introduced. Obviously, the drawings in the following description are only embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0018] Figure 1 The schematic diagram of the system layout for testing the bridge by the embodiments of the present application;

[0019] Figure 2 The flowchart of the bridge behavior test method of the embodiments of the present application;

[0020] Figure 3a The schematic diagram of the frequency synchronization process of the embodiments of the present application;

[0021] Figure 3b The schematic diagram of the path delay measurement of the embodiments of the present application;

[0022] Figure 3c The schematic diagram of the synchronization time calculation of the embodiments of the present application;

[0023] Figure 3d A schematic diagram of packet transmission when the Bridge is used for data forwarding by the embodiments of the present application;

[0024] Figure 4 A flow chart of determining the function behavior test result of the Bridge by the embodiments of the present application;

[0025] Figure 5 A flow chart of determining the proxy start behavior test result of the Bridge according to the first duration by the embodiments of the present application;

[0026] Figure 6 A flow chart of determining the proxy close behavior test result of the Bridge according to the second duration by the embodiments of the present application;

[0027] Figure 7 A structural schematic diagram of the Bridge behavior test device by the embodiments of the present application;

[0028] Figure 8 A structural schematic diagram of the electronic device by the embodiments of the present application. DETAILED DESCRIPTION

[0029] In order to make the objects, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the embodiments and 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 understood as the common meanings understood by those skilled in the art to which the embodiments of the present application belong. The terms “first”, “second” and similar terms used in the embodiments of the present application do not represent any order, number or importance, but are only used to distinguish different components. The terms “include” or “contain” and similar terms mean that the elements or objects before the terms cover the elements or objects listed after the terms and their equivalents, and do not exclude other elements or objects. The terms “connect” or “connected” and similar terms are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. The terms “up”, “down”, “left”, “right” and the like are only used to represent relative positional relationships, and when the absolute positions of the described objects are changed, the relative positional relationships may also be changed accordingly.

[0031] In this document, it should be understood that any number of elements in the drawings is used for example and not limitation, and any naming is only used for distinction and does not have any limiting meaning.

[0032] Based on the above description of the background art, there are also the following situations in the related art:

[0033] With the increasing number of functions deployed in vehicles, more and more controls are installed in vehicles, and data transmission between different controllers uses a generalized Precision Time Protocol (gPTP) which provides more precise clock performance measurement and monitoring mechanisms to help improve the clock synchronization accuracy and stability of the overall network. The gPTP is an Ethernet-based time synchronization protocol defined in IEEE 802.1AS standard, which is used to meet the demand of keeping time synchronization between nodes with time-sensitive applications in Ethernet. That is, the gPTP protocol sends an initial reference clock by specifying a node as a master clock in the system, and other nodes form a tree structure to receive the clock signal and align with the master clock to achieve time synchronization.

[0034] The gPTP protocol works in layer 2 of the International Organization for Standardization (ISO) seven-layer network model (Open System Interconnection, OSI), that is, the Media Access Control Address (MAC) layer, so that the nodes in the network can mark the time stamp by hardware, thereby avoiding problems such as software scheduling time, protocol stack processing speed, and cache affecting the accuracy of the time stamp, greatly improving the effect of time synchronization. According to the standard, the time synchronization accuracy between any two nodes within 7 hops (with six gPTP nodes in between) on a network implementing gPTP is less than 1 μs. In addition, since it works in layer 2, 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 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] PTP end node, an end node for sending (as a master node of a master clock) or receiving (as a slave node of a non-master clock) time synchronization information and utilizing it.

[0037] PTP relay node, a node for receiving time synchronization information, compensating for the delay generated on the network and itself, and then transmitting it out.

[0038] No matter which kind of device has a local clock, through the oscillation period of the crystal oscillator, both kinds of devices can provide the clock reference of the entire system as the grandmaster of the entire system, generally having the highest precision clock source in the entire system, and the determination of the grandmaster can be dynamic competition or static allocation. The ports of the gPTP device are divided into master ports and slave ports, the master ports are responsible for sending clock synchronization messages, and the slave ports are responsible for receiving clock synchronization messages. The bridge has both master ports and slave ports, but a node device has and only has one slave port. In a time synchronization system, there can be multiple time domains, each time domain independently performs time synchronization, and the same node can belong to multiple time domains at the same time, and each time domain has an independent clock source.

[0039] Among them, the bridge refers to a device used to connect different parts in the network and responsible for time signal transmission and processing, so if the function of the bridge is abnormal, it will cause problems in the time synchronization of the Ethernet node, causing the whole vehicle control to fail, but it is impossible to accurately locate the time to the millisecond level by manpower, resulting in the inability to artificially judge whether the bridge will affect the time synchronization.

[0040] The bridge behavior test method, device, electronic equipment and storage medium provided by the application can extract the first field value in the general message sent by the master node and the first modified field value in the general message sent by the bridge; determine the function behavior test result of the bridge according to the first modified field value and the first field value; disconnect the connection of the master node, determine the first duration that the bridge keeps 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 that the bridge keeps the proxy mode after receiving the master node message, and determine the proxy close behavior test result of the bridge according to the second duration. Whether there is time synchronization when the bridge forwards data is determined by the first modified field value and the first field value, so as to test whether the data forwarding function of the bridge can be normally executed, and ensure the accuracy of time synchronization. Then, by disconnecting the connection of the master node, whether the bridge will automatically enter the proxy mode within a specified time is tested according to the first duration that the bridge keeps 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, whether the bridge will exit the proxy mode within a specified time is tested according to the second duration that the bridge keeps the proxy mode after receiving the master node message, and the data forwarding function is continued to be executed, so as to ensure that the bridge can smoothly exit the proxy mode and correctly execute the data forwarding function when the master node failure is repaired.

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

[0042] In some embodiments, the bridge behavior testing method is applied to a behavior testing device, the behavior testing device is connected with a CANOE hardware device, the CANOE hardware device is connected with a controller node through Ethernet, and the controller node comprises a master node and a slave node connected through a bridge

[0043] The system layout for testing the bridge is shown in Figure 1 The testing device can be a PC device for deploying a Bridge behavior testing system script program, the PC is connected with a CAN open environment (CANOE) device through USB, and the CANOE hardware device supports Ethernet data acquisition, the Ethernet channel of the CANOE is connected with an Ethernet ECU through an Ethernet two-way line with a corresponding speed, and the Ethernet ECU comprises a Master as a master node, a Bridge and a Slave as a slave node. The PC integrates a system testing script, calculates and times an internal timestamp of the ECU through a Configuration-Profibus Architectures Library (CPAL) program, automatically captures timestamp information in a Follow up message sent by the Master, and judges whether a correction field is incremental, and also judges whether the Bridge can enter a proxy mode within a specified time under the condition that the Master is invalid.

[0044] The specific operation steps of arranging the testing system are as follows:

[0045] 1. Ensure that the PC correctly installs CANOE software and a license (License), and has a Bridge behavior testing engineering script of gPTP protocol.

[0046] 2. Correctly configure an Ethernet channel through a USB line and a CANOE hardware device, so as to collect and send data.

[0047] 3. Connect the CANOE and the Ethernet ECU through Ethernet.

[0048] 4. Configure MAC and a port number of the Master, the Bridge and the Slave in the testing system.

[0049] After the testing system is arranged, the bridge behavior testing process is executed, and the specific testing method is as follows:

[0050] In some embodiments, the bridge behavior testing method comprises the following steps, as shown in Figure 2 the bridge behavior testing method comprises the following steps.

[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 confirm that the connection between each ECU is normal, to ensure that there is no connectivity failure between the Master, Bridge, and Slave, and to ensure the accuracy of the subsequent test process. After the connectivity test confirms that the connection between each ECU is normal, the corresponding bridge behavior test method is started.

[0053] Messages in the gPTP protocol are divided into event-type messages (such as Sync messages, Pdelay Req messages, and Pdelay Resp messages) and general-type messages (such as Follow up messages, Announce messages, and Signaling messages). When receiving or sending event-type messages, they trigger the MAC layer to sample the local clock, combine the oscillation period count value with the clock oscillation frequency and the reference time, and generate a timestamp. When a device receives or sends a general-type message, it does not trigger the hardware to sample the hardware technology device and does not generate a timestamp, but it does 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: A non-clock node that acts as a transparent clock. After a gPTP message enters a bridge, it undergoes a processing time called the dwell time. The protocol requires that the bridge be able to test the dwell time.

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

[0057] Time synchronization needs to go through 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. Therefore, the bridge forwarding process is omitted in the introduction of time synchronization, but the residence time of the bridge forwarding is already included in the final message. The frequency synchronization process includes:

[0058] 1. Master sends Sync message, when the message leaves Master's MAC layer, triggers Master to record the time stamp T1.

[0059] 3. Slave receives Sync message, when the message arrives at Slave's MAC layer, triggers Slave to record the time stamp T2.

[0060] 4. Master sends Follow UP message, attaches t1 value in the Follow UP message.

[0061] 4. Master sends Sync message, when the message leaves Master's MAC layer, triggers Master to record the time stamp T3.

[0062] 5. Slave receives Sync message, when the message arrives at Slave's MAC layer, triggers Slave to record the time stamp T4.

[0063] 6. Master sends Follow UP message, attaches T3 value in the message.

[0064] 7. Slave calculates its clock frequency deviation R from Master by the following formula:

[0065]

[0066] Further, the process of path delay measurement is as shown in Figure 3b

[0067] 1. Slave sends Pdelay Req message, when the message leaves Slave's MAC layer, triggers Slave to record the time stamp T5.

[0068] 2. Master receives Pdelay_Req message, when the message arrives at Master's MAC layer, triggers Master to record the time stamp T6.

[0069] 3. Master sends Pdelay_Resp message, attaches T5 value in the message, when the message leaves Master's MAC layer, triggers Master to record the time stamp T7.

[0070] 4. Slave receives Pdelay Resp message, when the message arrives at Slave's MAC layer, triggers Slave to record the time stamp T8.

[0071] ​5. Master sends Pdelay Resp Follow UP message, and sends the value of T7 in the message.

[0072] 6. Slave calculates the path delay between adjacent devices by the following formula.

[0073]

[0074] Further, the process of calculating the synchronization time is as shown in Figure 3c

[0075] 1. Master sends Sync message, and when the message leaves the MAC layer of the Master, the Master records the time stamp T9 at this time.

[0076] 2. Slave receives the Sync message, and when the message reaches the MAC layer of the Slave, the Slave records the time stamp T10 at this time.

[0077] 3. Master sends Follow UP message, and sends the value of T9 in the message.

[0078] 4. Slave calculates the time stamp Ta on the Master according to the local time stamp Tb by the following formula, and thus completes the time synchronization.

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

[0080] It can be seen that if the function of the Bridge performing the forwarding of the messages between the Master and the Slave is problematic, the time at the Slave node will be incorrect, and thus the time synchronization will fail.

[0081] It should be noted that FFFE (binary 1111111111111110 in hexadecimal representation) is added in the middle of the MAC during the configuration. The reason why FFFE is added in the middle of the MAC in the GPTP protocol is to insert an additional bit in the 16-bit MAC address, so as to identify the 48-bit MAC address in the 64-bit time stamp. This is because the GPTP protocol uses the synchronization Ethernet protocol in the IEEE 802.1AS specification, which specifies the format of the 64-bit time stamp, which contains a 48-bit MAC address. Therefore, when identifying the MAC address in the time stamp, the MAC address needs to be expanded to 64 bits. By inserting FFFE in the middle of the MAC address, it can be converted into a 64-bit address, because FFFE occupies two bytes in 16 bits, i.e. 16 bits, thereby generating a 64-bit address.

[0082] ​Wherein, when Bridge is used for data forwarding, the transmission process of a group of Sync message and Follow UP message is as shown in Figure 3d The following steps are included:

[0083] 1. Master sends Sync message, when the message leaves the MAC layer of Master, Master is triggered to record the time t1.

[0084] 2. Bridge receives Sync message, when the message reaches the MAC layer of Bridge, Bridge is triggered to record the time t2, after the resident delay, Bridge sends Sync message, when the message leaves the MAC layer of Bridge, Bridge is triggered to record the time t3. If the resident time is Δt, then t3=t2+Δt.

[0085] 3. Slave receives Sync message, when the message reaches the MAC layer of Slave, Slave is triggered to record the time t4.

[0086] 4. Master sends Follow UP message, t1 value is attached in the Follow UP message. When the Follow UP message leaves the MAC layer of Master, Master is not triggered to perform clock sampling, and no time stamp is generated.

[0087] 5. Bridge receives Follow UP message, t3 value is attached in the Follow UP message. The Follow UP message does not trigger clock collection, and no time stamp is generated when Bridge sends the Follow UP message.

[0088] 6. Slave receives Follow UP message, reads the time stamp t1 and t3 in the Follow UP message. When the Follow UP message reaches the MAC layer of Slave, no clock collection is triggered, and no time stamp is generated.

[0089] Wherein, the path delay between Master and Bridge can be determined in the manner as shown in Figure 3b The same is not repeated here.

[0090] According to Figure 3dThe message transmission process shown, the test device can determine the 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 the 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 the functional behavior test result of the bridge according to the first correction field value and the first field value.

[0092] In implementation, according to Figure 3d It can be seen that, under the premise that the Bridge has no fault, t3=t1+delay+Δt. Therefore, in order to determine the path delay, the time when the event type message is received can be determined by reading the time stamp obtained by the Bridge when receiving the event type message. Then the time t2 corresponding to the time stamp and the time t1 corresponding to the first field value are determined. Then the path delay (delay) =t2-t1, which can more efficiently and accurately determine the path delay. The path delay can also be determined in the manner shown in Figure 3b However, if the Bridge itself has a problem, it will cause a large error in the path delay.

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

[0094] Where mod is the modulus operator in mathematics, used to take the remainder. A mod B represents the remainder after A is divided by B.

[0095] 2 16 : This is a number, equal to 65536. In binary representation, it is the maximum value of a 16-bit number. So delay mod 2 16 means taking the remainder of delay divided by 65536, which realizes the conversion of the time stamp into a compensation field value with the same number of bits as the first field value, realizing the nanosecond-level time synchronization test.

[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 the synchronization of clocks in the network. It is usually achieved by calculating the offset and jitter of the clocks in the network. ScaledNS can also be used to detect faults and abnormalities in the network, thereby helping to maintain the stability and reliability of the network.

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

[0098] And the first correction field value t3 = t5 + Δt (the more links passed in the Bridge, the larger the value of Δt), so t3 should be later than t5, so when determining 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 functional behavior normal. If t3 is less than or equal to t5, it is determined that the Bridge has performed internal data failure, and the time is disordered. It will cause the time synchronization error.

[0099] Step 203: disconnect the connection of the master node, determine the first duration of the bridge remaining in the default mode, and determine the proxy start behavior test result of the bridge according to the first duration.

[0100] In actual use, in order to avoid the time synchronization failure caused by the disconnection of the master node, the bridge needs to enter the proxy mode after the disconnection of the master node to replace the master clock of the master node to send the Sync / Follow Up message with constant accurate origin timestamp.

[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 the Sync / Follow Up message with constant accurate origin timestamp within 20S, so the proxy start behavior test result can be determined according to the first duration of the bridge remaining in the default mode. If it does not enter the proxy mode within 500ms, it means that the bridge has proxy start failure; if it successfully enters the proxy mode within 500ms, it means that the bridge can smoothly enter the proxy mode, and whether the bridge entering the proxy mode has the ability to replace the master node can be determined according to the time of message sending.

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

[0103] Step 204: restore the connection of the master node, determine the second duration of the bridge remaining in the proxy mode after receiving the message of the master node, and determine the proxy close behavior test result of the bridge according to the second duration.

[0104] In specific implementation, during actual use, the master node may be disconnected and then restored at any time. Therefore, restoring the master node's connection is used to test whether the bridge can normally exit the proxy mode. Under normal circumstances, the master node is required to exit the proxy mode within 125ms after the connection is restored. Therefore, the second duration of the bridge remaining in 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 agent opening behavior test results, and the agent closing 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 messages with constant and accurate origin timestamps and Sync / Follow Up messages instead of the master clock of the master node.

[0107] In summary, the bridge behavior testing method provided by this application can determine whether time synchronization exists when the bridge forwards data using the first correction field value and the first field value, thereby testing whether the bridge's data forwarding function can be properly executed and ensuring the accuracy of time synchronization. The method then disconnects the master node and tests whether the bridge automatically enters proxy mode within a specified time based on the first duration for which the bridge remains in default mode. This tests whether the bridge's proxy function is functioning properly, ensuring that time synchronization between different nodes in the Ethernet network can be maintained when the master node fails. Furthermore, the method restores the master node connection and tests whether the bridge exits proxy mode within a specified time based on the second duration for which the bridge remains in proxy mode after receiving a message from the master node, ensuring that the bridge can successfully exit proxy mode and correctly execute data forwarding functions when the master node failure is repaired.

[0108] In some embodiments, as 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 this time for subsequent multiple tests.

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

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

[0113] In some embodiments, the first field value is corrected according to the timestamp to obtain a second corrected field value, including:

[0114] Step 4021: determining a time conversion parameter.

[0115] In implementation, since the timestamp needs to be converted into a 16-bit representation, and 2 16 In binary, the maximum value of a 16-bit number is represented as 2 16 , which is determined as the time conversion parameter.

[0116] Step 4022: determining the time difference between the timestamp and the first field value as the path delay, determining the remainder of the path delay divided by the time conversion parameter, and converting the remainder into a compensation field value through network stability calculation.

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

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

[0119] In 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 added with the path delay.

[0120] Step 403: determining the functional behavior test result according to the second corrected field value and the first corrected 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] During specific implementation, since it takes a certain amount of time for the bridge point to perform internal data processing, that is, 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] During specific implementation, since it takes a certain amount of time for the bridge point to perform internal data processing, that is, 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 did not perform the correct bridge function, and the functional behavior test result is determined to be a functional behavior failure.

[0126] In some embodiments, as Figure 5 As shown, determining the agent 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 the proxy start-up behavior test result is a proxy start-up behavior failure.

[0128] In specific implementation, after the master node is disconnected, the bridge without faults will enter the proxy mode within 500ms and send a constant and accurate origin timestamp and Sync / Follow Up message on behalf of the master node within 20S.

[0129] Therefore, the proxy activation behavior test result can be determined based on the first duration of the bridge maintaining the default mode. If the first duration is greater than a preset duration threshold (e.g., 500ms), it means that the bridge did not enter 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 practice, if the bridge successfully enters proxy mode within 500ms, it indicates that the bridge can successfully enter proxy mode. However, further testing is required to determine whether the bridge in proxy mode has the ability to replace the master node. A healthy bridge will replace the master node's master clock within 20s to send a consistent and accurate origin timestamp and Sync / Follow Up message. Therefore, the third duration of the bridge not performing the proxy function can be used to determine whether the bridge has proxy capability.

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

[0133] Step 5021: In response to the third duration being greater than the preset maximum proxy interval, 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, indicating 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, determining that the proxy start behavior test result 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, indicating that the bridge has the replacement capability, and the proxy startup behavior test result is determined to be normal.

[0137] In some embodiments, as Figure 6 As shown, determining the proxy shutdown 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 actual use, the master node may be connected at any time after disconnection, so the bridge is tested for normal exit from the proxy mode by restoring the connection of the master node. Normally, the master node is required to exit the proxy mode within 125 ms after restoring the connection, so the second duration that the bridge remains in the proxy mode after receiving the message of the master node can be used to determine whether the bridge normally exits the proxy mode. If the second duration is greater than the preset recovery duration threshold, it is determined that the bridge does not exit the proxy mode within 125 ms, and it is determined that the proxy closing behavior test result is proxy closing behavior failure.

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

[0141] In actual use, if the second duration is less than or equal to the preset recovery duration threshold, it is determined that the bridge exits the proxy mode within 125 ms, and it is necessary to further verify whether the bridge that exits the proxy mode can successfully 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 functional test result being functional behavior failure, it is determined that the proxy closing behavior test result is proxy closing behavior failure.

[0143] In actual use, if the new functional test result is functional behavior failure, it is determined 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, cause large errors in time synchronization, and indicate that entering the proxy mode disrupts the normal function of the bridge. It is determined that the proxy closing behavior test result is proxy closing behavior failure.

[0144] Step 604: In response to the new functional test result being functional behavior normal, it is determined that the proxy closing behavior test result is proxy closing behavior normal.

[0145] In actual use, if the new functional test result is functional behavior normal, it is determined that the bridge can normally perform correct forwarding of message data after exiting the proxy mode, the time data is added normally when forwarding message data, the time synchronization between the master node and the slave node is ensured, and it is determined that the proxy closing behavior test result is proxy closing behavior failure.

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

[0147] It should be noted that some embodiments of the present application have been described above. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in a different order and still achieve desirable results. Additionally, the processes depicted in the figures do not necessarily require the particular order shown, or sequential order, to achieve the desired results. In certain implementations, multitasking and parallel processing can be advantageous.

[0148] Based on the same inventive concept, the present application also provides a bridge behavior testing device corresponding to any of the above-mentioned method embodiments, applied to a behavior testing device, the behavior testing device being connected with a CANOE hardware device, the CANOE hardware device being connected with a controller node through Ethernet, and the controller node including a master node and a slave node connected through a bridge.

[0149] Reference Figure 7 The bridge behavior testing device includes:

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

[0151] The function behavior testing module 20 is configured to determine a function behavior testing result of the bridge according to the first modified field value and the first field value.

[0152] The proxy opening testing module 30 is configured to disconnect the master node, determine a first duration for the bridge to keep a default mode, and determine a proxy opening behavior testing result of the bridge according to the first duration.

[0153] The proxy closing testing module 40 is configured to restore the connection of the master node, determine a second duration for the bridge to keep a proxy mode after receiving the message of the master node, and determine a proxy closing behavior testing result of the bridge according to the second duration.

[0154] For the convenience of description, the above device is described in various modules according to functions. Of course, the functions of the modules can be implemented in one or more software and / or hardware in the implementation of the present application.

[0155] The device of the above embodiment is used to implement the corresponding bridge behavior test method in any of the foregoing embodiments, and has the beneficial effects of the corresponding method embodiments, which are not described herein again.

[0156] Based on the same inventive concept, corresponding to the method of any of the above embodiments, the present application also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the bridge behavior test method of any of the above embodiments when executing the program.

[0157] Figure 8 A more specific hardware structure of an electronic device is shown in the embodiment, which can 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 for communication within the device.

[0158] The processor 1010 can be implemented in the form of a general-purpose CPU (Central Processing Unit), a microprocessor, an ASIC (Application Specific Integrated Circuit), or one or more integrated circuits, etc., for executing related programs to implement the technical solutions provided by the embodiments of the present specification.

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

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

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

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

[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 can also include other components necessary for normal operation. In addition, those skilled in the art can understand that the above device can also only contain the components necessary for the implementation of the embodiments of the present application, and does not have to contain all the components shown in the figure.

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

[0165] Based on the same inventive concept, corresponding to any of the above embodiment methods, the present application also provides a non-transitory computer readable storage medium, which stores computer instructions for causing the computer to execute the bridge behavior test method according to any of the above embodiments.

[0166] The computer readable medium of the present embodiment includes permanent and non-permanent, removable and non-removable media, which can be realized by any method or technology to store information. 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 technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, magnetic tape disk storage or other magnetic storage device, or any other non-transmission medium that can be used to store information accessible by a computing device.

[0167] The storage medium of the above-mentioned embodiments stores computer instructions for causing the computer to perform the bridge behavior test method as described in any of the above embodiments, and has the beneficial effects of the corresponding method embodiments, which are not repeated here.

[0168] Based on the same inventive concept, corresponding to the method of any of the above-mentioned embodiments, the present application also provides a vehicle comprising the electronic device or bridge behavior test device of the above-mentioned embodiments, and performing the bridge behavior test method as described in any of the above embodiments by the electronic device or bridge behavior test device of the above-mentioned embodiments, and has the beneficial effects of the corresponding method embodiments, which are not repeated here.

[0169] It can be understood that before using the technical solutions of various embodiments of the present application, the user will be informed of the type, scope of use, use scenario, etc. of the personal information involved by appropriate means, and the authorization of the user will be obtained.

[0170] For example, in response to receiving the user's active request, the user is sent prompt information to explicitly prompt the user that the operation requested to be performed will require the acquisition and use of the user's personal information. Thus, the user can voluntarily choose whether to provide personal information to the software or hardware such as electronic devices, application programs, servers or storage media that perform the technical solutions of the present application according to the prompt information.

[0171] As an optional but not limiting implementation manner, in response to accepting the user's active request, the way of sending prompt information to the user may be, for example, the way of a pop-up window, in which the prompt information can be presented in the form of text. In addition, the pop-up window can also carry selection controls for the user to select "agree" or "disagree" to provide personal information to the electronic device.

[0172] It can be understood that the above notification and user authorization process is only illustrative and does not limit the implementation manner of the present application, and other ways that meet the relevant laws and regulations can also be applied to the implementation manner of the present application.

[0173] Those skilled in the art will understand that the discussion of any of the above embodiments is only exemplary and is not intended to imply that the scope of the present application is limited to these examples; under the idea of the present application, the above embodiments or technical features in different embodiments can also be combined, the steps can be implemented in any order, and there are many other changes of different aspects of the embodiments of the present application as described above, which are not provided in detail for the sake of brevity.

[0174] Additionally, to simplify the description and discussion, and so as not to obscure the embodiments of the application being presented, the well-known functions or constructions of integrated circuit (IC) chips and other components can or can not be shown in the figures and will be omitted as not to unnecessarily obscure the embodiments of the application being presented. Moreover, the devices can be shown in block diagram form in order to avoid obscuring the embodiments of the application, and this also acknowledges the fact that the details in regard to the implementation of the block diagram devices are highly dependent on the platform within which the embodiments of the application are to be implemented (i.e., these details should be well within the purview of one of ordinary skill in the art). Where specific details are set forth in order to describe an illustrative embodiment of the application, it will be apparent to one of ordinary skill in the art that the embodiments of the application can be practiced without, or with variation of, these specific details. Thus, the description is to be considered as illustrative and not restrictive, and the scope of the application should be determined not with reference to the above description, but should be given to the appended claims.

[0175] While the application has been described in connection with specific embodiments thereof, many alternatives, modifications and variations will be apparent to those skilled in the art in light of the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) can use the embodiments discussed.

[0176] Embodiments of the application are intended to cover all such alternatives, modifications and variations as falling within the scope of the broadest possible interpretation of the application as set forth in the appended claims. Accordingly, any and all such modifications, variations or equivalents that fall within the spirit and scope of the underlying principles should be intended to be embraced by the claims.

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 includes: Extracting a first field value from the general message sent by the master node and a first modified field value from the general message sent by the bridge; wherein the first field value indicates the time when the master node sent the event message; Determining a functional behavior test result of the bridge based on the first corrected field value and the first field value; wherein determining the functional behavior test result of the bridge based on the first corrected field value and the first field value includes: determining a timestamp collected when the bridge receives the master node event-type message; correcting the first field value based on the timestamp to obtain a second corrected field value; and determining the functional behavior test result based on the second corrected field value and the first corrected field value; disconnecting the master node, determining a first duration during which the bridge maintains the default mode, and determining a proxy enable behavior test result of the bridge based on the first duration; and determining, in response to the first duration being greater than a preset duration threshold, that the proxy enable behavior test result is a proxy enable behavior failure; 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 based on the second duration; in response to the second duration being greater than the preset recovery duration threshold, determine that the proxy shutdown behavior test result is a proxy shutdown behavior failure.

2. The method according to claim 1, 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 normal functional behavior; 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.

3. The method according to claim 1, characterized in that The determining of the proxy enabling behavior test result of the bridge according to the first duration also includes: 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 the proxy function is determined, and the proxy activation behavior test result is determined according to the third duration.

4. The method according to claim 3, characterized in that The determining of the agent activation behavior test result according to the third duration includes: In response to the third duration being greater than a preset maximum proxy interval, 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 activation behavior test result is normal.

5. The method according to claim 1, wherein The determining of the proxy shutdown behavior test result of the bridge according to the second duration also includes: 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, it is determined that the proxy shutdown behavior test result is that the proxy shutdown behavior is normal.

6. The method according to claim 1, characterized in that The step of correcting the first field value according to the timestamp to obtain a second corrected field value comprises: Determine time conversion parameters; Determining a time difference between the timestamp and the first field value as a path delay, determining a remainder after dividing the path delay by a time conversion parameter, and converting 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.

7. 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 testing device comprises: a field extraction module configured to: extract a first field value from the general message sent by the master node and a first modified field value from the general message sent by the bridge; wherein the first field value indicates the time when the master node sent the event message; A functional behavior test module is configured to: determine a functional behavior test result of the bridge based on the first corrected field value and the first field value; wherein, determining the functional behavior test result of the bridge based on the first corrected field value and the first field value includes: determining a timestamp collected when the bridge receives a master node event-type message; correcting the first field value based on the timestamp to obtain a second corrected field value; and determining the functional behavior test result based on the second corrected field value and the first corrected field value; The proxy start test module is configured to: disconnect the master node, determine a first duration during which the bridge maintains the default mode, and determine a proxy start behavior test result of the bridge based on the first duration; and determine, in response to the first duration being greater than a preset duration threshold, that the proxy start behavior test result is a proxy start behavior failure; The proxy shutdown test module is configured to: restore the connection of the master node, determine the second duration of time that the bridge maintains the proxy mode after receiving the master node message, and determine the proxy shutdown behavior test result of the bridge based on the second duration; in response to the second duration being greater than a preset recovery duration threshold, determine that the proxy shutdown behavior test result is a proxy shutdown behavior failure.

8. 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 6 is implemented.

9. 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 6.

Citation Information

Patent Citations

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

    CN106549822A

  • Time synchronization test method, electronic equipment and storage medium

    CN117997463A