Test method and device, vehicle and medium
By acquiring and analyzing CAN message log files, periodic stability and bit field interference faults are identified and diagnosed, forming a closed-loop automated testing process. This solves the problem of insufficient automated analysis in existing technologies and improves testing efficiency and reliability.
Patent Information
- Application Number
- CN202511767206.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-27
- Publication Date
- 2026-01-13
AI Technical Summary
Existing technologies lack efficient and automated methods for comprehensive analysis of CAN message log files, which can easily lead to overlooking problems and result in high testing costs.
By acquiring log files, performing test analysis and fault identification, identifying periodic stability faults and bit-domain interference faults, and conducting diagnostic verification, a closed-loop automated testing process is formed.
It improves the efficiency and reliability of testing, solves the problem of lack of efficient automated analysis in existing technologies, and reduces testing costs.
Smart Images

Figure CN121334016A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, in particular to a test method and device, vehicle and medium. BACKGROUND
[0002] In the system development test of automobile, electronic and industrial control fields, bus communication such as Controller Area Network (CAN) is more common. In order to ensure the reliability of bus communication, the communication behavior of the system needs to be strictly tested. In the existing test scheme, devices such as Zhou Ligong are usually used to collect and record the corresponding CAN message log files. When communication failure occurs in vehicle road test, engineers can use Zhou Ligong software or other tools to manually replay the above log files, and carry out simple problem viewing and analysis. There is a lack of efficient and automated means to comprehensively analyze the log files, which is easy to miss problems and has high test cost. SUMMARY
[0003] Therefore, the embodiments of the present application aim to provide a test method, device, vehicle and medium, which can solve the technical problems of lacking efficient and automated means to comprehensively analyze log files, easy to miss problems and high test cost in the prior art.
[0004] In a first aspect, the present application provides a test method, comprising: obtaining a log file, wherein the log file comprises at least one data message, and the log file comprises an offline log file and / or an online log file; performing test analysis and fault identification based on at least one data message in the log file to obtain corresponding message faults, wherein the message faults comprise periodic stability faults and / or bit domain interference faults; performing diagnostic verification based on the message faults to obtain corresponding test results, wherein the test results at least comprise diagnostic verification results of the message faults.
[0005] In some embodiments, the performing test analysis and fault identification based on at least one data message in the log file to obtain corresponding message faults comprises: performing structural analysis and reconstruction on at least one data message in the log file to obtain corresponding data frame objects, wherein a row of the data frame object represents one data message, and a row of the data frame object represents a message identifier, a data length and a data payload of the data message; performing fault identification based on the data frame object to obtain the message faults corresponding to the message identifier.
[0006] In some embodiments, the message fault includes a periodic stability fault, and the step of fault identification based on the data frame object to obtain the message fault corresponding to the message identifier includes: The data frame objects are grouped based on the message identifier to obtain a message subset of the message identifier, and the message subset includes the data packets with different timestamps; The timestamp difference between adjacent data packets is calculated based on a subset of packets identified by the packet identifier to obtain a corresponding time series, wherein the time series includes at least one timestamp difference. A decision comparison is made based on at least one timestamp difference in the time series to obtain a corresponding Boolean sequence, wherein the Boolean sequence corresponds one-to-one with the time series. When the number of consecutive occurrences of a preset Boolean value is greater than a preset threshold, the message failure is determined to be a periodic stability failure.
[0007] In some embodiments, the message fault includes a bit field interference fault, and the fault identification based on the data frame object to obtain the message fault corresponding to the message identifier includes: The data payload in the data frame object is decoded to obtain the corresponding binary matrix, and the binary matrix includes at least a preset bit field corresponding to the data packet; Bit-field decision is performed on the binary value of the preset bit field in the binary matrix to obtain the corresponding decision result, which is used to indicate whether the binary value of the preset bit field has undergone a sudden change; When the judgment result indicates that the binary value of the preset bit field has changed abruptly, the message fault is determined to be the bit field interference fault.
[0008] In some embodiments, the diagnostic verification based on the message fault includes: The diagnostic service requests query internal data of the electronic control unit, which includes at least the self-test faults of the electronic control unit. The self-test fault and the message fault are verified and compared to obtain the diagnostic verification result.
[0009] In some embodiments, requesting to query internal data of the electronic control unit via diagnostic services includes: The diagnostic service request is sent to the electronic control unit via the application programming interface. The diagnostic service request is used to request the acquisition of internal data of the electronic control unit. Receive a diagnostic service response from the electronic control unit, the diagnostic service response including internal data of the electronic control unit.
[0010] In some embodiments, the method further includes: A corresponding test report is generated based on the test results. The test report includes the data packet, the packet fault, and the diagnostic verification results.
[0011] Secondly, this application provides a testing apparatus, comprising: An acquisition module is used to acquire a log file, the log file including at least one data packet, the log file including an offline log file and / or an online log file; The processing module is used to perform test analysis and fault identification based on at least one data packet in the log file to obtain the corresponding packet fault, which includes periodic stability fault and / or bit field interference fault. The processing module is also used to perform diagnostic verification based on the message fault and obtain corresponding test results, wherein the test results include at least the diagnostic verification results of the message fault.
[0012] For any content not introduced or described in the embodiments of this application, please refer to the relevant descriptions in the foregoing method embodiments; they will not be repeated here.
[0013] Thirdly, this application provides a vehicle, including: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to execute the executable instructions to implement the steps of the above-described test method.
[0014] Fourthly, this application provides a computer-readable storage medium having computer program instructions stored thereon, which, when executed by a processor, implement the steps of the above-described test method.
[0015] The technical solution provided in this application embodiment can include the following beneficial effects: This application acquires log files, which include at least one data packet, and the log files include offline log files and / or online log files; based on at least one data packet in the log file, test analysis and fault identification are performed to obtain the corresponding packet fault, which includes periodic stability faults and / or bit field interference faults; based on the packet fault, diagnostic verification is performed to obtain the corresponding test results, which at least include the diagnostic verification results of the packet fault. In this way, this application can form a closed-loop, complete automated testing process through log file acquisition, comprehensive analysis, and in-depth verification; in particular, the above-mentioned diagnostic verification is a capability completely lacking in existing technologies (such as native Zhou Ligong software), which is beneficial to improving the reliability of testing. Compared with existing technologies, this application not only improves the efficiency and reliability of testing, but also solves the technical problems existing in existing technologies, such as the lack of efficient and automated means for comprehensive analysis of log files, the ease of missing problems, and high testing costs.
[0016] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description
[0017] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the scope of this application. Furthermore, the same reference numerals denote the same parts throughout the drawings.
[0018] Figure 1 This is a flowchart illustrating a testing method provided in an embodiment of this application.
[0019] Figure 2 This is a schematic diagram of a testing device provided in an embodiment of this application.
[0020] Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0021] Figure 4 This is a structural schematic diagram of a vehicle provided in an embodiment of this application. Detailed Implementation
[0022] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0023] Unless otherwise defined, the technical or scientific terms used in the embodiments of this specification shall have the ordinary meaning understood by one of ordinary skill in the art to which this specification pertains. The terms "first," "second," and similar terms used in the embodiments of this specification do not indicate any order, quantity, or importance, but are merely used to avoid confusion of constituent elements.
[0024] Unless the context otherwise requires, throughout this specification, "a plurality of" means "at least two," and "including" is interpreted as open-ended or encompassing, that is, "including, but not limited to." In the description of this specification, terms such as "one embodiment," "some embodiments," "exemplary embodiment," "example," "specific example," or "some examples" are intended to indicate that a particular feature, structure, material, or characteristic associated with that embodiment or example is included in at least one embodiment or example of this specification. The illustrative representations of the above terms do not necessarily refer to the same embodiment or example.
[0025] Exemplary embodiments of the present application will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present application are shown in the drawings, it should be understood that the present application may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this application will be thorough and complete, and will fully convey the scope of the present application to those skilled in the art.
[0026] During the application process, the applicant also discovered that while Zhou Ligong's equipment and software can reliably collect and record CAN messages and have offline playback and viewing capabilities, they lack robust automated testing capabilities. Specifically, they lack an automated test script engine, have no scripting functionality, and cannot write complex automated test cases. Testing depth is insufficient; they cannot perform batch automated analysis of offline log files, such as automatically calculating the period of all messages or automatically detecting all unused bit fields. The process is isolated; the above solutions rely on manual operation and visual observation, resulting in low testing efficiency, difficulty in integrating into automated testing processes, and an inability to perform in-depth diagnostic verification of discovered problems.
[0027] To address the aforementioned problems, this application proposes a testing method, apparatus, vehicle, and medium. Please refer to [link / reference]. Figure 1 This is a flowchart illustrating a testing method provided in an embodiment of this application. Figure 1 The method shown may include the following implementation steps: S101. Obtain a log file, wherein the log file includes at least one data packet, and the log file includes an offline log file and / or an online log file.
[0028] The log files mentioned in this application can be log files collected by, for example, Zhouligong devices (such as Zhouligong CAN cards) and their accompanying software. These log files can include offline log files and / or online log files, and this application does not impose any limitations on their format. This application also does not limit the format of the log files; typically, they can be American Standard Code for Information Interchange (ASC) log files. The log files can include one or more data messages. This application does not limit the type of these data messages, as it depends on the corresponding data communication method. For example, in CAN communication, the log files can include one or more CAN messages, and this application does not impose any limitations on their type.
[0029] This application does not limit the implementation method of obtaining the above-mentioned log files. For example, this application can obtain the above-mentioned log files directly from the above-mentioned Zhouligong device and its software through the network, or read the log files pre-stored in the local database of the system through parsing libraries such as python-can. This application does not impose any restrictions on this.
[0030] S102. Based on at least one data packet in the log file, perform test analysis and fault identification to obtain the corresponding packet fault, which includes periodic stability fault and / or bit field interference fault.
[0031] The aforementioned message faults in this application can refer to specific faults or fault types occurring in the corresponding data messages, which may include, but are not limited to, combinations of any one or more of the following: periodic stability faults, bit field interference faults, or other custom message faults. Specifically, the aforementioned periodic stability faults can refer to message faults determined through message period determination, and the aforementioned bit field interference faults can refer to message faults determined through bit field determination. The specific determination or implementation methods for these two types of message faults will be detailed below in this application and will not be described here.
[0032] S103. Based on the message fault, perform diagnostic verification to obtain the corresponding test results, wherein the test results include at least the diagnostic verification results of the message fault.
[0033] This application can perform in-depth diagnosis and verification of the root cause of the above-mentioned message failures, which is a capability that existing technologies (such as native Zhou Ligong software) do not have at all, and is conducive to improving the reliability of the test.
[0034] By implementing the embodiments of this application, this application obtains log files, which include at least one data packet, and the log files include offline log files and / or online log files; based on at least one data packet in the log file, test analysis and fault identification are performed to obtain corresponding packet faults, which include periodic stability faults and / or bit field interference faults; based on the packet faults, diagnostic verification is performed to obtain corresponding test results, which at least include the diagnostic verification results of the packet faults. In this way, this application can form a closed-loop, complete automated testing process through log file acquisition, comprehensive analysis, and in-depth verification. Compared with existing technologies, this not only improves testing efficiency and reliability but also solves technical problems existing in existing technologies, such as the lack of efficient and automated means for comprehensive log file analysis, the ease of missing problems, and high testing costs.
[0035] The following describes some specific and optional embodiments related to this application.
[0036] In step S102, this application does not limit the specific implementation of the above-mentioned test analysis and fault identification. For example, this application can first perform structural parsing and reconstruction on at least one data packet in the above-mentioned log file to obtain the corresponding data frame object. In specific implementation, this application can use parsing libraries such as python-can to first parse each data packet in the above-mentioned log file into corresponding structured data, which may include, but is not limited to, structured data such as the timestamp, message identifier (such as CAN ID), data length code (DLC), and data payload of the data packet. Then, the pandas library is used to construct the parsed structured data into a corresponding data frame object, which is an object indexed by timestamp. Each row (or each row) of the data frame object represents a data packet, and the columns of the data frame represent / include the data content such as the message identifier, data length, and data payload of the data packet; this application does not impose further limitations on this. In this way, this application can convert the original time-series log file data into structured data suitable for high-performance statistics, facilitating the subsequent efficient testing process and thus improving the efficiency of the test.
[0037] After obtaining the aforementioned data frame objects, this application can perform fault identification based on these data frame objects, thereby obtaining the message fault corresponding to the aforementioned message identifier. Two possible specific implementation methods are described below.
[0038] In one implementation, the aforementioned message failure includes periodic stability failure. This application can group the aforementioned data frame objects based on the aforementioned message identifier. Specifically, this application can use the `groupby` method in the pandas library to group all data frame objects according to the message identifier, thereby obtaining a message subset for each of the aforementioned message identifiers. This message subset includes data packets with different timestamps but the same message identifier. For each message subset, this application can calculate the timestamp difference between adjacent data packets based on the message subset of the aforementioned message identifier. Specifically, this application can use the `diff` method to calculate the timestamp difference sequence between two adjacent data packets, thereby obtaining a corresponding time series. This time series can include at least one timestamp difference. Further, this application can perform a delay decision comparison based on at least one timestamp difference in the aforementioned time series. Specifically, this application can use the logical comparison function in the numpy library to compare each timestamp difference in the time series with a preset difference (e.g., 1.2 times the preset standard timestamp), obtaining a Boolean sequence that corresponds one-to-one with the aforementioned time series. Specifically, the Boolean sequence may include at least one Boolean value, which may include a true or false value. This application does not impose excessive restrictions on the specific representation of the aforementioned Boolean values; for example, 0 may represent a false value, and 1 may represent a true value. This application does not impose excessive restrictions or provide detailed descriptions in this regard.
[0039] After obtaining the aforementioned Boolean sequence, this application can further count and determine the number of consecutive occurrences of a preset Boolean value based on the Boolean sequence. Specifically, this application can use the NumPy library's arithmetic functions to count the number of consecutive occurrences of the preset Boolean value (true) in the aforementioned Boolean sequence, which can also be referred to as the number of times the limit is exceeded. If this application determines that the number of consecutive occurrences of the preset Boolean value is greater than a preset threshold, that is, when the number of consecutive times the limit is exceeded is greater than the preset threshold, this application can determine that the aforementioned message identifier (specifically, it can be a subset of messages / data packets corresponding to the aforementioned message identifier) has a periodic stability fault, that is, determine that the aforementioned message fault is the aforementioned periodic stability fault. Conversely, when it is less than or equal to the aforementioned preset threshold, it can be determined that the aforementioned message identifier does not have a periodic stability fault. The aforementioned preset threshold is a number threshold that the system or user pre-defined according to the actual situation. It can be an empirical value customized based on user experience, or it can be a statistical value calculated based on a series of experimental data. For example, the aforementioned preset threshold can be 3, etc. This application will not impose further limitations or details on this.
[0040] In another embodiment, the aforementioned message fault includes bit field interference faults. This application can decode the data payload in the aforementioned data frame object. Specifically, for example, it can use bit manipulation functions from the NumPy library (such as the `unpackbits` function) to decode the data payload in all data frame objects, converting / parsing the original hexadecimal byte data payload into a corresponding binary matrix. Then, through array slicing and other operations, it can accurately extract the preset bit fields in the corresponding data message from the aforementioned binary matrix. These preset bit fields can refer to bit fields in the aforementioned data message that are pre-defined by the system, such as unused bit fields or reserved bit fields, etc. This application does not impose further limitations on this. Furthermore, this application can perform bit field judgment on the binary values of the aforementioned preset bit fields in the aforementioned binary matrix. Specifically, for example, this application can use logical functions such as `any` or `all` from the NumPy library to determine whether the binary values on these preset bit fields remain constant or undergo a sudden change, such as all being 0 or 1, thereby obtaining the corresponding judgment result. This judgment result is used to indicate whether the binary values on the aforementioned preset bit fields remain constant or undergo a sudden change. If the above judgment result is used to indicate that the binary value on the above preset bit field has changed abruptly, that is, it has not remained constant, then this application can determine that the message fault corresponding to the above data message is a bit field interference fault. This application will not impose any further limitations or details on this.
[0041] In step S103, this application does not limit the specific implementation of the above-mentioned diagnostic verification. For example, this application can query and obtain the internal data of the Electronic Control Unit (ECU) through a diagnostic service request, such as ReadDTCInformation (0x19). This internal data can at least include the ECU's self-test faults, and optionally also include internal status or other custom information. This application does not impose further limitations on this. In specific implementation, this application can construct and send a diagnostic service request conforming to Unified Diagnostic Services (UDS) (hereinafter referred to as a UDS request) through the Application Programming Interface (API) provided by a ZLG device (such as a USB-CAN card). Specifically, the diagnostic service request can be sent to the ECU. This diagnostic service request is used to request to obtain / read the internal data of the ECU. Correspondingly, after receiving the diagnostic service request, the ECU can obtain its own internal data and return a corresponding diagnostic service response to the API interface. The diagnostic service response carries the internal data of the ECU, such as the ECU's self-test faults. Accordingly, after receiving the diagnostic service response through the aforementioned API interface, this application can parse and obtain the internal data of the electronic control unit (ECU), such as the ECU's self-test faults.
[0042] Furthermore, this application can verify and compare the aforementioned message faults and self-test faults. Specifically, for example, this application can cross-verify and compare the message faults obtained from the analysis of the aforementioned log files and the aforementioned self-test faults to determine whether the aforementioned message faults and the aforementioned self-test faults are the same, thereby obtaining the corresponding diagnostic verification results, completing the in-depth diagnosis of the root cause of the message fault, and improving the reliability of the test. Optionally, when the aforementioned message faults and the aforementioned self-test faults are not the same, this application can also provide early warning prompts, such as prompting that there are defects or bugs in the system software that need to be fixed in a timely manner. This application does not impose further limitations or details on this.
[0043] In some optional embodiments, this application can also generate corresponding test reports based on the above test results. The above test results and / or the above test reports may include, but are not limited to, data packets in the above log files, the above-determined packet faults, the above-mentioned diagnostic verification results, or other custom information or data. This application does not limit the format or specific form of the above test reports. For example, it may be a comma-separated values (CSV) test report. Taking the above CSV test report as an example, specifically, this application can reorganize and construct the above-mentioned data packets in the above log files, the above-mentioned packet faults, and the above-mentioned diagnostic verification results into a new data frame object using the pandas library, and then export it as a CSV test report with structured data using the to_csv method. This application does not impose further limitations or details on this.
[0044] In some alternative embodiments, if no corresponding message fault is identified / detected during the fault identification process described above, this application can also generate and output a corresponding test report for the user to view. This test report can provide information such as the absence of the corresponding message fault in the log file. This application does not impose further limitations on this aspect. For a detailed description of the test report, please refer to the relevant descriptions in the previous embodiments; they will not be repeated here.
[0045] As can be seen, this application successfully overcomes the shortcomings of existing Zhouligong testing equipment in terms of automated testing capabilities, constructing a closed-loop testing solution integrating log file acquisition, comprehensive analysis, and in-depth verification. Compared with existing technologies that rely on manual operation and visual observation, this application's solution achieves a leap from passive data collection to proactive intelligent diagnosis. This application can perform comprehensive, automatic, and in-depth analysis of log files collected by Zhouligong equipment, using algorithms such as continuous delay decision and bit-domain decision to accurately identify complex problems such as periodic stability faults and bit-domain interference faults, completely replacing the inefficient and error-prone manual analysis process. Furthermore, this application also utilizes the hardware resources of existing Zhouligong equipment, giving it proactive verification capabilities by integrating UDS diagnostic service requests. Specifically, after analyzing message faults in the log files, this application can automatically drive the Zhouligong card's API interface to send a diagnostic service request to the electronic control unit (ECU) under test, querying the ECU's internal data, forming a closed-loop testing process from test analysis to diagnostic verification, achieving in-depth tracing of the root cause of message faults. This not only greatly improves testing efficiency and accuracy, but also reduces reliance on testers and expensive tools, upgrading common data collection tools to more powerful automated testing and diagnostic systems, significantly reducing testing costs and improving testing efficiency and accuracy.
[0046] Based on the above embodiments, please refer to Figure 2 This is a schematic diagram of the structure of a testing device provided in an embodiment of this application. Figure 2 The apparatus shown may include an acquisition module 201 and a processing module 202, wherein: The acquisition module 201 is used to acquire a log file, the log file including at least one data packet, and the log file including an offline log file and / or an online log file; The processing module 202 is used to perform test analysis and fault identification based on at least one data packet in the log file to obtain the corresponding packet fault, the packet fault including periodic stability fault and / or bit field interference fault. The processing module 202 is further configured to perform diagnostic verification based on the message fault and obtain corresponding test results, wherein the test results include at least the diagnostic verification results of the message fault.
[0047] In some embodiments, the processing module 202 is specifically used for: At least one data packet in the log file is parsed and reconstructed to obtain a corresponding data frame object. The row of the data frame object represents a data packet, and the row and column of the data frame object represent the packet identifier, data length and data payload of the data packet. Fault identification is performed based on the data frame object to obtain the message fault corresponding to the message identifier.
[0048] In some embodiments, the message failure includes a periodic stability failure, and the processing module 202 is specifically used for: The data frame objects are grouped based on the message identifier to obtain a message subset of the message identifier, and the message subset includes the data packets with different timestamps; The timestamp difference between adjacent data packets is calculated based on a subset of packets identified by the packet identifier to obtain a corresponding time series, wherein the time series includes at least one timestamp difference. A decision comparison is made based on at least one timestamp difference in the time series to obtain a corresponding Boolean sequence, wherein the Boolean sequence corresponds one-to-one with the time series. When the number of consecutive occurrences of a preset Boolean value is greater than a preset threshold, the message failure is determined to be a periodic stability failure.
[0049] In some embodiments, the message fault includes a bit field interference fault, and the processing module 202 is specifically used for: The data payload in the data frame object is decoded to obtain the corresponding binary matrix, and the binary matrix includes at least a preset bit field corresponding to the data packet; Bit-field decision is performed on the binary value of the preset bit field in the binary matrix to obtain the corresponding decision result, which is used to indicate whether the binary value of the preset bit field has undergone a sudden change; When the judgment result indicates that the binary value of the preset bit field has changed abruptly, the message fault is determined to be the bit field interference fault.
[0050] In some embodiments, the processing module 202 is specifically used for: The diagnostic service requests query internal data of the electronic control unit, which includes at least the self-test faults of the electronic control unit. The self-test fault and the message fault are verified and compared to obtain the diagnostic verification result.
[0051] In some embodiments, the processing module 202 is specifically used for: The diagnostic service request is sent to the electronic control unit via the application programming interface. The diagnostic service request is used to request the acquisition of internal data of the electronic control unit. Receive a diagnostic service response from the electronic control unit, the diagnostic service response including internal data of the electronic control unit.
[0052] In some embodiments, the processing module 202 is further configured to: A corresponding test report is generated based on the test results. The test report includes the data packet, the packet fault, and the diagnostic verification results.
[0053] By implementing the embodiments of this application, the above-described apparatus can acquire log files, which include at least one data packet, and include offline log files and / or online log files; perform test analysis and fault identification based on at least one data packet in the log file to obtain corresponding packet faults, which include periodic stability faults and / or bit field interference faults; perform diagnostic verification based on the packet faults to obtain corresponding test results, which at least include the diagnostic verification results of the packet faults. Thus, this application can form a closed-loop, complete automated testing process through log file acquisition, comprehensive analysis, and in-depth verification; in particular, the above-described diagnostic verification is a capability completely lacking in existing technologies (such as native Zhou Ligong software), which is beneficial for improving test reliability. Compared with existing technologies, this application not only improves testing efficiency and reliability but also solves technical problems existing in existing technologies, such as the lack of efficient and automated means for comprehensive analysis of log files, the ease of missing problems, and high testing costs.
[0054] Please see Figure 3This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. For example... Figure 3 The electronic device shown can be a mobile phone, computer, digital broadcasting terminal, messaging device, game console, tablet device, medical device, fitness equipment, personal digital assistant, etc. This electronic device can be used in various types of vehicles, etc.
[0055] Reference Figure 3 The electronic device 300 may include one or more of the following components: processing component 302, memory 304, power supply component 306, multimedia component 308, audio component 310, input / output interface 312, sensor component 314, and communication component 316.
[0056] Processing component 302 typically controls the overall operation of electronic device 300, such as operations associated with display, telephone calls, data communication, camera operation, and recording. Processing component 302 may include one or more processors 320 to execute instructions to complete all or part of the steps of the aforementioned test method. Furthermore, processing component 302 may include one or more modules to facilitate interaction between processing component 302 and other components. For example, processing component 302 may include a multimedia module to facilitate interaction between multimedia component 308 and processing component 302.
[0057] Memory 304 is configured to store various types of data to support the operation of electronic device 300. Examples of such data include instructions for any application or method operating on electronic device 300, contact data, phonebook data, messages, pictures, videos, etc. Memory 304 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0058] Power supply component 306 provides power to various components of electronic device 300. Power supply component 306 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic device 300.
[0059] Multimedia component 308 includes a screen that provides an output interface between the electronic device 300 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of the touch or swipe action but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 308 includes a front-facing camera and / or a rear-facing camera. When the electronic device 300 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or the rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
[0060] Audio component 310 is configured to output and / or input audio signals. For example, audio component 310 includes a microphone (MIC) configured to receive external audio signals when electronic device 300 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 304 or transmitted via communication component 316. In some embodiments, audio component 310 also includes a speaker for outputting audio signals.
[0061] Input / output interface 312 provides an interface between processing component 302 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, start buttons, and lock buttons.
[0062] Sensor assembly 314 includes one or more sensors for providing state assessments of various aspects of electronic device 300. For example, sensor assembly 314 can detect the on / off state of electronic device 300, the relative positioning of components such as the display and keypad of electronic device 300, changes in position of electronic device 300 or a component of electronic device 300, the presence or absence of user contact with electronic device 300, orientation or acceleration / deceleration of electronic device 300, and temperature changes of electronic device 300. Sensor assembly 314 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 314 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 314 may also include an accelerometer, gyroscope, magnetometer, pressure sensor, or temperature sensor.
[0063] Communication component 316 is configured to facilitate wired or wireless communication between electronic device 300 and other devices. Electronic device 300 can access wireless networks based on communication standards, such as WiFi, 2G, or 3G, or combinations thereof. In one exemplary embodiment, communication component 316 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 316 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0064] In an exemplary embodiment, the electronic device 300 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above-described test methods.
[0065] Understandably, the processor 320 in this embodiment can be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method embodiment can be completed by integrated logic circuits in the processor's hardware or by software instructions. The processor described above can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0066] Understandably, the memory 304 in the embodiments of this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous linked dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM). It should be noted that the memory used in the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0067] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 304 including instructions, which can be executed by a processor 320 of an electronic device 300 to complete the above-described upper-level testing method. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0068] The aforementioned device can be a standalone electronic device or a part of a standalone electronic device. For example, in one embodiment, the device can be an integrated circuit (IC) or a chip, wherein the integrated circuit can be a single IC or a collection of multiple ICs. The chip can include, but is not limited to, the following types: GPU (Graphics Processing Unit), CPU (Central Processing Unit), FPGA (Field Programmable Gate Array), DSP (Digital Signal Processor), ASIC (Application Specific Integrated Circuit), and SoC (System on Chip). The aforementioned integrated circuit or chip can be used to execute executable instructions (or code) to implement the aforementioned test method. The executable instructions can be stored in the integrated circuit or chip or obtained from other devices or equipment. For example, the integrated circuit or chip includes a processor, memory, and an interface for communicating with other devices. The executable instruction can be stored in the memory, and when the executable instruction is executed by the processor, the above test method can be implemented; or, the integrated circuit or chip can receive the executable instruction through the interface and transmit it to the processor for execution to implement the above test method.
[0069] Please see Figure 4 This is a schematic diagram of the structure of a vehicle provided in an embodiment of this application. For example, as shown... Figure 4 As shown, the vehicle 400 includes a memory 401 and a processor 402. The memory 401 stores executable program code 4011, and the processor 402 is used to call and execute the executable program code 4011 to perform a test method.
[0070] This application embodiment can divide the vehicle into functional modules according to the above method embodiment. For example, each function can be assigned to a separate module, or two or more functions can be integrated into a processing module. The integrated module can be implemented in hardware. It should be noted that the module division in this embodiment is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods. When dividing each functional module according to its corresponding function, the vehicle may include a processing module and a communication module, etc.
[0071] It should be noted that all relevant content of each step involved in the above method embodiments can be referenced from the functional description of the corresponding functional module, and will not be repeated here. The vehicle provided in this embodiment is used to execute one of the above-described testing methods, and therefore can achieve the same effect as the above-described implementation method.
[0072] In another exemplary embodiment, a computer program product is also provided, the computer program product comprising a computer program executable by a programmable device, the computer program having a code portion for performing the above-described test method when executed by the programmable device.
[0073] It should be noted that the descriptions of the above embodiments of storage media, devices, and equipment are similar to the descriptions of the above method embodiments, and have similar beneficial effects. For technical details not disclosed in the embodiments of storage media, devices, and equipment of this application, please refer to the descriptions of the method embodiments of this application for understanding.
[0074] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of this application. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed in this application. The specification and embodiments are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.
[0075] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications or equivalent substitutions made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A testing method, characterized in that, include: Obtain a log file, the log file including at least one data packet, the log file including an offline log file and / or an online log file; Test analysis and fault identification are performed based on at least one data packet in the log file to obtain the corresponding packet fault, which includes periodic stability fault and / or bit field interference fault. Diagnostic verification is performed based on the message fault to obtain corresponding test results, and the test results include at least the diagnostic verification results of the message fault.
2. The method according to claim 1, characterized in that, The test analysis and fault identification based on at least one data packet in the log file, resulting in corresponding packet faults, include: At least one data packet in the log file is parsed and reconstructed to obtain a corresponding data frame object. The row of the data frame object represents a data packet, and the row and column of the data frame object represent the packet identifier, data length and data payload of the data packet. Fault identification is performed based on the data frame object to obtain the message fault corresponding to the message identifier.
3. The method according to claim 2, characterized in that, The message fault includes periodic stability faults, and the fault identification based on the data frame object to obtain the message fault corresponding to the message identifier includes: The data frame objects are grouped based on the message identifier to obtain a message subset of the message identifier, and the message subset includes the data packets with different timestamps; The timestamp difference between adjacent data packets is calculated based on a subset of packets identified by the packet identifier to obtain a corresponding time series, wherein the time series includes at least one timestamp difference. A decision comparison is made based on at least one timestamp difference in the time series to obtain a corresponding Boolean sequence, wherein the Boolean sequence corresponds one-to-one with the time series. When the number of consecutive occurrences of a preset Boolean value is greater than a preset threshold, the message failure is determined to be a periodic stability failure.
4. The method according to claim 2, characterized in that, The message fault includes bit field interference faults, and the fault identification based on the data frame object to obtain the message fault corresponding to the message identifier includes: The data payload in the data frame object is decoded to obtain the corresponding binary matrix, and the binary matrix includes at least a preset bit field corresponding to the data packet; Bit-field decision is performed on the binary value of the preset bit field in the binary matrix to obtain the corresponding decision result, which is used to indicate whether the binary value of the preset bit field has undergone a sudden change; When the judgment result indicates that the binary value of the preset bit field has changed abruptly, the message fault is determined to be the bit field interference fault.
5. The method according to claim 1, characterized in that, The diagnostic verification based on the message fault includes: The diagnostic service requests query internal data of the electronic control unit, which includes at least the self-test faults of the electronic control unit. The self-test fault and the message fault are verified and compared to obtain the diagnostic verification result.
6. The method according to claim 5, characterized in that, The request to query the internal data of the electronic control unit via diagnostic services includes: The diagnostic service request is sent to the electronic control unit via the application programming interface. The diagnostic service request is used to request the acquisition of internal data of the electronic control unit. Receive a diagnostic service response from the electronic control unit, the diagnostic service response including internal data of the electronic control unit.
7. The method according to any one of claims 1-6, characterized in that, The method further includes: A corresponding test report is generated based on the test results. The test report includes the data packet, the packet fault, and the diagnostic verification results.
8. A testing device, characterized in that, include: An acquisition module is used to acquire a log file, the log file including at least one data packet, the log file including an offline log file and / or an online log file; The processing module is used to perform test analysis and fault identification based on at least one data packet in the log file to obtain the corresponding packet fault, which includes periodic stability fault and / or bit field interference fault. The processing module is also used to perform diagnostic verification based on the message fault and obtain corresponding test results, wherein the test results include at least the diagnostic verification results of the message fault.
9. A vehicle, characterized in that, include: processor; A memory for storing processor-executable instructions; wherein the processor is configured to execute the executable instructions to implement the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having computer program instructions stored thereon, characterized in that, When the computer program instructions are executed by the processor, they implement the steps of the method according to any one of claims 1 to 7.