CAN signal test method, device, equipment, chip, vehicle and medium
Through a CAN signal testing method, the set of functions to be tested is obtained and the signal value range of the CAN signal is judged, which solves the problem of low testing efficiency of CAN signal control function in the prior art, and realizes efficient testing and saves labor costs.
Patent Information
- Application Number
- CN202411987233.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-04-22
- Estimated Expiration
- 2044-12-31
AI Technical Summary
The lack of universal CAN signal control function testing methods in the prior art leads to the development of a set of test programs for each function, which is inefficient in testing and requires a large amount of labor costs.
A CAN signal testing method is provided. By obtaining the set of functions to be tested, it determines whether the signal value of the CAN signal is within the preset range, and performs a carry operation when the signal value exceeds the maximum value, and determines the functional test results based on the test results and carry results.
It realizes comprehensive testing of CAN signals, improves testing efficiency, saves labor costs, and can judge multiple functions to be tested at one time.
Smart Images

Figure CN119861691A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of CAN signal testing, and specifically to a CAN signal testing method, device, equipment, chip, vehicle and medium. Background Art
[0002] In the automotive field, CAN (Controller Area Network) signals are widely used to achieve communication between various electronic control units inside the vehicle. Through the CAN bus, different systems of the vehicle can exchange data efficiently and reliably.
[0003] With the development of automated testing, automated testing for vehicle-mounted CAN signals has also become more mature. However, there is no universal technology for testing functions controlled by CAN signals. Often, a set of test procedures is developed for each function, which has low test efficiency and requires a lot of labor costs.
[0004] Therefore, a solution for CAN signal testing is urgently needed to improve testing efficiency. Summary of the invention
[0005] In order to solve the above-mentioned problems in the prior art, the present application provides a CAN signal testing method, device, equipment, chip, vehicle and medium to improve the testing efficiency and save labor costs.
[0006] According to a first aspect of the present application, a CAN signal testing method is provided, the method comprising:
[0007] Acquire a set of functions to be tested; the set of functions to be tested includes multiple functions to be tested and at least one CAN signal corresponding to any function to be tested; the function to be tested is triggered when the corresponding at least one CAN signal satisfies a preset function trigger condition;
[0008] After increasing the preset step length for the signal value of the CAN signal, determining whether the signal value of the CAN signal is within a preset range, and obtaining the signal test result;
[0009] If the signal value of the CAN signal exceeds the maximum value of the CAN signal, the carry device performs a carry operation, and the number of bits of the carry device is the same as the number of the CAN signal of the function to be tested;
[0010] The test result of the function to be tested is determined according to the matching condition between the execution result of the function to be tested and the signal test result and the result of the carry operation performed by the carry device.
[0011] In an optional embodiment, the method further includes:
[0012] When the carry flag of the highest bit of the carry register is true, the test operation of the current function to be tested is completed.
[0013] In an optional implementation manner, when the signal value of the CAN signal exceeds the maximum value of the CAN signal, the carry device performs a carry operation, including:
[0014] Get the CAN signal list corresponding to the function to be tested;
[0015] A preset step length is added to the lowest CAN signal in the CAN signal list. When the signal value of the lowest CAN signal exceeds the maximum signal value of the CAN signal, the carry device performs a carry operation.
[0016] In an optional embodiment, the method further includes:
[0017] After the carry device performs the carry operation, a carry update operation is performed on all CAN signals in the CAN signal list according to the carry order according to the corresponding maximum values of the CAN signals.
[0018] In an optional implementation, determining the test result of the function to be tested according to the matching between the execution result of the function to be tested and the signal test result includes:
[0019] If the signal test result meets the preset function triggering condition and the function to be tested is triggered successfully, or if the signal test result does not meet the preset function triggering condition and the function to be tested fails to be triggered, then the test result of the function to be tested meets expectations;
[0020] If the signal test result meets the preset function triggering condition and the function to be tested fails to be triggered, or the signal test result does not meet the preset function triggering condition and the function to be tested is triggered, then the test result of the function to be tested does not meet expectations.
[0021] In an optional embodiment, the method further includes:
[0022] When the test function result meets expectations, it is set to the first mark; the first mark indicates that the function test has passed;
[0023] When the test function result does not meet expectations, a second mark is set; the second mark indicates that the function test has not passed.
[0024] In an optional embodiment, the method further includes:
[0025] Generate a test report based on the test results of the function to be tested.
[0026] According to a second aspect of the present application, a CAN signal testing device is provided, the device comprising:
[0027] An acquisition unit is used to acquire a set of functions to be tested; the set of functions to be tested includes multiple functions to be tested and at least one CAN signal corresponding to any function to be tested; the function to be tested is triggered when the corresponding at least one CAN signal satisfies a preset function trigger condition;
[0028] A judging unit, used to judge whether the signal value of the CAN signal is within a preset range after adding a preset step length to the signal value of the CAN signal, and obtain a signal test result;
[0029] A carry unit, used for performing a carry operation if the signal value of the CAN signal exceeds the maximum value of the CAN signal, and the number of bits of the carry unit is the same as the number of CAN signals of the function to be tested;
[0030] The function test unit is used to determine the test result of the function to be tested according to the matching situation between the execution result of the function to be tested and the signal test result and the result of the carry operation performed by the carry device.
[0031] According to a third aspect of the present application, an electronic device is provided, the electronic device comprising a memory and a processor;
[0032] The memory is connected to the processor and is used for storing programs;
[0033] The processor is used to implement the CAN signal testing method in the first aspect or any one of the embodiments of the first aspect by running the program in the memory.
[0034] According to a fourth aspect of the present application, a vehicle is provided, the vehicle comprising the electronic device provided in the third aspect.
[0035] According to the fifth aspect of the present application, a chip is provided, comprising a processor and a data interface, wherein the processor reads and runs a program stored in a memory through the data interface to execute a CAN signal testing method as in the first aspect or any one of the embodiments of the first aspect.
[0036] According to the sixth aspect of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the CAN signal testing method in the first aspect or any one of the embodiments of the first aspect is implemented.
[0037] The present application provides a CAN signal testing method, device, electronic device, vehicle and medium, by obtaining a set of functions to be tested, the set of functions to be tested includes the functions to be tested and at least one CAN signal corresponding to the functions to be tested; the functions to be tested are triggered when the corresponding CAN signal meets the preset function triggering condition; after adding a preset step length to the signal value of the CAN signal, it is determined whether the signal value of the CAN signal is within a preset range to obtain a signal test result; if the signal value of the CAN signal exceeds the maximum value of the CAN signal, the carry device performs a carry operation, and the number of bits of the carry device is the same as the number of CAN signals of the functions to be tested; according to the matching of the execution result of the functions to be tested and the signal test result and the result of the carry device performing the carry operation, the test result of the functions to be tested is determined. The CAN signal testing method provided in the present application can test whether all signal values of the CAN signal meet the preset range, so as to realize a comprehensive test of the functions to be tested; since the set of functions to be tested includes multiple functions to be tested, multiple functions to be tested can be judged at one time, which improves the efficiency of the test and saves labor costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0039] Figure 1 A schematic diagram of an implementation environment provided for an embodiment of the present application;
[0040] Figure 2 A flowchart of a CAN signal testing method provided in an embodiment of the present application;
[0041] Figure 3 A structural block diagram of a CAN signal testing device provided in an embodiment of the present application;
[0042] Figure 4 A structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0043] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0044] In the automotive field, CAN (Controller Area Network) signals are widely used to achieve communication between various electronic control units inside the vehicle. Through the CAN bus, different systems of the vehicle can exchange data efficiently and reliably.
[0045] With the development of automated testing, automated testing for vehicle-mounted CAN signals has also become more mature. However, there is no universal technology for testing functions controlled by CAN signals. Often, a set of test procedures is developed for each function, which has low test efficiency and requires a lot of labor costs.
[0046] Therefore, a solution for CAN signal testing is urgently needed to improve testing efficiency.
[0047] The embodiments of the present application provide a CAN signal testing method, device, electronic device, vehicle and storage medium, which implement a comprehensive test of the function to be tested by judging all signal values of the CAN signal; since the function set to be tested includes multiple functions to be tested, multiple functions to be tested can be judged at one time, which improves the test efficiency and saves labor costs.
[0048] Exemplary Implementation Environment
[0049] Please refer to Figure 1 , Figure 1 It is a schematic diagram of an implementation environment involved in the present invention.
[0050] like Figure 1 As shown, the implementation environment of the embodiment of the present application involves a server 1 and a terminal 2, wherein the terminal 2 can capture and analyze signals on the CAN bus, such as a CAN bus analyzer; the terminal 2 sends the acquired CAN signal to the server 1, and the server 1 implements the test of the CAN signal by processing and analyzing the CAN signal.
[0051] Server 1 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. The server can also become a node of the blockchain.
[0052] The server 1 may be one or more servers. When there are multiple servers 1, there are at least two servers for providing different services, and / or there are at least two servers for providing the same service, such as providing the same service in a load balancing manner, which is not limited in the embodiment of the present invention.
[0053] It should be understood that Figure 1 This is only an exemplary description and does not specifically limit the application scenarios of the embodiments of the present application. Figure 1 One terminal and one server are shown as an example, but other numbers of terminals and servers may actually be included, and this application does not impose any limitation on this.
[0054] Exemplary Methods
[0055] Figure 2 This is a flow chart of the CAN signal testing method provided in the embodiment of the present application. Figure 2 In an exemplary embodiment, a CAN signal testing method is provided, and the method may include:
[0056] S220: Obtain a set of functions to be tested.
[0057] In this embodiment, the set of functions to be tested includes multiple functions to be tested and at least one CAN signal corresponding to any function to be tested. In actual application scenarios, the function to be tested is controlled by at least one CAN signal. For example, function A can be controlled by CAN1, CAN2, and CAN3 signals. When the signal values of CAN1, CAN2, and CAN3 meet the preset function triggering conditions, the function to be tested is triggered to execute.
[0058] The function set to be tested includes a function list, which is used to record the function name of the function to be tested, the name of the controlled signal, the range of the signal value, etc. After the current function to be tested is completed, the CAN signal test of multiple functions to be tested is completed by self-incrementing the function list.
[0059] The function to be tested is triggered when at least one of the corresponding CAN signals meets the preset function triggering conditions. The function to be tested is controlled by multiple signals, and the function to be tested is triggered when all CAN signals meet the preset function triggering conditions. The preset function triggering conditions can be pre-set, for example: the blind mirror displays, the corresponding CAN signals are CAN1, CAN2, and CAN3, where the signal value range of the CAN1 signal is 0 to 255, the signal value range of the CAN2 signal is 0 to 4, and the signal value range of the CAN3 signal is 0 to 127; the preset function triggering conditions are: when and only when the signal value of the CAN1 signal is in the range of 127 to 200, the signal value of the CAN2 signal is 2 or 3, and the signal value range of the CAN3 signal is 64 to 120, the blind mirror is triggered to open.
[0060] S240: after increasing the preset step length for the signal value of the CAN signal, determining whether the signal value of the CAN signal is within a preset range, and obtaining a signal test result;
[0061] The preset range of the signal value of the CAN signal is related to the actual function to be tested. The preset range of the signal value of the controlled CAN signal of different functions to be tested is different. Therefore, it is necessary to judge the signal value of each CAN signal one by one to determine whether the signal value of the CAN signal is within the preset range, and to trigger the function when the test result meets the preset function trigger condition, and not to trigger the function when the test result does not meet the preset function trigger condition.
[0062] In order to achieve comprehensiveness of the test, based on the signal value of the current CAN signal in this embodiment, a preset step length is added to the signal value of the CAN signal, and the signal value of the CAN signal is judged to be within a preset range to obtain a signal test result, complete the traversal of the signal values of all signals, and improve the integrity and accuracy of the test. The preset step length can be set according to the actual test requirements, for example, the preset step length can be 1.
[0063] S260: If the signal value of the CAN signal exceeds the maximum value of the CAN signal, the carry register performs a carry operation, and the number of bits of the carry register is the same as the number of CAN signals of the function to be tested.
[0064] The above-mentioned function to be tested is taken as an example of opening the blind spot mirror.
[0065] In this embodiment, the function to be tested is to turn on the blind mirror, and the controlled CAN signals are CAN1, CAN2 and CAN3; the CAN1 signal, CAN2 signal and CAN3 signal are arranged in order from high to low, that is, the lowest CAN3 signal and the highest CAN1 signal. The preset function trigger condition is to turn on the blind mirror when and only when the CAN1 signal value is in the range of 127 to 200, the CAN2 signal value is 2 or 3, and the CAN3 signal value range is 64 to 120.
[0066] First, initialize the carry register, and the length of the carry register is the same as the number of CAN signals corresponding to the function to be tested. Initialize the carry register to [0,0,0]; obtain the signal value of the CAN1 signal, the signal value of the CAN2 signal, and the signal value of the CAN3 signal, and determine whether the signal value of the CAN1 signal, the signal value of the CAN2 signal, and the signal value of the CAN3 signal are within the preset range to obtain the signal test result. Send the signal signal_list_result to obtain the execution status of the function to be tested. After the test is completed; the signal value of the CAN3 signal is increased by 1, and the signal value of the CAN1 signal, the signal value of the CAN2 signal, and the signal value of the CAN3 signal are continued to be determined. Whether it is within the preset range, and after the signal value of the CAN3 signal exceeds the maximum value of the CAN3 signal, the carry register is automatically increased by 1, that is, the carry register becomes [0,0,1]; when the carry flag of the highest bit of the carry register is 1, it means that all signal contents have been tested.
[0067] S280: Determine the test result of the function to be tested according to the matching between the execution result of the function to be tested and the signal test result and the result of the carry operation performed by the carry device.
[0068] When the carry operation result of the carry register is that the flag bit of the highest bit of the carry register is true, it indicates that the test of the current function to be tested is completed.
[0069] Depending on the matching between the execution result of the function to be tested and the signal test result, it may include:
[0070] When the test result meets the preset function trigger condition, the function to be tested is triggered to execute, and the execution result of the function to be tested matches the signal test result;
[0071] When the test result does not meet the preset function triggering condition, the function to be tested is not triggered to execute, and the execution result of the function to be tested matches the signal test result;
[0072] When the test result meets the preset function triggering condition, the function to be tested is not triggered to execute, and the execution result of the function to be tested does not match the signal test result;
[0073] When the test result meets the preset function triggering condition, the function to be tested is triggered to be executed, and the execution result of the function to be tested does not match the signal test result.
[0074] The CAN signal testing method provided in the embodiment of the present application can test multiple to-be-tested functions in the to-be-tested function set at the same time, thereby improving the efficiency of the test. The CAN signal testing method provided in the present application can judge all signal values of the CAN signal, thereby achieving a comprehensive test of the to-be-tested functions and improving the accuracy of the test.
[0075] In one embodiment, the method may further include:
[0076] When the carry flag of the highest bit of the carry register is true, the current function test operation to be tested is completed.
[0077] When the carry flag of the highest bit of the carry register is 1, it indicates that all values of all CAN signals have been tested and the test work of the current function to be tested is completed.
[0078] In one embodiment, when the signal value of the CAN signal exceeds the maximum value of the CAN signal, the carry device performs a carry operation, including:
[0079] Get the CAN signal list corresponding to the function to be tested;
[0080] A preset step length is added to the lowest CAN signal in the CAN signal list. When the signal value of the lowest CAN signal exceeds the maximum signal value of the CAN signal, the carry device performs a carry operation.
[0081] In actual applications, the function to be tested is controlled by multiple CAN signals. By obtaining the CAN signal list, all CAN signals corresponding to the function to be tested can be determined. The preset step length is increased starting from the lowest CAN signal, and when the CAN signal exceeds the maximum value of the CAN signal, the carry device performs a carry operation.
[0082] In one embodiment, the CAN signal testing method provided in the embodiment of the present application may further include:
[0083] After the carry device performs the carry operation, a carry update operation is performed on all CAN signals in the CAN signal list according to the carry order according to the corresponding maximum values of the CAN signals.
[0084] Continuing with the above example, when the CAN3 signal value exceeds the maximum value, the carry register advances by 1, and the signal value of the CAN3 signal returns to zero. The operation of increasing the preset step size continues. After the lowest-order CAN3 signal performs the carry operation, all CAN signals in the CAN signal list are updated with the carry order from low to high according to their corresponding CAN signal maximum values.
[0085] In one embodiment, determining the test result of the function to be tested according to the matching between the execution result of the function to be tested and the signal test result may include:
[0086] If the signal test result meets the preset function triggering condition and the function to be tested is triggered successfully, or if the signal test result does not meet the preset function triggering condition and the function to be tested fails to be triggered, then the test result of the function to be tested meets expectations;
[0087] If the signal test result meets the preset function triggering condition and the function to be tested fails to be triggered, or the signal test result does not meet the preset function triggering condition and the function to be tested is triggered, then the test result of the function to be tested does not meet expectations.
[0088] In this embodiment, by testing all signal values of the CAN signal, the test of the function to be tested is more comprehensively implemented, thereby improving the integrity of the test.
[0089] In one embodiment, the method further comprises:
[0090] When the test function result meets expectations, it is set to the first mark; the first mark indicates that the function test has passed;
[0091] When the test function result does not meet expectations, a second mark is set; the second mark indicates that the function test has not passed.
[0092] In practical applications, the first mark may be pass, which indicates that the functional test has passed; the second mark may be fail, which indicates that the functional test has failed. It should be understood that the first mark and the second mark may also be other marks, and the first mark and the second mark may be set according to the actual test report requirements.
[0093] In this embodiment, the function test pass is marked by the first mark, and the function test fail is marked by the second mark, so that the test result is clear at a glance and the readability of the test report is enhanced.
[0094] In one embodiment, the method further comprises:
[0095] Generate a test report based on the test results of the function to be tested.
[0096] The test report format can be pre-set and the test report can be generated according to the test report requirements.
[0097] The CAN signal testing method provided in the embodiment of the present application can judge all signal values of the CAN signal to achieve a comprehensive test of the function to be tested; since the function set to be tested includes multiple functions to be tested, multiple functions to be tested can be judged at one time, which improves the test efficiency and saves labor costs.
[0098] Exemplary Devices
[0099] Accordingly, the embodiment of the present application also provides a CAN signal testing device, Figure 3 The structural block diagram of the CAN signal testing device provided in the embodiment of the present application; Figure 3 As shown, the apparatus may include:
[0100] The acquisition unit 310 is used to acquire a set of functions to be tested; the set of functions to be tested includes multiple functions to be tested and at least one CAN signal corresponding to any function to be tested; the function to be tested is triggered when the corresponding at least one CAN signal satisfies a preset function trigger condition;
[0101] A judging unit 330, configured to determine whether the signal value of the CAN signal is within a preset range after adding a preset step length to the signal value of the CAN signal, and obtain a signal test result;
[0102] A carry unit 350, for performing a carry operation if the signal value of the CAN signal exceeds the maximum value of the CAN signal, and the number of bits of the carry unit is the same as the number of the CAN signal of the function to be tested;
[0103] The function test unit 370 is used to determine the test result of the function to be tested according to the matching condition between the execution result of the function to be tested and the signal test result and the result of the carry operation performed by the carry device.
[0104] The CAN signal test device provided in this embodiment belongs to the same application concept as the CAN signal test method provided in the above embodiment of this application, and can execute the CAN signal test method provided in any of the above embodiments of this application, and has the corresponding functional modules and beneficial effects of executing the CAN signal test method. For technical details not fully described in this embodiment, please refer to the specific processing content of the CAN signal test method provided in the above embodiment of this application, and will not be repeated here.
[0105] The functions implemented by the above acquisition unit 310, judgment unit 330, carry unit 350 and function test unit 370 may be implemented by the same or different processors respectively, which is not limited in the embodiment of the present application.
[0106] It should be understood that the acquisition unit 310, the judgment unit 330, the carry unit 350 and the function test unit 370 in the above device can be implemented in the form of a processor calling software. For example, the device includes a processor, the processor is connected to a memory, and instructions are stored in the memory. The processor calls the instructions stored in the memory to implement any of the above methods or realize the functions of each unit of the device, wherein the processor can be a general processor, such as a CPU or a microprocessor, etc., and the memory can be a memory in the device or a memory outside the device. Alternatively, the unit in the device can be implemented in the form of a hardware circuit, and the functions of some or all of the units can be realized by designing the hardware circuit. The hardware circuit can be understood as one or more processors; for example, in one implementation, the hardware circuit is an ASIC, and the functions of some or all of the above units are realized by designing the logical relationship of the components in the circuit; for another example, in another implementation, the hardware circuit can be implemented by PLD. Taking FPGA as an example, it can include a large number of logic gate circuits, and the connection relationship between the logic gate circuits is configured through the configuration file, so as to realize the functions of some or all of the above units. All units of the above device may be implemented entirely in the form of a processor calling software, or entirely in the form of a hardware circuit, or partially in the form of a processor calling software and the rest in the form of a hardware circuit.
[0107] In an embodiment of the present application, a processor is a circuit with the ability to process signals. In one implementation, the processor may be a circuit with the ability to read and run instructions, such as a CPU, a microprocessor, a GPU, or a DSP; in another implementation, the processor may implement certain functions through the logical relationship of a hardware circuit, and the logical relationship of the hardware circuit is fixed or reconfigurable, such as a hardware circuit implemented by an ASIC or PLD, such as an FPGA. In a reconfigurable hardware circuit, the process of the processor loading a configuration document to implement the hardware circuit configuration can be understood as the process of the processor loading instructions to implement the functions of some or all of the above units. In addition, it can also be a hardware circuit designed for artificial intelligence, which can be understood as an ASIC, such as an NPU, TPU, DPU, etc.
[0108] It can be seen that each unit in the above device can be one or more processors (or processing circuits) configured to implement the above method, such as: CPU, GPU, NPU, TPU, DPU, microprocessor, DSP, ASIC, FPGA, or a combination of at least two of these processor forms.
[0109] In addition, all or part of the units in the above device can be integrated together, or can be implemented independently. In one implementation, these units are integrated together and implemented in the form of a SOC. The SOC may include at least one processor for implementing any of the above methods or implementing the functions of each unit of the device. The type of the at least one processor may be different, for example, including a CPU and an FPGA, a CPU and an artificial intelligence processor, a CPU and a GPU, etc.
[0110] Exemplary Electronic Devices
[0111] Another embodiment of the present application also provides an electronic device, see Figure 4 As shown, the device includes:
[0112] Memory 400 and processor 410;
[0113] The memory 400 is connected to the processor 410 and is used to store programs;
[0114] The processor 410 is used to implement the CAN signal testing method disclosed in any of the above embodiments by running the program stored in the memory 400.
[0115] Specifically, the electronic device may further include: a bus, a communication interface 420 , an input device 430 and an output device 440 .
[0116] The processor 410, the memory 400, the communication interface 420, the input device 430 and the output device 440 are connected to each other via a bus.
[0117] A bus may include a pathway that transfers information between components of a computer system.
[0118] Processor 410 may be a general purpose processor, such as a general purpose central processing unit (CPU), a microprocessor, etc., or an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the scheme of the present invention. It may also be 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, discrete hardware components.
[0119] The processor 410 may include a main processor, and may also include a baseband chip, a modem, and the like.
[0120] The memory 400 stores a program for executing the technical solution of the present invention, and may also store an operating system and other key services. Specifically, the program may include a program code, and the program code includes a computer operation instruction. More specifically, the memory 400 may include a read-only memory (ROM), other types of static storage devices that can store static information and instructions, a random access memory (RAM), other types of dynamic storage devices that can store information and instructions, a disk storage, a flash, and the like.
[0121] The input device 430 may include a device for receiving data and information input by a user, such as a keyboard, a mouse, a camera, a scanner, a light pen, a voice input device, a touch screen, a pedometer, or a gravity sensor.
[0122] Output device 440 may include a device that allows information to be output to a user, such as a display screen, a printer, a speaker, etc.
[0123] The communication interface 420 may include any transceiver or the like to communicate with other devices or communication networks, such as Ethernet, a radio access network (RAN), a wireless local area network (WLAN), etc.
[0124] The processor 410 executes the program stored in the memory 400 and calls other devices, which can be used to implement each step of any CAN signal testing method provided in the above embodiments of the present application.
[0125] An embodiment of the present application also proposes a chip, which includes a processor and a data interface. The processor reads and runs a program stored in a memory through the data interface to execute the CAN signal testing method introduced in any of the above embodiments. The specific processing process and its beneficial effects can be found in the above-mentioned embodiment introduction of the CAN signal testing method.
[0126] Exemplary computer program products and storage media
[0127] In addition to the above-mentioned methods and devices, an embodiment of the present application may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the steps of the CAN signal testing method according to various embodiments of the present application described in any of the above-mentioned embodiments of this specification.
[0128] The computer program product may be written in any combination of one or more programming languages to write program codes for performing the operations of the embodiments of the present application, including object-oriented programming languages, such as Java, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as an independent software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0129] In addition, the embodiment of the present application may also be a storage medium on which a computer program is stored. The computer program is executed by a processor to execute the steps of the CAN signal testing method according to various embodiments of the present application described in any of the above embodiments of this specification, and specifically the following steps may be implemented:
[0130] S220: Obtain a set of functions to be tested.
[0131] S240: After increasing the preset step length for the signal value of the CAN signal, determine whether the signal value of the CAN signal is within a preset range to obtain a signal test result.
[0132] S260: If the signal value of the CAN signal exceeds the preset range, the carry device performs a carry operation, and the number of bits of the carry device is the same as the number of CAN signals of the function to be tested.
[0133] S280: Determine the test result of the function to be tested according to the matching between the execution result of the function to be tested and the signal test result and the result of the carry operation performed by the carry device.
[0134] For the aforementioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the order of the actions described, because according to the present application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0135] It should be noted that each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the embodiments can be referred to each other. For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0136] The steps in the methods of each embodiment of the present application can be adjusted in order, combined and deleted according to actual needs, and the technical features recorded in each embodiment can be replaced or combined.
[0137] The modules and sub-modules in the devices and terminals of the various embodiments of the present application can be combined, divided and deleted according to actual needs.
[0138] In the several embodiments provided in the present application, it should be understood that the disclosed terminals, devices and methods can be implemented in other ways. For example, the terminal embodiments described above are only schematic, for example, the division of modules or submodules is only a logical function division, and there may be other division methods in actual implementation, for example, multiple submodules or modules can be combined or integrated into another module, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, which can be electrical, mechanical or other forms.
[0139] The modules or submodules described as separate components may or may not be physically separated, and the components of the modules or submodules may or may not be physical modules or submodules, that is, they may be located in one place, or they may be distributed on multiple network modules or submodules. Some or all of the modules or submodules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0140] In addition, each functional module or submodule in each embodiment of the present application may be integrated into one processing module, or each module or submodule may exist physically separately, or two or more modules or submodules may be integrated into one module. The above-mentioned integrated modules or submodules may be implemented in the form of hardware or in the form of software functional modules or submodules.
[0141] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0142] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly by hardware, software units executed by a processor, or a combination of the two. The software units may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0143] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0144] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A CAN signal testing method, characterized in that: include: Acquire a set of functions to be tested; the set of functions to be tested includes multiple functions to be tested and at least one CAN signal corresponding to any of the functions to be tested; the function to be tested is triggered when the corresponding at least one CAN signal satisfies a preset function trigger condition; After increasing the preset step length for the signal value of the CAN signal, determining whether the signal value of the CAN signal is within a preset range, and obtaining a signal test result; If the signal value of the CAN signal exceeds the maximum value of the CAN signal, the carry device performs a carry operation, and the number of bits of the carry device is the same as the number of the CAN signal of the function to be tested; The function test result is determined as the function test result to be tested according to the matching condition between the execution result of the function to be tested and the signal test result and the result of the carry operation performed by the carry device.
2. The CAN signal testing method according to claim 1, characterized in that: The method further comprises: When the carry flag of the highest bit of the carry register is true, the current function test operation to be tested is completed.
3. The CAN signal testing method according to claim 1, characterized in that: When the signal value of the CAN signal exceeds the maximum value of the CAN signal, the carry device performs a carry operation, including: Obtain a CAN signal list corresponding to the function to be tested; A preset step length is added to the lowest CAN signal in the CAN signal list, and when the signal value of the lowest CAN signal exceeds the maximum signal value of the CAN signal, the carry device performs a carry operation.
4. The CAN signal testing method according to claim 3, characterized in that: The method further comprises: After the carry device performs the carry operation, a carry update operation is performed on all CAN signals in the CAN signal list according to the carry sequence according to the corresponding CAN signal maximum values.
5. The CAN signal testing method according to claim 1, characterized in that: The step of determining the test result of the function to be tested according to the matching condition between the execution result of the function to be tested and the signal test result includes: If the signal test result meets the preset function triggering condition and the function to be tested is triggered successfully, or if the signal test result does not meet the preset function triggering condition and the function to be tested fails to be triggered, then the test result of the function to be tested meets expectations; If the signal test result meets the preset function triggering condition and the function to be tested fails to be triggered, or the signal test result does not meet the preset function triggering condition and the function to be tested is triggered, then the test result of the function to be tested does not meet expectations.
6. The CAN signal testing method according to claim 5, characterized in that: The method further comprises: When the test function result meets expectations, a first mark is set; the first mark indicates that the function test has passed; When the test function result does not meet expectations, a second mark is set; the second mark indicates that the function test has failed.
7. The CAN signal testing method according to claim 1, characterized in that: The method further comprises: Generate a test report based on the test results of the function to be tested.
8. A CAN signal testing device, characterized in that: include: An acquisition unit, used for acquiring a set of functions to be tested; the set of functions to be tested includes multiple functions to be tested and at least one CAN signal corresponding to any of the functions to be tested; the function to be tested is triggered when the corresponding at least one CAN signal satisfies a preset function trigger condition; A judging unit, configured to judge whether the signal value of the CAN signal is within a preset range after adding a preset step length to the signal value of the CAN signal, and obtain a signal test result; A carry unit, configured to perform a carry operation if the signal value of the CAN signal exceeds the maximum value of the CAN signal, and the number of bits of the carry unit is the same as the number of the CAN signal of the function to be tested; The function test unit is used to determine the test result of the function to be tested according to the matching condition between the execution result of the function to be tested and the signal test result and the result of the carry operation performed by the carry device.
9. An electronic device, characterized in that: including memory and processor; The memory is connected to the processor and is used to store programs; The processor is used to implement the CAN signal testing method as described in any one of claims 1 to 7 by running the program in the memory.
10. A vehicle, characterized in that: A vehicle comprises the electronic device according to claim 9.
11. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by the processor, the CAN signal testing method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Test method and device based on channel switch
CN104063322A
Information processing method and device, equipment and medium
CN111538628A
Vehicle function test method, device and equipment and computer readable storage medium
CN114594751A
CAN message simulation test method, device and system based on Ethernet
CN118337681A
Apparatus for Nitrogen Removing Using Co-culture of Microalgae and Denitrifying Bacteria and Method for Nitrogen Removing Using the Same
KR101996065B1