Communication protocol test method, electronic equipment and computer readable storage medium

By selecting the protocol to be executed from multiple communication protocols in the test system, reading the data table to generate battery simulation data, and responding to the request message of the system under test, the communication protocol test of multiple protocol types and multiple number of battery packs and the system under test is realized, solving the problem of inefficient testing of existing tools and improving the testing efficiency.

CN119629079APending Publication Date: 2025-03-14WUHAN MEGMEET ELECTRICAL CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411466800.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-18
Publication Date
2025-03-14

AI Technical Summary

Technical Problem

Existing battery protocol simulation tools are difficult to simulate multiple protocol types and multiple battery packs simultaneously to communicate with the same system under test, resulting in inefficient testing.

Method used

In response to the protocol test operation, the test system determines at least one protocol to be executed from the preset multiple communication protocols, reads the battery pack in the corresponding data table to generate simulation data, and generates a response message in response to the request message of the system under test, so as to realize the communication protocol test of the multi-protocol type and a multiple-number battery pack and the system under test.

Benefits of technology

It solves the problem that multiple protocol types and multiple battery packs are difficult to test with the same system under test at the same time, and improves the testing efficiency of communication protocols.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119629079A_ABST
    Figure CN119629079A_ABST
Patent Text Reader

Abstract

The invention discloses a communication protocol test method, electronic equipment and a computer readable storage medium. The method comprises the following steps: in response to a protocol test operation, a test system determines at least one protocol to be executed from a plurality of preset communication protocols; reading at least one battery pack in the data table corresponding to each protocol to be executed to generate corresponding battery simulation data; and in response to a request message of the tested system, generating a response message based on the request message and the battery simulation data, and replying the response message to the tested system to receive an execution result returned by the tested system. At least one to-be-executed protocol is selected from a plurality of communication protocols to read at least one battery pack in a data table corresponding to each to-be-executed protocol so as to simulate communication protocol testing between the battery packs and a tested system. The technical problem that a plurality of battery packs of multiple protocol types under each protocol type are difficult to test with the same tested system at the same time can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data testing technology, and in particular to a communication protocol testing method, an electronic device, and a computer-readable storage medium. Background Art

[0002] In the use scenario of lithium iron batteries, the same battery management system (BMS) will be connected to multiple protocol types and multiple lithium iron batteries under each protocol type. The battery management system will communicate with each lithium iron battery and perform business processing based on the communication data with the battery. Before the battery management system is officially put into market application, it is necessary to test the correctness of the battery management system communicating with multiple protocol types and multiple lithium iron batteries under each protocol type.

[0003] However, current battery protocol simulation tools can only simulate battery data of a single protocol type. For example, the ModbusSlave tool can simulate batteries based on the Modbus protocol, but if the battery is not a Modbus protocol, it cannot be simulated; even for batteries based on the Modbus protocol, due to the different custom data within the Modbus protocol, the Modbus Slave tool can only customize one type of data, that is, simulate batteries of one protocol type. In addition, general battery protocols also have limitations on the number of simulated devices. For example, the Modbus Slave tool can only simulate a maximum of 32 groups of battery data of the same protocol type. Summary of the invention

[0004] The main technical problem solved by the present application is to provide a communication protocol testing method, an electronic device and a computer-readable storage medium, which can solve the technical problem that multiple protocol types and a large number of battery packs under each protocol type are difficult to test simultaneously with the same system under test.

[0005] In order to solve the above technical problems, a technical solution adopted in this application is: the communication protocol testing method includes:

[0006] The test system determines at least one protocol to be executed from a plurality of preset communication protocols in response to the protocol test operation;

[0007] Reading at least one battery pack in the data table corresponding to each of the protocols to be executed to generate corresponding battery simulation data;

[0008] In response to a request message from the system under test, a response message is generated based on the request message and the battery simulation data, and the response message is replied to the system under test to receive an execution result returned by the system under test.

[0009] Optionally, the test system includes an execution platform, a data transceiver layer, a data parsing layer and a protocol data layer;

[0010] The test system, in response to the protocol test operation, before determining at least one protocol to be executed from a plurality of preset communication protocols, comprises:

[0011] Acquire configuration data of a plurality of the communication protocols through the protocol data layer, and generate data tables corresponding to a plurality of the communication protocols according to the configuration data;

[0012] The test system determines at least one protocol to be executed from a plurality of preset communication protocols in response to a protocol test operation, including:

[0013] Determining, by the execution platform, at least one protocol to be executed from a plurality of preset communication protocols in response to the protocol test operation;

[0014] The step of reading at least one battery pack in a data table corresponding to each of the protocols to be executed to generate corresponding battery simulation data includes:

[0015] Reading at least one battery pack in the data table corresponding to each of the protocols to be executed through the data parsing layer to generate corresponding battery simulation data;

[0016] The step of responding to a request message from the system under test, generating a response message based on the request message and the battery simulation data, and replying the response message to the system under test to receive an execution result returned by the system under test includes:

[0017] Through the data transceiver layer, in response to the request message of the system under test, a response message is generated based on the request message and the battery simulation data, and the response message is replied to the system under test to receive the execution result returned by the system under test.

[0018] Optionally, acquiring configuration data of the plurality of communication protocols through the protocol data layer, and generating data tables corresponding to the plurality of communication protocols according to the configuration data, comprises:

[0019] Acquiring configuration data of a plurality of communication protocols in response to a protocol configuration operation through the protocol data layer; wherein the configuration data includes a plurality of protocol fields of each communication protocol, and each battery pack corresponds to data content and data type of each protocol field;

[0020] The configuration data are respectively input into preset protocol templates for filling, and a plurality of data tables corresponding to the communication protocols are generated.

[0021] Optionally, reading at least one battery pack in a data table corresponding to each of the to-be-executed protocols through the data parsing layer to generate corresponding battery simulation data includes:

[0022] Through the data parsing layer, information is extracted from the data table of each protocol to be executed to obtain the data content and data type of each battery pack corresponding to the protocol field;

[0023] Based on the data type, the data content is parsed to generate battery simulation data of the corresponding battery pack.

[0024] Optionally, the protocol data layer includes a data generator, which parses the data content based on the data type to generate battery simulation data of the corresponding battery pack, including:

[0025] In response to the data type belonging to a dynamic data type, the data generator is called to parse the data content to generate battery simulation data of the corresponding battery pack; wherein the battery simulation data is a value sequence of the dynamic data type.

[0026] Optionally, the battery pack information includes the number of battery packs and battery addresses of the multiple battery packs; wherein the battery addresses are sorted in ascending order.

[0027] Optionally, the determining, by the execution platform in response to the protocol test operation, at least one protocol to be executed from the preset plurality of communication protocols comprises:

[0028] The execution platform responds to the protocol test operation to determine at least one protocol to be executed and its message receiving and sending parameters from the preset multiple communication protocols.

[0029] Optionally, the generating, by the data transceiver layer, in response to a request message of the system under test and based on the request message and the battery simulation data, a response message includes:

[0030] The data transceiver layer responds to the request message of the system under test, and according to the request message, calls the corresponding battery simulation data in the data parsing layer to assemble the response message.

[0031] In order to solve the above technical problems, another technical solution adopted by the present application is: an electronic device, the electronic device comprising:

[0032] A memory for storing executable program codes;

[0033] The processor is used to call and run the executable program code from the memory, so that the electronic device executes the communication protocol testing method as described in any one of the above.

[0034] To solve the above technical problems, another technical solution adopted in the present application is: a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the communication protocol testing method as described in any one of the above items is implemented.

[0035] Different from the prior art, the embodiment of the present application provides a communication protocol testing method, which includes: the test system determines at least one protocol to be executed from a plurality of preset communication protocols in response to the protocol test operation; reads at least one battery pack in the data table corresponding to each of the protocols to be executed to generate corresponding battery simulation data; responds to the request message of the system under test, generates a response message based on the request message and the battery simulation data, and replies the response message to the system under test to receive the execution result returned by the system under test. By flexibly selecting at least one protocol to be executed from a plurality of preset communication protocols to read at least one battery pack in the data table corresponding to each protocol to be executed, and simulating these battery packs to perform communication protocol testing with the system under test, the technical problem that multiple protocol types and a large number of battery packs under each protocol type are difficult to test with the same system under test at the same time can be solved, thereby improving the testing efficiency of the communication protocol. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 It is a flowchart of the first embodiment of the communication protocol testing method of the present application;

[0037] Figure 2 It is a flow chart of the second embodiment of the communication protocol testing method of the present application;

[0038] Figure 3 It is a schematic diagram of the system technology framework of the communication protocol test method test system of the present application;

[0039] Figure 4 This is a schematic diagram of the scenario of simulating communication networking in the test system of the communication protocol test method of this application:

[0040] Figure 5 It is a flowchart of the third embodiment of the communication protocol testing method of the present application;

[0041] Figure 6 It is an exemplary flow chart of the communication protocol testing method of the present application;

[0042] Figure 7 It is an exemplary structural block diagram of an electronic device of the communication protocol testing method of the present application;

[0043] Figure 8It is an exemplary structural block diagram of the computer-readable storage medium of the communication protocol testing method of the present application.

[0044] Figure numbers: protocol data layer 310; data parsing layer 320; data transceiver layer 330; execution platform 340; system under test 410; test system 420; model A first battery 4311; model A second battery 4312; model B first battery 4321; model B second battery 4322; model B third battery 4323; model C first battery 4331; model C second battery 4332. DETAILED DESCRIPTION

[0045] The present application is described in detail below with reference to the accompanying drawings and implementation methods.

[0046] This embodiment takes into account that

[0047] See also Figure 1 , Figure 1 It is a flow chart of the first embodiment of the communication protocol testing method of the present application. It should be noted that if there are substantially the same results, the method of the present application is not based on Figure 1 The process sequence shown is limited. Figure 1 As shown, the communication protocol testing method includes:

[0048] Step S110, the test system determines at least one protocol to be executed from a plurality of preset communication protocols in response to the protocol test operation;

[0049] Specifically, the test system is used to simulate multiple protocol types and multiple battery packs under each protocol type, and communicate with the system under test through the simulated battery pack to detect the communication function between the system under test and multiple protocol types and multiple battery packs under each protocol type. The system under test can be a battery management system (Battery Management System, BMS), such as Modbus, RS-232 / RS-485, CAN, SPI, TCP / IP and other communication protocols. The protocol test operation can be used to verify whether the system under test can communicate with multiple protocol types and multiple battery packs under each protocol type at the same time, so as to verify the functionality and reliability of the system under test under different types of protocol types and operating conditions.

[0050] The system determines the protocol to be executed through protocol testing operations based on a preset list of multiple communication protocols. Each protocol may correspond to different types of data processing requirements and different device communication methods, so it is necessary to ensure that all relevant protocols are fully verified during testing.

[0051] Step S120, reading at least one battery pack in the data table corresponding to each of the protocols to be executed to generate corresponding battery simulation data;

[0052] Specifically, each protocol to be executed corresponds to a data table, each data table may store multiple battery packs, and each battery pack may be a system composed of at least one single battery. The data table is used to structuredly manage the specific parameters and formats of each protocol type and multiple battery packs under each protocol type, so as to generate battery simulation data by simulating these battery packs and perform communication tests with the system under test.

[0053] Step S130, in response to the request message of the system under test, generating a response message based on the request message and the battery simulation data, and replying the response message to the system under test to receive the execution result returned by the system under test.

[0054] Specifically, the request message is an instruction sent by the system under test to the test system, and can be used to request a response message for the status of a battery pack or a single battery. The response message can be data generated by the test system based on the request message and sent to the system under test, simulating the result of the system's feedback to the system under test in actual operation. For example, the system under test requests the battery voltage, and the test system returns the simulated value of the battery voltage. The execution result is the processing and feedback made by the system under test based on the response message of the test system, and can be the status or result returned after the system under test performs a certain operation. Furthermore, the test system receives the execution result and compares the execution result with the expected result to verify whether the system under test can correctly handle different types of protocol types and related operations of multiple battery packs under each protocol type after receiving the response message of the test system.

[0055] In this embodiment, by flexibly selecting at least one to-be-executed protocol from a plurality of preset communication protocols to read at least one battery pack in a data table corresponding to each to-be-executed protocol, communication protocol testing of these battery packs and the system under test can be simulated. This can solve the technical problem that multiple protocol types and a large number of battery packs under each protocol type are difficult to test with the same system under test at the same time, thereby improving the testing efficiency of the communication protocol.

[0056] See also Figure 2 , Figure 2 1 is a flow chart of the second embodiment of the communication protocol testing method of the present application. Figure 2 As shown, the communication protocol testing method comprises the following steps:

[0057] Step S210, obtaining configuration data of a plurality of the communication protocols through the protocol data layer, and generating data tables corresponding to a plurality of the communication protocols according to the configuration data;

[0058] Specifically, the protocol data layer may include a data table, which may be used to record the field types and corresponding data types of all types of battery communication protocols, as well as the number of battery packs under each type of battery communication protocol. The field type may be a communication field in each protocol type, such as a register address, field length, data type, etc.; the data type may be static data or dynamic data.

[0059] Step S220, determining, by the execution platform in response to the protocol test operation, at least one protocol to be executed from the preset plurality of communication protocols;

[0060] Specifically, the execution platform is used to provide an interface to the user so that the user can configure and operate the test system. That is, the execution platform is used to convert the user's operation into the underlying function call of the system to ensure that the user can flexibly control the simulation process. After ensuring that the physical connection between the system under test and the serial port of the electronic device or server where the execution platform is located is normal, the user can determine the battery communication protocol to be executed through the execution platform, and then click to run. For the user level, after clicking to run, the test system can automatically send and receive communication data with the system under test.

[0061] Step S230, reading at least one battery pack in the data table corresponding to each of the protocols to be executed through the data parsing layer to generate corresponding battery simulation data;

[0062] Specifically, the data parsing layer can serve as a bridge between the connection protocol and the communication, converting the data into a format that can be sent and received by the system under test, thereby ensuring that data of different types of protocols can be processed.

[0063] Step S240, through the data transceiver layer, in response to the request message of the system under test, based on the request message and the battery simulation data, a response message is generated, and the response message is replied to the system under test to receive the execution result returned by the system under test.

[0064] Specifically, the data transceiver layer is used to communicate with the system under test to ensure that the request messages, response messages and execution results in the test can be correctly sent and received, and support real-time response to dynamic data.

[0065] In an exemplary embodiment, see Figure 3 The test system adopts a layered technical framework, which is divided into four parts from the bottom layer to the top layer: protocol data layer 310, data parsing layer 320, data transceiver layer 330 and execution platform 340. Among them, the protocol data layer 310 provides the data source, the data parsing layer 320 converts it into a communication format, the data transceiver layer 330 is responsible for the actual communication operation, and the execution platform 340 can be the control interface of the test system. For further information, please refer to Figure 4 , Figure 4 The system under test 410, the test system 420, the first battery 4311 of model A, the second battery 4312 of model A, the first battery 4321 of model B, the second battery 4322 of model B, the third battery 4323 of model B, the first battery 4331 of model C, and the second battery 4332 of model C are shown. The test system 420 is used to simulate the battery pack of model A, the battery pack of model B, and the battery pack of model C, and communicates with the system under test 410 through the RS485 serial port.

[0066] In this embodiment, the test system adopts a layered design so that each layer is used to perform specific tasks, which can provide a good foundation for the expansion, maintenance and testing of the system. Users can configure different test scenarios through the execution platform, while the bottom layer of the system is responsible for processing complex communication protocols and data interactions, ensuring the flexibility and accuracy of the test process.

[0067] This embodiment takes into account that the existing iron-lithium battery communication protocol still uses the real battery for manual testing, which takes a long time and is inefficient; even if the existing protocol simulation tool is used, it can often only simulate the battery data of a single protocol type, such as the Modbus Slave tool. If the lithium battery is a non-Modbus protocol, it cannot be simulated; even if the battery is based on the Modbus protocol, the custom data inside the protocol is different, and the Modbus Slave tool can only customize one type of data at the same time, that is, simulate one type of battery. Secondly, the general battery protocol also has limitations on the number of simulated devices, such as the Modbus Slave tool, which can only simulate 32 groups of lithium battery data of the same type at most. Then, during the test of the real iron-lithium battery, the data interacted through the communication protocol is constantly changing dynamically, while the existing protocol simulation tool needs to set the test data before the tool, and can only set one set of communication data. After the test is run, the battery communication data interacting with the system is fixed and unchanged, which is very different from the use scenario of the real battery, and it is difficult to simulate the dynamic changes of the data when the real battery is running.

[0068] Therefore, based on the demand for automated testing of the communication protocol of lithium iron batteries, this embodiment proposes a test system that can automatically test the communication protocol between lithium batteries and battery management systems in batches. This test system can support multiple protocol types, such as YDT1363, Modbus, etc., and each protocol can customize different data to achieve simulation of multiple types of battery data; at the same time, the configuration data of the test system is realized in Excel, and each group of batteries is just a row of Excel, which can achieve simulation of large quantities of battery data. In addition, the test system can also define and customize the change curve of each group of battery data, and realize the dynamic change of data during the test process, so as to be closer to the dynamic change of data when the real battery is running.

[0069] See also Figure 5 , Figure 5 1 is a flow chart of the third embodiment of the communication protocol testing method of the present application. Figure 5 As shown, the communication protocol testing method includes:

[0070] Step S510, obtaining configuration data of a plurality of communication protocols in response to a protocol configuration operation through the protocol data layer; wherein the configuration data includes a plurality of protocol fields of each communication protocol, and each battery pack corresponds to data content and data type of each protocol field;

[0071] The protocol fields between different protocol types may be different. For multiple protocol fields under any protocol type, these protocol fields may be used to define the data content of each battery pack under this protocol type. The protocol type may include but is not limited to: register address, field length, data type, precision, offset and unit, etc. The data content may be the specific data that the battery pack actually wants to transmit or simulate for each protocol field. The data type may be a specific type of data content, such as static data or dynamic data.

[0072] Step S520: input the configuration data into preset protocol templates for filling, and generate a plurality of data tables corresponding to the communication protocols.

[0073] Among them, each communication protocol of each protocol type may correspond to a data table, and the data table may be an Excel sheet. The first row of the data table may be multiple protocol fields; the second row and subsequent rows of the data table may each represent specific data actually to be transmitted or simulated under multiple protocol fields corresponding to a battery pack.

[0074] The test system may be pre-set with a protocol template, which may contain the basic framework of each protocol type, such as the layout of the protocol field, data format, etc., but may not contain specific data content. Multiple protocol fields corresponding to each protocol type (such as register address, field length, etc.) are filled into the corresponding positions in the template, and according to the requirements of the protocol field, it can be ensured that the data type of each field is correctly matched to the template.

[0075] Step S530: In response to the protocol test operation, the execution platform determines at least one protocol to be executed and its message receiving and sending parameters from the preset multiple communication protocols.

[0076] Specifically, the execution platform can be an operation interface of the test system. The user can configure through the execution platform. For example, the user can select the protocol type to be simulated, can select to simulate all protocol types, or can select a part of the protocol types for simulation; the user can also configure the message sending and receiving parameters through the execution platform, wherein the message sending and receiving parameters can include but are not limited to the duration of sending and receiving messages and the serial port number, etc. Further, the number of battery packs under each protocol type can be configured. The test system starts the test according to these configurations and displays the real-time data during the test through the execution platform.

[0077] Step S540, extracting information from the data table of each protocol to be executed through the data parsing layer to obtain the data content and data type of each battery pack corresponding to the protocol field;

[0078] Step S550: parsing the data content based on the data type to generate battery simulation data of the corresponding battery pack.

[0079] Specifically, the data parsing layer can read the data content corresponding to each protocol field from the data table. If the data type of the data content is a constant, the data parsing layer directly reads and parses the data content; if the data type of the data content is dynamic data, the data parsing layer calls the data generator to generate a dynamic value and then parses it. The parsed battery simulation data can be used for communication interaction in the data transceiver layer.

[0080] Further, the protocol data layer includes a data generator, and step S550 may include:

[0081] In response to the data type belonging to a dynamic data type, the data generator is called to parse the data content to generate battery simulation data of the corresponding battery pack; wherein the battery simulation data is a value sequence of the dynamic data type.

[0082] Specifically, in a simulation environment, battery simulation data of some specific protocol types need to change during the test process to simulate the real-time state of the battery. Therefore, by using a data generator with multiple data generation methods, the corresponding battery simulation data can be dynamically generated according to demand when the data type belongs to dynamic data. Among them, dynamic data types include but are not limited to random quantities within a limited range, enumeration types, Boolean types, and linear or nonlinear change curves customized according to specific parameters. When a field in a data table is marked as a dynamic data type, the test system can call the function of the data generator to generate the corresponding dynamic data. For example, the voltage of the battery can gradually decrease according to a preset linear curve as the test progresses.

[0083] Step S560, responding to the request message of the system under test through the data transceiver layer, calling the corresponding battery simulation data in the data parsing layer according to the request message, assembling the response message, and replying the response message to the system under test to receive the execution result returned by the system under test.

[0084] Specifically, the data transceiver layer is used to communicate with the system under test, and generates and sends response messages to the test system based on its request messages. The transceiver layer calls the data parsing layer to generate the corresponding battery simulation data and assembles it into a response message that conforms to the protocol format. Among them, if the response message contains a dynamically generated part, the data transceiver layer will call the data parsing layer and the data generator each time it responds, ensuring that the data returned each time can change dynamically to simulate the changes in the real battery status.

[0085] In an exemplary embodiment, see Figure 6 , the data table of each protocol type in the test system can be maintained in advance, which can specifically include the configuration of the protocol type to be simulated, the number of simulated battery groups, multiple protocol fields under each protocol type, and the data content and data type corresponding to each protocol field; before each communication protocol test, the user can select or default the communication protocol to be tested, as well as the serial port number for sending and receiving communication messages, the change frequency and number of changes of battery simulation data through the execution platform; then, the user can click to run through the execution platform, and the execution platform reads the parameters in the data table corresponding to the communication protocol to be executed in the protocol data layer, specifically including the number of battery groups, data content and data type of the data table corresponding to each communication protocol to be executed; if the data type is static If the data type is dynamic data, the data parsing layer is directly called to parse the data content and generate corresponding battery simulation data; if the data type is dynamic data, the data content is transmitted to the data generator, and the data generation method of the data generator is used to generate a parameter value sequence, and then the data parsing layer is called to parse the parameter value sequence to generate corresponding battery simulation data; then the data transceiver layer is called, and the data transceiver layer responds to the request message of the system under test, calls and assembles the battery simulation data according to the request message, generates a response message, and sends the response message to the system under test to receive the execution result returned by the system under test; further, the execution result can also be written back to the corresponding data table; finally, it can be determined whether the communication protocol is running normally according to the execution result.

[0086] In this embodiment, the protocol fields, data formats, etc. of different protocol types are defined by utilizing data tables, thereby standardizing the battery simulation data generation process for multiple protocol types and multiple battery packs under each protocol type; at the same time, the test system parses and generates battery data through data tables to ensure that the communication with the system under test complies with the protocol specifications so that the test system can accurately transmit and process data; in addition, when the data content is a dynamic data type, calling the data generator to generate the corresponding dynamic battery simulation data can realize dynamic changes in data during the test process, thereby being closer to the dynamic changes in data when the real battery is in operation.

[0087] See also Figure 7 , Figure 7 is an exemplary structural block diagram of an electronic device of the communication protocol testing method of the present application. Figure 7 As shown, the electronic device 700 of the present application may include a processor 701 and a memory 702, wherein the processor 701 and the memory 702 communicate with each other via a bus. The memory 702 stores program instructions for communication protocol testing, and when the program instructions are executed by the processor 701, the processor executes the above-mentioned related method steps to implement a communication protocol testing method in the above-mentioned embodiment.

[0088] See also Figure 8 , Figure 8 is an exemplary structural block diagram of a computer-readable storage medium of the communication protocol testing method of the present application. Figure 8 As shown, the computer-readable storage medium 800 stores a computer program 801. When the computer program 801 is executed by a processor on a computer, the computer executes the above-mentioned related method steps to implement a communication protocol testing method in the above-mentioned embodiment.

[0089] In the above scheme, the test system responds to the protocol test operation, determines at least one protocol to be executed from the preset multiple communication protocols; reads at least one battery pack in the data table corresponding to each of the protocols to be executed to generate corresponding battery simulation data; responds to the request message of the system under test, generates a response message based on the request message and the battery simulation data, and replies the response message to the system under test to receive the execution result returned by the system under test. By flexibly selecting at least one protocol to be executed from multiple preset communication protocols to read at least one battery pack in the data table corresponding to each protocol to be executed, and simulating these battery packs to perform communication protocol testing with the system under test, the technical problem that multiple protocol types and a large number of battery packs under each protocol type are difficult to test with the same system under test at the same time can be solved, thereby improving the testing efficiency of the communication protocol.

[0090] In the several embodiments provided in the present application, it should be understood that the disclosed methods, electronic devices and storage media can be implemented in other ways. For example, the device implementation described above is only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0091] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0092] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0093] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (processor) to perform all or part of the steps of the communication protocol test method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.

[0094] The above description is only an implementation method of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly used in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A communication protocol testing method, characterized in that: The communication protocol testing method comprises: The test system determines at least one protocol to be executed from a plurality of preset communication protocols in response to the protocol test operation; Reading at least one battery pack in the data table corresponding to each of the protocols to be executed to generate corresponding battery simulation data; In response to a request message from the system under test, a response message is generated based on the request message and the battery simulation data, and the response message is replied to the system under test to receive an execution result returned by the system under test.

2. The protocol testing method according to claim 1, characterized in that: The test system includes an execution platform, a data transceiver layer, a data parsing layer and a protocol data layer; The test system, in response to the protocol test operation, before determining at least one protocol to be executed from a plurality of preset communication protocols, comprises: Acquire configuration data of a plurality of the communication protocols through the protocol data layer, and generate data tables corresponding to a plurality of the communication protocols according to the configuration data; The test system determines at least one protocol to be executed from a plurality of preset communication protocols in response to a protocol test operation, including: Determining, by the execution platform, at least one protocol to be executed from a plurality of preset communication protocols in response to the protocol test operation; The step of reading at least one battery pack in a data table corresponding to each of the protocols to be executed to generate corresponding battery simulation data includes: Reading at least one battery pack in the data table corresponding to each of the protocols to be executed through the data parsing layer to generate corresponding battery simulation data; The step of responding to a request message from the system under test, generating a response message based on the request message and the battery simulation data, and replying the response message to the system under test to receive an execution result returned by the system under test includes: Through the data transceiver layer, in response to the request message of the system under test, a response message is generated based on the request message and the battery simulation data, and the response message is replied to the system under test to receive the execution result returned by the system under test.

3. The protocol testing method according to claim 2, characterized in that: The step of acquiring configuration data of a plurality of the communication protocols through the protocol data layer and generating data tables corresponding to a plurality of the communication protocols according to the configuration data comprises: Acquiring configuration data of a plurality of communication protocols in response to a protocol configuration operation through the protocol data layer; wherein the configuration data includes a plurality of protocol fields of each communication protocol, and each battery pack corresponds to data content and data type of each protocol field; The configuration data are respectively input into preset protocol templates for filling, and a plurality of data tables corresponding to the communication protocols are generated.

4. The protocol testing method according to claim 3, characterized in that: The step of reading at least one battery pack in the data table corresponding to each of the protocols to be executed through the data parsing layer to generate corresponding battery simulation data includes: Through the data parsing layer, information is extracted from the data table of each protocol to be executed to obtain the data content and data type of each battery pack corresponding to the protocol field; Based on the data type, the data content is parsed to generate battery simulation data of the corresponding battery pack.

5. The protocol testing method according to claim 4, characterized in that: The protocol data layer includes a data generator; based on the data type, the data content is parsed to generate battery simulation data corresponding to the battery pack, including: In response to the data type belonging to a dynamic data type, the data generator is called to parse the data content to generate battery simulation data of the corresponding battery pack; wherein the battery simulation data is a value sequence of the dynamic data type.

6. The protocol testing method according to claim 2, characterized in that: The battery pack information includes the number of battery packs and battery addresses of the multiple battery packs; wherein the battery addresses are sorted in ascending order.

7. The protocol testing method according to claim 2, characterized in that: The step of determining, by the execution platform in response to the protocol test operation, at least one protocol to be executed from a plurality of preset communication protocols comprises: The execution platform responds to the protocol test operation to determine at least one protocol to be executed and its message receiving and sending parameters from the preset multiple communication protocols.

8. The protocol testing method according to claim 2, characterized in that: The step of generating a response message based on the request message and the battery simulation data by the data transceiver layer in response to the request message of the system under test includes: The data transceiver layer responds to the request message of the system under test, and according to the request message, calls the corresponding battery simulation data in the data parsing layer to assemble the response message.

9. An electronic device, characterized in that: The electronic device comprises: A memory for storing executable program codes; A processor, configured to call and run the executable program code from the memory, so that the electronic device executes the communication protocol testing method as described in any one of claims 1 to 8.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the communication protocol testing method according to any one of claims 1 to 8 is implemented.