Test method and device
By receiving communication completion signals from driving computers, obtaining log files and filtering preset function message logs, the CAN message communication cycle transmitted by ECU in new energy vehicles is determined, and the problem of manual analysis is solved, and efficient period error statistics and message cycle inspection is realized.
Patent Information
- Application Number
- CN202411812413.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-10
- Publication Date
- 2025-04-08
AI Technical Summary
During the research and development and testing stage of new energy vehicles, the CAN message signal data transmitted in the ECU is huge, resulting in large workload of manual analysis and low regression testing efficiency, which cannot meet the analysis needs.
It provides a testing method and device, which receives communication completion signals from a driving computer, obtains log files, determines test information based on database files, filters preset function message logs, determines message communication cycles, and counts period errors.
It improves the efficiency of stating the periodic errors of communication messages, optimizes the message period check and design expectation compliance check, and can quickly and effectively monitor the network message sending cycle.
Smart Images

Figure CN119788566A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of data analysis, and in particular to a testing method and device. Background Art
[0002] With the development of automobiles, ECU (Electronic Control Unit) integrates more and more functions. During the research and development and testing phase of new energy vehicles, there will be new demands and new functions need to be launched online, so the number of messages on CAN (Controller Area Network) will also increase accordingly.
[0003] The amount of CAN message signal data transmitted in the current ECU is huge. As the development progresses, each function update requires checking the status of the message. When analyzing the specific data collected, manual analysis methods are used. The workload increases dramatically with the size of the collected data and the number of analyzed signals. Manual verification will lead to a large workload for manual analysis of CAN data, low efficiency of regression testing, and failure to meet analysis needs. Summary of the invention
[0004] In view of this, the purpose of the present application is to provide a testing method and device to overcome at least one of the above-mentioned defects.
[0005] In a first aspect, an embodiment of the present application provides a testing method, the method comprising: receiving a communication completion signal from an on-board computer, the communication completion signal being used to indicate that the communication between the on-board computer and the on-board communication object has been completed; in response to the communication completion signal, obtaining a log file, the log file being used to record log information during the communication process between the on-board computer and the on-board communication object; determining test information corresponding to a preset function according to a database file, the test information comprising a test channel, a message number and a sending node; according to the test information, filtering a preset function message log from the log file, the preset function message log comprising a message number corresponding to the communication message, a test channel used for sending the communication message, a sending node for sending the communication message and a timestamp for sending the communication message; determining a message communication cycle corresponding to the preset function according to the preset function message log recorded during the test time period.
[0006] In an optional embodiment of the present application, the message communication cycle corresponding to the preset function is determined according to the preset function message log recorded in the test time period, including: extracting the preset function message log recorded in the test time period, generating a message list corresponding to different functions, each message list including all message information of communication messages sent under the same message number, the same test channel and the same sending node, the message list including multiple message information, each message information is arranged in the order of timestamps recorded in the message information; for each message list, calculating the difference between the timestamp of each message information in the message list and the timestamp of the previous message information, and determining the time interval of each message information in the message list; for each message list, matching all time intervals in the message list with the cycle interval, and counting the total number of sending cycle errors in the message list with the same message number, the same test channel and the same sending node, so as to reflect the message communication cycle of the corresponding function in the message list.
[0007] In an optional embodiment of the present application, the periodic interval includes a first periodic interval, a second periodic interval and a third periodic interval, the lower limit of the first periodic interval is a first threshold, the upper limit of the first periodic interval is a second threshold, the lower limit of the second periodic interval is the second threshold, the upper limit of the second periodic interval is a third threshold, the lower limit of the third periodic interval is a third threshold, and the second threshold is greater than the first threshold and less than the third threshold.
[0008] In an optional embodiment of the present application, the sending cycle error conditions include communication message sending timeout, communication message sending abnormality and communication message sending loss, wherein the total number of sending cycle error conditions of each message list is determined in the following manner: for each message list, determine the cycle interval in which all time intervals in the message list are located; for each time interval in each message list, if the time interval is in the first cycle interval, determine the communication message sending timeout corresponding to the message list, and record the total number of sending timeout conditions; for each time interval in each message list, if the time interval is in the second cycle interval, determine the communication message sending abnormality corresponding to the message list, and record the total number of sending abnormality conditions; for each time interval in each message list, if the time interval is in the third cycle interval, determine the communication message sending loss corresponding to the message list, and record the total number of sending loss conditions.
[0009] In an optional embodiment of the present application, the method further includes: counting all communication messages that have been determined but do not appear in the log file; for each communication message, determining whether the message sending type of the communication message belongs to a trigger type; for each communication message, if the message sending type of the communication message belongs to a trigger type, then determining that the communication message belongs to a normal sending phenomenon and no verification is required; if the message sending type of the communication message does not belong to the trigger type, then determining that the communication message belongs to an abnormal sending phenomenon and prompting verification of the communication situation of the communication message.
[0010] In an optional embodiment of the present application, the log file is generated by the vehicle computer in the following manner: receiving a test instruction for a preset function, the test instruction including a test name used to characterize the preset function; determining communication information corresponding to the test name, the communication information including a communication channel, a message number and a sending node; forming a communication message based on the message number, and sending the communication message to the on-board communication object through the sending node via the test channel for multiple times; recording log information for each time the communication message is sent, and determining the log information as a log file.
[0011] In an optional embodiment of the present application, the method also includes: for each message list, filtering out a preset number of target time intervals from all time intervals in the message list, the target time interval being the maximum time interval in the message list; for each target time interval, according to the message number corresponding to the target time interval, filtering out the timestamp corresponding to the target time interval from the log file, and recording it together with the target time interval.
[0012] In the second aspect, an embodiment of the present application also provides a testing device, which includes: a communication completion signal receiving module, which is used to receive a communication completion signal from an on-board computer, and the communication completion signal is used to indicate that the communication between the on-board computer and the on-board communication object has been completed; a log file acquisition module, which is used to obtain a log file in response to the communication completion signal, and the log file is used to record log information during the communication process between the on-board computer and the on-board communication object; a test information determination module, which is used to determine the test information corresponding to the preset function according to the database file, and the test information includes a test channel, a message number and a sending node; a preset function message log screening module, which is used to screen the preset function message log from the log file according to the test information, and the preset function message log includes the message number corresponding to the communication message, the test channel used to send the communication message, the sending node used to send the communication message and the timestamp of sending the communication message; a message communication cycle determination module, which is used to determine the message communication cycle corresponding to the preset function according to the preset function message log recorded during the test time period.
[0013] In a third aspect, an embodiment of the present application further provides an electronic device, comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the steps of the method described above are performed.
[0014] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the method described above are executed.
[0015] The test method and device provided by the embodiment of the present application receive a communication completion signal from the driving computer; in response to the communication completion signal, obtain a log file, the log file is used to record the log information during the communication process between the driving computer and the vehicle-mounted communication object; according to the database file, determine the test information corresponding to the preset function, the test information includes a test channel, a message number and a sending node; according to the test information, filter the preset function message log from the log file, the preset function message log includes the message number corresponding to the communication message, the test channel used to send the communication message, the sending node used to send the communication message and the timestamp of sending the communication message; according to the preset function message log recorded in the test time period, determine the message communication cycle corresponding to the preset function. Through this application, the efficiency of counting the cycle error of the communication message is improved.
[0016] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0018] Figure 1 A flow chart of the testing method provided in the embodiment of the present application;
[0019] Figure 2 A schematic diagram of the structure of the test device provided in the embodiment of the present application;
[0020] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0021] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application usually described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, each other embodiment obtained by those skilled in the art without making creative work belongs to the scope of protection of the present application.
[0022] First, the application scenarios to which the present application is applicable are introduced. The present application can be applied in the field of data analysis technology.
[0023] Research has found that the amount of CAN message signal data transmitted in the current ECU is huge. As the development progresses, each function update requires checking the status of the message. When analyzing the specific data collected, manual analysis methods are used. The workload increases dramatically with the size of the collected data and the number of analyzed signals. Manual verification will lead to a large workload for manual analysis of CAN data, low efficiency of regression testing, and inability to meet analysis needs.
[0024] Based on this, the embodiment of the present application provides a test method and device, receiving a communication completion signal from a driving computer; in response to the communication completion signal, obtaining a log file, the log file is used to record the log information during the communication process between the driving computer and the vehicle-mounted communication object; according to the database file, determining the test information corresponding to the preset function, the test information includes a test channel, a message number and a sending node; according to the test information, filtering the preset function message log from the log file, the preset function message log includes the message number corresponding to the communication message, the test channel used to send the communication message, the sending node used to send the communication message and the timestamp of sending the communication message; according to the preset function message log recorded in the test time period, determining the message communication cycle corresponding to the preset function. Through this application, the efficiency of counting the cycle error of the communication message is improved.
[0025] The executor of the present application is a test terminal, which collects statistics on log files of all communication messages sent in the vehicle computer, detects the log files, and obtains the message communication cycle of the communication messages.
[0026] See also Figure 1 , Figure 1 This is a flow chart of the test method provided in the embodiment of the present application. Figure 1 As shown in, the test method provided in the embodiment of the present application includes:
[0027] S101. Receive a communication completion signal from the vehicle computer.
[0028] The communication completion signal is used to indicate that the communication between the on-board computer and the on-board communication object has been completed.
[0029] The Electronic Control Unit (Electronic Control Unit, also known as the in-vehicle infotainment system or in-vehicle processor) is an electronic system integrated into the car. It transmits and controls vehicle information by communicating with the in-vehicle communication objects.
[0030] In an optional embodiment, the communication between the on-board computer and the on-board communication object mainly includes the following functions:
[0031] For example, in-vehicle network communication can be carried out, and the communication objects can be various electronic devices in the car (such as sensors, controllers, etc.); the communication method can be through the in-vehicle CAN bus protocol to realize information data transmission between various devices in the car, which is used for real-time detection and operation control of device status, and establish a digital in-vehicle control system. For example, the driving computer can receive vehicle status information (such as vehicle speed, engine speed, etc.) from the sensor and display it on the dashboard for the driver to view.
[0032] In summary, the in-vehicle network communication between the on-board computer and the on-board communication objects constitutes the core part of the on-board communication system, providing the driver with a safe, comfortable, intelligent and efficient driving experience and traffic services.
[0033] S102: In response to a communication completion signal, obtain a log file.
[0034] The log file is used to record the log information during the communication process between the on-board computer and the on-board communication object.
[0035] Specifically, the log file is generated by the on-board computer in the following ways:
[0036] Receive test instructions for preset functions.
[0037] The test instruction includes a test name used to characterize a preset function. Preferably, the test instruction can be understood as a test instruction generated by the underlying software of the vehicle computer.
[0038] Among them, these instructions are usually used to verify the communication function and performance of the CAN bus network and whether it complies with specific protocols or standards. The following are some possible test instructions:
[0039] Functional test instructions: used to verify whether the communication function of the CAN bus network is normal. This may include sending specific CAN messages to check whether the nodes can receive and respond correctly, or simulating node failures to check the fault tolerance of the network.
[0040] Performance test instructions: used to evaluate the performance indicators of the CAN bus network, such as communication rate, load capacity, anti-interference ability, etc. These instructions may involve sending a large amount of data to test the throughput of the network, or testing the stability of the network under different conditions (such as electromagnetic interference).
[0041] Protocol test instructions: used to verify that the CAN bus network complies with a specific communication protocol, which may include checking the format and identifiers of the message.
[0042] Determine the communication information corresponding to the test name.
[0043] The communication information includes the communication channel, message number and sending node.
[0044] In an optional embodiment, due to the large variability of DBC (Database CAN file) during the development of the on-board computer, it is necessary to set up a json configuration file corresponding to the DBC in advance so that the DBC used can be determined by reading the json file. In the later development process, if the DBC changes, it is only necessary to modify the configuration in the json file, which is more flexible and more versatile.
[0045] For example, you can call the database interface in the Cantools library to load all configured DBC files. Because the DBC format is difficult to automatically analyze with other data, all the contents in the DBC are formatted first so that they can be indexed according to the file name to form a dictionary, which is convenient for subsequent calls to the database file.
[0046] A communication message is formed based on the message number, and the communication message is sent to the vehicle communication object through the sending node through the test channel for multiple times.
[0047] In this step, the on-board computer sends a communication message to the on-board communication object according to a preset number of times.
[0048] The log information of each communication message sent is recorded and the log information is determined as a log file.
[0049] In an optional embodiment, the BLFreader in the library can is called to create a BLF object, traverse the object, extract and record the information such as the test channel, message number, sending node and timestamp of each communication message.
[0050] Here, BLF (Binary Logging File) files are used to record and store real-time data and messages obtained from the vehicle bus (such as CAN bus). These files usually store data in binary format, including timestamp, data length, data content, etc.
[0051] S103: Determine test information corresponding to the preset function according to the database file.
[0052] The test information includes the test channel, message number and sending node.
[0053] S104. Filter preset function message logs from the log file according to the test information.
[0054] The preset function message log includes the message number corresponding to the communication message, the test channel used to send the communication message, the sending node used to send the communication message, and the timestamp of sending the communication message.
[0055] S105: Determine a message communication cycle corresponding to the preset function according to the preset function message log recorded during the test period.
[0056] Specifically, the preset function message logs recorded during the test period are extracted to generate message lists corresponding to different functions.
[0057] After the test, the message number, sending node and test channel are used as indexes to retrieve all timestamps under the index, and the message information under the same index is stored in the same message list. Moreover, whenever a new message is processed, if the key of the message (composed of the message number, sending node and test channel) does not exist in the database file, a new key is created and associated with an empty message list, and then the timestamp of the message is appended to the list. In this way, all timestamps of each message can be saved in the message list, which is convenient for the subsequent calculation of the message cycle.
[0058] Here, each message list includes all message information of communication messages sent under the same message number, the same test channel and the same sending node. The message list includes multiple message information, and each message information is arranged in the order of the timestamp recorded in the message information;
[0059] For each message list, calculate the difference between the timestamp of each message information in the message list and the timestamp of the previous message information, and determine the time interval of each message information in the message list;
[0060] For each message list, all time intervals in the message list are matched with the cycle interval, and the total number of sending cycle errors under the same message number, the same test channel and the same sending node in the message list is counted to reflect the message communication cycle of the corresponding function in the message list.
[0061] Because the time intervals for sending messages in the test instructions are different, the cycle threshold is set to a file that can be configured through json, which is more flexible. Engineers can freely adjust the threshold according to their own architecture design.
[0062] In an optional embodiment, the periodic interval includes a first periodic interval, a second periodic interval and a third periodic interval, the lower limit of the first periodic interval is a first threshold, the upper limit of the first periodic interval is a second threshold, the lower limit of the second periodic interval is the second threshold, the upper limit of the second periodic interval is a third threshold, the lower limit of the third periodic interval is a third threshold, and the second threshold is greater than the first threshold and less than the third threshold.
[0063] Preferably, the first threshold is timeout_threshold, the second threshold is abnormal_threshold, and the third threshold is lost_threshold.
[0064] Among them, timeout_threshold is a custom multiple for timeout judgment. The program will judge how many messages in the message information exceed timeout_threshold times the period, but are lower than abnormal_threshold times the period; abnormal_threshold is a custom multiple for non-specified frames. The program will judge how many messages in the message information exceed abnormal_threshold times the period, but are lower than lost_threshold times the period; lost_threshold is a custom multiple for lost frames. The program will judge how many messages in the message information exceed lost_threshold times the period.
[0065] Preferably, the first threshold is set to 1.5, the second threshold is set to 1.8, and the third threshold is set to 2. For example, the sending period of each communication message is 100ms, then the first threshold 1.5 represents 1.5 times of 100ms, which is 150ms. Therefore, the specific time of each threshold needs to correspond to the preset communication message sending period, and no specific limitation is made here.
[0066] Specifically, the sending cycle error conditions include three conditions: communication message sending timeout, communication message sending abnormality, and communication message sending loss.
[0067] Here, according to the periodic threshold in the configuration file and the timestamp information in the log file, it is determined whether the time interval of each message list belongs to the communication message sending timeout, communication message sending abnormality, and communication message sending loss situation, and the number of frames in the corresponding state is counted to find the maximum preset number of time intervals and their position in the timestamp list for report output.
[0068] Preferably, three reports can be output, among which Sheet 1: Messages (information) lists the log information of the communication messages extracted from the log file, including the message number, name, sending node, test channel, sending cycle time specified by the database, etc., and can quickly find specific messages or message numbers through filters or search functions, support sorting of message lists for easy analysis and comparison, help engineers quickly understand the communication network structure and data flow of the vehicle, support comparison and analysis of communication data under different working conditions, so as to evaluate the data integrity of the vehicle under different conditions.
[0069] Sheet2: Frame States, including message number, name, sending node, test channel, sending cycle time specified by the database, total number of timeouts, exceptions and losses, the three largest time intervals and their positions in the log file, etc. It displays the time interval statistics corresponding to each communication message for further analysis and supports graphical display of time interval statistics for intuitive understanding of data trends, which can help engineers identify performance bottlenecks in communication networks, such as message delays or losses.
[0070] Sheet2 is used to evaluate the performance of ECUs and communication networks, especially under high load or abnormal conditions. It supports comparison and analysis of time interval statistics under different operating conditions to evaluate the performance of the vehicle under different conditions.
[0071] Specifically, the total number of sending cycle errors for each message list is determined in the following ways and handling suggestions are given:
[0072] For each message list, determine the period interval of all time intervals in the message list;
[0073] For each time interval in each message list, if the time interval is within the first cycle interval, determine that the communication message corresponding to the message list has timed out, and record the total number of timeouts;
[0074] Here, when a communication message sending timeout occurs in the message list, it is recommended that engineers should consider whether the database file design is reasonable, whether there are parts that can be optimized, whether the functions are limited, and whether to reduce the network load.
[0075] For each time interval in each message list, if the time interval is within the second period interval, determining that the communication message corresponding to the message list is abnormal in sending, and recording the total number of abnormal sending situations;
[0076] Here, when abnormal communication message sending occurs in the message list, engineers are advised to consider that the priority of some messages is set too high, resulting in other messages not being sent on time. It is recommended to re-evaluate the message priority setting to ensure that high-priority messages do not excessively occupy network resources.
[0077] For each time interval in each message list, if the time interval is within the third period interval, it is determined that the communication message corresponding to the message list is lost, and the total number of times the loss occurs is recorded.
[0078] Here, when communication messages are lost in the message list, engineers are advised to check the underlying code to see if the relevant message sending logic is correct. Or if the ECU does not process messages fast enough, resulting in message backlogs, it is recommended to optimize the software algorithm, increase the processing speed, or increase the resources of the ECU.
[0079] After determining the total number of times that the communication messages in each communication list have a sending cycle error, for each message list, a preset number of target time intervals are screened out from all time intervals in the message list.
[0080] Preferably, the preset number may be three, and the target time interval is the three largest time intervals in the message list;
[0081] For each target time interval, according to the message number corresponding to the target time interval, the timestamp corresponding to the target time interval is filtered from the log file and recorded together with the target time interval.
[0082] Here, the timestamps corresponding to the three largest time intervals in the message list are recorded, and the position of the test process corresponding to the timestamp is determined in the log file.
[0083] Sheet3: Additional Messages. This report is used to prompt which communication messages have been generated according to the test instructions, but the communication messages do not appear in the log file, including the message number, name, sending node, test channel and other information.
[0084] Sheet3 supports filtering and searching for messages that have not appeared, so as to facilitate quick location and analysis, helping engineers to discover potential communication problems or unrecorded messages, and ensuring that the vehicle's communication network and ECU performance are fully optimized. It supports in-depth analysis of messages that have not appeared to discover potential problems or improvement opportunities, and supports architecture design and application design checks to see if they meet design expectations.
[0085] In an optional embodiment, the present application may count all communication messages that have been determined but do not appear in the log file;
[0086] For each communication message, determine whether the message sending type of the communication message belongs to the trigger type;
[0087] For each communication message, if the message sending type of the communication message belongs to the trigger type, it is determined that the communication message is sent normally and meets the design expectations, and no verification is required. If the message sending type of the communication message does not belong to the trigger type, it is determined that the communication message is sent abnormally, and it is prompted to verify the communication situation of the communication message, and whether it meets the design expectations and whether the code function can be implemented as required.
[0088] The test method and device provided by the embodiment of the present application receive a communication completion signal from the driving computer; in response to the communication completion signal, obtain a log file, the log file is used to record the log information during the communication process between the driving computer and the vehicle-mounted communication object; according to the database file, determine the test information corresponding to the preset function, the test information includes the test channel, the message number and the sending node; according to the test information, filter the preset function message log from the log file, the preset function message log includes the message number corresponding to the communication message, the test channel used to send the communication message, the sending node used to send the communication message and the timestamp of sending the communication message; according to the preset function message log recorded in the test time period, determine the message communication cycle corresponding to the preset function. Through this application, the efficiency of counting the cycle error of the communication message is improved, and this application can be used to optimize the message cycle check and the design expectation compliance check.
[0089] The present invention can quickly and effectively monitor the network message sending cycle, automatically generate a test report, identify network real-time problems in the development stage, and detect whether the actual sending cycle of the vehicle CAN network message is consistent with the designed cycle.
[0090] Based on the same inventive concept, a testing device corresponding to the testing method is also provided in the embodiment of the present application. Since the principle of solving the problem by the device in the embodiment of the present application is similar to the above-mentioned testing method in the embodiment of the present application, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0091] See also Figure 2 , Figure 2 This is a schematic diagram of the structure of the test device provided in the embodiment of the present application. Figure 2 As shown in , the testing device 200 comprises:
[0092] The communication completion signal receiving module 201 is used to receive a communication completion signal from the on-board computer, wherein the communication completion signal is used to indicate that the communication between the on-board computer and the on-board communication object has been completed;
[0093] A log file acquisition module 202, for acquiring a log file in response to a communication completion signal, wherein the log file is used to record log information during the communication process between the vehicle computer and the vehicle communication object;
[0094] The test information determination module 203 is used to determine the test information corresponding to the preset function according to the database file, and the test information includes the test channel, the message number and the sending node;
[0095] The preset function message log screening module 204 is used to screen the preset function message log from the log file according to the test information, wherein the preset function message log includes the message number corresponding to the communication message, the test channel used for sending the communication message, the sending node for sending the communication message, and the timestamp of sending the communication message;
[0096] The message communication period determination module 205 is used to determine the message communication period corresponding to the preset function according to the preset function message log recorded during the test time period.
[0097] See also Figure 3 , Figure 3 This is a schematic diagram of the structure of the electronic device provided in the embodiment of the present application. Figure 3 As shown in , the electronic device 300 includes a processor 310 , a memory 320 and a bus 330 .
[0098] The memory 320 stores machine-readable instructions executable by the processor 310. When the electronic device 300 is running, the processor 310 communicates with the memory 320 via the bus 330. When the machine-readable instructions are executed by the processor 310, the above-mentioned Figure 1 The specific implementation of the steps of the testing method in the method embodiment shown can be found in the method embodiment, and will not be repeated here.
[0099] The present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the computer program can execute the above-mentioned Figure 1The specific implementation of the steps of the testing method in the method embodiment shown can be found in the method embodiment, and will not be repeated here.
[0100] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0101] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0102] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0103] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0104] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application can essentially be embodied in the form of a software product, or in other words, the part that contributes to the prior art or the part of the technical solution. 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 method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0105] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The protection scope of the present application is not limited thereto. Although the present application is described in detail with reference to the above-mentioned embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-mentioned embodiments within the technical scope disclosed in the present application, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A testing method, characterized in that: include: receiving a communication completion signal from the on-board computer, wherein the communication completion signal is used to indicate that the communication between the on-board computer and the on-board communication object has been completed; In response to the communication completion signal, a log file is obtained, wherein the log file is used to record log information during the communication process between the on-board computer and the on-board communication object; Determine test information corresponding to a preset function according to a database file, the test information including a test channel, a message number, and a sending node; According to the test information, filter the preset function message log from the log file, wherein the preset function message log includes the message number corresponding to the communication message, the test channel used to send the communication message, the sending node used to send the communication message, and the timestamp of sending the communication message; The message communication period corresponding to the preset function is determined according to the preset function message log recorded during the test time period.
2. The method according to claim 1, characterized in that The determining, based on the preset function message log recorded during the test period, a message communication cycle corresponding to the preset function, includes: Extracting the preset function message log recorded during the test time period, generating message lists corresponding to different functions, each message list including all message information of communication messages sent under the same message number, the same test channel, and the same sending node, the message list including multiple message information, each message information is arranged in the order of the timestamp recorded in the message information; For each message list, calculate the difference between the timestamp of each message information in the message list and the timestamp of the previous message information to determine the time interval of each message information in the message list; For each message list, all time intervals in the message list are matched with the cycle interval, and the total number of sending cycle errors under the same message number, the same test channel and the same sending node in the message list is counted to reflect the message communication cycle of the corresponding preset function in the message list.
3. The method according to claim 2, characterized in that The periodic interval includes a first periodic interval, a second periodic interval, and a third periodic interval, the lower limit of the first periodic interval is a first threshold, the upper limit of the first periodic interval is a second threshold, the lower limit of the second periodic interval is the second threshold, the upper limit of the second periodic interval is a third threshold, the lower limit of the third periodic interval is a third threshold, and the second threshold is greater than the first threshold and less than the third threshold.
4. The method according to claim 3, characterized in that The sending cycle error conditions include communication message sending timeout, communication message sending abnormality and communication message sending loss, The total number of transmission cycle errors for each message list is determined in the following manner: For each message list, determine the period interval of all time intervals in the message list; For each time interval in each message list, if the time interval is within the first period interval, determining that the communication message corresponding to the message list has timed out, and recording the total number of timeouts; For each time interval in each message list, if the time interval is within the second period interval, determining that the communication message corresponding to the message list is abnormal in sending, and recording the total number of abnormal sending situations; For each time interval in each message list, if the time interval is within the third period interval, it is determined that the communication message corresponding to the message list is lost, and the total number of times the loss occurs is recorded.
5. The method according to claim 1, characterized in that The method further comprises: Counting all communication messages that have been identified but do not appear in the log file; For each communication message, determine whether the message sending type of the communication message belongs to the trigger type; For each communication message, if the message sending type of the communication message belongs to the trigger type, it is determined that the communication message is sent normally and no verification is required. If the message sending type of the communication message does not belong to the trigger type, it is determined that the communication message is sent abnormally and a prompt is given to verify the test status of the communication message.
6. The method according to claim 1, characterized in that The log file is generated by the on-board computer in the following ways: receiving a test instruction for a preset function, wherein the test instruction includes a test name for characterizing the preset function; Determine the communication information corresponding to the test name, the communication information including the communication channel, message number and sending node; forming a communication message based on the message number, and sending the communication message to the vehicle-mounted communication object through the sending node via the test channel multiple times; Record log information of each communication message sent, and determine the log information as a log file.
7. The method according to claim 2, characterized in that The method further comprises: For each message list, a preset number of target time intervals are screened out from all time intervals in the message list, where the target time interval is the maximum time interval in the message list; For each target time interval, according to the message number corresponding to the target time interval, the timestamp corresponding to the target time interval is filtered from the log file and recorded together with the target time interval.
8. A testing device, characterized in that: include: a communication completion signal receiving module, configured to receive a communication completion signal from the on-board computer, wherein the communication completion signal is used to indicate that the communication between the on-board computer and the on-board communication object has been completed; a log file acquisition module, configured to acquire a log file in response to a communication completion signal, wherein the log file is configured to record log information during the communication process between the on-board computer and the on-board communication object; A test information determination module is used to determine test information corresponding to a preset function according to a database file, wherein the test information includes a test channel, a message number, and a sending node; A preset function message log screening module, configured to screen the preset function message log from the log file according to the test information, wherein the preset function message log includes the message number corresponding to the communication message, the test channel used for sending the communication message, the sending node for sending the communication message, and the timestamp of sending the communication message; The message communication period determination module is used to determine the message communication period corresponding to the preset function according to the preset function message log recorded during the test time period.
9. An electronic device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate via the bus, and the processor executes the machine-readable instructions to perform the steps of any one of the methods described in claims 1 to 7.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are executed.