An automated testing method, apparatus, device, and storage medium for protocol conversion.

By acquiring test signals and generating return signals, the problem of being unable to test automotive functions that require protocol conversion in existing technologies has been solved, achieving the effect of automated testing.

CN116418706BActive Publication Date: 2026-03-13CHONGQING CHANGAN TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-13
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

Existing technologies are unable to test automotive functions involving protocol conversion.

Method used

The test signal is acquired, sent to the vehicle controller, and the test is completed based on the return signal. The communication protocol of the return signal is the second protocol, and the test result is generated.

Benefits of technology

It enables automated testing of automotive functions that require protocol conversion, improving testing efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116418706B_ABST
    Figure CN116418706B_ABST
Patent Text Reader

Abstract

This invention provides an automatic testing method, apparatus, device, and storage medium for protocol conversion. The method involves acquiring a test signal using a first protocol; sending the test signal to a vehicle controller; and completing the test based on a return signal received from the vehicle controller. The return signal uses a second protocol and is generated based on the test signal. This invention tests vehicle functions using a test signal based on the first protocol and obtains a return signal based on the second protocol, from which the test result is obtained. This allows for the testing of automotive functions involving protocol conversion.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of testing technology, specifically to an automatic testing method, apparatus, device, and storage medium for protocol conversion. Background Technology

[0002] With the development of automotive intelligence, in-vehicle Ethernet has become an indispensable part of advanced automotive electronic architecture, but the CAN (Controller Area Network) bus still occupies a dominant position. If the automotive communication transmission protocol includes both Ethernet and CAN buses based on DDS (Data Distribution Service) middleware, communication between CAN nodes and Ethernet nodes will inevitably exist, requiring the conversion of CAN signals to DDS data or vice versa.

[0003] However, existing automotive function testing methods cannot test automotive functions that involve protocol conversion. Summary of the Invention

[0004] In view of the shortcomings of the prior art described above, the present invention provides an automatic testing method, apparatus, device and storage medium for protocol conversion, which can solve the technical problem that the prior art cannot test automotive functions involving protocol conversion.

[0005] This invention provides an automated testing method for protocol conversion, the method comprising:

[0006] Acquire a test signal, wherein the communication protocol of the test signal is a first protocol;

[0007] The test signal is sent to the vehicle controller;

[0008] Upon receiving a return signal from the vehicle controller, the test is completed based on the return signal; the communication protocol of the return signal is the second protocol, and the return signal is generated based on the test signal.

[0009] In one embodiment of the present invention, when the first protocol is a controller area network bus protocol, sending the test signal to the vehicle controller includes:

[0010] Obtain the Controller Area Network Bus Protocol (CAN) call script;

[0011] The test signal is automatically sent to the vehicle controller by calling the script according to the controller local area network bus protocol.

[0012] In one embodiment of the present invention, when the first protocol is a data distribution service protocol, sending the test signal to the vehicle controller includes:

[0013] Script to retrieve data distribution service protocol;

[0014] The test signal is automatically sent to the vehicle controller by calling the script according to the data distribution service protocol.

[0015] In one embodiment of the present invention, before completing the test based on the returned signal, the method further includes:

[0016] Obtain the signal detection script;

[0017] The signal detection script determines whether a return signal from the vehicle controller has been received.

[0018] In one embodiment of the present invention, when the test signal includes vehicle speed information generated by a simulated vehicle stability system, the test is completed based on the returned signal, including:

[0019] The vehicle speed information in the returned signal is compared with the vehicle speed information in the test signal;

[0020] The test passes when the vehicle speed information in the returned signal matches the vehicle speed information in the test signal; the test fails when the vehicle speed information in the returned signal does not match the vehicle speed information in the test signal.

[0021] In one embodiment of the present invention, when the test signal includes control information for controlling vehicle components, the test is completed based on the return signal, including:

[0022] The returned signal is identified;

[0023] The test passes when the return signal includes execution success information corresponding to the control information; the test fails when the return signal does not include execution success information corresponding to the control information.

[0024] In one embodiment of the present invention, the method further includes, after completing the test based on the returned signal:

[0025] Obtain test results;

[0026] A test report is constructed based on the test results, and the test report is output.

[0027] In one embodiment of the present invention, the test signal is automatically sent to the vehicle controller according to the controller local area network bus protocol call script, including:

[0028] The first sending cycle of the controller local area network bus protocol call script is set;

[0029] The controller local area network bus protocol call script sends the test signal to the vehicle controller according to the first transmission cycle.

[0030] In one embodiment of the present invention, the test signal is automatically sent to the vehicle controller by calling a script according to the data distribution service protocol, including:

[0031] The second sending cycle of the data distribution service protocol call script is set;

[0032] The script that controls the data distribution service protocol calls sends the test signal to the vehicle controller according to the second sending cycle.

[0033] The present invention also provides an automatic testing device for protocol conversion, the device comprising:

[0034] The acquisition module is used to acquire test signals, and the communication protocol of the test signals is a first protocol;

[0035] A transmitting module is used to transmit the test signal to the vehicle controller;

[0036] The testing module is used to complete the test based on the return signal received from the vehicle controller; the communication protocol of the return signal is a second protocol, and the return signal is generated based on the test signal.

[0037] The present invention also provides an electronic device, the electronic device comprising:

[0038] One or more processors;

[0039] A storage device for storing one or more programs, which, when executed by one or more processors, enable the electronic device to perform an automated test method for protocol conversion as described above.

[0040] The present invention also provides a computer-readable storage medium, characterized in that it stores a computer program thereon, which, when executed by a computer's processor, causes the computer to perform an automatic test method for protocol conversion as described above.

[0041] The beneficial effects of this invention are as follows: This invention provides an automatic testing method, apparatus, device, and storage medium for protocol conversion. The method involves acquiring a test signal, the communication protocol of which is a first protocol; sending the test signal to a vehicle controller; and completing the test based on a return signal received from the vehicle controller. The communication protocol of the return signal is a second protocol, and the return signal is generated based on the test signal. This invention tests vehicle functions using a test signal of the first protocol and obtains a return signal of the second protocol, from which the test result is obtained. This allows for the testing of automotive functions involving protocol conversion.

[0042] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description

[0043] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application. It is obvious that the drawings described below are merely some embodiments of this application, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort. In the drawings:

[0044] Figure 1 This is an exemplary embodiment of the present application illustrating an application scenario of an automated testing method for protocol conversion;

[0045] Figure 2 This is a flowchart illustrating an automated testing method for protocol conversion, as shown in an exemplary embodiment of this application.

[0046] Figure 3 This is another exemplary embodiment of the present application illustrating an automated testing method for protocol conversion;

[0047] Figure 4 This is a schematic diagram of the CAN-to-DDS test steps in one embodiment of this application;

[0048] Figure 5 This is a schematic diagram of the DDS-to-CAN test steps in one embodiment of this application.

[0049] Figure 6 This is a structural block diagram of an automatic testing apparatus for protocol conversion, as illustrated in an exemplary embodiment of this application.

[0050] Figure 7 A schematic diagram of the structure of a computer system suitable for implementing the electronic device of the present application is shown. Detailed Implementation

[0051] The embodiments of the present invention will be described below with reference to the accompanying drawings and preferred embodiments. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be understood that the preferred embodiments are only for illustrating the present invention and not for limiting the scope of protection of the present invention.

[0052] It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. Therefore, the drawings only show the components related to the present invention and are not drawn according to the actual number, shape and size of the components in the actual implementation. In the actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.

[0053] In the following description, numerous details are explored to provide a more thorough explanation of embodiments of the invention. However, it will be apparent to those skilled in the art that embodiments of the invention may be practiced without these specific details. In other embodiments, well-known structures and devices are shown in block diagram form rather than in detail to avoid obscuring embodiments of the invention.

[0054] Figure 1 This is an exemplary embodiment of the present application illustrating an application scenario of an automated testing method for protocol conversion, such as... Figure 1 As shown, this embodiment receives test signals or test messages through the vehicle's ECU (Electronic Control Unit). The ECU, as the test object, returns corresponding return signals or messages based on its function after receiving the test signals or messages. By acquiring the return signals or messages from the ECU, vehicle testing is achieved. In this embodiment, the vehicle's CAN-to-DDS and DDS-to-CAN functions are primarily tested. Therefore, the ECU and the host computer are connected via a network cable to enable DDS service access. The ECU's CAN channel is connected to USBCAN via a DB9 adapter cable, and USBCAN is then connected to the host computer via a USB cable, enabling the host computer to send / read CAN signals to the ECU.

[0055] like Figure 2 As shown, in an exemplary embodiment, an automated testing method for protocol conversion includes at least steps S210 to S230, which are described in detail below:

[0056] S210, acquire a test signal, wherein the communication protocol of the test signal is the first protocol;

[0057] S220, the test signal is sent to the vehicle controller;

[0058] S230, upon receiving a return signal from the vehicle controller, the test is completed based on the return signal; the communication protocol of the return signal is the second protocol, and the return signal is generated based on the test signal.

[0059] In this embodiment, the test signal is used to test functions involving DDS to CAN or CAN to DDS.

[0060] If the vehicle speed information is sent to the instrument panel for display, the test signal is a simulated vehicle speed signal generated by the ESP (Electronic Stability Program) of the host computer. The test signal uses the CAN protocol. The host computer sends the test signal to the ECU via the CAN bus. After receiving the test signal, the ECU performs the corresponding CAN-to-DDS conversion and displays the converted vehicle speed signal on the instrument panel. Since the ECU is not actually connected to an external instrument panel, the converted vehicle speed signal is returned to the host computer in DDS protocol. The host computer can complete the test by analyzing the returned vehicle speed signal.

[0061] The above process tests the CAN to DDS conversion function. Correspondingly, if it is necessary to test the DDS to CAN conversion function, it is necessary to obtain the corresponding DDS test signal, send the DDS test signal to the ECU, and analyze the ECU's CAN protocol return signal.

[0062] In one embodiment of the present invention, when the first protocol is a controller area network bus protocol, the process of sending the test signal to the vehicle controller may include steps S310 to S320, which are described in detail below:

[0063] S310, obtain the controller LAN bus protocol call script;

[0064] S320, according to the controller local area network bus protocol, calls the script to automatically send the test signal to the vehicle controller.

[0065] In this embodiment, since the test signals of the CAN bus protocol need to be invoked through a host computer, a CAN invocation environment needs to be configured on the host computer, and the corresponding scripts are used to invoke the CAN signals. The specific configuration steps are as follows: Place the usbcan library function folder kerneldlls into the Python working directory. The USBCAN transmit and receive signals are encapsulated. send_CANFD(canFDdata,cycle_time,canid) is used to send CAN signals, where canFDdata is the CAN message to be sent, cycle_time is the transmission cycle, and canid is the CAN signal ID; read_CANFD(cantype,canid,exp_value,exp_sort) is used to read CAN signals and compare them with the expected CAN signal parameters, where cantype is the CAN signal type (CAN or CANFD), canid is the CAN signal ID, exp_value is the expected parameter value, and exp_sort is the position of the parameter value in the CAN message.

[0066] In one embodiment of the present invention, when the first protocol is a data distribution service protocol, the process of sending the test signal to the vehicle controller may include steps S410 to S420, which are described in detail below:

[0067] S410, obtain the data distribution service protocol call script;

[0068] S420, according to the data distribution service protocol, the script is invoked to automatically send the test signal to the vehicle controller.

[0069] In this embodiment, since the test signal of the DDS bus protocol needs to be called through the host computer, the host computer needs to install the DDS service call environment before the test to confirm that DDS service calls can be performed. The service call command is executed in DOS. During the test, the computer acts as the client and the controller acts as the server. The call command is: DDS script service name_method name(request parameters)method interval time call count.

[0070] In Python, the DDS script calling mechanism is encapsulated into the openExe() method. The calling method is openExe(exeName, callMethod, callWay, runNum, cycleTime), where exeName is the name of the DDS script, callMethod is the service name with parameters, callWay is the service type (method or event), runNum is the number of service calls, and cycleTime is the service call interval.

[0071] In one embodiment of the present invention, the process prior to completing the test based on the return signal may further include steps S510 to S520, which are described in detail below:

[0072] S510, obtain the signal detection script;

[0073] S520, determine whether a return signal from the vehicle controller has been received according to the signal detection script.

[0074] In this embodiment, the return signal is also detected by writing a script. The detection script here is the same script as the data distribution service protocol call script and the controller local area network bus protocol call script. They are different functional units of the same script.

[0075] In one embodiment of the present invention, when the test signal includes vehicle speed information generated by a simulated vehicle stability system, the process of completing the test based on the return signal may include steps S610 to S620, which are described in detail below:

[0076] S610, compare the vehicle speed information in the returned signal with the vehicle speed information in the test signal;

[0077] S620: If the vehicle speed information in the returned signal is consistent with the vehicle speed information in the test signal, the test is passed; if the vehicle speed information in the returned signal is inconsistent with the vehicle speed information in the test signal, the test is failed.

[0078] In this embodiment, a script is used to compare the vehicle speed information in the returned signal with the vehicle speed information in the test signal, and the test results are automatically recorded. This achieves automated testing. The script here is the same script as the aforementioned detection script, data distribution service protocol call script, and controller area network bus protocol call script; they are different functional units of the same script.

[0079] In one embodiment of the present invention, when the test signal includes control information for controlling vehicle components, the process of completing the test based on the return signal may include steps S710 to S720, which are described in detail below:

[0080] S710, Identify the returned signal;

[0081] S720: If the return signal includes execution success information corresponding to the control information, the test is passed; if the return signal does not include execution success information corresponding to the control information, the test is not passed.

[0082] In this embodiment, the return signal is identified by writing a script. This script is the same as the aforementioned detection script, data distribution service protocol call script, and controller area network bus protocol call script, and they are different functional units of the same script.

[0083] In one embodiment of the present invention, the process after completing the test based on the returned signal may further include steps S810 to S820, which are described in detail below:

[0084] S810, obtain test results;

[0085] S820: Based on the test results, construct a test report and output the test report.

[0086] In this embodiment, after the test is completed, a test report is generated based on the test results so that staff can obtain the results.

[0087] In one embodiment of the present invention, the process of automatically sending the test signal to the vehicle controller according to the controller local area network bus protocol call script may include steps S910 to S920, which are described in detail below:

[0088] S910, set the first sending cycle of the controller local area network bus protocol call script;

[0089] S920, the controller local area network bus protocol call script is controlled to send the test signal to the vehicle controller according to the first transmission cycle.

[0090] In this embodiment, since the test is performed automatically via script, it is necessary to set the period for sending test signals. The test is then performed automatically and continuously according to the first period, which saves time and effort.

[0091] In one embodiment of the present invention, the process of automatically sending the test signal to the vehicle controller by calling a script according to the data distribution service protocol may include steps S1010 to S1020, which are described in detail below:

[0092] S1010, Set the second sending cycle for the data distribution service protocol call script;

[0093] S1020, the control script of the data distribution service protocol calls the test signal to the vehicle controller according to the second sending cycle.

[0094] In this embodiment, since the test is performed automatically by script, it is necessary to set the period for sending test signals. The test is then performed automatically and continuously according to the second period, which saves time and effort.

[0095] Figure 3This application illustrates another exemplary embodiment of an automated testing method for protocol conversion, such as... Figure 3 As shown in another embodiment of this application, an automated testing method for protocol conversion includes the following steps:

[0096] (1) Test environment setup

[0097] The ECU and the host computer are connected via a network cable to enable DDS service access. The ECU's CAN channel is connected to USBCAN via a DB9 adapter cable, and USBCAN is then connected to the host computer via a USB cable, enabling the host computer to send / read CAN signals to the ECU.

[0098] (2) DDS service call environment configuration

[0099] Before testing, the host computer needs to install the DDS service call environment and confirm that it can perform DDS service calls. The service call command is executed in DOS. During the test, the computer acts as the client and the controller acts as the server. The call command is: DDS script service name_method name(request parameters)method interval time number of calls.

[0100] In Python, the DDS script calling mechanism is encapsulated into the openExe() method. The calling method is openExe(exeName, callMethod, callWay, runNum, cycleTime), where exeName is the name of the DDS script, callMethod is the service name with parameters, callWay is the service type (method or event), runNum is the number of service calls, and cycleTime is the service call interval.

[0101] (3) USBCAN usage environment configuration

[0102] Place the usbcan library folder kerneldlls into your Python working directory. The USBCAN transmit and receive signals are encapsulated. `send_CANFD(canFDdata, cycle_time, canid)` is used to send CAN signals; `canFDdata` is the CAN message to be sent, `cycle_time` is the transmission cycle, and `canid` is the CAN signal ID. `read_CANFD(cantype, canid, exp_value, exp_sort)` is used to read CAN signals and compare them with the expected CAN signal parameters; `cantype` is the CAN signal type (CAN or CANFD), `canid` is the CAN signal ID, `exp_value` is the expected parameter value, and `exp_sort` is the position of the parameter value in the CAN message.

[0103] (4) Test script writing

[0104] Before writing the test script, you need to put the relevant library functions for DDS service calls and USBCAN library functions into the Python working directory. The test will be divided into CAN-to-DDS conversion and DDS-to-CAN conversion tests.

[0105] Figure 4 This is a schematic diagram of the CAN-to-DDS test steps in one embodiment of this application, as shown below. Figure 4 As shown, the CAN to DDS test takes the vehicle speed CAN signal to DDS service as an example. The test steps are as follows:

[0106] First, the simulated vehicle stability system (ESP) sends a vehicle speed CAN signal to the ECU. The host computer then calls the send_CANFD function to send the vehicle speed CAN signal to the ECU.

[0107] After the ECU receives the vehicle speed signal from the host computer, it will convert the data into DDS service and report it to the instrument panel for display. At this time, the vehicle speed reporting service request can be sent by calling the openExe function to listen for whether the vehicle speed is reported through the DDS service.

[0108] The vehicle speed information returned by the openExe function is compared with the vehicle speed information sent in the first step. If they match, the test passes; otherwise, the test fails.

[0109] Figure 5 This is a schematic diagram of the DDS-to-CAN test steps in one embodiment of this application, as shown below. Figure 5 As shown, the DDS to CAN conversion test takes the front air conditioning off as an example. The test steps are as follows:

[0110] First, a request to turn off the front air conditioning is sent to the ECU. The host computer then sends a DDS service request to the ECU through the openExe function.

[0111] After the ECU receives the request to turn off the front air conditioning, it will send a CAN signal to the air conditioning unit to turn off the front air conditioning. At this time, the CAN signal sent by the ECU can be read through the read_CANFD function.

[0112] Based on the return value of the read_CANFD function, determine whether the ECU has sent a CAN signal to turn off the front air conditioning. If the ECU has sent a CAN signal to turn off the front air conditioning, the test passes; otherwise, the test fails.

[0113] Based on the above testing approach, test scripts can be written.

[0114] (5) Automated execution of test scripts

[0115] After all the test scripts for all test cases are written, put the test scripts in a folder, and create an automated test script outside the folder to iterate through the test cases and execute the test scripts. When each test script is executed, the test results will be printed, which is equivalent to outputting a simple test report.

[0116] By following the above testing process, after the test script is written, an automated test script can be executed to complete the CAN to DDS test and output the test results, which greatly improves testing efficiency and shortens the testing cycle.

[0117] This invention discloses an automatic testing method for protocol conversion. The method involves acquiring a test signal using a first protocol; sending the test signal to a vehicle controller; and completing the test based on a return signal received from the vehicle controller. The return signal uses a second protocol and is generated based on the test signal. This invention tests vehicle functions using a test signal based on the first protocol and obtains a return signal based on the second protocol, from which the test result is derived. This allows for the testing of automotive functions involving protocol conversion.

[0118] like Figure 6 As shown, the present invention also provides an automatic testing device for protocol conversion, the device comprising:

[0119] The acquisition module is used to acquire test signals, and the communication protocol of the test signals is a first protocol;

[0120] A transmitting module is used to transmit the test signal to the vehicle controller;

[0121] The testing module is used to complete the test based on the return signal received from the vehicle controller; the communication protocol of the return signal is a second protocol, and the return signal is generated based on the test signal.

[0122] This invention discloses an automatic testing device for protocol conversion. The device acquires a test signal using a first protocol; sends the test signal to a vehicle controller; and upon receiving a return signal from the vehicle controller, completes the test based on the return signal. The return signal uses a second protocol and is generated based on the test signal. This invention tests vehicle functions using a test signal based on the first protocol and obtains a return signal based on the second protocol, from which the test result is derived. This allows for the testing of automotive functions involving protocol conversion.

[0123] It should be noted that the application data display system and the application data display method provided in the above embodiments belong to the same concept. The specific ways in which each module and unit performs operations have been described in detail in the method embodiments and will not be repeated here. In practical applications, the application data display system provided in the above embodiments can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. This is not a limitation here.

[0124] Embodiments of this application also provide an electronic device, including: one or more processors; and a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the electronic device enables the application data display method provided in the above embodiments.

[0125] Figure 7 A schematic diagram of a computer system suitable for implementing the embodiments of this application is shown. It should be noted that... Figure 7 The computer system 700 of the electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.

[0126] like Figure 7As shown, the computer system 700 includes a Central Processing Unit (CPU) 701, which can perform various appropriate actions and processes based on programs stored in Read-Only Memory (ROM) 702 or programs loaded from storage portion 708 into Random Access Memory (RAM) 703, such as performing the methods described in the above embodiments. The RAM 703 also stores various programs and data required for system operation. The CPU 701, ROM 702, and RAM 703 are interconnected via a bus 704. An Input / Output (I / O) interface 705 is also connected to the bus 704.

[0127] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, mouse, etc.; an output section 707 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN (Local Area Network) card, modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 710 as needed so that computer programs read from it can be installed into the storage section 708 as needed.

[0128] Specifically, according to embodiments of this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program including a computer program for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 709, and / or installed from removable medium 711. When the computer program is executed by central processing unit (CPU) 701, it performs various functions defined in the system of this application.

[0129] It should be noted that the computer-readable medium shown in the embodiments of this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disc read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this application, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying a computer-readable computer program. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The computer program contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to wireless, wired, etc., or any suitable combination thereof.

[0130] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. Each block in a flowchart or block diagram may represent a module, segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0131] The units described in the embodiments of this application can be implemented in software or hardware, and the described units can also be located in a processor. The names of these units do not necessarily limit the specific unit itself.

[0132] Another aspect of this application provides a computer-readable storage medium storing a computer program thereon, which, when executed by a computer's processor, causes the computer to perform the application data display method as described above. This computer-readable storage medium may be included in the electronic device described in the above embodiments, or it may exist independently and not assembled into the electronic device.

[0133] Another aspect of this application provides a computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the application data display method provided in the various embodiments described above.

[0134] The above embodiments are merely illustrative of the principles and effects of the present invention and are not intended to limit the invention. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in the present invention should still be covered by the claims of the present invention.

Claims

1. A method of automatic testing of protocol conversion, characterized by, The method comprises: acquiring a test signal, a communication protocol of the test signal being a first protocol; wherein, if the first protocol is a CAN protocol, a second protocol is a DDS protocol; if the first protocol is a DDS protocol, the second protocol is a CAN protocol; sending the test signal to a vehicle controller; when the first protocol is a controller area network bus protocol, comprising: acquiring a controller area network bus protocol calling script, and automatically sending the test signal to the vehicle controller according to the controller area network bus protocol calling script; and configuring a CAN calling environment in a host computer, and calling a CAN signal by using a corresponding script; wherein, the process of configuring the CAN calling environment in the host computer comprises: placing a library function folder kerneldlls of a usbcan into a python working directory, and encapsulating a transceiving signal of the usbcan; wherein, send_CANFD (canFDdata, cycle_time, canid) is used for sending a CAN signal, canFDdata is a CAN message to be sent, cycle_time is a sending cycle, and canid is a CAN signal ID; read_CANFD (cantype, canid, exp_value, exp_sort) is used for reading a CAN signal and comparing the CAN signal with an expected CAN signal parameter, cantype is a CAN signal type, canid is a CAN signal ID, exp_value is an expected parameter value, and exp_sort is a position of the parameter value in a CAN message; when a return signal from the vehicle controller is received, completing a test based on the return signal; a communication protocol of the return signal is the second protocol, and the return signal is generated based on the test signal.

2. The protocol conversion automatic test method according to claim 1, wherein, When the first protocol is a controller area network bus protocol, sending the test signal to the vehicle controller comprises: acquiring a controller area network bus protocol calling script; automatically sending the test signal to the vehicle controller according to the controller area network bus protocol calling script.

3. The protocol conversion automatic test method of claim 1, wherein, When the first protocol is a data distribution service protocol, sending the test signal to the vehicle controller comprises: acquiring a data distribution service protocol calling script; automatically sending the test signal to the vehicle controller according to the data distribution service protocol calling script.

4. The protocol conversion automatic test method of claim 1, wherein, Before completing the test based on the return signal, further comprising: acquiring a signal detection script; determining whether the return signal from the vehicle controller is received according to the signal detection script.

5. The protocol conversion automatic test method of claim 1, wherein, When the test signal comprises vehicle speed information generated by a simulated vehicle body stability system, completing the test based on the return signal comprises: comparing vehicle speed information in the return signal with vehicle speed information in the test signal; when the vehicle speed information in the return signal is consistent with the vehicle speed information in the test signal, passing the test; and when the vehicle speed information in the return signal is inconsistent with the vehicle speed information in the test signal, failing the test.

6. The method of automatic testing of a protocol conversion according to claim 1, wherein, When the test signal comprises control information for controlling vehicle parts, the test is completed based on the return signal, comprising: identifying the return signal; when the return signal comprises execution success information corresponding to the control information, passing the test; when the return signal does not comprise execution success information corresponding to the control information, failing the test.

7. The method of claim 1, 5, or 6, wherein the protocol conversion is performed by a protocol converter. After the test is completed based on the return signal, further comprising: obtaining a test result; constructing a test report based on the test result, and outputting the test report.

8. The protocol conversion automatic test method of claim 2, wherein, According to the CAN bus protocol calling script, the test signal is automatically sent to the vehicle controller, comprising: setting a first sending period of the CAN bus protocol calling script; controlling the CAN bus protocol calling script to send the test signal to the vehicle controller according to the first sending period.

9. The method of automatic testing of a protocol conversion according to claim 3, wherein, According to the DDS protocol calling script, the test signal is automatically sent to the vehicle controller, comprising: setting a second sending period of the DDS protocol calling script; controlling the DDS protocol calling script to send the test signal to the vehicle controller according to the second sending period.

10. An automatic test equipment for protocol conversion, characterized by, The device comprises: a collection module for obtaining a test signal, the communication protocol of the test signal being a first protocol; wherein if the first protocol is a CAN protocol, the second protocol is a DDS protocol; if the first protocol is a DDS protocol, the second protocol is a CAN protocol; a sending module for sending the test signal to a vehicle controller; when the first protocol is a CAN bus protocol, comprising: obtaining a CAN bus protocol calling script, and automatically sending the test signal to the vehicle controller according to the CAN bus protocol calling script; and configuring a CAN calling environment in the host computer, and using a corresponding script to call the CAN signal; wherein the process of configuring the CAN calling environment in the host computer comprises: placing the library function folder kerneldlls of the usbcan into the python working directory, and encapsulating the receiving and sending signals of the USB CAN; wherein send_CANFD(canFDdata, cycle_time, canid) is used to send the CAN signal, canFDdata is the CAN message to be sent, cycle_time is the sending period, and canid is the CAN signal ID; read_CANFD(cantype, canid, exp_value, exp_sort) is used to read the CAN signal and compare it with the expected CAN signal parameters, cantype is the CAN signal type, canid is the CAN signal ID, exp_value is the expected parameter value, and exp_sort is the position of the parameter value in the CAN message. a test module to, upon receipt of a return signal from the vehicle controller, complete a test based on the return signal; the return signal being of a second protocol, the return signal being generated based on the test signal.

11. An electronic device, comprising: The electronic device includes: one or more processors; a memory device for storing one or more programs that, when executed by the one or more processors, cause the electronic device to implement an automatically testing method of protocol conversion as claimed in any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that, a computer program stored thereon that, when executed by a processor of a computer, causes the computer to perform an automatically testing method of protocol conversion as claimed in any one of claims 1 to 9.

Citation Information

Patent Citations

  • Vehicle-mounted Ethernet protocol conformance test method and device, and related equipment

    CN115102888A