Test system and method for cabin-driving fusion time synchronization function
By designing a test system that includes multiple interfaces and data parsing and processing modules, the test challenge of time synchronization function under the cabin-pilot fusion architecture was solved, and the accuracy testing of multiple interfaces and application requirement evaluation were realized, thereby improving test efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-16
- Publication Date
- 2026-04-07
AI Technical Summary
The lack of effective testing tools or systems in the existing technology to evaluate the time synchronization function under the vehicle-cabin-driver fusion architecture makes it impossible to effectively test and evaluate the time synchronization accuracy.
A testing system was designed, including Ethernet, CAN, and PPS interfaces and corresponding data parsing and processing modules. The system records time jump values and frequency changes through time management and data processing modules, thereby realizing the parsing and accuracy detection of time synchronization data from multiple interfaces.
It enables comprehensive testing of various time synchronization interfaces in the cabin-pilot integration scenario, improving testing efficiency, and uses timer data analysis to determine whether the time synchronization function meets application requirements.
Smart Images

Figure CN121814248A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the field of time synchronization function test, and particularly relates to a test system and method for cabin-driving fusion time synchronization function. BACKGROUND
[0002] In the current era of increasingly popular intelligent driving, the newly proposed cabin-driving fusion architecture can unify the applications of the cabin and the intelligent driving into a software system. Compared with the previous cabin-driving separation framework, the cabin-driving fusion can reduce the amount of cross-domain communication data, but also has many challenges. For the time synchronization function in the application field of vehicle cabin-driving fusion, the time displayed by the cabin side instrument needs to be aligned with the world time, and the time on the intelligent driving side requires no forward and backward jumps during a running process. Because of different requirements, the intelligent driving time and the cabin time are separated into two independent time domains. Under this time synchronization architecture, there is no effective and complete test tool or system, which leads to the inability to effectively test the time synchronization function and the inability to overall evaluate the precision of time synchronization. SUMMARY
[0003] In view of the problems of the prior art, the application provides a test system and method for cabin-driving fusion time synchronization function, which can effectively test the time synchronization function of cabin-driving fusion, effectively analyze the time synchronization report data packets of various interfaces of the cabin-driving fusion host, support multiple interfaces such as Ethernet, CAN, and PPS at the same time, and detect the precision and fluctuation of time synchronization.
[0004] The application is implemented by the following technical solutions:
[0005] A test system for cabin-driving fusion time synchronization function, comprising:
[0006] an Ethernet interface, a CAN interface, and a PPS interface, configured to receive corresponding time synchronization packets from a to-be-tested host;
[0007] Ethernet data analysis processing modules, CAN data analysis processing modules, and PPS data analysis processing modules, which are one-to-one corresponding to the Ethernet interface, the CAN interface, and the PPS interface, are configured to respectively obtain time synchronization packet data from the corresponding interfaces and perform data analysis to obtain corresponding time synchronization data;
[0008] a timer management module, configured to set the time synchronization data of the data analysis processing modules other than the Ethernet data analysis processing module to corresponding timers; the Ethernet data analysis module completes the time setting of the built-in timer of the Ethernet interface and the reading of the time stamp by itself;
[0009] And a timer data processing module is configured to record the time jump value and frequency variation of each timer, and form a final time record report by analysis and arrangement, and determine whether the time synchronization function of the corresponding interface meets the application requirement of cabin and driving fusion according to the time record report.
[0010] In some embodiments, the Ethernet analysis processing module comprises an EMAC, a BPF and a gPTP.
[0011] The EMAC is configured to read a timestamp and set a synchronization time of a built-in timer of the Ethernet interface as an upper-layer driver of the Ethernet interface.
[0012] The BPF is configured to directly construct and filter Ethernet MAC layer communication data packets, and provide corresponding APIs to be called by the gPTP.
[0013] The gPTP is configured to analyze the time jump value and frequency variation value of the timer from the EMAC bottom-layer communication data packet, and record and analyze the final time record report by the timer data processing module, and determine whether the Ethernet time synchronization function meets the requirement according to the time record report.
[0014] In some embodiments, the CAN data analysis processing module comprises a CAN IF and a CanTSyn.
[0015] The CanTSyn is configured to complete the transmission and reception of CAN interface synchronization messages by using the API provided by the CAN IF, and set the CAN interface time synchronization data to the corresponding timer by the timer management module, record the time jump value and frequency variation of the corresponding timer by the timer data processing module, analyze the final time record report, and determine whether the CAN time synchronization function meets the requirement according to the time record report.
[0016] In some embodiments, the PPS data analysis processing module comprises a GPIO interrupt, a serial port and a PPS.
[0017] The PPS is configured to receive the GPIO interrupt timestamp data by the serial port, set the timestamp data to the corresponding timer by the timer management module, record the time jump value and frequency variation of the corresponding timer by the timer data processing module, analyze the final time record report, and determine whether the PPS time synchronization function meets the requirement according to the time record report.
[0018] In some implementations, multiple interfaces and timers belong to the system hardware layer, EMAC, BPF, CAN IF, GPIO interrupt, serial port and timer management module belong to the system driver layer, and gPTP, CanTSyn, PPS and timer data processing module belong to the system application layer.
[0019] The hardware interfaces of the system hardware layer are independent of each other and can work simultaneously;
[0020] The system driver layer depends on the corresponding hardware, and the system application layer controls the corresponding hardware by calling the driver layer;
[0021] The system application layer has independent programs to control and parse time synchronization messages. Then, through software settings, different interrupt handling in the system driver layer is bound to different CPU cores, enabling the system driver layer to execute concurrently.
[0022] Secondly, embodiments of this application also propose a testing method for a testing system based on any of the above-described embodiments, the testing method comprising:
[0023] Power on and initialize the test system;
[0024] Waiting steps: Wait for the host under test to send a time synchronization message;
[0025] Synchronization steps: Receive the time synchronization message and synchronize it to the corresponding timer in the test system;
[0026] Recording steps: Record the time jump value and frequency change value of the corresponding timer;
[0027] The waiting step, synchronization step, and recording step are executed periodically;
[0028] After the test, the test results are statistically analyzed to determine whether they meet the application requirements.
[0029] In some implementations, the test method includes an Ethernet time synchronization test, the specific test process of which includes:
[0030] gPTP initial BPF and EMAC;
[0031] gPTP receives data from the BPF;
[0032] Delay detection steps: gPTP actively sends a delay request message;
[0033] gPTP obtains the sending timestamp of the delay request message from the EMAC;
[0034] gPTP receives delayed response messages from the BPF;
[0035] gPTP obtains the received timestamp of the delayed response message from the EMAC;
[0036] gPTP receives Pdelay Resp Fup messages from the BPF;
[0037] gPTP obtains the receiving timestamp of the Pdelay Resp Fup message from the EMAC;
[0038] Repeat the delay detection steps to detect link delay;
[0039] Time synchronization steps: gPTP receives a synchronization message from the BPF;
[0040] gPTP obtains the received timestamp of the synchronization message from the EMAC;
[0041] gPTP receives follow-up messages from the BPF;
[0042] gPTP obtains the received timestamp of the follow-up message from the EMAC;
[0043] Repeat the time synchronization steps to synchronize the time from the host under test;
[0044] The timer data processing module obtains the time synchronization status and time, including timestamp and clock frequency, from the gPTP;
[0045] gPTP obtains the timer's timestamp and clock frequency from the EMAC and returns them to the timer data processing module.
[0046] In some implementations, the test method includes a CAN time synchronization test, the specific test process of which includes:
[0047] CanTSyn initializes the CAN IF and timer management module;
[0048] CanTSyn receives data from the CAN IF;
[0049] CanTSyn receives synchronization messages;
[0050] CanTSyn obtains the timestamp of the received synchronization message from the timer management module;
[0051] CanTSyn receives follow-up messages;
[0052] CanTSyn obtains the timestamp of the received follow-up message from the timer management module;
[0053] The timer data processing module obtains the time synchronization status and time, including timestamp and clock frequency, from the CanTSyn.
[0054] CanTSyn obtains the timer's timestamp and clock frequency from the timer management module and returns them to the timer data processing module.
[0055] In some implementations, the test method includes a PPS time synchronization test, the specific test process of which includes:
[0056] PPS initializes the timer management module, serial port, and interrupts;
[0057] The interrupt triggers the timer management module, clearing the value below the timer second.
[0058] PPS receives timestamp data from the serial port;
[0059] PPS configures the timer management module to set the timer's second-level timer to the received timestamp;
[0060] The timer data processing module obtains the time synchronization status and time, including timestamp and clock frequency, from the PPS;
[0061] PPS obtains the timer's timestamp and clock frequency from the timer management module and returns them to the timer data processing module.
[0062] In some implementations, whether the analysis and test results meet the application requirements includes:
[0063] If the time update value of the timer for Ethernet interface synchronization is greater than 500ns, the time synchronization function of the host under test is deemed unqualified and the synchronization parameters need to be optimized.
[0064] If the time update value of the timer for CAN interface synchronization is greater than 500μs, the time synchronization function of the host under test is deemed unqualified and the synchronization parameters need to be optimized.
[0065] If the time update value of the timer synchronized by the PPS interface is greater than 250ns, the time synchronization function of the host under test is deemed unqualified and the synchronization parameters need to be optimized.
[0066] If the clock frequency ratio between the test system and the host under test is greater than 1.0001 or less than 0.9999, an alarm will be issued; if the clock frequency ratio between the test system and the host under test is greater than 1.0002 or less than 0.9998, the time synchronization function of the host under test is determined to be unqualified.
[0067] This application presents a testing system and method for time synchronization functions in cabin-driver integration. It simultaneously supports multiple time synchronization interfaces such as Ethernet, CAN, and PPS, and their corresponding synchronization protocols, enabling comprehensive testing of all core time synchronization interfaces in cabin-driver integration scenarios and meeting the application testing requirements of cabin-driver integration. A novel software architecture is adopted, capable of simultaneously supporting multiple time synchronization protocol stacks. Different software protocol stacks are adapted to the protocol stack of the host under test, enabling parallel testing of all interfaces and improving testing efficiency. Furthermore, by using the time jump value and frequency variation value when the local timer is synchronized, the accuracy and maximum error of the time synchronization function of the host under test are quantitatively analyzed to determine whether it meets the application requirements of cabin-driver integration. Attached Figure Description
[0068] The accompanying drawings, which are included to provide a further understanding of the embodiments of this application and form part of this application, do not constitute a limitation on the embodiments of this application. In the drawings:
[0069] Figure 1 This is a block diagram illustrating the principle of the test system proposed in an embodiment of this application;
[0070] Figure 2 This is a schematic diagram of the test system architecture proposed in an embodiment of this application;
[0071] Figure 3 This is a schematic diagram illustrating the interaction between the test system and the host under test as proposed in an embodiment of this application;
[0072] Figure 4 This is a flowchart of the testing method proposed in the embodiments of this application;
[0073] Figure 5 This is a flowchart of the Ethernet time synchronization test according to an embodiment of this application;
[0074] Figure 6 This is a flowchart of the CAN time synchronization test according to an embodiment of this application;
[0075] Figure 7 This is a flowchart of the PPS time synchronization test according to an embodiment of this application. Detailed Implementation
[0076] In the following, the terms “comprising” or “may include” as used in the various embodiments of this application indicate the presence of a function, operation, or element of the invention and do not limit the addition of one or more functions, operations, or elements. Furthermore, as used in the various embodiments of this application, the terms “comprising,” “having,” and their cognates are intended only to indicate a specific feature, number, step, operation, element, component, or combination of the foregoing and should not be construed as primarily excluding the presence of one or more other features, numbers, steps, operations, elements, components, or combinations of the foregoing, or adding one or more combinations of the foregoing.
[0077] In various embodiments of this application, the expression "or" or "at least one of A and / or B" includes any combination or all combinations of the words listed simultaneously. For example, the expression "A or B" or "at least one of A and / or B" may include A, may include B, or may include both A and B.
[0078] The terms used in the various embodiments of this application (such as "first," "second," etc.) may modify various constituent elements in the various embodiments, but do not limit the corresponding constituent elements. For example, the above terms do not limit the order and / or importance of the elements. The above terms are only used for the purpose of distinguishing one element from other elements. For example, a first user device and a second user device refer to different user devices, although both are user devices. For example, without departing from the scope of the various embodiments of this application, a first element may be referred to as a second element, and similarly, a second element may be referred to as a first element.
[0079] It should be noted that if a description is made of "connecting" one component to another, then the first component can be directly connected to the second component, and a third component can be "connected" between the first and second components. Conversely, when a component is "directly connected" to another component, it can be understood that there is no third component between the first and second components.
[0080] The terminology used in the various embodiments of this application is for the purpose of describing particular embodiments only and is not intended to limit the various embodiments of this application. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Unless otherwise defined, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art to which the various embodiments of this application pertain. The terms (such as those defined in a generally used dictionary) are to be interpreted as having the same meaning as in the context of the relevant technical field and are not to be interpreted as having an idealized or overly formal meaning, unless clearly defined in the various embodiments of this application.
[0081] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the embodiments and accompanying drawings. The illustrative embodiments and descriptions of this application are only for explaining this application and are not intended to limit this application.
[0082] Currently, there is a lack of effective and complete testing tools or systems for the time synchronization function under the vehicle-cabin-driver integration time synchronization architecture. To address this, this application proposes a testing system for the time synchronization function of the vehicle-cabin-driver integration, which can simultaneously parse the time synchronization messages of the Ethernet, CAN, PPS and other interfaces of the vehicle-cabin-driver integration host, detect the time synchronization accuracy and fluctuation, and conduct an overall evaluation of whether the time synchronization function meets the application requirements of intelligent driving and cockpit.
[0083] like Figure 1 As shown, the testing system proposed in this application includes:
[0084] Multiple interfaces, covering all interfaces of the host under test, including but not limited to Ethernet interface, CAN interface, and PPS interface, are used to receive corresponding time synchronization messages from the host under test;
[0085] Multiple data parsing and processing modules are set up one-to-one with multiple interfaces, including but not limited to Ethernet data parsing and processing module, CAN data parsing and processing module, and PPS data parsing and processing module, which are used to obtain time synchronization message data from the corresponding interface and perform data parsing to obtain the corresponding time synchronization data.
[0086] The timer management module is used to set the time synchronization data of other data parsing and processing modules besides the Ethernet data parsing and processing module into their corresponding timers; the Ethernet data parsing and processing module
[0087] Timer group, which includes timers for interfaces other than the Ethernet interface, including but not limited to timers corresponding to the CAN interface and timers corresponding to the PPS interface;
[0088] Additionally, a timer data processing module is used to record the time jump values and frequency changes of each timer in the timer group and the built-in timer in the Ethernet data parsing and processing module, and to generate a final time record report through analysis and organization. Based on this time record report, it is determined whether the corresponding time synchronization function meets the needs of the upper cockpit and intelligent driving.
[0089] It should be noted that the timers in the test system proposed in this application are all standard timers. The time in the standard timer is used as a reference to test and record the change of the time of the host under test compared with the time of the standard timer, so as to determine whether the corresponding time synchronization function meets the requirements. Moreover, the test system can simultaneously parse time synchronization messages of multiple interfaces and detect the time synchronization accuracy and fluctuation, thereby realizing the overall evaluation of the time synchronization function of the host under test.
[0090] Furthermore, such as Figure 2 As shown, in the test system proposed in this application embodiment, the Ethernet data parsing and processing module mainly includes EMAC, BPF (Berkeley Packet Filter), and gPTP. Among them, EMAC, as the upper-layer driver of the Ethernet hardware interface, reads the timestamp and sets the synchronization time of the Ethernet interface's built-in timer. BPF is used to construct and filter specified Ethernet MAC layer communication data packets and provides corresponding APIs that can be called by gPTP. gPTP parses the data packets to obtain the timer time jump value and frequency change value, and records them through the timer data processing module (i.e., Time Record) to form the final time record report. Based on the time record report, it is determined whether the Ethernet time synchronization function meets the requirements.
[0091] The CAN data parsing and processing module mainly includes CAN IF and CanTSyn. CanTSyn uses the API provided by CAN IF to complete the sending and receiving of CAN interface synchronization messages and parses the CAN interface time synchronization data. The Timer Manager module sets the CAN interface time synchronization data into the corresponding timer. The Timer Data Processing module records the time jump value and frequency change of the timer and analyzes it to form the final time record report. Based on the time record report, it is determined whether the CAN time synchronization function meets the requirements.
[0092] The PPS data parsing and processing module includes GPIO interrupt, serial port, and PPS. PPS receives GPIO interrupt timestamp data through the serial port, sets it into the corresponding timer through the timer management module, records the time jump value and frequency change of the timer through the timer data processing module, analyzes and generates the final time record report, and judges whether the PPS time synchronization function meets the requirements based on the time record report.
[0093] It should be noted that in the test system proposed in this application embodiment, the Ethernet interface, CAN interface, PPS interface, and timer group belong to the hardware layer; EMAC, BPF, CAN IF, GPIO interrupt, serial port, and Timer Manager belong to the driver layer; and gPTP, CanTSyn, PPS, and Time Record belong to the application layer. The hardware interfaces in the hardware layer are independent of each other, and the three hardware interfaces can work simultaneously. The driver layer depends on the corresponding hardware, and the application layer controls the corresponding hardware by calling the driver layer. Each application layer has independent programs to control and parse time synchronization messages. Furthermore, software settings bind different interrupt handling in the driver to different CPU cores, allowing the driver layer to execute concurrently without mutual interference. Mutual interference between application layer programs does not affect the measurement accuracy of time synchronization. This application embodiment uses... Figure 2 The software architecture shown is compatible with multiple time synchronization protocol stacks. It adapts different software protocol stacks according to the protocol stack of the host under test, realizes parallel testing of all interfaces, and improves testing efficiency.
[0094] The interaction process between the test system and the host under test proposed in this application embodiment is as follows: Figure 3 As shown, after both the test system and the host under test are powered on and initialized, the host under test automatically starts Ethernet time synchronization, CAN time synchronization and PPS time synchronization. The test system obtains the corresponding time synchronization messages from the host under test through the Ethernet interface, CAN interface and PPS interface, and synchronizes the time to the corresponding timer in the test system. The time update jump value and frequency change of the timer in the test system are used to determine whether the time synchronization function of the host under test meets the application requirements of cockpit-driver fusion.
[0095] Furthermore, embodiments of this application also propose a testing method based on the above-described testing system, such as... Figure 4 As shown, the test method includes:
[0096] Step 100: Power on and initialize the test system; specifically, initialize the system peripherals and protocol stack.
[0097] Step 110: Wait for the host under test to send a time synchronization message;
[0098] Step 120: Receive the time synchronization message and synchronize it to the corresponding timer in the test system;
[0099] Step 130: Record the time jump value and frequency change value of the corresponding timer;
[0100] Step 140, execute steps 110-130 periodically;
[0101] Step 150: After the test is completed, collect and analyze the test results to see if they meet the application requirements.
[0102] Furthermore, the testing method includes Ethernet time synchronization testing, the specific testing procedure of which is as follows: Figure 5 As shown, it includes:
[0103] Step 200: gPTP starts and initializes BPF;
[0104] Step 201, gPTP initializes EMAC;
[0105] Step 202: gPTP calls Recv to receive data from BPF;
[0106] Step 203: gPTP actively sends a Pdelay Req message (delay request message);
[0107] Step 204: gPTP obtains the sending timestamp of the Pdelay Req message from EMAC;
[0108] Step 205: gPTP receives a Pdelay Resp message from BPF.
[0109] Step 206: gPTP obtains the received timestamp of the Pdelay Resp message from EMAC;
[0110] Step 207: gPTP receives Pdelay Resp Fup messages (i.e. Pdelay Resp Follow UP messages) from BPF.
[0111] Step 208: gPTP obtains the received timestamp of the Pdelay Resp Fup message from EMAC;
[0112] Step 209: Repeat steps 203-208 to detect link latency;
[0113] Step 210: gPTP receives a Sync message from BPF.
[0114] Step 211: gPTP obtains the received timestamp of the Sync message from EMAC;
[0115] Step 212, gPTP receives Follow UP messages from BPF.
[0116] Step 213: gPTP obtains the received timestamp of the Follow UP message from EMAC;
[0117] Step 214: Repeat steps 210-213 to synchronize the time from the host under test;
[0118] Step 215: Timer Record obtains the time synchronization status and time from gPTP, including the timestamp and clock frequency;
[0119] Step 216: gPTP obtains the timestamp and clock frequency of the Timer from EMAC and returns them to the Timer Record.
[0120] Furthermore, the test method includes CAN time synchronization testing, the specific test procedure of which is as follows: Figure 6 As shown, it includes:
[0121] Step 300: CanTSyn starts and initializes the CAN IF;
[0122] Step 301: CanTSyn initializes the Timer Manager;
[0123] Step 302: CanTSyn calls Recv to receive data from the CAN IF;
[0124] Step 303: CanTSyn receives the Sync message (synchronization message);
[0125] Step 304: CanTSyn obtains the timestamp of the received Sync message from the Timer Manager;
[0126] Step 305, CanTSyn receives the Flow UP message (followed by a message);
[0127] Step 306: CanTSyn obtains the timestamp of the received Flow UP message from the Timer Manager;
[0128] Step 307: Timer Record obtains the time synchronization status and time from CanTSyn, including the timestamp and clock frequency;
[0129] Step 308: CanTSyn obtains the timestamp and clock frequency of the Timer from the Timer Manager and returns them to the TimerRecord.
[0130] Furthermore, the testing method includes PPS time synchronization testing, the specific testing procedure of which is as follows: Figure 7 As shown, it includes:
[0131] Step 400: PPS starts and initializes Timer Manager;
[0132] Step 401: PPS initializes the serial port;
[0133] Step 402, PPS initialization interrupt;
[0134] Step 403: Interrupt triggers Timer Manager, clearing the values below the timer seconds;
[0135] Step 404: PPS receives timestamp data from the serial port;
[0136] Step 405: In PPS Timer Manager, set the timer's second-level timer to the received timestamp.
[0137] Step 406: Timer Record obtains the time synchronization status and time from PPS, including timestamp and clock frequency;
[0138] Step 407: PPS obtains the timestamp and clock frequency of the Timer from the Timer Manager and returns them to TimerRecord.
[0139] Currently, there are no relevant regulations that impose mandatory precision requirements, but the embodiments of this application have different precision requirements for different interfaces in terms of implementation:
[0140] (1) For the Ethernet time synchronization interface, the running gPTP protocol complies with the standard "IEEE Std 802.1AS™-2011". The time synchronization error should be less than ±500ns. If the time update value of the Ethernet timer is greater than ±500ns, the time synchronization function of the host under test is considered to be unqualified. The synchronization parameters need to be optimized to improve the synchronization accuracy.
[0141] (2) For the CAN time synchronization interface, refer to the "Specification of Time Synchronization over CAN" protocol in the AUTOSAR CP standard. There is no explicit requirement for time synchronization delay, but for general implementation, the error should be less than ±500μs. If the time update value of the timer synchronized by the CAN interface is greater than ±500μs, the time synchronization function of the host under test is considered unqualified, and the synchronization parameters need to be optimized to improve the synchronization accuracy.
[0142] (3) For the PPS time synchronization interface, refer to standard GB / T 45086.1-2024 "Technical Requirements and Test Methods for Vehicle Positioning Systems Part 1: Satellite Positioning", where the 1PPS error for satellite time synchronization is less than ±250ns. If the time update value of the timer synchronized by the PPS interface of the host under test is greater than ±250ns, the time synchronization function of the host under test is considered unqualified, and the synchronization parameters need to be optimized to improve the synchronization accuracy.
[0143] According to the standard IEEE Std 802.1AS™-2011, the system clock error should be less than ±100 PPM. In this embodiment, the test system clock is measured with standard instruments, and the error is guaranteed to be less than ±100 PPM under a fixed test environment. Simultaneously, the clock frequency error of the host under test should be less than 100 PPM. If the frequency ratio between the test system and the host under test in this embodiment is greater than 1.0001 or less than 0.9999, it indicates that the clock frequency error between the two is greater than 100 PPM, and an alarm should be triggered, increasing the observation time. If the frequency ratio is greater than 1.0002 or less than 0.9998, it indicates that the relative clock frequency error between the two exceeds ±200 PPM, and the time synchronization function is considered unqualified, requiring a re-evaluation of the solution.
[0144] The testing system and method proposed in this application can simultaneously support multiple time synchronization interfaces such as Ethernet, CAN, and PPS, and support corresponding synchronization protocols to meet the application testing requirements of cabin-driver integration. A novel software architecture is proposed that is compatible with multiple time synchronization protocol stacks, adapting different software protocol stacks according to the protocol stack of the host under test, enabling parallel testing of all interfaces. Furthermore, the time jump value and frequency variation value when the local timer is synchronized are used to analyze the accuracy and maximum error of the time synchronization function of the host under test, determining whether it meets the application requirements of cabin-driver integration and whether it is necessary to optimize the parameters of the corresponding synchronization protocol to improve time synchronization accuracy.
[0145] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0146] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0147] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0148] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0149] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of this application. It should be understood that the above description is only a specific embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. A test system for cockpit-pilot fusion time synchronization function, characterized in that, include: Ethernet interface, CAN interface and PPS interface are used to receive corresponding time synchronization messages from the host under test; The Ethernet data parsing and processing module, CAN data parsing and processing module, and PPS data parsing and processing module, which are configured one-to-one with the Ethernet interface, CAN interface, and PPS interface, are used to obtain time synchronization message data from the corresponding interface and perform data parsing to obtain the corresponding time synchronization data. The timer management module is used to set the time synchronization data of data parsing and processing modules other than the Ethernet data parsing and processing module into the corresponding timers; The Ethernet data parsing module automatically sets the time of the built-in timer of the Ethernet interface and reads the timestamp. Additionally, a timer data processing module is used to record the time jump values and frequency changes of each timer, and to generate a final time record report through analysis and organization. Based on the time record report, it is determined whether the time synchronization function of the corresponding interface meets the application requirements of cabin-pilot fusion.
2. The test system for cockpit-pilot fusion time synchronization function according to claim 1, characterized in that, The Ethernet parsing and processing module includes EMAC, BPF, and gPTP; The EMAC, acting as an upper-layer driver for the Ethernet interface, reads the timestamp and sets the synchronization time of the Ethernet interface's built-in timer. The BPF has the function of directly constructing and filtering Ethernet MAC layer communication packets, and provides corresponding APIs that can be called by the gPTP. The gPTP parses the underlying EMAC communication data packets to obtain the time jump value and frequency change value of the timer, and records and analyzes them through the timer data processing module to form a final time record report. Based on the time record report, it is determined whether the Ethernet time synchronization function meets the requirements.
3. A test system for cockpit-pilot fusion time synchronization function according to claim 2, characterized in that, The CAN data parsing and processing module includes CAN IF and CanTSyn; Specifically, CanTSyn uses the API provided by the CAN IF to send and receive CAN interface synchronization messages. After parsing the CAN interface time synchronization data, it sets the data into the corresponding timer through the timer management module. The timer data processing module records the time jump value and frequency change of the corresponding timer, analyzes and forms the final time record report, and judges whether the CAN time synchronization function meets the requirements based on the time record report.
4. A test system for cabin-pilot fusion time synchronization function according to claim 3, characterized in that, The PPS data parsing and processing module includes GPIO interrupt, serial port, and PPS; Specifically, the PPS receives GPIO interrupt timestamp data via a serial port and sets it into the corresponding timer through the timer management module. The timer data processing module records the time jump value and frequency change of the corresponding timer, analyzes and generates a final time recording report, and determines whether the PPS time synchronization function meets the requirements based on the time recording report.
5. A test system for cockpit-pilot fusion time synchronization function according to claim 4, characterized in that, Multiple interfaces and timers belong to the system hardware layer; EMAC, BPF, CAN IF, GPIO interrupt, serial port and timer management module belong to the system driver layer; gPTP, CanTSyn, PPS and timer data processing module belong to the system application layer. The hardware interfaces of the system hardware layer are independent of each other and can work simultaneously; The system driver layer depends on the corresponding hardware, and the system application layer controls the corresponding hardware by calling the driver layer; The system application layer has independent programs to control and parse time synchronization messages. Then, through software settings, different interrupt handling in the system driver layer is bound to different CPU cores, enabling the system driver layer to execute concurrently.
6. A test method for a test system for cabin-pilot fusion time synchronization function according to any one of claims 1-5, characterized in that, The testing method includes: Power on and initialize the test system; Waiting steps: Wait for the host under test to send a time synchronization message; Synchronization steps: Receive the time synchronization message and synchronize it to the corresponding timer in the test system; Recording steps: Record the time jump value and frequency change value of the corresponding timer; The waiting step, synchronization step, and recording step are executed periodically; After the test, the test results are statistically analyzed to determine whether they meet the application requirements.
7. The test method according to claim 6, characterized in that, The test method includes Ethernet time synchronization testing, and the specific test process includes: gPTP initial BPF and EMAC; gPTP receives data from the BPF; Delay detection steps: gPTP actively sends a delay request message; gPTP obtains the sending timestamp of the delay request message from the EMAC; gPTP receives delayed response messages from the BPF; gPTP obtains the received timestamp of the delayed response message from the EMAC; gPTP receives Pdelay Resp Fup messages from the BPF; gPTP obtains the receiving timestamp of the Pdelay Resp Fup message from the EMAC; Repeat the delay detection steps to detect link delay; Time synchronization steps: gPTP receives a synchronization message from the BPF; gPTP obtains the received timestamp of the synchronization message from the EMAC; gPTP receives follow-up messages from the BPF; gPTP obtains the received timestamp of the follow-up message from the EMAC; Repeat the time synchronization steps to synchronize the time from the host under test; The timer data processing module obtains the time synchronization status and time, including timestamp and clock frequency, from the gPTP; gPTP obtains the timer's timestamp and clock frequency from the EMAC and returns them to the timer data processing module.
8. The test method according to claim 6, characterized in that, The test method includes CAN time synchronization testing, and the specific test process includes: CanTSyn initializes the CAN IF and timer management module; CanTSyn receives data from the CAN IF; CanTSyn receives synchronization messages; CanTSyn obtains the timestamp of the received synchronization message from the timer management module; CanTSyn receives follow-up messages; CanTSyn obtains the timestamp of the received follow-up message from the timer management module; The timer data processing module obtains the time synchronization status and time, including timestamp and clock frequency, from the CanTSyn. CanTSyn obtains the timer's timestamp and clock frequency from the timer management module and returns them to the timer data processing module.
9. The test method according to claim 6, characterized in that, The testing method includes PPS time synchronization testing, and the specific testing process includes: PPS initializes the timer management module, serial port, and interrupts; The interrupt triggers the timer management module, clearing the value below the timer second. PPS receives timestamp data from the serial port; PPS configures the timer management module to set the timer's second-level timer to the received timestamp; The timer data processing module obtains the time synchronization status and time, including timestamp and clock frequency, from the PPS; PPS obtains the timer's timestamp and clock frequency from the timer management module and returns them to the timer data processing module.
10. The test method according to any one of claims 6-9, characterized in that, Whether the analysis and test results meet the application requirements includes: If the time update value of the timer for Ethernet interface synchronization is greater than 500ns, the time synchronization function of the host under test is deemed unqualified and the synchronization parameters need to be optimized. If the time update value of the timer for CAN interface synchronization is greater than 500μs, the time synchronization function of the host under test is deemed unqualified and the synchronization parameters need to be optimized. If the time update value of the timer synchronized by the PPS interface is greater than 250ns, the time synchronization function of the host under test is deemed unqualified and the synchronization parameters need to be optimized. If the clock frequency ratio between the test system and the host under test is greater than 1.0001 or less than 0.9999, an alarm will be issued; if the clock frequency ratio between the test system and the host under test is greater than 1.0002 or less than 0.9998, the time synchronization function of the host under test is determined to be unqualified.