Can signal detection method and device, electronic equipment, storage medium and program product
By filtering the signal parameters of the target vehicle model from the CAN signal matrix and selecting the detection mode, and using an automatic detection script to perform CAN signal detection, the problems of low efficiency and high error rate in the existing technology are solved, and efficient and accurate CAN signal acceptance is achieved.
Patent Information
- Application Number
- CN202411345285.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-25
- Publication Date
- 2025-12-05
- Estimated Expiration
- 2044-09-25
AI Technical Summary
Existing technologies for CAN signal detection are characterized by low efficiency, high error rate, and long processing time. They require manual writing or adjustment of test scripts for verification, which can lead to signal omissions or errors in the detection process.
By acquiring the database connection between the CAN signal matrix and the target vehicle model, the signal parameters of the target CAN signal are filtered out. The manual or automatic mode is selected according to the visual interface for detection. The automatic detection script reads the signal values within a preset period and generates the detection results.
It achieves efficient and accurate CAN signal detection, avoids signal omissions and errors, saves acceptance personnel time, eliminates the need to manually write new scripts, and is applicable to any vehicle model.
Smart Images

Figure CN119473828B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of vehicles, in particular to a CAN signal detection method and device, electronic equipment, storage medium and program product. BACKGROUND
[0002] In the development of an intelligent driving system, vehicle signal level acceptance and testing are performed to prevent problems such as vehicle component monitoring signal error or vehicle unresponsive to a line control handshake due to vehicle software development errors or other reasons.
[0003] In related technologies, a CAN device such as a CANoE, Zhou Ligong, or other device is generally used to access the vehicle CAN network to test and accept vehicle signals. In actual execution, for different vehicle models and communication matrices, testers often need to manually write or adjust test scripts to verify signals, which is time-consuming and may have risks of signal omission or signal viewing errors, resulting in low accuracy of test results. SUMMARY
[0004] The present application provides a CAN signal detection method, device, electronic equipment, storage medium and program product to solve the problems of low efficiency, high error rate and long time consumption in related technologies by manually writing or adjusting test scripts to verify signals.
[0005] The first aspect of the present application provides a CAN signal detection method, comprising the following steps: obtaining a CAN signal matrix and a database connection of a target vehicle model; filtering 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 input by a visualization interface; detecting the target CAN signal according to the signal parameters of the target CAN signal and the target detection mode, and determining a target CAN signal acceptance result of the target vehicle model according to a detection result of the target CAN signal.
[0006] Optionally, the target detection mode includes a manual mode and an automatic mode, and detecting the target CAN signal according to the signal parameters of the target CAN signal and the target detection mode includes: if the target mode is the manual mode, detecting the target CAN signal manually according to the signal parameters; and if the target mode is the automatic mode, detecting the target CAN signal automatically 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 detecting the target CAN signal according to the signal parameter comprises: inputting a signal ID in the visual interface; and detecting the target CAN signal according to related content of the signal ID displayed in the visual interface.
[0009] Optionally, the automatically detecting the target CAN signal according to the signal parameter comprises: importing at least one of a signal ID, a signal name and a signal value into a target template; setting a target detection duration, and assigning the target detection duration to a local variable of an automatic detection script; reading the target template by the automatic detection script, and reading the signal value by the automatic detection script and assigning the signal value to the local variable of the automatic detection script in each preset period; and determining a detection result of the target CAN signal according to the local variable in each preset period, until the current detection duration reaches the target detection duration, and the automatic detection is stopped.
[0010] Optionally, after the automatic detection is stopped when the current detection duration reaches the target detection duration, the method further comprises: generating an end prompt of the automatic detection of the target CAN signal.
[0011] The second aspect embodiment of the present application provides a CAN signal detection device, comprising: an acquisition module configured to acquire a CAN signal matrix and a database connection of a target vehicle model; a screening module configured to screen signal parameters of a target CAN signal of the 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; and a detection module configured to detect the target CAN signal according to the signal parameters of the target CAN signal and the target detection mode, and determine a target CAN signal acceptance result of the target vehicle model according to a detection result of the target CAN signal.
[0012] Optionally, the target detection mode comprises a manual mode and an automatic mode, and the detection module is further configured to detect the target CAN signal according to the signal parameters in the manual mode, and detect the target CAN signal according to the signal parameters in the automatic mode.
[0013] Optionally, the signal parameters of the target CAN signal comprise at least one of the signal ID, the signal name and the signal value.
[0014] Optionally, the detection module is further configured to input the signal ID in the visual interface, and detect the target CAN signal according to related content of the signal ID displayed in the visual interface.
[0015] Optionally, the detection module is further configured to import at least one of the signal ID, the signal name and the signal value into the target template; set a target detection duration, and assign the target detection duration to a local variable of the automatic detection script; read the target template by the automatic detection script, and read the signal value by the automatic detection script and assign the signal value to the local variable of the automatic detection script at each preset period; and determine a detection result of the target CAN signal according to the local variable at each preset period, until the current detection duration reaches the target detection duration, and the automatic detection is stopped.
[0016] Optionally, the CAN signal detection device further comprises a generation module configured to generate an end prompt of the target CAN signal automatic detection 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, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, and the processor executes the program to implement the CAN signal detection method of the above-mentioned embodiments.
[0018] The fourth aspect of the present application provides a computer readable storage medium, which stores a computer program or instructions, and the program or instructions are executed by a processor to implement the CAN signal detection method of the above-mentioned embodiments.
[0019] The fifth aspect of the present application provides a computer program product, comprising a computer program or instructions, and the computer program or instructions are executed to implement the CAN signal detection method of the above-mentioned embodiments.
[0020] Therefore, the present application has the following beneficial effects:
[0021] The embodiments of the present application can screen the signal parameters of the target CAN signal required by the target vehicle model from the CAN signal matrix, avoid the occurrence of signal omission or signal viewing errors and other problems, determine the corresponding test mode according to the selected test mode to detect the target CAN signal, and output the acceptance result, which can greatly save the time of the acceptance personnel, and does not need to develop a test personnel to write a new script, and is suitable for CAN signal detection of any vehicle. Therefore, the problems of low efficiency, high error rate and long time consumption in the related art by manually writing or adjusting the test script to verify the signal are solved.
[0022] Additional aspects and advantages of the present application will be given in part in the following description, will become apparent from the following description, or will be learned by practice of the present application. BRIEF DESCRIPTION OF DRAWINGS
[0023] The above and / or additional aspects and advantages of the present application will become apparent and more readily appreciated from the following description, taken in conjunction with the following drawings of exemplary embodiments of the present application, wherein:
[0024] Figure 1 A flowchart of a CAN signal detection method according to an embodiment of the present application is provided.
[0025] Figure 2 A CAN signal detection example diagram according to an embodiment of the present application is provided.
[0026] Figure 3 An example diagram of a CAN signal detection device according to an embodiment of the present application is provided.
[0027] Figure 4 A structural schematic diagram of an electronic device according to an embodiment of the present application is provided. DETAILED DESCRIPTION
[0028] Embodiments of the present application are described in detail below with reference to the accompanying drawings, in which like or similar elements are denoted by the same or similar reference numerals, and the embodiments described below are examples intended to explain the present application and should not be understood as limiting the present application.
[0029] The CAN signal detection method, device, electronic device, storage medium and program product of the embodiments of the present application are described below with reference to the accompanying drawings. In view of the problems mentioned in the above background art, 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 from the CAN signal matrix, avoiding the occurrence of signal omission or signal viewing errors, and the target CAN signal is detected according to the selected test mode and the corresponding test mode is output to output the acceptance result, which can greatly save the time of acceptance personnel, and does not need to develop test personnel to write new scripts, and is suitable for CAN signal detection of any vehicle. Thus, the problems of low efficiency, high error rate and long time-consuming in related art by manually writing or adjusting test scripts to verify signals are solved.
[0030] Specifically, Figure 1 A flowchart of a CAN signal detection method according to an embodiment of the present application is provided.
[0031] As shown in Figure 1 , the CAN signal detection method comprises the following steps:
[0032] In step S101, the CAN signal matrix and the database connection of the target vehicle model are acquired.
[0033] The CAN signal matrix is a table or database form document used to describe the signal transmission rules in the CAN bus system. The embodiment of the application establishes a database connection between the CAN signal matrix and the target vehicle model to obtain the document of the related data of the target vehicle model, including the DBC file and other technical documents.
[0034] In step S102, the signal parameters of the target CAN signal of the target vehicle model are screened from the CAN signal matrix according to the database connection, and the target detection mode of the target CAN signal input by the visualization interface is identified.
[0035] It can be understood that the embodiment of the application can screen 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, the signal name and the signal value.
[0036] In the embodiment of the application, the target detection mode includes a manual mode and an automatic mode, and the detection modes performed by different detection modes are different. The manual mode is usually used for instant observation of signal changes, and the automatic mode is suitable for batch testing under preset conditions, which can improve the testing efficiency. In the actual execution process, the embodiment of the application can determine the target detection mode of the target CAN signal according to the selection of the user on the visualization interface, wherein the window of the visualization interface can be created by capl or by other ways, which is not limited.
[0037] In step S103, the target CAN signal is detected according to the signal parameters and the target detection mode of the target CAN signal, and the acceptance result of the target CAN signal 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 the manual mode on the visualization interface, the embodiment of the application detects the target CAN signal according to the signal parameters; if the user selects the target mode as the automatic mode on the visualization interface, the embodiment of the application detects the target CAN signal according to the signal parameters.
[0039] Specifically, the manual detection of the target CAN signal according to the signal parameters includes: inputting the signal ID on the visualization interface; and detecting the target CAN signal according to the related content of the signal ID displayed on the visualization interface.
[0040] As Figure 2As shown, the embodiment of the present application can manually input the signal ID in the visualization interface, and can observe the signal value under the signal ID in the visualization interface in real time when starting the test. 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 an embodiment of the present application, the target CAN signal is 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 variable of the automatic detection script; reading the target template by the automatic detection script, and reading the signal value by the automatic detection script and assigning the local variable of 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 variable, until the current detection duration reaches the target detection duration, and stopping the automatic detection. Wherein the target detection duration can be set by the user according to the actual situation, such as 30 minutes, without specific risk.
[0042] Wherein, the target template can be an excel template. Before starting the automatic detection, the selected signals are imported into the excel template in advance, and the excel template is imported into the project after the project starts, so as to determine the signal value required by the automatic test script verification, and after the detection time is input, the automatic detection button is clicked to start the automatic detection. After the detection time expires, the selected signals are automatically screened and displayed, and the verification result is given. Figure 2 As shown, the embodiment of the present application imports the screened signals into the excel template in advance, imports the excel template into the project after the project starts, so as to determine the signal value required by the automatic test script verification, and after the detection time is input, the automatic detection button is clicked to start the automatic detection. After the detection time expires, the selected signals are automatically screened and displayed, and the verification result is given.
[0043] Specifically, when the automatic detection mode starts, the window prompts: “automatic detection starts”, and the detection time is assigned to the local variable in the automatic detection script. The automatic detection script reads the excel, assigns the signal name read to the local variable, and creates a local variable corresponding to each signal value for detecting the state. In each fixed period, the script reads the bus signal value in real time and assigns it to the local variable. The automatic detection script makes a logical judgment on the local variable. If it is the correct value in the excel template, the local variable for detecting the state is 1, otherwise it is 0. If the local variable for detecting the state is 1, the signal name and “P” are written into the last two columns of the original table, indicating that the acceptance is passed. If the local variable for detecting the state is 0, the signal name and “S” are written into the last two columns of the original table, indicating that the acceptance is failed.
[0044] Further, after stopping the automatic detection when the current detection duration reaches the target detection duration, the embodiment of the present application can also generate an end prompt of the target CAN signal automatic detection, such as a window prompt "automated detection has ended, please continue operation", or an end prompt in the form of 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 from the CAN signal matrix, avoiding the occurrence of problems such as signal omission or signal viewing error, and the target CAN signal is detected according to the selected test mode and the corresponding test mode, and the acceptance result is output, which can greatly save the time of acceptance personnel, and does not need to develop 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-consuming in the related art by manually writing or adjusting test scripts to verify signals are solved.
[0046] Secondly, the CAN signal detection device according to the embodiment of the present application is described with reference to the accompanying drawings.
[0047] Figure 3 is a block schematic diagram of the CAN signal detection device of the embodiment of the present application.
[0048] As shown in Figure 3 , the CAN signal detection device 10 comprises an acquisition module 100, a screening module 200 and a detection module 300.
[0049] The acquisition module 100 is configured to acquire a CAN signal matrix and a database connection of a target vehicle model; the screening module 200 is configured to screen signal parameters of a target CAN signal of the 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 by a visual interface; and the detection module 300 is configured to detect the target CAN signal according to the signal parameters of the target CAN signal and the target detection mode, and determine an acceptance result of the target CAN signal of the target vehicle model according to a detection result of the target CAN signal.
[0050] In an embodiment of the present application, the target detection mode comprises a manual mode and an automatic mode, and the detection module 300 is further configured to detect the target CAN signal according to the signal parameters when the target mode is the manual mode; and detect the target CAN signal according to the signal parameters when the target mode is the automatic mode.
[0051] In an embodiment of the present application, the signal parameters of the target CAN signal comprise at least one of a signal ID, a signal name and a signal value.
[0052] In an embodiment of the present application, the detection module 300 is further configured to input a signal ID into the visualization interface; and perform detection on the target CAN signal according to related content of the signal ID displayed on the visualization interface.
[0053] In an embodiment of the present application, the detection module 300 is further configured to import at least one of the signal ID, the signal name and the 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 by the automatic detection script, and read the signal value by the automatic detection script and assign the signal value to the local variable of the automatic detection script in each preset period; and determine a detection result of the target CAN signal according to the local variable in each preset period until the current detection duration reaches the target detection duration, and stop the automatic detection.
[0054] In an embodiment of the present application, the CAN signal detection device 10 further comprises a generation module. The generation module is configured to generate an end prompt of 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 description of the CAN signal detection method embodiments is also applicable to the CAN signal detection device of the embodiments, which will not be described here.
[0056] The CAN signal detection device provided in the embodiments of the present application filters the signal parameters of the target CAN signal required by the target vehicle model from the CAN signal matrix, avoids the occurrence of problems such as signal omission or signal viewing error, determines a corresponding test mode according to the selected test mode to detect the target CAN signal, and outputs an acceptance result, which can greatly save the time of acceptance personnel and does not require a test personnel to develop a new script, and is suitable for CAN signal detection of any vehicle model. Thus, the problems of low efficiency, high error rate and long time consumption in the related art by manually writing or adjusting a test script to verify a signal are solved.
[0057] Figure 4 A structural schematic diagram of an electronic device provided in the embodiments of the present application is shown. The electronic device can include:
[0058] The memory 401, the processor 402 and a computer program stored in the memory 401 and executable on the processor 402.
[0059] The processor 402 implements the CAN signal detection method provided in the above embodiments when executing the program.
[0060] Further, the electronic device further includes:
[0061] The communication interface 403 is configured to communicate between the memory 401 and the processor 402.
[0062] The memory 401 is configured to store a computer program capable of being executed on the processor 402.
[0063] The memory 401 can include a high-speed RAM (Random Access Memory) memory, and can further include a nonvolatile memory such as at least one disk memory.
[0064] If the memory 401, the processor 402 and the communication interface 403 are independently implemented, the communication interface 403, the memory 401 and the processor 402 can be connected to each other through a bus and complete communication between each other. The bus can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component) 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 the convenience of representation, Figure 4 In the figure, only one thick line is used to represent the bus, but it 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 complete communication between each other through an internal interface.
[0066] The processor 402 can be a CPU (Central Processing Unit), or an ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement one or more embodiments of the present application.
[0067] The embodiment of the present application further provides a computer readable storage medium, which has a computer program stored thereon, and the program is executed by a processor to implement the CAN signal detection method.
[0068] The embodiment of the present application further provides a computer program product, which includes a computer program or instructions, and the computer program or instructions are executed to implement the CAN signal detection method.
[0069] In the description of the application, the description of the terms "one embodiment", "some embodiments", "an example", "a specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the application. In the description of the application, the illustrative description of the above terms is not necessarily directed to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any appropriate manner in any one or N embodiments or examples. In addition, different embodiments or examples described in the description of the application and the features of different embodiments or examples can be combined and combined by those skilled in the art without contradiction.
[0070] In addition, the terms "first", "second" are only for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined with "first", "second" can explicitly or implicitly include at least one of the features. In the description of the application, the meaning of "N" is at least two, for example, two, three, etc., unless otherwise specifically limited.
[0071] Any process or method descriptions in flow charts or otherwise described herein can be understood as representing code modules, segments, or portions of code that include one or more executable instructions for implementing specific logic functions (or steps) in the process, and that the various embodiments of the application can include additional or fewer steps or processes in alternative implementations, as will be appreciated by those skilled in the art. The various embodiments of the application can be implemented in hardware, software, firmware, or a combination thereof, as desired.
[0072] It should be understood that parts of the application can be implemented in hardware, software, firmware, or a combination thereof. In the above-described embodiments, the steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. As in another embodiment implemented in hardware, any one or a combination of the following technologies known in the art can be used: discrete logic circuit with logic gate circuit for implementing logic functions on data signals, application specific integrated circuit with suitable combination logic gate circuit, programmable gate array, field programmable gate array, etc.
[0073] Those skilled in the art of the art can understand that the method of implementing the above-mentioned embodiments carries out all or part of the steps. The above-mentioned program can be stored in a computer readable storage medium, which includes one or a combination of the steps of the method embodiment when executed.
[0074] Although the embodiments of the present application have been shown and described above, it is understood that the above-described embodiments are exemplary and are not to be construed as limiting the present application, and that changes, modifications, substitutions and variations can be made by those skilled in the art without departing from the scope of the present application.
Claims
1. A CAN signal detection method, characterized in that, Includes the following steps: Obtain the database connection for the CAN signal matrix and the target vehicle model; Based on the database connection, the signal parameters of the target CAN signal of the target vehicle model are filtered from the CAN signal matrix, and the target detection mode of the target CAN signal input by the visual interface is identified; The target CAN signal is detected based on 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 based on the detection result of the target CAN signal. If the target mode is automatic mode, the target CAN signal is automatically detected according to the signal parameters, wherein the signal parameters of the target CAN signal include at least one of signal ID, signal name and signal value; The automatic detection of the target CAN signal based on the signal parameters includes: importing at least one of the following into a target template: a signal ID, a signal name, and a signal value; setting a target detection duration and assigning the target detection duration to a local variable of the automatic detection script; reading the target template through the automatic detection script, and reading signal values through the automatic detection script and assigning them to a local variable of the automatic detection script within each preset period; determining the detection result of the target CAN signal based on the local variable within each preset period, until the current detection duration reaches the target detection duration and then stopping the automatic detection.
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. The detection of the target CAN signal based on the signal parameters of the target CAN signal and the target detection mode includes: If the target mode is manual mode, then the target CAN signal is manually detected according to the signal parameters.
3. The CAN signal detection method according to claim 2, characterized in that, Manual detection of the target CAN signal based on the signal parameters includes: Enter the signal ID in the visual interface; The target CAN signal is detected based on the relevant information of the signal ID displayed on the visualization interface.
4. The CAN signal detection method according to claim 1, characterized in that, After stopping automatic detection until the current detection duration reaches the target detection duration, the process also includes: Generate a prompt indicating the end of the automatic detection of the target CAN signal.
5. A CAN signal detection device, characterized in that, include: The acquisition module is used to acquire the database connection of the CAN signal matrix and the target vehicle model; The filtering module is used to filter the signal parameters of the target CAN signal of the target vehicle model from the CAN signal matrix according to the database connection, and to identify the target detection mode of the target CAN signal input by the 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 to determine the target CAN signal acceptance result of the target vehicle model based on the detection result of the target CAN signal. The detection module is further configured to automatically detect the target CAN signal according to the signal parameters when the target mode is automatic mode, wherein the signal parameters of the target CAN signal include at least one of signal ID, signal name and signal value; The detection module is further configured to import at least one of a signal ID, signal name, and signal value into a target template; set a target detection duration and assign the target detection duration to a local variable of the automatic detection script; read the target template through the automatic detection script, and read signal values through the automatic detection script and assign them 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 in each preset period, and stop automatic detection when the current detection duration reaches the target detection duration.
6. An electronic device, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, the processor executing the program to implement the CAN signal detection method according to any one of claims 1-4.
7. A computer-readable storage medium having a computer program or instructions stored thereon, characterized in that, When the computer program or instructions are executed, they implement the CAN signal detection method according to any one of claims 1-4.
8. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or instructions are executed, they implement the CAN signal detection method according to any one of claims 1-4.
Citation Information
Patent Citations
Automatic testing method and device, electronic equipment and storage medium
CN115757483A