Can signal testing method, device, equipment, chip, vehicle and medium
By acquiring and judging the signal value of the CAN signal and its carry operation, the problem of low efficiency of CAN signal function testing is solved, and efficient function testing and cost saving are achieved.
Patent Information
- Application Number
- CN202411987233.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2044-12-31
AI Technical Summary
The functional testing method of CAN signals in the existing technology lacks universality, resulting in low testing efficiency and requiring a lot of labor costs.
By obtaining the set of functions to be tested, it is determined whether the signal value of the CAN signal is within the preset range, and a carry operation is performed when the signal value exceeds the maximum value. Combined with the fact that the number of bits of the carry register is the same as the number of CAN signals of the function to be tested, the function test result is determined based on the execution result and the signal test result.
It realizes comprehensive testing of CAN signals, improves testing efficiency and saves labor costs.
Smart Images

Figure CN119861691B_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 industry, CAN (Controller Area Network) signals are widely used to enable communication between various electronic control units within a vehicle. Through the CAN bus, different systems in a vehicle can exchange data efficiently and reliably.
[0003] With the advancement of automated testing, automated testing for in-vehicle CAN signals has also matured. However, there is no universal technology for testing functions controlled by CAN signals. Often, a test program is developed for each function, resulting in low testing efficiency and high 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 efficiency of testing 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 a 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 register performs a carry operation, and the number of bits of the carry register is the same as the number of the CAN signals 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, 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 size 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 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 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 if the signal test result does not meet the preset function triggering condition and the function to be tested is triggered, 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 the expectation, the first mark is set; 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 failed.
[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 configured 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 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;
[0028] a judgment unit, 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;
[0029] A carry unit is used to perform a carry operation if the signal value of the CAN signal exceeds the maximum value of the CAN signal. 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 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.
[0031] According to a third aspect of the present application, an electronic device is provided, the electronic device including a memory and a processor;
[0032] The memory is connected to the processor and is used to store 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 including 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 application provides a CAN signal test method, device, electronic equipment, vehicle and medium, the CAN signal test method comprises the following steps: acquiring a to-be-tested function set, the to-be-tested function set comprising a to-be-tested function and at least one CAN signal corresponding to the to-be-tested function; the to-be-tested function is triggered when the corresponding CAN signal meets a preset function triggering condition; adding a preset step to a signal value of the CAN signal, and determining 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 a maximum value of the CAN signal, a carry-lookahead unit performs a carry operation, the number of bits of the carry-lookahead unit is the same as the number of CAN signals of the to-be-tested function; and determining a to-be-tested function test result according to a matching condition of an execution result of the to-be-tested function and the signal test result and a carry operation result of the carry-lookahead unit. The CAN signal test method provided in the application can test whether all signal values of the CAN signal meet the preset range, and comprehensive testing of the to-be-tested function is realized; since the to-be-tested function set comprises multiple to-be-tested functions, multiple to-be-tested functions can be determined at one time, the testing efficiency is improved, and the labor cost is saved. BRIEF DESCRIPTION OF DRAWINGS
[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or the prior art description. Obviously, the drawings in the following description are only part of the embodiments of the present application, and for those skilled in the art, other drawings can be obtained without creative labor based on the provided drawings.
[0039] Figure 1 The schematic diagram of the implementation environment provided for the embodiments of the present application;
[0040] Figure 2 The flowchart of the CAN signal test method provided for the embodiments of the present application;
[0041] Figure 3 The structural block diagram of the CAN signal test device provided for the embodiments of the present application;
[0042] Figure 4 The structural diagram of the electronic equipment provided for the embodiments of the present application. DETAILED DESCRIPTION
[0043] The technical solutions in the embodiments of the present application will be described clearly and completely in combination with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the protection scope of the present application.
[0044] In the automotive industry, CAN (Controller Area Network) signals are widely used to enable communication between various electronic control units within a vehicle. Through the CAN bus, different systems in a vehicle can exchange data efficiently and reliably.
[0045] With the advancement of automated testing, automated testing for in-vehicle CAN signals has also matured. However, there is no universal technology for testing functions controlled by CAN signals. Often, a test program is developed for each function, resulting in low testing efficiency and high 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 achieve comprehensive testing 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 efficiency of the test and saves labor costs.
[0048] Exemplary Implementation Environment
[0049] Please refer to Figure 1 , Figure 1 A schematic diagram of an implementation environment according to 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 the 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 a standalone physical server, a server cluster or distributed system consisting 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 in the blockchain.
[0052] Server 1 may be one or more servers. When there are multiple servers 1, at least two servers are used to provide different services, and / or at least two servers are used to provide the same service, such as providing the same service in a load balancing manner, which is not limited in this embodiment of the present invention.
[0053] It should be understood that Figure 1 This is only an illustrative description and does not specifically limit the application scenarios of the embodiments of this application. For example, 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, which 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 each function to be tested. In practical applications, the function to be tested is controlled by at least one CAN signal. For example, function A may be controlled by CAN1, CAN2, and CAN3 signals. When the signal values of CAN1, CAN2, and CAN3 meet the preset function trigger conditions, the function to be tested is triggered and executed.
[0058] The set of functions to be tested includes a function list, which records the function name, the name of the controlled signal, and the range of the signal value of the function to be tested. After the current function to be tested is tested, the CAN signal test of multiple functions to be tested is completed by automatically 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 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~255, the signal value range of the CAN2 signal is 0~4, and the signal value range of the CAN3 signal is 0~127; the preset function triggering conditions are: if and only if the signal value of the CAN1 signal is in the range of 127~200, the signal value of the CAN2 signal is 2 or 3, and the signal value range of the CAN3 signal is 64~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 trigger the function when the test result meets the preset function trigger condition, and not trigger the function when the test result does not meet the preset function trigger condition.
[0062] To achieve comprehensive testing, this embodiment adds a preset step size to the current CAN signal value. The CAN signal value is then determined to be within a preset range to obtain a signal test result. This completes the traversal of all signal values, improving the completeness and accuracy of the test. The preset step size can be set based on actual test requirements; for example, the preset step size 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 to explain opening the blind spot mirror.
[0065] In this embodiment, the function to be tested is to activate the blind spot detector. The controlled CAN signals are CAN1, CAN2, and CAN3. The CAN1, CAN2, and CAN3 signals are arranged in descending order, with the CAN3 signal being the lowest bit and the CAN1 signal being the highest bit. The preset function trigger condition is to activate the blind spot detector 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 is in the range of 64 to 120.
[0066] First, initialize the register. The length of the register is the same as the number of CAN signals corresponding to the function to be tested. Initialize the register to [0,0,0]. Obtain the signal values of CAN1, CAN2, and CAN3, and determine whether the values are within the preset range to obtain the signal test results. Send the signal signal_list_result to obtain the execution status of the function to be tested. After the test is complete, increment the value of CAN3 by 1. Continue to determine whether the values are within the preset range. If the value of CAN3 exceeds the maximum value of CAN3, increment the register by 1, changing the register to [0,0,1]. When the carry flag in the highest bit of the register is 1, it indicates that all signal contents have been tested.
[0067] S280: Determine a test result of the function to be tested according to a matching condition between the execution result of the function to be tested and the signal test result and a carry operation result 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 results of the function to be tested and the signal test results, 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 trigger condition, but the function to be tested is not triggered to execute, the execution result of the function to be tested does not match the signal test result;
[0073] When the test result does not meet the preset function triggering condition, the function to be tested is triggered to execute, 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 a to-be-tested function set simultaneously, 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 test operation of the current function 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 size 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 practical 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 size is increased starting from the lowest CAN signal. When the CAN signal exceeds the maximum CAN signal value, the carry register 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 according to their corresponding maximum CAN signal values in the carry order from low to high.
[0085] In one embodiment, determining the test result of the function to be tested based on 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 if the signal test result does not meet the preset function triggering condition and the function to be tested is triggered, 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 achieved, thereby improving the integrity of the test.
[0089] In one embodiment, the method further comprises:
[0090] When the test function result meets the expectation, the first mark is set; 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 failed.
[0092] In practical applications, the first mark can be "pass" to indicate that the functional test has passed, and the second mark can be "fail" to indicate that the functional test has failed. It should be understood that the first mark and the second mark can also be other marks, and the first mark and the second mark can be set according to the actual test report requirements.
[0093] In this embodiment, the function test pass is marked with the first mark, and the function test fail is marked with the second mark, which can make the test results clear at a glance and enhance the readability of the test report.
[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 comprehensive testing 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 This is a 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 configured 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 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;
[0101] A determination unit 330 is configured to determine whether the signal value of the CAN signal is within a preset range after increasing the preset step size to obtain a signal test result;
[0102] A carry unit 350 is 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 CAN signals 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 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 unit.
[0104] The CAN signal testing device provided in this embodiment is based on the same concept as the CAN signal testing method provided in the aforementioned embodiments of this application. It can execute the CAN signal testing method provided in any of the aforementioned embodiments of this application and has the corresponding functional modules and beneficial effects for executing the CAN signal testing method. For technical details not fully described in this embodiment, please refer to the specific processing content of the CAN signal testing method provided in the aforementioned embodiments of this application and will not be repeated here.
[0105] The functions implemented by the above-mentioned acquisition unit 310, judgment unit 330, carry unit 350 and function test unit 370 can be respectively implemented by the same or different processors, which is not limited in the embodiment of the present application.
[0106] It should be understood that the acquisition unit 310, the determination unit 330, the carrier unit 350, and the function test unit 370 in the above apparatus can be implemented in the form of processor calling software. For example, the apparatus includes a processor connected with a memory, the memory stores instructions, and the processor calls the instructions stored in the memory to implement any of the above methods or to implement the functions of the units of the apparatus. The processor can be a general-purpose processor, such as a CPU or a microprocessor, and the memory can be an internal memory of the apparatus or an external memory of the apparatus. Alternatively, the units in the apparatus can be implemented in the form of hardware circuit. The functions of some or all of the units can be implemented 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 units are implemented by designing the logical relationship of elements in the circuit. For another example, in another implementation, the hardware circuit can be implemented by a PLD. Taking an 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 by a configuration file, so as to implement the functions of some or all of the units. All the units of the above apparatus can be implemented in the form of processor calling software, or all the units can be implemented in the form of hardware circuit, or part of the units are implemented in the form of processor calling software, and the remaining part is implemented in the form of hardware circuit.
[0107] In the embodiments of the present application, the processor is a circuit with signal processing capability. In one implementation, the processor can be a circuit with instruction reading and running capability, such as a CPU, a microprocessor, a GPU, or a DSP. In another implementation, the processor can implement certain functions through the logical relationship of a hardware circuit, and the logical relationship of the hardware circuit is fixed or can be reconfigured. For example, the processor is an ASIC or a PLD implemented hardware circuit, such as an FPGA. In the reconfigurable hardware circuit, the process of the processor loading a configuration document to implement the configuration of the hardware circuit can be understood as the process of the processor loading instructions to implement the functions of some or all of the 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, a TPU, a DPU, etc.
[0108] As can be seen, each unit in the above apparatus can be one or more processors (or processing circuits) configured to implement the above methods, such as a CPU, a GPU, an NPU, a TPU, a DPU, a microprocessor, a DSP, an ASIC, an FPGA, or a combination of at least two of these processor forms.
[0109] In addition, all or part of each unit in the above apparatus can be integrated together or can be independently implemented. In one implementation, the units are integrated together to be implemented in the form of a SOC. The SOC can include at least one processor for implementing the functions of any of the above methods or implementing the functions of each unit of the apparatus. The at least one processor can be of different types, such as 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, as shown in Figure 4 The device includes:
[0112] a memory 400 and a processor 410;
[0113] The memory 400 is connected with the processor 410, and is configured to store a program.
[0114] The processor 410 is configured to realize the CAN signal test method disclosed in any of the above embodiments by running the program stored in the memory 400.
[0115] Specifically, the electronic device can 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 with each other through the bus. Among them:
[0117] The bus can include a path for transmitting information between various components of a computer system.
[0118] The processor 410 can be a general-purpose processor, such as a general-purpose central processing unit (CPU), a microprocessor, etc., or can be an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of programs of the present application. It can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a ready-to-use programmable gate array (FPGA), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
[0119] The processor 410 can include a main processor, and can also include a baseband chip, a modem, etc.
[0120] 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 program code, which includes computer operating instructions. More specifically, memory 400 may include read-only memory (ROM), other types of static storage devices capable of storing static information and instructions, random access memory (RAM), other types of dynamic storage devices capable of storing information and instructions, disk storage, flash memory, 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 devices that allow information to be output to a user, such as a display screen, printer, speakers, etc.
[0123] The communication interface 420 may include any device such as a transceiver 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 the program stored in the 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 embodiments of this specification.
[0128] The computer program product may be written in any combination of one or more programming languages to implement the program code for performing the operations of the embodiments of the present application, including object-oriented programming languages such as Java, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0129] In addition, an embodiment of the present application may also be a storage medium having a computer program stored thereon, and the computer program is used 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, specifically the following steps:
[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 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.
[0133] S280: Determine a test result of the function to be tested according to a matching condition between the execution result of the function to be tested and the signal test result and a carry operation result performed by the carry device.
[0134] For the sake of simplicity, the aforementioned method embodiments are described as a series of action combinations. However, those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily required by this application.
[0135] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Similarities between the various embodiments can be referred to in conjunction with each other. For device embodiments, since they are generally similar to method embodiments, their description is relatively simple, and for relevant details, reference can be made to the description of the method embodiments.
[0136] The steps in the methods of each embodiment of the present application can be adjusted in sequence, merged, 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 merged, divided, and deleted according to actual needs.
[0138] In the several embodiments provided in this 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 merely illustrative. For example, the division of modules or submodules is merely a logical function division. In actual implementation, there may be other division methods, such as multiple submodules or modules can be combined or integrated into another module, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or module, which can be electrical, mechanical or other forms.
[0139] The modules or submodules described as separate components may or may not be physically separate, 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 distributed across multiple network modules or submodules. Some or all of the modules or submodules may be selected to achieve the purpose of this embodiment according to actual needs.
[0140] In addition, each functional module or submodule in each embodiment of the present application may be integrated into a processing module, or each module or submodule may exist physically separately, or two or more modules or submodules may be integrated into a single module. The above-mentioned integrated modules or submodules may be implemented in the form of hardware or 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 above description has generally described the components and steps of each example according to their functions. 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 beyond the scope of this application.
[0142] The steps of a method or algorithm described in connection with the embodiments disclosed herein can be embodied directly in hardware, in a software executed by a processor, or in a combination of the two. A software unit can reside in RAM, flash memory, ROM, electrically programmable ROM (EPROM or EEPROM), electrically erasable programmable ROM (EEPROM), registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art. The storage medium can be loaded into the execution system by a manufacturer, a seller, or a user of an electronic system.
[0143] Finally, it is to be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting. It is to be understood that the use of relational terms such as first and second, and the like, are used solely to distinguish one from another entity or action without necessarily implying any actual relationship or order between such entities or actions. Moreover, the terms "comprises", "comprising", or any other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can also include other elements not expressly listed or inherent to such process, method, article, or apparatus. Additionally, unless otherwise stated the use of the negative "does not" does not imply an or requirement of an affirmative "does".
[0144] The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and generic principles defined herein can be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A CAN signal testing method, characterized in that: include: Obtain 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 signal test results of the corresponding at least one CAN signal meet the preset function trigger condition; After increasing a 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 register performs a carry operation, and the number of bits of the carry register is the same as the number of the CAN signals of the function to be tested; 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.
2. The CAN signal testing method according to claim 1, wherein: The method further comprises: 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.
3. The CAN signal testing method according to claim 1, wherein: 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 list of CAN signals corresponding to the function to be tested; A preset step size is added to the least significant CAN signal in the CAN signal list, and when the signal value of the least significant 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, wherein: 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 order according to the corresponding CAN signal maximum values.
5. The CAN signal testing method according to claim 1, wherein: The 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 if the signal test result does not meet the preset function triggering condition and the function to be tested is triggered, 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 functional 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 is configured to acquire a set of functions to be tested; the set of functions to be tested includes a plurality of 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 signal test results of the corresponding at least one CAN signal all meet a preset function trigger condition; a judging unit, configured to, after adding a preset step length to the signal value of the CAN signal, judge whether the signal value of the CAN signal is within a preset range, 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, wherein 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 configured to implement the CAN signal testing method according to any one of claims 1 to 7 by running the program in the memory.
10. A vehicle, characterized in that: A vehicle includes 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