CAN signal detection method and device, electronic equipment, storage medium and program product
By filtering the signal parameters required by the target vehicle model from the CAN signal matrix and detecting the CAN signal according to the detection mode, the problems of low efficiency, high error rate and long time caused by manual writing of test scripts in the prior art are solved, and the problem of low efficiency, high error rate and long time is achieved. Efficient and accurate CAN signal detection.
Patent Information
- Application Number
- CN202411345285.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-25
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2044-09-25
AI Technical Summary
In the prior art, the verification of CAN signals by manually writing or adjusting test scripts has problems such as low efficiency, high error rate and long time.
By obtaining the CAN signal matrix and the database connection of the target vehicle model, filter the signal parameters of the target vehicle model required by the target vehicle model, and detect the target CAN signal according to the selected detection mode (manual mode or automatic mode) to output the acceptance result.
This method can avoid signal omissions or signal viewing errors, save time for acceptance personnel, and is suitable for CAN signal detection of any vehicle model, solving the problems of low efficiency, high error rate and long time.
Smart Images

Figure CN119473828A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of vehicle technology, and in particular to a CAN signal detection method, device, electronic device, storage medium and program product. Background Art
[0002] When developing an intelligent driving system, acceptance and testing of the vehicle signal level is carried out to prevent problems such as vehicle faults or vehicle software development errors that may cause monitoring signals of certain vehicle components to report errors or the vehicle to be unable to respond to the wire control handshake and become uncontrolled.
[0003] In related technologies, CAN devices such as CANoE and Zhou Ligong are generally used to access the vehicle CAN network for vehicle signal testing and acceptance. In the actual implementation process, for different vehicle models and communication matrices, testers often need to manually write or adjust test scripts to verify signals, which takes a long time and may have the risk of signal omissions or signal viewing errors, resulting in low accuracy of test results. Summary of the invention
[0004] The present application provides a CAN signal detection method, device, electronic device, storage medium and program product to solve the problems of low efficiency, high error rate and long time spent in manually writing or adjusting test scripts to verify signals in the related art.
[0005] The first aspect of the present application provides a CAN signal detection method, comprising the following steps: obtaining a database connection between a CAN signal matrix and a target vehicle model; filtering signal parameters of a target CAN signal of a target vehicle model from the CAN signal matrix according to the database connection, and identifying a target detection mode of the target CAN signal input into a visual interface; detecting the target CAN signal according to the signal parameters and the target detection mode of the target CAN signal, and determining an acceptance result of the target CAN signal of the target vehicle model according to the detection result of the target CAN signal.
[0006] Optionally, the target detection mode includes a manual mode and an automatic mode, and the target CAN signal is detected according to the signal parameters of the target CAN signal and the target detection mode, including: if the target mode is a manual mode, the target CAN signal is manually detected according to the signal parameters; if the target mode is an automatic mode, the target CAN signal is automatically detected according to the signal parameters.
[0007] Optionally, the signal parameters of the target CAN signal include at least one of a signal ID, a signal name and a signal value.
[0008] Optionally, the target CAN signal is manually detected according to the signal parameters, including: inputting a signal ID in a visual interface; and detecting the target CAN signal according to relevant content of the signal ID displayed on the visual interface.
[0009] Optionally, the target CAN signal is automatically detected according to the signal parameters, including: importing at least one of the signal ID, signal name and signal value into the target template; setting the target detection duration, and assigning the target detection duration to the local variables of the automatic detection script; reading the target template through the automatic detection script, and reading the signal value through the automatic detection script in each preset period and assigning it to the local variables of the automatic detection script; in each preset period, determining the detection result of the target CAN signal according to the local variables, and stopping the automatic detection until the current detection duration reaches the target detection duration.
[0010] Optionally, after stopping the automatic detection when the current detection duration reaches the target detection duration, the method further includes: generating an end prompt of the automatic detection of the target CAN signal.
[0011] The second aspect of the present application provides a CAN signal detection device, including: an acquisition module, used to obtain a CAN signal matrix and a database connection of a target vehicle model; a screening module, used to screen the signal parameters of a target CAN signal of a target vehicle model from the CAN signal matrix according to the database connection, and identify a target detection mode of the target CAN signal input in a visual interface; a detection module, used to detect the target CAN signal according to the signal parameters and the target detection mode of the target CAN signal, and determine an acceptance result of the target CAN signal of the target vehicle model according to the detection result of the target CAN signal.
[0012] Optionally, the target detection mode includes a manual mode and an automatic mode, and the detection module is further used to manually detect the target CAN signal according to the signal parameters when the target mode is the manual mode; and to automatically detect the target CAN signal according to the signal parameters when the target mode is the automatic mode.
[0013] Optionally, the signal parameters of the target CAN signal include at least one of a signal ID, a signal name and a signal value.
[0014] Optionally, the detection module is further used to input a signal ID in a visual interface; and detect the target CAN signal according to relevant content of the signal ID displayed on the visual interface.
[0015] Optionally, the detection module is further used to import at least one including a signal ID, a signal name and a signal value into a target template; set a target detection duration, and assign the target detection duration to a local variable of an automatic detection script; read the target template through the automatic detection script, and read the signal value through the automatic detection script in each preset period and assign it to a local variable of the automatic detection script; in each preset period, determine the detection result of the target CAN signal according to the local variable, and stop the automatic detection until the current detection duration reaches the target detection duration.
[0016] Optionally, the CAN signal detection device further comprises: a generation module, configured to generate a prompt for ending the automatic detection of the target CAN signal after the automatic detection is stopped when the current detection duration reaches the target detection duration.
[0017] The third aspect of the present application provides an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement a CAN signal detection method as described in the above embodiment.
[0018] The fourth aspect of the present application provides a computer-readable storage medium on which a computer program or instruction is stored. The program or instruction is executed by a processor to implement the CAN signal detection method as described in the above embodiment.
[0019] The fifth aspect of the present application provides a computer program product, including a computer program or instructions, which, when executed, are used to implement the CAN signal detection method as described in the above embodiment.
[0020] Therefore, this application includes the following beneficial effects:
[0021] The embodiment of the present application can filter out the signal parameters of the target CAN signal required by the target vehicle model from the CAN signal matrix, avoiding the occurrence of problems such as signal omission or signal viewing errors, and determining the corresponding test method according to the selected test mode to detect the target CAN signal and output the acceptance result, which can save a lot of time for acceptance personnel, and does not require the development of test personnel to write new scripts, and is suitable for CAN signal detection of any vehicle model. Therefore, the problems of low efficiency, high error rate and long time spent in the related art of manually writing or adjusting test scripts to verify signals are solved.
[0022] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0024] Figure 1 A flowchart of a CAN signal detection method provided according to an embodiment of the present application;
[0025] Figure 2 This is an example diagram of CAN signal detection provided according to an embodiment of the present application;
[0026] Figure 3 This is an example diagram of a CAN signal detection device provided according to an embodiment of the present application;
[0027] Figure 4 It is a schematic diagram of the structure of an electronic device provided according to an embodiment of the present application. DETAILED DESCRIPTION
[0028] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.
[0029] The following describes the CAN signal detection method, device, electronic device, storage medium and program product of the embodiment of the present application with reference to the accompanying drawings. In view of the problems mentioned in the above background technology, the present application provides a CAN signal detection method, in which the signal parameters of the target CAN signal required by the target vehicle model are screened out from the CAN signal matrix, thereby avoiding the occurrence of problems such as signal omission or signal viewing error, and determining the corresponding test method according to the selected test mode to detect the target CAN signal, and output the acceptance result, which can save a lot of time for the acceptance personnel, and does not require the development of test personnel to write new scripts, and is suitable for CAN signal detection of any vehicle model. Thus, the problems of low efficiency, high error rate and long time spent in the related art of manually writing or adjusting the test script to verify the signal are solved.
[0030] Specifically, Figure 1 A flowchart of a CAN signal detection method provided in an embodiment of the present application.
[0031] like Figure 1 As shown, the CAN signal detection method includes the following steps:
[0032] In step S101, a CAN signal matrix and a database connection of a target vehicle type are obtained.
[0033] The CAN signal matrix is a table or database document used to describe the signal transmission rules in the CAN bus system. The embodiment of the present application establishes a database connection between the CAN signal matrix and the target vehicle model to obtain documents related to the target vehicle model, including DBC files and other technical documents.
[0034] In step S102, signal parameters of a target CAN signal of a target vehicle model are screened from a CAN signal matrix according to a database connection, and a target detection mode of the target CAN signal inputted into a visualization interface is identified.
[0035] It can be understood that the embodiment of the present application can filter the signal parameters of the target CAN signal required by the target vehicle model from the CAN signal matrix according to the DBC file, including at least one of the signal ID, signal name and signal value.
[0036] In the embodiment of the present application, the target detection mode includes a manual mode and an automatic mode. Different detection modes perform different detection methods. The manual mode is usually used to observe signal changes in real time, while the automatic mode is suitable for batch testing under preset conditions, which can improve test efficiency. In the actual execution process, the embodiment of the present application can determine the target detection mode of the target CAN signal according to the user's selection on the visual interface, wherein the window of the visual interface can be created by the user through capl or other methods, without specific limitation.
[0037] In step S103, the target CAN signal is detected according to the signal parameters of the target CAN signal and the target detection mode, and the target CAN signal acceptance result of the target vehicle model is determined according to the detection result of the target CAN signal.
[0038] It can be understood that if the user selects the target mode as manual mode on the visualization interface, the embodiment of the present application will manually detect the target CAN signal according to the signal parameters; if the user selects the target mode as automatic mode on the visualization interface, the embodiment of the present application will automatically detect the target CAN signal according to the signal parameters.
[0039] Specifically, the target CAN signal is manually detected according to the signal parameters, including: inputting a signal ID in a visual interface; and detecting the target CAN signal according to relevant content of the signal ID displayed on the visual interface.
[0040] like Figure 2As shown, in the embodiment of the present application, by manually inputting the signal ID in the visual interface, when clicking to start the test, the signal value under the signal ID can be observed in real time in the visual interface. If the signal value is consistent with the expected value and no abnormal situation (such as signal interruption) occurs, the signal acceptance result is passed. If the signal value deviates from the expected value, or there is an abnormal situation, the signal acceptance result is failed.
[0041] In one embodiment of the present application, the target CAN signal is automatically detected according to the signal parameters, including: importing at least one of the signal ID, signal name and signal value into the target template; setting the target detection duration, assigning the target detection duration to the local variables of the automatic detection script; reading the target template through the automatic detection script, and assigning the signal value to the local variables of the automatic detection script through the automatic detection script in each preset period; in each preset period, determining the detection result of the target CAN signal according to the local variables, until the current detection duration reaches the target detection duration, stop the automatic detection. The target detection duration can be set by the user according to the actual situation, such as setting it to 30 minutes, without specific insurance.
[0042] The target template can be an Excel template. Before starting the automatic detection, Figure 2 As shown, the embodiment of the present application imports the screened signals into the Excel template in advance, and imports the Excel template into the project after the project starts to determine the signal value required for the automatic test script verification, and after entering the detection time, click the automatic detection button to start the automatic detection. After the detection time expires, the selected signal will be automatically screened out for display and the verification result will be given.
[0043] Specifically, when the automatic detection mode starts, the window prompts: "Automated detection starts", and the detection time is assigned to the local variables in the automatic detection script. The automatic detection script reads Excel, assigns the read signal name to the local variable, and creates a local variable for detecting the status corresponding to each signal value. In each fixed cycle, the script reads the bus signal value in real time and assigns it to the local variable. The automatic detection script performs logical judgment on the local variable. If it is the correct value in the Excel template, the local variable used to detect the status is set to 1, otherwise it is set to 0. If the local variable used to detect the status is 1, the signal name and "P" are written to the last two columns of the original table, indicating that the acceptance is passed. If the local variable used to detect the status is 0, the signal name and "S" are written to the last two columns of the original table, indicating that the acceptance has failed.
[0044] Furthermore, after the automatic detection is stopped when the current detection duration reaches the target detection duration, the embodiment of the present application can also generate an end prompt for the automatic detection of the target CAN signal, such as a prompt in the window "Automatic detection has ended, please continue the operation", or an end prompt through voice broadcast.
[0045] According to the CAN signal detection method proposed in the embodiment of the present application, the signal parameters of the target CAN signal required by the target vehicle model are screened out from the CAN signal matrix, thereby avoiding the occurrence of problems such as signal omission or signal viewing errors. The corresponding test method is determined according to the selected test mode to detect the target CAN signal and output the acceptance result, which can save a lot of time for acceptance personnel and does not require the development of test personnel to write new scripts. It is suitable for CAN signal detection of any vehicle model. Therefore, the problems of low efficiency, high error rate and long time spent in the related art of manually writing or adjusting test scripts to verify signals are solved.
[0046] Next, the CAN signal detection device proposed according to the embodiment of the present application is described with reference to the accompanying drawings.
[0047] Figure 3 It is a block diagram of a CAN signal detection device according to an embodiment of the present application.
[0048] like Figure 3 As shown, the CAN signal detection device 10 includes: an acquisition module 100 , a screening module 200 and a detection module 300 .
[0049] Among them, the acquisition module 100 is used to obtain the database connection of the CAN signal matrix and the target vehicle model; the screening module 200 is used to screen the signal parameters of the target CAN signal of the target vehicle model from the CAN signal matrix according to the database connection, and identify the target detection mode of the target CAN signal input in the visual interface; the detection module 300 is used to detect the target CAN signal according to the signal parameters and the target detection mode of the target CAN signal, and determine the acceptance result of the target CAN signal of the target vehicle model according to the detection result of the target CAN signal.
[0050] In one embodiment of the present application, the target detection mode includes a manual mode and an automatic mode, and the detection module 300 is further used to manually detect the target CAN signal according to the signal parameters when the target mode is the manual mode; and to automatically detect the target CAN signal according to the signal parameters when the target mode is the automatic mode.
[0051] In one embodiment of the present application, the signal parameters of the target CAN signal include at least one of a signal ID, a signal name, and a signal value.
[0052] In one embodiment of the present application, the detection module 300 is further used to input a signal ID in a visual interface; and detect the target CAN signal according to relevant content of the signal ID displayed on the visual interface.
[0053] In one embodiment of the present application, the detection module 300 is further used to import at least one including a signal ID, a signal name and a signal value into a target template; set a target detection duration, and assign the target detection duration to a local variable of an automatic detection script; read the target template through the automatic detection script, and read the signal value through the automatic detection script in each preset cycle and assign it to a local variable of the automatic detection script; in each preset cycle, determine the detection result of the target CAN signal according to the local variable, and stop the automatic detection until the current detection duration reaches the target detection duration.
[0054] In one embodiment of the present application, the CAN signal detection device 10 further includes: a generation module, wherein the generation module is used to generate a prompt for ending the automatic detection of the target CAN signal after the automatic detection is stopped when the current detection duration reaches the target detection duration.
[0055] It should be noted that the above explanation of the embodiment of the CAN signal detection method is also applicable to the CAN signal detection device of this embodiment, and will not be repeated here.
[0056] According to the CAN signal detection device proposed in the embodiment of the present application, by screening out the signal parameters of the target CAN signal required by the target vehicle model from the CAN signal matrix, the occurrence of problems such as signal omission or signal viewing error is avoided, and the corresponding test method is determined according to the selected test mode to detect the target CAN signal, and the acceptance result is output, which can save a lot of time for acceptance personnel, and there is no need for development test personnel to write new scripts, and it is suitable for CAN signal detection of any vehicle model. Therefore, the problems of low efficiency, high error rate and long time spent in the related art of manually writing or adjusting test scripts to verify signals are solved.
[0057] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device may include:
[0058] Memory 401 , processor 402 , and a computer program stored in the memory 401 and executable on the processor 402 .
[0059] When the processor 402 executes the program, the CAN signal detection method provided in the above embodiment is implemented.
[0060] Furthermore, the electronic device further comprises:
[0061] The communication interface 403 is used for communication between the memory 401 and the processor 402 .
[0062] The memory 401 is used to store computer programs that can be executed on the processor 402 .
[0063] The memory 401 may include a high-speed RAM (Random Access Memory) memory, and may also include a non-volatile memory, such as at least one disk memory.
[0064] If the memory 401, the processor 402 and the communication interface 403 are implemented independently, the communication interface 403, the memory 401 and the processor 402 can be connected to each other through a bus and communicate with each other. The bus can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0065] Optionally, in a specific implementation, if the memory 401, the processor 402 and the communication interface 403 are integrated on a chip, the memory 401, the processor 402 and the communication interface 403 can communicate with each other through an internal interface.
[0066] The processor 402 may be a CPU (Central Processing Unit), or an ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present application.
[0067] An embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the above-mentioned CAN signal detection method is implemented.
[0068] An embodiment of the present application also provides a computer program product, including a computer program or instructions, which, when executed, are used to implement the above CAN signal detection method.
[0069] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms are not necessarily directed to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or N embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0070] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of this application, "N" means at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0071] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or N executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.
[0072] It should be understood that the various parts of the present application can be implemented in hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, the steps or methods can be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array, a field programmable gate array, etc.
[0073] A person of ordinary skill in the art may understand that all or part of the steps carried by the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the above-mentioned program may be stored in a computer-readable storage medium, which, when executed, includes one of the steps of the method embodiment or a combination thereof.
[0074] Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limitations on the present application. Ordinary technicians in this field can change, modify, replace and modify the above embodiments within the scope of the present application.
Claims
1. A CAN signal detection method, characterized in that: The following steps are involved: Get the CAN signal matrix and the database connection of the target vehicle model; Filtering signal parameters of the target CAN signal of the target vehicle model from the CAN signal matrix according to the database connection, and identifying a target detection mode of the target CAN signal inputted by the visualization interface; The target CAN signal is detected according to the signal parameters of the target CAN signal and the target detection mode, and the target CAN signal acceptance result of the target vehicle model is determined according to the detection result of the target CAN signal.
2. The CAN signal detection method according to claim 1, characterized in that: The target detection mode includes a manual mode and an automatic mode, and the detecting the target CAN signal according to the signal parameter of the target CAN signal and the target detection mode includes: If the target mode is a manual mode, manually detecting the target CAN signal according to the signal parameters; If the target mode is the automatic mode, the target CAN signal is automatically detected according to the signal parameters.
3. The CAN signal detection method according to claim 2, characterized in that: The signal parameter of the target CAN signal includes at least one of a signal ID, a signal name and a signal value.
4. The CAN signal detection method according to claim 3, characterized in that: Manually detecting the target CAN signal according to the signal parameter includes: Input the signal ID in the visual interface; The target CAN signal is detected according to the relevant content of the signal ID displayed on the visualization interface.
5. The CAN signal detection method according to claim 3, characterized in that: The automatic detection of the target CAN signal according to the signal parameter includes: importing at least one of a signal ID, a signal name, and a signal value into a target template; Set the target detection duration, and assign the target detection duration to a local variable of the automatic detection script; The target template is read by the automatic detection script, and a signal value is read by the automatic detection script and assigned to a local variable of the automatic detection script in each preset cycle; In each preset cycle, the detection result of the target CAN signal is determined according to the local variable, and automatic detection is stopped when the current detection duration reaches the target detection duration.
6. The CAN signal detection method according to claim 5, characterized in that: After the automatic detection is stopped until the current detection duration reaches the target detection duration, the method further includes: Generate an end prompt of the automatic detection of the target CAN signal.
7. A CAN signal detection device, characterized in that: include: Acquisition module, used to obtain the CAN signal matrix and the database connection of the target vehicle model; A screening module, for screening signal parameters of a target CAN signal of the target vehicle model from the CAN signal matrix according to the database connection, and identifying a target detection mode of the target CAN signal inputted by a visual interface; The detection module is used to detect the target CAN signal according to the signal parameters of the target CAN signal and the target detection mode, and determine the target CAN signal acceptance result of the target vehicle model according to the detection result of the target CAN signal.
8. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the CAN signal detection method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program or instruction stored thereon, characterized in that: When the computer program or instruction is executed, the CAN signal detection method according to any one of claims 1 to 6 is implemented.
10. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed, the CAN signal detection method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Automatic testing method and device, electronic equipment and storage medium
CN115757483A
CAN signal test method and system, electronic equipment and storage medium
CN115941565A
Data testing method and testing device based on communication matrix protocol
CN116016254A
CAN configuration file and code generation method and device, equipment and medium
CN118276841A