Vehicle-mounted Ethernet time synchronization precision test method, system, equipment and medium

By sending link delay requests and time synchronization messages, the time synchronization accuracy of vehicle-mounted equipment is calculated, which solves the problems of hardware modification and high cost in the existing technology, and realizes high-precision vehicle Ethernet time synchronization testing.

CN118784518APending Publication Date: 2024-10-15CHINA FAW CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411099866.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-12
Publication Date
2024-10-15

AI Technical Summary

Technical Problem

Existing vehicle Ethernet time synchronization accuracy testing methods require hardware modifications and are costly, making it difficult to meet the high-precision requirements for in-vehicle time synchronization.

Method used

By sending link delay requests and time synchronization messages, the time synchronization accuracy of the vehicle equipment under test is determined without modifying the device hardware. The link delay and reverse link delay are used to calculate the time synchronization accuracy.

Benefits of technology

It achieves the accuracy of the vehicle Ethernet time synchronization accuracy test, while reducing the test cost and avoiding the complexity of hardware modifications and the need for expensive test equipment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118784518A_ABST
    Figure CN118784518A_ABST
Patent Text Reader

Abstract

The invention discloses a vehicle-mounted Ethernet time synchronization precision test method, system and device and a medium, and the method comprises the steps: responding to a first link delay request sent by a to-be-tested vehicle-mounted device, and sending a first link delay response and a time synchronization message to the to-be-tested vehicle-mounted device, enabling the to-be-tested vehicle-mounted equipment to perform time synchronization according to the first link delay response and the time synchronization message; sending a second link delay request to the to-be-tested vehicle-mounted equipment, receiving a second link delay response returned by the to-be-tested vehicle-mounted equipment, and determining reverse link delay according to the second link delay request and the second link delay response; and receiving a reverse synchronization message sent by the to-be-tested vehicle-mounted device, and determining the time synchronization precision of the to-be-tested vehicle-mounted device according to the reverse link delay and the sending time and the receiving time of the reverse synchronization message. According to the invention, the test cost is reduced while the accuracy of the vehicle-mounted Ethernet time synchronization precision test is ensured, and the method can be applied to the technical field of vehicle monitoring.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of vehicle monitoring, and in particular to a method, system, equipment and medium for testing the time synchronization accuracy of an on-vehicle Ethernet. Background Art

[0002] The electronic control units of intelligent connected vehicles are becoming more and more complex, and the large amount of data interaction in the car has higher and higher requirements for real-time and reliable transmission, which needs to be based on precise time synchronization. As the basic protocol of time-sensitive networks, gPTP (generalized Precision Time Protocol) is inevitably used first. In order to ensure the accuracy requirements of time synchronization in vehicle Ethernet communication, it is necessary to test the stability of time synchronization accuracy of the nodes in the vehicle. At present, the commonly used method for time synchronization accuracy testing is the 1PPS test method. This method requires the vehicle-mounted device to be tested to lead out the 1PPS line from the hardware board end, and requires a high-precision tester. The disadvantage is that the hardware changes to the vehicle-mounted device to be tested are large and the test equipment is expensive, so the test is difficult to implement and the test cost is high. Therefore, in order to test the time synchronization accuracy of gPTP in the vehicle field, there is an urgent need for another automated test solution that does not require hardware changes during the test and is low-cost to meet the high-precision requirements of vehicle time synchronization. Summary of the invention

[0003] The purpose of the present invention is to solve one of the technical problems existing in the prior art to at least a certain extent.

[0004] To this end, an object of an embodiment of the present invention is to provide a method for testing the time synchronization accuracy of an in-vehicle Ethernet, which reduces the test cost while ensuring the accuracy of the time synchronization accuracy test of the in-vehicle Ethernet.

[0005] Another object of an embodiment of the present invention is to provide a vehicle-mounted Ethernet time synchronization accuracy testing system.

[0006] In order to achieve the above technical objectives, the technical solutions adopted by the embodiments of the present invention include:

[0007] On the one hand, an embodiment of the present invention provides a method for testing the time synchronization accuracy of an in-vehicle Ethernet, comprising the following steps:

[0008] In response to a first link delay request sent by the vehicle-mounted device under test, sending a first link delay response and a time synchronization message to the vehicle-mounted device under test, so that the vehicle-mounted device under test performs time synchronization according to the first link delay response and the time synchronization message;

[0009] Sending a second link delay request to the vehicle-mounted device to be tested, and receiving a second link delay response returned by the vehicle-mounted device to be tested, and then determining a reverse link delay according to the second link delay request and the second link delay response;

[0010] A reverse synchronization message sent by the vehicle-mounted device to be tested is received, and the time synchronization accuracy of the vehicle-mounted device to be tested is determined according to the reverse link delay and the sending time and receiving time of the reverse synchronization message.

[0011] Further, in one embodiment of the present invention, in response to the first link delay request sent by the vehicle-mounted device to be tested, sending the first link delay response and the time synchronization message to the vehicle-mounted device to be tested specifically includes:

[0012] receiving the first link delay request through a link delay request receiving interface, and determining a time for receiving the first link delay request;

[0013] Sending the first link delay response to the vehicle-mounted device under test through a link delay response sending interface, wherein the first link delay response carries a first timestamp and a second timestamp, wherein the first timestamp is the time when the first link delay request is received, and the second timestamp is the time when the first link delay response is sent;

[0014] The time synchronization message is sent to the vehicle-mounted device to be tested through a time synchronization sending interface, the time synchronization message carries a third timestamp, and the third timestamp is the time when the time synchronization message is sent.

[0015] Further, in an embodiment of the present invention, performing time synchronization according to the first link delay response and the time synchronization message specifically includes:

[0016] Parsing the first link delay response to obtain the first timestamp and the second timestamp, and determining a first request processing duration according to a difference between the second timestamp and the first timestamp;

[0017] Determine a first request response duration according to a time difference between receiving the first link delay response and sending the first link delay request;

[0018] Determine a first link delay according to half of a difference between a duration of responding to the first request and a duration of processing the first request;

[0019] The time synchronization message is parsed to obtain the third timestamp, and the third timestamp is corrected according to the first link delay to obtain a synchronization timestamp, and then the vehicle-mounted device to be tested is time synchronized according to the synchronization timestamp.

[0020] Further, in one embodiment of the present invention, the sending of the second link delay request to the vehicle-mounted device to be tested, and receiving the second link delay response returned by the vehicle-mounted device to be tested, specifically includes:

[0021] Sending the second link delay request to the vehicle-mounted device under test through a link delay request sending interface, so that the vehicle-mounted device under test returns the second link delay response, the second link delay response carries a fourth timestamp and a fifth timestamp, the fourth timestamp is the time when the second link delay request is received, and the fifth timestamp is the time when the second link delay response is sent;

[0022] The second link delay response is received through a link delay response receiving interface.

[0023] Further, in one embodiment of the present invention, determining the reverse link delay according to the second link delay request and the second link delay response specifically includes:

[0024] Parsing the second link delay response to obtain the fourth timestamp and the fifth timestamp, and determining the second request processing duration according to a difference between the fifth timestamp and the fourth timestamp;

[0025] Determine the second request response duration according to the time difference between receiving the second link delay response and sending the second link delay request;

[0026] The reverse link delay is determined based on half of the difference between the second request response time and the second request processing time.

[0027] Further, in one embodiment of the present invention, the receiving of the reverse synchronization message sent by the vehicle-mounted device to be tested and determining the time synchronization accuracy of the vehicle-mounted device to be tested according to the reverse link delay and the sending time and receiving time of the reverse synchronization message specifically include:

[0028] Receiving the reverse synchronization message through a reverse time synchronization receiving interface, and determining a reception time of the reverse synchronization message, wherein the reverse synchronization message carries a sixth timestamp, and the sixth timestamp is a time when the reverse synchronization message is sent;

[0029] Parsing the reverse synchronization message to obtain the sixth timestamp, and determining the sending time of the reverse synchronization message according to the sixth timestamp;

[0030] The first transmission duration of the reverse synchronization message is determined according to the difference between the reception time and the sending time of the reverse synchronization message, the time deviation of the vehicle-mounted device to be tested is determined according to the difference between the first transmission duration and the reverse link delay, and the time synchronization accuracy is further determined according to the time deviation.

[0031] Furthermore, in one embodiment of the present invention, the vehicle-mounted Ethernet time synchronization accuracy test method further includes the following steps:

[0032] When the reverse link delay does not meet the preset threshold range, it is determined that the reverse link delay is invalid, and a second link delay request is sent back to the vehicle-mounted device to be tested.

[0033] On the other hand, an embodiment of the present invention provides a vehicle-mounted Ethernet time synchronization accuracy test system, comprising:

[0034] A time synchronization module, configured to respond to a first link delay request sent by the vehicle-mounted device under test, send a first link delay response and a time synchronization message to the vehicle-mounted device under test, so that the vehicle-mounted device under test performs time synchronization according to the first link delay response and the time synchronization message;

[0035] a reverse link delay determination module, configured to send a second link delay request to the vehicle-mounted device to be tested, and receive a second link delay response returned by the vehicle-mounted device to be tested, and then determine a reverse link delay according to the second link delay request and the second link delay response;

[0036] The time synchronization accuracy determination module is used to receive the reverse synchronization message sent by the vehicle-mounted device to be tested, and determine the time synchronization accuracy of the vehicle-mounted device to be tested according to the reverse link delay and the sending time and receiving time of the reverse synchronization message.

[0037] On the other hand, an embodiment of the present invention provides an electronic device, comprising a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for realizing connection and communication between the processor and the memory, wherein the program, when executed by the processor, realizes the vehicle Ethernet time synchronization accuracy test method as described above.

[0038] On the other hand, an embodiment of the present invention further provides a storage medium, which is a computer-readable storage medium used for computer-readable storage, and the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the vehicle Ethernet time synchronization accuracy test method as described above.

[0039] On the other hand, an embodiment of the present invention further provides a vehicle, the vehicle comprising the vehicle-mounted Ethernet time synchronization accuracy test system or electronic device as described above.

[0040] The advantages and beneficial effects of the present invention will be partly given in the following description, partly become apparent from the following description, or be understood through the practice of the present invention:

[0041] In response to a first link delay request sent by a vehicle-mounted device under test, an embodiment of the present invention sends a first link delay response and a time synchronization message to the vehicle-mounted device under test, so that the vehicle-mounted device under test performs time synchronization according to the first link delay response and the time synchronization message, sends a second link delay request to the vehicle-mounted device under test, and receives a second link delay response returned by the vehicle-mounted device under test, and then determines a reverse link delay according to the second link delay request and the second link delay response, receives a reverse synchronization message sent by the vehicle-mounted device under test, and determines the time synchronization accuracy of the vehicle-mounted device under test according to the reverse link delay and the sending time and receiving time of the reverse synchronization message. The embodiment of the present invention performs time synchronization with the vehicle-mounted device to be tested according to the first link delay request and the corresponding first link delay response and the time synchronization message sent by the vehicle-mounted device to be tested, sends a second link delay request to the vehicle-mounted device to be tested to determine the reverse link delay, and then receives the reverse synchronization message sent by the vehicle-mounted device to be tested, so as to determine the time synchronization accuracy of the vehicle-mounted device to be tested according to the reverse link delay and the sending time and receiving time of the reverse synchronization message. There is no need to modify the device hardware during the test process, which ensures the accuracy of the vehicle Ethernet time synchronization accuracy test while reducing the test cost. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the technical solution in the embodiments of the present invention, the following introduction is made to the drawings required for use in the embodiments of the present invention. It should be understood that the drawings introduced below are only for the convenience of clearly describing some embodiments of the technical solution of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0043] Figure 1 A flowchart of a method for testing the time synchronization accuracy of an in-vehicle Ethernet provided by an embodiment of the present invention;

[0044] Figure 2 A step flow chart of step S101 provided in an embodiment of the present invention;

[0045] Figure 3 Another step flow chart of step S101 provided in an embodiment of the present invention;

[0046] Figure 4A step flow chart of step S102 provided in an embodiment of the present invention;

[0047] Figure 5 Another step flow chart of step S102 provided in an embodiment of the present invention;

[0048] Figure 6 A step flow chart of step S103 provided in an embodiment of the present invention;

[0049] Figure 7 Another step flow chart of a method for testing the time synchronization accuracy of an in-vehicle Ethernet provided by an embodiment of the present invention;

[0050] Figure 8 A schematic diagram of the structure of a vehicle-mounted Ethernet time synchronization accuracy test system provided by an embodiment of the present invention;

[0051] Fig. 9 A schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present invention;

[0052] Fig.10 A schematic diagram of the structure of a storage medium provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0053] Embodiments of the present invention are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be understood as limitations on the present application. It should be noted that, although the functional module division is performed in the system schematic diagram and the logical order is shown in the flow chart, in some cases, the steps shown or described may be performed in a different order from the module division in the system schematic diagram or the flow chart. For the step numbers in the following embodiments, they are only set for the convenience of explanation, and the order between the steps is not limited in any way. The execution order of each step in the embodiment can be adaptively adjusted according to the understanding of those skilled in the art.

[0054] In the description of the present invention, the meaning of "a plurality" is two or more. If there is a description of the first or the second, it is only for the purpose of distinguishing the technical features, and it cannot be understood as indicating or implying the relative importance or implicitly indicating the number of the indicated technical features or implicitly indicating the order of the indicated technical features. In addition, unless otherwise defined, all technical and scientific terms used in this document have the same meaning as those commonly understood by technicians in the technical field of this application. The terms used in this document are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.

[0055] The vehicle Ethernet time synchronization accuracy test method provided in the embodiment of the present application can be applied to the terminal, can also be applied to the server side, and can also be software running in the terminal or the server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a set-top box, etc.; the server side can be configured as an independent physical server, or a server cluster or distributed system composed of multiple physical servers, and can also be configured as a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements the vehicle Ethernet time synchronization accuracy test method, but is not limited to the above forms.

[0056] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

[0057] It should be noted that in each specific implementation of the present application, when it comes to the need to perform relevant processing based on data related to user identity or characteristics such as user information, user behavior data, user historical data, and user location information, the user's permission or consent will be obtained first, and the collection, use, and processing of these data will comply with the relevant laws, regulations, and standards of the relevant countries and regions. In addition, when the embodiment of the present application needs to obtain the user's sensitive personal information, the user's separate permission or consent will be obtained through a pop-up window or by jumping to a confirmation page. After clearly obtaining the user's separate permission or consent, the necessary user-related data for the normal operation of the embodiment of the present application will be obtained.

[0058] like Figure 1 FIG. 1 is a flow chart showing a method for testing the time synchronization accuracy of an in-vehicle Ethernet according to an embodiment of the present invention. Figure 1The embodiment of the present invention provides a method for testing the time synchronization accuracy of an in-vehicle Ethernet, which specifically includes the following steps:

[0059] S101. In response to a first link delay request sent by a vehicle-mounted device under test, a first link delay response and a time synchronization message are sent to the vehicle-mounted device under test, so that the vehicle-mounted device under test performs time synchronization according to the first link delay response and the time synchronization message.

[0060] Specifically, the embodiment of the present invention implements the time synchronization accuracy test of the vehicle-mounted device to be tested through a computer and a vehicle-mounted Ethernet communication board, wherein the vehicle-mounted device to be tested is a vehicle-mounted device with a gPTP function, and a software analysis and processing module is integrated on the computer. The vehicle-mounted Ethernet communication board communicates with the vehicle-mounted device to be tested in real time through the data acquisition module through Ethernet, and is responsible for sending the test data issued by the software analysis and processing module to the vehicle-mounted device to be tested, and also returning the data sent by the vehicle-mounted device to the software analysis and processing module. The software analysis and processing module includes two parts: the time synchronization module and the reverse synchronization time accuracy analysis module. The test system forms a time synchronization module based on various self-developed gPTP algorithm interfaces, and uses this time synchronization module as the master clock to synchronize the time for the vehicle-mounted equipment under test through the gPTP protocol; and forms a reverse time synchronization accuracy test module based on the self-developed algorithm, obtains the reverse synchronization message sent by the vehicle-mounted equipment under test by configuring parameters, parses the link request data and replies to the link delay response message to calculate the reverse link delay between the test system and the vehicle-mounted equipment under test, and parses the reverse synchronization message to obtain the precise timestamp of the vehicle-mounted equipment under test after synchronization according to the time synchronization module, and finally obtains the local precise timestamp of the test system receiving the reverse synchronization message to calculate the time synchronization accuracy.

[0061] like Figure 2 FIG. 1 is a flowchart of step S101 provided in an embodiment of the present invention, referring to FIG. Figure 2 As an optional implementation, in response to the first link delay request sent by the vehicle-mounted device to be tested, sending a first link delay response and a time synchronization message to the vehicle-mounted device to be tested specifically includes:

[0062] S1011, receiving a first link delay request through a link delay request receiving interface, and determining a time for receiving the first link delay request;

[0063] S1012: Send a first link delay response to the vehicle-mounted device under test through a link delay response sending interface, where the first link delay response carries a first timestamp and a second timestamp, where the first timestamp is the time when the first link delay request is received, and the second timestamp is the time when the first link delay response is sent;

[0064] S1013. Send a time synchronization message to the vehicle-mounted device to be tested through a time synchronization sending interface, where the time synchronization message carries a third timestamp, and the third timestamp is the time when the time synchronization message is sent.

[0065] Specifically, the time synchronization module of an embodiment of the present invention includes a link delay request receiving interface, a link delay response sending interface and a time synchronization sending interface. The link delay request receiving interface is used to receive a link delay request message sent by the vehicle-mounted device to be tested. The link delay response sending interface is used to process the link delay request sent by the vehicle-mounted device to be tested and send a link delay response. The time synchronization sending interface is used to periodically send time synchronization messages to perform time synchronization for the vehicle-mounted device to be tested.

[0066] like Figure 3 FIG. 1 is another step flow chart of step S101 provided in an embodiment of the present invention, referring to FIG. Figure 3 As an optional implementation, time synchronization is performed according to the first link delay response and the time synchronization message, which specifically includes:

[0067] S1014: parse the first link delay response to obtain a first timestamp and a second timestamp, and determine a first request processing duration according to a difference between the second timestamp and the first timestamp;

[0068] S1015, determining a first request response duration according to a time difference between receiving a first link delay response and sending a first link delay request;

[0069] S1016, determining a first link delay according to half of a difference between a first request response duration and a first request processing duration;

[0070] S1017: Parse the time synchronization message to obtain a third timestamp, correct the third timestamp according to the first link delay to obtain a synchronization timestamp, and then perform time synchronization on the vehicle-mounted device to be tested according to the synchronization timestamp.

[0071] Specifically, the first request processing time T 1 =t 2 -t 1 , where t 2 Indicates the second timestamp, i.e., the time when the test end sends the first link delay response, t 1 represents the first timestamp, i.e., the time when the test end receives the first link delay request; the first request response time T 2 =t b -t a , where t b Indicates the time it takes for the vehicle-mounted device under test to receive the first link delay response, t a Indicates the time when the vehicle-mounted device under test sends the first link delay request; the first link delay T3 =(T 2 -T 1 ) / 2; Synchronize timestamp t c =t 3 +T 3 , where t 3 Indicates the third timestamp, that is, the time when the test end sends the time synchronization message.

[0072] S102: Send a second link delay request to the vehicle-mounted device to be tested, and receive a second link delay response returned by the vehicle-mounted device to be tested, and then determine a reverse link delay according to the second link delay request and the second link delay response.

[0073] Specifically, the reverse time synchronization accuracy analysis module includes a reverse link delay determination module and a time synchronization accuracy determination module, wherein the reverse link delay determination module includes a link delay request sending interface, a link delay response receiving interface and a link delay calculation unit, and the time synchronization accuracy determination module includes a reverse time synchronization receiving port and a time synchronization accuracy calculation unit.

[0074] like Figure 4 FIG. 1 is a flow chart of step S102 provided in an embodiment of the present invention, referring to FIG. Figure 4 As an optional implementation, sending a second link delay request to the vehicle-mounted device to be tested, and receiving a second link delay response returned by the vehicle-mounted device to be tested, specifically includes:

[0075] S1021. Send a second link delay request to the vehicle-mounted device under test through a link delay request sending interface, so that the vehicle-mounted device under test returns a second link delay response, where the second link delay response carries a fourth timestamp and a fifth timestamp, where the fourth timestamp is the time when the second link delay request is received, and the fifth timestamp is the time when the second link delay response is sent;

[0076] S1022: Receive a second link delay response through a link delay response receiving interface.

[0077] Specifically, a link delay request sending interface is used to send a link delay request message to calculate the link delay; a link delay response receiving interface is used to receive and process a link delay response message, parse the message, and obtain the time when the vehicle-mounted device under test receives the link delay request message and the time when the vehicle-mounted device under test sends the link delay response message; a link delay calculation unit is used to calculate the reverse link delay from the test system to the vehicle-mounted device under test.

[0078] like Figure 5 FIG. 1 is another step flow chart of step S102 provided in an embodiment of the present invention, referring to FIG. Figure 5As an optional implementation, determining the reverse link delay according to the second link delay request and the second link delay response specifically includes:

[0079] S1023: parse the second link delay response to obtain a fourth timestamp and a fifth timestamp, and determine a second request processing duration according to a difference between the fifth timestamp and the fourth timestamp;

[0080] S1024, determining a second request response duration according to a time difference between receiving a second link delay response and sending a second link delay request;

[0081] S1025. Determine the reverse link delay according to half of the difference between the second request response duration and the second request processing duration.

[0082] Specifically, the second request processing time T 4 =t 5 -t 4 , where t 5 represents the fifth timestamp, i.e., the time when the vehicle-mounted device under test sends the second link delay response, t 4 represents the fourth timestamp, i.e., the time when the vehicle-mounted device under test receives the second link delay request; the second request response time T 5 =t e -t d , where t e Indicates the time it takes for the test end to receive the second link delay response, t d Indicates the time when the test end sends the second link delay request; the reverse link delay T 6 =(T 5 -T 4 ) / 2.

[0083] S103: Receive a reverse synchronization message sent by the vehicle-mounted device to be tested, and determine the time synchronization accuracy of the vehicle-mounted device to be tested according to a reverse link delay and a sending time and a receiving time of the reverse synchronization message.

[0084] like Figure 6 FIG. 1 is a flow chart of step S103 provided in an embodiment of the present invention, referring to FIG. Figure 6 As an optional implementation, a reverse synchronization message sent by the vehicle-mounted device to be tested is received, and the time synchronization accuracy of the vehicle-mounted device to be tested is determined according to the reverse link delay and the sending time and receiving time of the reverse synchronization message, which specifically includes:

[0085] S1031. Receive a reverse synchronization message through a reverse time synchronization receiving interface, and determine a receiving time of the reverse synchronization message, where the reverse synchronization message carries a sixth timestamp, which is a time when the reverse synchronization message is sent;

[0086] S1032, parsing the reverse synchronization message to obtain a sixth timestamp, and determining a sending time of the reverse synchronization message according to the sixth timestamp;

[0087] S1033. Determine a first transmission duration of the reverse synchronization message according to the difference between the reception time and the transmission time of the reverse synchronization message, determine a time deviation of the vehicle-mounted device to be tested according to the difference between the first transmission duration and the reverse link delay, and then determine a time synchronization accuracy according to the time deviation.

[0088] Specifically, the reverse time synchronization receiving interface is used to receive and process the reverse time synchronization message sent by the vehicle-mounted device to be tested, parse the message, and obtain the sixth timestamp t 6 , i.e., the sending time of the reverse time synchronization message (on-board device to be tested); time synchronization accuracy calculation, used to determine the first transmission duration of the reverse synchronization message according to the difference between the receiving time and the sending time of the reverse synchronization message, the first transmission duration T 7 =t f -t 6 , where t f Indicates the receiving time of the reverse synchronization message (test end). The time deviation of the vehicle-mounted device to be tested is determined according to the difference between the first transmission duration and the reverse link delay. The time deviation ΔT = T 7 -T 6 The time deviation indicates the time deviation between the vehicle-mounted device to be tested and the test end after time synchronization. The time synchronization accuracy can be determined based on the time deviation.

[0089] In some optional embodiments, the parameters of the vehicle-mounted device to be tested required for the test are provided in advance, and the parameters are stored in a cache through the parsing algorithm library before the test starts, for use during the subsequent test execution; during the test execution, the test system will automatically enable the time synchronization module and the reverse time synchronization accuracy analysis module. After the time synchronization module is enabled, it will automatically call the time synchronization interface library to complete the time synchronization with the vehicle-mounted device to be tested; after the reverse time synchronization accuracy analysis module is enabled, it will automatically call the synchronization accuracy algorithm library to issue a link delay request and process the response, parse the reverse time synchronization message, extract the reverse time synchronization precise timestamp, and complete the calculation of the time synchronization accuracy through the synchronization accuracy algorithm library; after the test is completed, the test system will automatically save the time synchronization accuracy test results in the specified file, and store them together with the test data in the specified folder.

[0090] like Figure 7 FIG. 1 is another flow chart of the steps of the vehicle Ethernet time synchronization accuracy test method provided by the embodiment of the present invention, referring to FIG. Figure 7 As an optional implementation, the vehicle Ethernet time synchronization accuracy test method further includes the following steps:

[0091] S104: When the reverse link delay does not meet the preset threshold range, it is determined that the reverse link delay is invalid, and a second link delay request is sent back to the vehicle-mounted device to be tested.

[0092] Specifically, the preset threshold range can be 0 to 1 second. When the calculated reverse link delay is less than 0 second or greater than 1 second, it means that the measurement of the reverse link delay is invalid, and the process can return to the step of sending a second link delay request to the vehicle-mounted device to be tested for re-measurement.

[0093] In an embodiment of the present invention, after the test system starts testing, it parses the configuration parameters of the vehicle-mounted device to be tested and stores them in a cache, and starts to receive Ethernet data from the vehicle-mounted Ethernet port of the vehicle-mounted device to be tested, and starts to process gPTP related data at the same time; waits to receive link delay request data sent by the vehicle-mounted device to be tested, responds to the link delay, and sends a time synchronization message to the vehicle-mounted device to be tested for time synchronization; according to the reverse synchronization method, sends link delay request data, and processes the link delay response data replied by the vehicle-mounted device to be tested, so as to reversely calculate the reverse link delay between the test system and the vehicle-mounted device to be tested; judges whether the calculated reverse link delay is valid, if the calculated reverse link delay is valid, the test system receives and processes the reverse synchronization message sent by the vehicle-mounted device to be tested, and then tests the time synchronization accuracy of the vehicle-mounted device to be tested according to the reverse synchronization algorithm library, if the calculated reverse link delay is invalid, resends the link delay request data according to the reverse synchronization method; judges whether the time synchronization accuracy of the test meets the requirements, generates a test report according to the judgment result, and stores the test result and test data in the specified path.

[0094] The above is an explanation of the method steps of the embodiment of the present invention. It can be understood that the embodiment of the present invention performs time synchronization with the vehicle-mounted device to be tested according to the first link delay request and the corresponding first link delay response and the time synchronization message sent by the vehicle-mounted device to be tested, sends a second link delay request to the vehicle-mounted device to be tested to determine the reverse link delay, and then receives the reverse synchronization message sent by the vehicle-mounted device to be tested, thereby determining the time synchronization accuracy of the vehicle-mounted device to be tested according to the reverse link delay and the sending time and receiving time of the reverse synchronization message, without changing the device hardware during the test process, ensuring the accuracy of the vehicle Ethernet time synchronization accuracy test while reducing the test cost.

[0095] like Figure 8 FIG. 1 is a schematic diagram of a vehicle Ethernet time synchronization accuracy test system according to an embodiment of the present invention. Figure 8 , an embodiment of the present invention provides a vehicle-mounted Ethernet time synchronization accuracy test system, comprising:

[0096] A time synchronization module, configured to respond to a first link delay request sent by the vehicle-mounted device under test, send a first link delay response and a time synchronization message to the vehicle-mounted device under test, so that the vehicle-mounted device under test performs time synchronization according to the first link delay response and the time synchronization message;

[0097] A reverse link delay determination module, used to send a second link delay request to the vehicle-mounted device to be tested, and receive a second link delay response returned by the vehicle-mounted device to be tested, and then determine the reverse link delay according to the second link delay request and the second link delay response;

[0098] The time synchronization accuracy determination module is used to receive the reverse synchronization message sent by the vehicle-mounted device to be tested, and determine the time synchronization accuracy of the vehicle-mounted device to be tested according to the reverse link delay and the sending time and receiving time of the reverse synchronization message.

[0099] The contents of the above method embodiments are all applicable to the present system embodiments. The functions specifically implemented by the present system embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0100] The embodiment of the present invention also provides an electronic device, the electronic device comprising: a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for realizing connection and communication between the processor and the memory, and the program is executed by the processor to realize the above-mentioned vehicle Ethernet time synchronization accuracy test method. The electronic device can be any intelligent terminal including a tablet computer, a vehicle-mounted computer, etc.

[0101] like Fig. 9 FIG. 1 is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present invention, referring to FIG. Fig. 9 , an embodiment of the present invention provides an electronic device, including:

[0102] The processor 901 may 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 the present invention;

[0103] The memory 902 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 902 can store an operating system and other application programs. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 902, and the processor 901 calls and executes the vehicle Ethernet time synchronization accuracy test method of the embodiment of the present invention;

[0104] Input / output interface 903, used to implement information input and output;

[0105] Communication interface 904, used to realize communication interaction between the device and other devices, which can be realized by wired mode (such as USB, network cable, etc.) or wireless mode (such as mobile network, WIFI, Bluetooth, etc.);

[0106] A bus 905 that transmits information between various components of the device (e.g., the processor 901, the memory 902, the input / output interface 903, and the communication interface 904);

[0107] The processor 901 , the memory 902 , the input / output interface 903 and the communication interface 904 are connected to each other in communication within the device via a bus 905 .

[0108] like Fig.10 FIG. 1 is a schematic diagram of a storage medium according to an embodiment of the present invention. Fig.10 An embodiment of the present invention further provides a storage medium, which is a computer-readable storage medium used for computer-readable storage. The storage medium stores one or more programs 1001, and the one or more programs 1001 can be executed by one or more processors to implement the above-mentioned vehicle Ethernet time synchronization accuracy test method.

[0109] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0110] An embodiment of the present invention further provides a vehicle, the vehicle comprising the above-mentioned vehicle-mounted Ethernet time synchronization accuracy test system or an electric drive assembly of an electronic device.

[0111] Specifically, the vehicle may be a private car, such as a sedan, SUV, MPV or pickup truck.

[0112] The embodiment of the present invention further provides a computer program product or a computer program, wherein the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a computer device can read the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes Figure 1 The method shown.

[0113] In some selectable embodiments, the function / operation mentioned in the block diagram may not occur in the order mentioned in the operation diagram. For example, depending on the function / operation involved, the two boxes shown in succession can actually be executed substantially simultaneously or the above-mentioned boxes can sometimes be executed in reverse order. In addition, the embodiment presented and described in the flow chart of the present invention is provided by way of example, for the purpose of providing a more comprehensive understanding of technology. The disclosed method is not limited to the operation and logic flow presented herein. Selectable embodiments are expected, wherein the order of various operations is changed and the sub-operation of a part for which is described as a larger operation is performed independently.

[0114] In addition, although the present invention is described in the context of functional modules, it should be understood that, unless otherwise specified to the contrary, one or more of the above-mentioned functions and / or features can be integrated into a single physical device and / or software module, or one or more functions and / or features can be implemented in a separate physical device or software module. It is also understood that a detailed discussion of the actual implementation of each module is unnecessary for understanding the present invention. More specifically, in view of the properties, functions and internal relationships of the various functional modules in the device disclosed herein, the actual implementation of the module will be understood within the conventional skills of the engineer. Therefore, those skilled in the art can implement the present invention set forth in the claims without excessive experimentation using ordinary techniques. It is also understood that the specific concepts disclosed are merely illustrative and are not intended to limit the scope of the present invention, which is determined by the full scope of the appended claims and their equivalents.

[0115] If the above functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the above methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0116] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.

[0117] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and editable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the above-mentioned program is printed, since the above-mentioned program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or processing in other suitable ways as necessary, and then stored in a computer memory.

[0118] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0119] In the above description of this specification, the description with reference to the terms "one embodiment / example", "another embodiment / example" or "certain embodiments / examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0120] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the claims and their equivalents.

[0121] The above is a specific description of the preferred implementation of the present invention, but the present invention is not limited to the above embodiments. Those skilled in the art may make various equivalent modifications or substitutions without violating the spirit of the present invention. These equivalent modifications or substitutions are all included in the scope defined by the claims of this application.

Claims

1. A method for testing the time synchronization accuracy of an in-vehicle Ethernet, characterized in that: The following steps are involved: In response to a first link delay request sent by the vehicle-mounted device under test, sending a first link delay response and a time synchronization message to the vehicle-mounted device under test, so that the vehicle-mounted device under test performs time synchronization according to the first link delay response and the time synchronization message; Sending a second link delay request to the vehicle-mounted device to be tested, and receiving a second link delay response returned by the vehicle-mounted device to be tested, and then determining a reverse link delay according to the second link delay request and the second link delay response; A reverse synchronization message sent by the vehicle-mounted device to be tested is received, and the time synchronization accuracy of the vehicle-mounted device to be tested is determined according to the reverse link delay and the sending time and receiving time of the reverse synchronization message.

2. A vehicle Ethernet time synchronization accuracy test method according to claim 1, characterized in that: The step of sending a first link delay response and a time synchronization message to the vehicle-mounted device under test in response to the first link delay request sent by the vehicle-mounted device under test specifically includes: receiving the first link delay request through a link delay request receiving interface, and determining a time for receiving the first link delay request; Sending the first link delay response to the vehicle-mounted device under test through a link delay response sending interface, wherein the first link delay response carries a first timestamp and a second timestamp, wherein the first timestamp is the time when the first link delay request is received, and the second timestamp is the time when the first link delay response is sent; The time synchronization message is sent to the vehicle-mounted device to be tested through a time synchronization sending interface, the time synchronization message carries a third timestamp, and the third timestamp is the time when the time synchronization message is sent.

3. A vehicle-mounted Ethernet time synchronization accuracy test method according to claim 2, characterized in that: The performing time synchronization according to the first link delay response and the time synchronization message specifically includes: Parsing the first link delay response to obtain the first timestamp and the second timestamp, and determining a first request processing duration according to a difference between the second timestamp and the first timestamp; Determine a first request response duration according to a time difference between receiving the first link delay response and sending the first link delay request; Determine a first link delay according to half of a difference between a duration of responding to the first request and a duration of processing the first request; The time synchronization message is parsed to obtain the third timestamp, and the third timestamp is corrected according to the first link delay to obtain a synchronization timestamp, and then the vehicle-mounted device to be tested is time synchronized according to the synchronization timestamp.

4. The method for testing the time synchronization accuracy of an in-vehicle Ethernet according to claim 1, characterized in that: The sending of the second link delay request to the vehicle-mounted device to be tested, and receiving a second link delay response returned by the vehicle-mounted device to be tested, specifically includes: Sending the second link delay request to the vehicle-mounted device under test through a link delay request sending interface, so that the vehicle-mounted device under test returns the second link delay response, the second link delay response carries a fourth timestamp and a fifth timestamp, the fourth timestamp is the time when the second link delay request is received, and the fifth timestamp is the time when the second link delay response is sent; The second link delay response is received through a link delay response receiving interface.

5. A vehicle-mounted Ethernet time synchronization accuracy test method according to claim 4, characterized in that: The determining the reverse link delay according to the second link delay request and the second link delay response specifically includes: Parsing the second link delay response to obtain the fourth timestamp and the fifth timestamp, and determining the second request processing duration according to a difference between the fifth timestamp and the fourth timestamp; Determine the second request response duration according to the time difference between receiving the second link delay response and sending the second link delay request; The reverse link delay is determined based on half of the difference between the second request response time and the second request processing time.

6. A method for testing the time synchronization accuracy of an in-vehicle Ethernet according to any one of claims 1 to 5, characterized in that: The receiving a reverse synchronization message sent by the vehicle-mounted device to be tested, and determining the time synchronization accuracy of the vehicle-mounted device to be tested according to the reverse link delay and the sending time and receiving time of the reverse synchronization message, specifically includes: Receiving the reverse synchronization message through a reverse time synchronization receiving interface, and determining a reception time of the reverse synchronization message, wherein the reverse synchronization message carries a sixth timestamp, and the sixth timestamp is a time when the reverse synchronization message is sent; Parsing the reverse synchronization message to obtain the sixth timestamp, and determining the sending time of the reverse synchronization message according to the sixth timestamp; The first transmission duration of the reverse synchronization message is determined according to the difference between the reception time and the sending time of the reverse synchronization message, the time deviation of the vehicle-mounted device to be tested is determined according to the difference between the first transmission duration and the reverse link delay, and the time synchronization accuracy is further determined according to the time deviation.

7. A vehicle-mounted Ethernet time synchronization accuracy test method according to claim 6, characterized in that: The vehicle-mounted Ethernet time synchronization accuracy test method further includes the following steps: When the reverse link delay does not meet the preset threshold range, it is determined that the reverse link delay is invalid, and a second link delay request is sent back to the vehicle-mounted device to be tested.

8. A vehicle-mounted Ethernet time synchronization accuracy test system, characterized in that: include: A time synchronization module, configured to respond to a first link delay request sent by the vehicle-mounted device under test, send a first link delay response and a time synchronization message to the vehicle-mounted device under test, so that the vehicle-mounted device under test performs time synchronization according to the first link delay response and the time synchronization message; a reverse link delay determination module, configured to send a second link delay request to the vehicle-mounted device to be tested, and receive a second link delay response returned by the vehicle-mounted device to be tested, and then determine a reverse link delay according to the second link delay request and the second link delay response; The time synchronization accuracy determination module is used to receive the reverse synchronization message sent by the vehicle-mounted device to be tested, and determine the time synchronization accuracy of the vehicle-mounted device to be tested according to the reverse link delay and the sending time and receiving time of the reverse synchronization message.

9. An electronic device, characterized in that: The electronic device includes a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for realizing connection and communication between the processor and the memory. When the program is executed by the processor, the steps of the vehicle Ethernet time synchronization accuracy test method as described in any one of claims 1 to 7 are realized.

10. A storage medium, the storage medium being a computer-readable storage medium, used for computer-readable storage, characterized in that: The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of the vehicle Ethernet time synchronization accuracy test method as described in any one of claims 1 to 7.