Communication test method and system of battery array management unit, and storage medium

By using the mapping relationship between signal constants and signal addresses in the communication test of the battery array management unit, the problem of large workload and high maintenance costs of test scripts is solved, and efficient and easy-to-read signal testing is achieved.

CN120281693APending Publication Date: 2025-07-08JIANGXI THERMAL POWER CONSTR CORP +3
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510432751.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-08
Publication Date
2025-07-08

AI Technical Summary

Technical Problem

In the prior art, the communication test script analysis of the battery array management unit is large in work and has high maintenance costs, making it difficult to efficiently conduct signal testing and protocol analysis.

Method used

By calling the test cases of target signal constants in the test script, the simulation analysis node communicates with the battery array management unit, sends test instructions for the target signal address, and performs signal testing based on the signal operation results, establishes a mapping relationship between the signal constant and the signal address, and reduces the analysis workload and maintenance costs.

Benefits of technology

It realizes the convenience and clear and easy-to-read signal testing, reduces the parsing workload and maintenance cost of test scripts, and improves testing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120281693A_ABST
    Figure CN120281693A_ABST
Patent Text Reader

Abstract

The invention relates to a communication test method and system for a battery array management unit and a storage medium, and the method comprises the steps: calling a test case of a target signal constant in a test script, and transmitting a simulation analysis node which is in communication connection with the battery array management unit to a simulation analysis node which is in communication connection with the battery array management unit; sending a test instruction for the target signal address to enable the simulation analysis node to perform signal operation on the target signal address, and performing signal test according to a signal operation result; wherein the target signal constant and the target signal address have a pre-established mapping relation; the target signal address is a to-be-tested signal address corresponding to an external communication link of the battery array management unit. The signal constant can be directly called in the test script, and the analysis workload and maintenance cost of the test script are reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of energy storage testing, and particularly to a communication testing method, system, and storage medium for a battery array management unit. Background Art

[0002] Currently, in order to ensure the accuracy of the communication protocol, signal integrity, system reliability, and functional correctness between the battery array management unit (BAU) in the energy storage system and external devices (such as human-machine interfaces, Energy Management Systems (EMS), etc.), automated testing tools (such as ECU-TEST) are usually used to perform read and write tests on the signals corresponding to the communication protocol. The communication between the BAU and external devices usually uses the Ethernet Modbus TCP protocol, which defines signal names, signal addresses, signal accuracies, offsets, etc. In the test, the protocol needs to be parsed, and then the corresponding variables are called in the automated testing tool ECU-TEST to complete the reading and writing of signals and make judgments to achieve automated testing.

[0003] In some related technologies, the protocol is often parsed by signal name, all signals are captured and stored separately in system variables, and system variables are retrieved in ECU-TEST to write automated scripts and complete the test. In this way, tens of thousands of system variables need to be made to complete the full match with the communication protocol, and the parsing workload is large. When the communication protocol changes, the system variables also need to be updated synchronously, and the later maintenance cost is high.

[0004] In view of the problems of large parsing workload and high maintenance cost of test scripts in related technologies, no effective solution has been proposed yet. Summary of the Invention

[0005] In this embodiment, a communication testing method, system, and storage medium for a battery array management unit are provided to solve the problems of large parsing workload and high maintenance cost of test scripts in related technologies.

[0006] In a first aspect, in this embodiment, a communication testing method for a battery array management unit is provided. The method includes:

[0007] Based on the test cases that call the target signal constants in the test script, send a test instruction for the target signal address to the simulation parsing node communicatively connected to the battery array management unit, so that the simulation parsing node performs signal operations on the target signal address and performs signal tests according to the results of the signal operations; where:

[0008] The target signal constant has a pre - established mapping relationship with the target signal address; the target signal address is the signal address to be tested corresponding to the external communication link of the battery array management unit.

[0009] In some of the embodiments, before sending a test instruction for the target signal address, the method further includes:

[0010] Determine the signal address to be tested and the signal name to be tested according to the communication protocol used by the external communication link;

[0011] Use a preset Python script, with the signal address to be tested and the signal name to be tested as script inputs, to complete the establishment of a one - to - one mapping relationship between each signal address to be tested and the signal constant; the signal constant includes the target signal constant.

[0012] In some of the embodiments, in the test script - based method, call the test case of the target signal constant, and send a test instruction for the target signal address to the simulation parsing node communicatively connected to the battery array management unit, so that the simulation parsing node performs signal operations on the target signal address and conducts signal testing according to the result of the signal operation, including:

[0013] Based on the test script, call the read test case of the first signal constant, send a signal read instruction for the first signal address to the simulation parsing node communicatively connected to the battery array management unit, and receive the read value fed back by the simulation parsing node for read testing; the first signal address has a pre - established mapping relationship with the first signal constant; and / or,

[0014] Based on the test script, call the write test case of the second signal constant, send a signal write instruction for the second signal address to the simulation parsing node, so that the simulation parsing node writes the write value included in the signal write instruction to the second signal address for write testing; the second signal address has a pre - established mapping relationship with the second signal constant; the first signal address and the second signal address are both signal addresses to be tested corresponding to the communication protocol of the battery array management unit.

[0015] In some of the embodiments, based on the test script, call the read test case of the first signal constant, send a signal read instruction for the first signal address to the simulation parsing node communicatively connected to the battery array management unit, and receive the read value fed back by the simulation parsing node for read testing, including:

[0016] Based on the test script, call the read test case of the first signal constant, and send a signal read instruction for the first signal address to the simulation parsing node;

[0017] From the system variables established by the simulation parsing node, obtain the read value captured by the simulation parsing node from the first signal address in the external communication link;

[0018] Compare the read value with a preset expected value, and determine the read test result for the first signal address according to the comparison result.

[0019] In some embodiments, in the test script, call the write test case of the second signal constant, and send a signal write instruction for the second signal address to the simulation parsing node, so that the simulation parsing node writes the write value included in the signal write instruction to the second signal address for write test, including:

[0020] Based on the test script, call the write test case of the second signal constant, and send a signal write instruction for the second signal address to the simulation parsing node, so that the simulation parsing node writes the write value included in the signal write instruction to the second signal address in the external communication link;

[0021] Based on the signal read operation associated with the second signal address, determine whether the write of the signal write instruction is successful to obtain the write test result for the second signal address.

[0022] In some embodiments, the test script includes test packages corresponding to different signal operation tests, and each test package reserves a setting interface to set signal constants corresponding to signal addresses to be tested.

[0023] In a second aspect, a communication test system for a battery array management unit is provided in this embodiment, including a test tool and a simulation parsing node;

[0024] The simulation parsing node is communicatively connected to the battery array management unit to be tested based on the application layer communication protocol of Ethernet;

[0025] The test tool is used to execute the communication test method of the battery array management unit described in the first aspect above.

[0026] In a third aspect, an electronic device is provided in this embodiment, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the communication test method of the battery array management unit described in the first aspect above is implemented.

[0027] Fourthly, in this embodiment, a storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the communication test method of the battery array management unit described in the first aspect above is implemented.

[0028] Compared with the related art, in this embodiment, a communication test method, a system and a storage medium for a battery array management unit are provided. In the communication test method of the battery array management unit, based on the test cases that call the target signal constants in the test script, test instructions for the target signal address are sent to the simulation parsing node communicatively connected to the battery array management unit, so that the simulation parsing node performs signal operations on the target signal address, and signal tests are performed according to the results of the signal operations; wherein: there is a pre-established mapping relationship between the target signal constant and the target signal address; the target signal address is the signal address to be tested corresponding to the external communication link of the battery array management unit. It can directly call signal constants in the test script, reducing the parsing workload and maintenance cost of the test script.

[0029] Details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more concise and understandable. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation of the present application. In the drawings:

[0031] Figure 1 is a hardware structure block diagram of the terminal of the communication test method of the battery array management unit according to an embodiment of the present application;

[0032] Figure 2 is a flowchart of the communication test method of the battery array management unit according to an embodiment of the present application;

[0033] Figure 3 is an interaction schematic diagram between an ECU-TEST and a simulation parsing node according to an embodiment of the present application;

[0034] Figure 4 is a mapping relationship schematic diagram between a signal constant and a signal address according to an embodiment of the present application;

[0035] Figure 5a is a schematic diagram of the composition of a test script for implementing signal reading test according to an embodiment of the present application;

[0036] Figure 5b is an expansion schematic diagram of a signal reading test packet according to an embodiment of the present application;

[0037] Figure 6aIt is a schematic diagram of the composition of a test script for implementing signal writing tests according to an embodiment of the present application;

[0038] Figure 6b It is an expanded schematic diagram of a signal writing test package according to an embodiment of the present application;

[0039] Figure 7 It is a schematic diagram of the composition of a test script for readable and writable signals according to an embodiment of the present application;

[0040] Figure 8 It is a flowchart of a communication test method for a battery array management unit according to some embodiments of the present application;

[0041] Figure 9 It is a schematic diagram of the structure of a communication test system for a battery array management unit according to this embodiment. Detailed implementation manners

[0042] For a clearer understanding of the purpose, technical solution, and advantages of the present application, the present application will be described and explained below in conjunction with the accompanying drawings and embodiments.

[0043] Unless otherwise defined, the technical terms or scientific terms involved in the present application shall have the general meaning understood by those with ordinary skills in the technical field to which the present application belongs. In the present application, words such as "a", "one", "a kind of", "the", "these", etc. do not indicate a limitation in quantity, and they can be singular or plural. The terms "including", "comprising", "having" and any variations thereof involved in the present application are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or device including a series of steps or modules (units) is not limited to the listed steps or modules (units), but may include unlisted steps or modules (units), or may include other steps or modules (units) inherent in these processes, methods, products, or devices. The terms "connected", "coupled", etc. involved in the present application do not limit to physical or mechanical connections, but may include electrical connections, whether directly or indirectly connected. The term "plurality" involved in the present application refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" may represent: A exists alone, A and B exist simultaneously, and B exists alone. Usually, the character " / " indicates that the associated objects before and after are in an "or" relationship. The terms "first", "second", "third", etc. involved in the present application are only used to distinguish similar objects and do not represent a specific sorting for the objects.

[0044] The method embodiments provided in this embodiment can be executed on a terminal, a computer, or a similar computing device. For example, running on a terminal, Figure 1It is a hardware structure block diagram of the terminal of the communication test method for the battery array management unit of this embodiment. As Figure 1 shown, the terminal may include one or more ( Figure 1 only one is shown in the figure) processors 102 and a memory 104 for storing data. Among them, the processor 102 may include, but is not limited to, processing devices such as a microprocessor MCU or a field programmable gate array FPGA. The above terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those of ordinary skill in the art can understand that Figure 1 the structure shown is only for illustration and does not limit the structure of the above terminal. For example, the terminal may further include more or fewer components than Figure 1 shown in the figure, or have a different configuration from Figure 1 shown.

[0045] The memory 104 can be used to store computer programs. For example, software programs and modules of application software, such as the computer program corresponding to the communication test method of the battery array management unit in this embodiment. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, implements the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some instances, the memory 104 may further include a memory remotely set relative to the processor 102, and these remote memories can be connected to the terminal through a network. Examples of the above network include, but are not limited to, the Internet, an enterprise intranet, a local area network, a mobile communication network, and their combinations.

[0046] The transmission device 106 is used to receive or send data via a network. The above network includes the wireless network provided by the communication provider of the terminal. In one instance, the transmission device 106 includes a network adapter (abbreviated as NIC), which can be connected to other network devices through a base station and thus can communicate with the Internet. In one instance, the transmission device 106 may be a radio frequency (abbreviated as RF) module, which is used to communicate with the Internet wirelessly.

[0047] In this embodiment, a communication test method for a battery array management unit is provided. Figure 2 It is a flowchart of the communication test method for the battery array management unit of this embodiment. As Figure 2 shown, the process includes the following steps:

[0048] Step S210, based on the test script, calls the test case of the target signal constant, sends a test instruction for the target signal address to the simulation parsing node that is communicatively connected to the battery array management unit, so as to make the simulation parsing node perform a signal operation on the target signal address, and perform a signal test according to the result of the signal operation; wherein: the target signal constant and the target signal address have a pre-established mapping relationship; the target signal address is the signal address to be tested corresponding to the external communication link of the battery array management unit.

[0049] The above-mentioned test script can specifically be a test tool ECU-TEST suitable for automated testing of electronic control units (ECUs), which uses automated scripts that are pre-written using computer programs. A simulation parsing node based on the controller area network (CAN) bus access programming language (CAPL) can be added to the external communication link between the BAU and the human-machine interface or the energy management system. Through the communication between the test tool ECU-TEST and the simulation parsing node, the master station is simulated to send a read or write request instruction to the slave station (that is, the tested device BAU), and the returned data obtained is processed. The test tool can send a signal read and / or write instruction to the simulation parsing node, so that test cases for signal reading tests and test cases for signal writing can be set accordingly. The specific automated testing process is not limited in this embodiment.

[0050] The above signal address is the starting address of the signal (for example, battery voltage value, temperature value, etc.) in the register of the Modbus TCP protocol, which is 2 bytes. Most signals only occupy one address. Due to the large data value of some signals, the data combination of two addresses will be used to represent them. For example, "BAU single discharge power" uses the data combination of 0x0040 and 0x0041 to represent the data content. The above signal constants can be implemented based on the global constants Globalconstants provided by ECU-TEST. Global constants can be used as a convenient tool to establish mapping relationships. After the signal constants are established, it is easier to read when writing test cases than to use signal addresses to call, which enhances the readability of test cases. In addition, after the communication protocol file is changed on the development side, the test side only needs to change the signal constants, and there is no need to rewrite the test cases. Avoid large amounts of repetitive work and save time.

[0051] The mapping between different signal constants and signal addresses in the Ethernet based on the Modbus TCP communication protocol can be completed in advance. Then, in the test script of the test tool, use Clobal constants to define signal constants, where the name of the signal constant is the same as the signal name in the communication protocol. By calling the corresponding signal constant, for example, in the way of "api.GlobalConstants.signal constant name" to call the signal constant, the test script can be written, so that based on this test script, the operation of the signal constant can be converted into the operation of the signal address in the CAPL simulation parsing node.

[0052] In this embodiment, through the mapping of signal constants and signal addresses, in the test script, the reading operation of the signal at the signal address can be realized only based on the call of the signal constant. Since the signal constant is loaded by ECU-TEST, and the mapping relationship can also be generated with one click by means of a Python script, and the converted signal constant is stored in the ".gcd" file available to ECU-TEST, therefore, there is no problem of poor operation when ECU-TEST loads and uses the ".gcd" file. Thus, there is no problem of poor operation in the establishment of the mapping relationship between signal constants and signal addresses and the loading and use of signal constants. Even if the protocol changes, the maintenance difficulty is relatively low. In the related technology, the system variables that exactly match the communication protocol used are added by CANoe. There is no way to generate multiple system variables with one click. Each system variable needs to be added manually, and the parsing workload is large. In addition, when CANoe loads tens of thousands of system variables, it is relatively stuck and not easy to use during operation.

[0053] In some other related technologies, the data corresponding to the signal address is captured on the communication link, and ECU-TEST directly inputs the signal address to write the test script to complete the test. In this way, all the test scripts use signal addresses, such as "0x0001", "0x0002", etc., and it is impossible to clearly see what signal is being operated on. Therefore, the readability of the test script is poor and it is not easy to debug.

[0054] Therefore, on the one hand, this embodiment does not require the use of signal addresses in the automation script, ensuring the clarity and readability of the automation script. On the other hand, it does not require the creation of a large number of system variables, reducing the parsing workload and maintenance cost, and can also achieve convenient interaction with the CAPL simulation node.

[0055] Figure 3 It is an interaction schematic diagram between ECU-TEST and the simulation parsing node of this embodiment. As Figure 3As shown, a CAPL simulation parsing node is added to the communication link between the BAU and human-machine interfaces such as the host computer and the screen, or between the BAU and the EMS based on the Modus TCP communication protocol. ECU-TEST is used as an automated testing tool, and this CAPL simulation parsing node is responsible for receiving the "read or write" instructions sent from ECU-TEST and the addresses of the signals to be read or written, and feeding the obtained original Ethernet data back into the system variables created by the simulation parsing node for ECU-TEST to obtain and judge in order to achieve automated testing. Among them, the BAU can communicate based on CAN with each battery control unit (abbreviated as BCU). Each BCU can control and manage multiple battery management units (abbreviated as BMU). For example Figure 3 in, the BAU communicates with BCU1 to BCUn, and each BCU communicates with the corresponding BMU1 to BMUn.

[0056] The communication inside the BAU and the BCU is CAN communication, and the corresponding communication protocol is the Database Container protocol (abbreviated as DBC). The comprehensive tool CANoe for automotive electronics system development, testing, and analysis observes the signals on the CAN bus by loading the DBC file. For the Ethernet communication between the BAU and external devices, there is no file similar to the DBC protocol file, so the signals transmitted on the Ethernet cannot be directly observed. To capture the signals on the Ethernet, this embodiment introduces the above-mentioned simulation parsing node to capture the signals on the Ethernet.

[0057] Figure 4 It is a schematic diagram of the mapping relationship between signal constants and signal addresses in this embodiment. As Figure 4 shown, each signal address can map to a signal constant, and different signal addresses map to different signal constants. For example, the signal constant named "SysHVWorkSts" maps to the signal address in hexadecimal form "0x0001" and in decimal form "1".

[0058] This embodiment can adopt the method of parsing by address in protocol parsing to realize the one-to-one mapping between the Global constants signal constants of ECU-TEST and the signal addresses in the protocol. In this way, the signal constants can be directly called in the test script to write the automated script, which can not only reduce the workload of protocol parsing and the later maintenance cost, but also make the test script clear and easy to read.

[0059] Through the above step S210, based on the test cases that call the target signal constants in the test script, send test instructions for the target signal address to the simulation parsing node communicatively connected to the battery array management unit, so that the simulation parsing node performs signal operations on the target signal address and conducts signal tests according to the results of the signal operations; wherein: there is a pre-established mapping relationship between the target signal constants and the target signal addresses; the target signal address is the signal address to be tested corresponding to the external communication link of the battery array management unit. It can directly call signal constants in the test script, reducing the parsing workload and maintenance cost of the test script.

[0060] In one embodiment, before sending the test instructions for the target signal address, the above communication test method may further include:

[0061] Determine the signal address to be tested and the signal name to be tested according to the communication protocol used by the external communication link; use a preset Python script, with the signal address to be tested and the signal name to be tested as script inputs, to complete the establishment of a one-to-one mapping relationship between each signal address to be tested and the signal constants; the signal constants include the target signal constants.

[0062] Specifically, the signal name and signal address can be extracted from the Modbus communication protocol document. The signal address can be first converted to decimal, and the signal name and signal address are input into a pre-written Python script to establish a one-to-one mapping relationship between different signal addresses and signal constants. Thus, according to the definition of the Modbus TCP communication protocol, use Global constants in ECU-TEST to define the mapping relationship between signal constants and addresses in the protocol.

[0063] Additionally, after the mapping relationship is established, the mapping relationship can be stored in a file of the ".xam" type. When calling signal constants in the test cases of ECU-TEST, the API interface function provided by ECU-TEST will obtain the mapped signal address in the ".xam" file through the name of the signal constant. Among them, when calling the API, the name of the signal constant is input in the test script, but when executing the specific test case, the corresponding signal address is actually sent to the simulation parsing node. The mapping of GlobalConstants can complete this conversion. Therefore, this embodiment can achieve the convenient generation of the mapping relationship between signal constants and signal addresses, thus realizing the convenient interaction between the test tool and the simulation node.

[0064] In one embodiment, based on the above step S210, in the test script, a test case for calling a target signal constant is used to send a test instruction for a target signal address to a simulation parsing node communicatively connected to the battery array management unit, so that the simulation parsing node performs signal operations on the target signal address and performs signal testing based on the results of the signal operations, which may include:

[0065] In the test script, a read test case for calling a first signal constant is used to send a signal read instruction for a first signal address to a simulation parsing node communicatively connected to the battery array management unit, and the read value fed back by the simulation parsing node is received for read testing; a mapping relationship is pre-established between the first signal address and the first signal constant; and / or, in the test script, a write test case for calling a second signal constant is used to send a signal write instruction for a second signal address to the simulation parsing node, so that the simulation parsing node writes the write value included in the signal write instruction to the second signal address for write testing; a mapping relationship is pre-established between the second signal address and the second signal constant; both the first signal address and the second signal address are signal addresses to be tested corresponding to the communication protocol of the battery array management unit.

[0066] Signals of the Modbus TCP communication protocol are classified into three types according to attributes: read-only (R), write-only (W), and read-write (W / R). Among them, when testing a read-only (R) signal or a read-write (W / R) signal, in the test script, a read test case for a first signal constant for the read-only signal or the read-write signal can be called to send a "read" instruction to the simulation parsing node and send the first signal address to be read, so as to complete the test of signal reading based on the reading operation of the simulation parsing node from the corresponding first signal address. When testing a write-only (W) signal or a read-write (W / R) signal, in the test script, a write test case for a second signal constant for the write-only signal or the read-write signal can be called to send a "write" instruction to the simulation parsing node to write a signal to the corresponding second signal address, and then the signal write test can be completed based on the feedback of the simulation parsing node.

[0067] This embodiment can complete the read and write tests of signals based on the read test case, the write test case, and the interaction between the test tool and the simulation parsing node.

[0068] Specifically, in one embodiment, in the test script, a read test case for calling a first signal constant is used to send a signal read instruction for a first signal address to a simulation parsing node communicatively connected to the battery array management unit, and the read value fed back by the simulation parsing node is received for read testing, which may include:

[0069] In the test script, call the read test case of the first signal constant, send a signal read instruction for the first signal address to the simulation parsing node; obtain the read value captured by the simulation parsing node from the first signal address in the external communication link from the system variables established by the simulation parsing node; compare the read value with the preset expected value, and determine the read test result for the first signal address according to the comparison result.

[0070] Specifically, ECU-TEST sends a "read" instruction and the first signal address to be read to the CAPL simulation parsing node. The CAPL simulation parsing node captures the data corresponding to the first signal address on the Ethernet and feeds it back to the system variables built in the simulation parsing node. ECU-TEST obtains the value of the system variable in the simulation parsing node and compares it with the set expected value. If the two are the same, the test is judged to pass; otherwise, the test is judged to fail.

[0071] It should be noted that the system variables built in the simulation parsing node are not the system variables matching the Modbus TCP communication protocol established in the related art for signal testing. The system variables built in the simulation parsing node in this embodiment are for the simulation parsing node to communicate with BAU or the upper computer, etc., and are used to realize data reading and writing. This embodiment does not need to establish system variables matching the Modbus TCP communication protocol. The number of system variables built in the simulation parsing node in this embodiment is relatively small, which is quite different from the number of system variables established in the related art for signal testing. The system variables built in the simulation parsing node in this embodiment are equivalent to an intermediate container. For example, the values read from BAU are placed in system variables such as receive value[0], receive valuel[1], receive value

[500] . When ECU-TEST tests, it takes values from these system variables, which are the read signal values. Correspondingly, in the writing process, ECU-TEST gives the signal value to be written to the system variable RegisterValue of the simulation parsing node, and the simulation parsing node writes this value to the required signal address. Based on this, this embodiment simulates and realizes the data reading interaction between the master station and the DUT BAU based on the interaction between the test tool and the simulation parsing node.

[0072] In addition, in one embodiment, in the test script, call the write test case of the second signal constant, send a signal write instruction for the second signal address to the simulation parsing node, so that the simulation parsing node writes the write value included in the signal write instruction to the second signal address for write testing, which may specifically include:

[0073] In the test script, a write test case that calls the second signal constant is used to send a signal write instruction for the second signal address to the simulation parsing node, so that the simulation parsing node writes the write value included in the signal write instruction to the second signal address in the external communication link; based on the signal read operation associated with the second signal address, it is judged whether the write of the signal write instruction is successful, so as to obtain the write test result for the second signal address.

[0074] Specifically, ECU-TEST sends a "write" instruction, the second signal address to be written, and the write value to the CAPL simulation parsing node. The CAPL simulation parsing node writes the write value to the second signal address. The success of the write can be judged by reading other associated signals. For example, request to switch to the operation and maintenance mode. After writing the signal constant "OPSCtrlCmd" as 1, read the signal value of the signal "SysWorkSts" representing the system state. If the signal value indicates a switch to the operation and maintenance mode, it is confirmed that the write is successful. If the signal value indicates that the switch to the operation and maintenance mode has not occurred, it is confirmed that the write fails.

[0075] Additionally, in one embodiment, the test script includes test packages corresponding to different signal operation tests. Each test package reserves a setting interface to set the signal constant corresponding to the signal address to be tested. Among them, test statements that can be repeatedly called related to signal operations (such as signal reading or signal writing) can be packaged into test packages, and the parameters to be set are reserved with setting interfaces. Thus, when automatically executing test cases, the test package can be directly called to save the script writing time and make the test program more concise. In this embodiment, the signal constant, the corresponding number of signals, etc. can be set in the setting interface reserved by the test package. For example, BAURead is a test package for reading signals. The signal constant "api.GlobalConstants.SysHVWorkSts" can be set in the setting interface "SignalAddress" reserved by this test package for calling the signal constant "SysHVWorkSts". The number of signals SignalNum can be set to 1. Here, the number of signals N means reading N signal values simultaneously, that is, starting from the signal address corresponding to the set signal constant and going back N signals in total.

[0076] Next, take BAURead as the test package for reading signals and read the value of the signal "SysHVWorkSts" as an example for illustration. Figure 5a It is a schematic diagram of the composition of a test script for implementing signal reading test. As Figure 5aAs shown in the figure, in order to implement signal reading tests, the script can include the BAURead package and the "JOB-Execute:ReadSysVar" instruction. Among them, BAURead can target a certain signal, such as the maximum battery temperature, and simulate the master station to send a request read function code in the Modbus TCP protocol to the slave station BAU, and finally obtain the maximum temperature value sent by the BAU. By setting api.GlobalConstants.SysHVWorkSts in the reserved setting interface SignalAddress of the BAURead test Package and setting the signal quantity SignalNum to 1, the reading test of the signal "SysHVWorkSts" can be implemented. Among them, BAURead sends the read instruction to the simulation parsing node, and "JOB-Execute:ReadSysVar" reads the value returned by the simulation parsing node. Specifically, Figure 5a in the parameter "varPath:’Modbus / BAU / receive_value’" is the system variable path of the signal value fed back by the simulation parsing node after reading, and "F 3000ms value[0]==1" is the set expected value, that is, if the signal value obtained within 3 seconds is equal to 1, the reading test passes, otherwise it fails. BAURead and "JOB-Execute:ReadSysVar" are used together to read the required signal value and complete the reading test.

[0077] Figure 5b It is an expanded schematic diagram of a signal reading test package. As Figure 5b shown, among which Figure 5b each row represents an execution step. The respective digital numbers corresponding to the "#" sign in the first column represent the step numbers, the second column "Action / Name" represents the operation steps to be executed, the third column "Parameter" represents the dynamic input parameters or environmental configuration parameters required for each test step to be executed, and the fourth column "Expectation / Value" is the content to be written for the write operation. For example, Figure 5b in

[0078] the first step is "Wait";

[0079] the second step is to perform a write operation on the system variable "Slave_ID" in the simulation parsing node, and subsequent steps can successively complete the writing of "Function_Code_Send", "RegisterNum_Send", and "RegisterAddr_Send" in the simulation parsing node.

[0080] The second step means fixing "Slave_ID" to 1; the third step means setting the function code to read, where 3 is for reading and 6 is for writing; the fourth step means setting the number of signals to be read; the fifth step is to set the signal address to be read, which is set by calling the corresponding signal constant, and the seventh step is to send a read instruction to the simulation parsing node.

[0081] Next, take the test package of BAUWrite as the write signal as an example to illustrate the implementation of setting the signal value "SinalValue" to 1 to request switching to the operation and maintenance mode. To implement the write test of "SinalValue", "api.GlobalConstants.OPSCtrlCmd" can be set in the reserved setting interface "SignalAddress" of the test package of this write signal, and setting the signal value "SinalValue" to 1 means requesting to switch to the operation and maintenance mode.

[0082] After that, set the reading of the system status in the package of BAURead:

[0083] "api.GlobalConstants.SysWorkSts", and judge whether this value switches to "6" representing the operation and maintenance mode within 3 seconds. Figure 6a It is a schematic diagram of the composition of a test script for implementing signal write test. As Figure 6a shown, the "Action / Name" column represents the operation steps to be executed. For example:

[0084] The first step is to send a read instruction;

[0085] The second step is to read the return value of the simulation parsing node;

[0086] The third step is to send a write instruction;

[0087] The fourth step is to send a read instruction;

[0088] The fifth step is to read the return value of the simulation parsing node.

[0089] The "Parameter" column is used to define the dynamic input parameters or environment configuration parameters required when the test steps are executed. For example:

[0090] In the first step, define the signal name to be read;

[0091] In the second step, define the path where the return value of the simulation parsing node is located;

[0092] In the third step, define the signal name for which the write operation needs to be performed and the write value;

[0093] The functions of the subsequent steps can be inferred by analogy and will not be elaborated here.

[0094] The "Expectation / Value" column is the expected result. After the test script runs, in the 2nd and 5th steps, the obtained return value will be compared with the expected result set here to determine whether the test passes or fails. Figure 6b It is an expanded schematic diagram of a test package for signal writing. As Figure 6b shown, the write test package BAUWrite can be expanded into 7 steps. The specific steps executed are similar to the above Figure 5b and will not be elaborated here.

[0095] In addition, tests for readable and writable (W / R) signals can also be performed. Figure 7 It is a schematic diagram of the composition of a test script for readable and writable signals. As Figure 7 shown, this test script can include the test package BAURead for signal reading, the instruction "JOB-Execute:ReadSysVar" to read the signal value returned by the CAPL simulation parsing node, and the test package BAUWrite for signal writing. ECU-TEST sends a "write" instruction, the signal address to be written, and the data to be written to the CAPL simulation parsing node, and the CAPL simulation parsing node writes the data to this address. After the signal is written, the signal value can be directly read to determine whether the written value is consistent with the read value to judge whether the writing is successful. It is necessary to configure the number of battery clusters as 14, then write the signal constant "BCUNum = 14", and if "BCUNum = 14" is read, it is judged as successful, otherwise it is judged as failed.

[0096] In Figure 7 , first, by executing the test package BAURead, based on the setting of "SignalAddress = api.GlobalConstants.BCUNum; SignalNum = 1", the instruction to read the value of the signal "BCUNum" is executed, and the signal value fed back by the simulation parsing node is obtained through the "JOB-Execute:ReadSysVar" instruction. The signal value obtained through the path "varPath:'Modbus / BAU / receive_value'" is used to judge whether the signal value obtained within 3 seconds is not equal to 14. If it is not equal to 14, the number of battery clusters is written as 14 through the test package of BAUWrite. Then, based on the BAURead test package and the instruction "JOB-Execute:ReadSysVar" again, it is judged whether the signal value of the number of battery clusters read within 3 seconds is 14. If it is, the write test passes and the write test is completed.

[0097] Figure 8 It is a flowchart of the communication test method for the battery array management unit in some of the embodiments, asFigure 8 As shown, the communication test method includes the following steps:

[0098] Step S801: Determine the signal address to be tested and the signal name to be tested according to the communication protocol used by the external communication link.

[0099] Step S802: Use a preset Python script, with the signal address to be tested and the signal name to be tested as the script inputs, to establish a one-to-one mapping relationship between each signal address to be tested and a signal constant; the signal constant includes a target signal constant.

[0100] Step S803: Based on the test script, call the read test case for the first signal constant, send a signal read instruction for the first signal address to the simulation parsing node communicatively connected to the battery array management unit, and receive the read value fed back by the simulation parsing node to perform a read test; the first signal address and the first signal constant have a pre-established mapping relationship.

[0101] Step S804: Based on the test script, call the write test case for the second signal constant, send a signal write instruction for the second signal address to the simulation parsing node, so that the simulation parsing node writes the write value included in the signal write instruction to the second signal address to perform a write test; the second signal address and the second signal constant have a pre-established mapping relationship; both the first signal address and the second signal address are signal addresses to be tested corresponding to the communication protocol of the battery array management unit.

[0102] In the above steps S801 to S804, the protocol parsing adopts the method of parsing by signal address, and in the implementation of the test script, the Global constants signal constants of ECU-TEST are mapped one by one with the addresses in the protocol. In this way, the signal constants can be directly called in the test script to complete the script writing, which not only meets the convenience of protocol parsing, reduces the parsing workload and the later maintenance cost, but also makes the test script clearer and easier to read.

[0103] In this embodiment, a communication test system for a battery array management unit is also provided. Figure 9 It is a schematic structural diagram of the communication test system 90 for the battery array management unit of this embodiment, as Figure 9 shown, the communication test system 90 includes: a test tool 92 and a simulation parsing node 94; the simulation parsing node 94 is communicatively connected to the battery array management unit to be tested based on the application layer communication protocol of Ethernet; the test tool 92 is used to execute the communication test method for the battery array management unit provided in any of the above embodiments. Specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementation manners, and will not be elaborated in this embodiment.

[0104] In this embodiment, an electronic device is further provided, which includes a memory and a processor. A computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0105] Optionally, the above electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the above processor, and the input / output device is connected to the above processor.

[0106] Optionally, in this embodiment, the above processor may be configured to execute the following steps through a computer program:

[0107] S1, based on the test cases that call the target signal constants in the test script, send a test instruction for the target signal address to the simulation parsing node communicatively connected to the battery array management unit, so as to make the simulation parsing node perform signal operations on the target signal address and perform signal tests according to the results of the signal operations; wherein: there is a pre-established mapping relationship between the target signal constant and the target signal address; the target signal address is the signal address to be tested corresponding to the external communication link of the battery array management unit.

[0108] It should be noted that for the specific examples in this embodiment, reference may be made to the examples described in the above embodiments and optional implementation manners, and details will not be repeated in this embodiment.

[0109] In this embodiment, a computer device is further provided, and the computer device may be a server. The computer device includes a processor, a memory, a network interface, and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store a preset configuration information set. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, the communication test method of the above battery array management unit is implemented.

[0110] In one embodiment, a computer device is provided, which may be a terminal. The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected via a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, it implements a communication test method for a battery array management unit. The display screen of the computer device may be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device may be a touch layer covering the display screen, or a button, a trackball, or a touchpad provided on the housing of the computer device, or an external keyboard, touchpad, or mouse, etc.

[0111] In addition, in combination with the communication test method for the battery array management unit provided in the above embodiment, a storage medium may also be provided in this embodiment to implement it. A computer program is stored on the storage medium; when the computer program is executed by the processor, it implements any one of the communication test methods for the battery array management unit in the above embodiment.

[0112] It should be understood that the specific embodiments described here are only used to explain this application, rather than to limit it. According to the embodiments provided in this application, all other embodiments obtained by those of ordinary skill in the art without creative work belong to the protection scope of this application.

[0113] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0114] Obviously, the drawings are only some examples or embodiments of this application. For those of ordinary skill in the art, this application can also be applied to other similar situations based on these drawings without creative work. In addition, it can be understood that although the work done during the development process here may be complex and time-consuming, for those of ordinary skill in the art, certain design, manufacturing, or production changes based on the technical content disclosed in this application are only conventional technical means and should not be regarded as insufficient disclosure of this application.

[0115] The term "embodiment" in this application means that the specific features, structures or characteristics described in connection with an embodiment may be included in at least one embodiment of this application. The phrase appears in various positions in the specification and does not necessarily mean the same embodiment, nor does it mean being independent or alternative to other embodiments and mutually exclusive. Those of ordinary skill in the art can clearly or implicitly understand that the embodiments described in this application can be combined with other embodiments without conflict.

[0116] The above-described embodiments merely represent several implementation manners of this application. The description is relatively specific and detailed, but it should not be construed as a limitation on the scope of patent protection. It should be noted that for those of ordinary skill in the art, without departing from the concept of this application, several modifications and improvements can still be made, and these all fall within the protection scope of this application. Therefore, the protection scope of this application shall be subject to the appended claims.

Claims

1. A communication test method for a battery array management unit, characterized in that The method includes: Based on the test cases in the test script that call the target signal constants, send test instructions for the target signal address to the simulation parsing node communicatively connected to the battery array management unit, so that the simulation parsing node performs signal operations on the target signal address and conducts signal tests according to the results of the signal operations; where: The target signal constants and the target signal addresses have a pre-established mapping relationship; the target signal addresses are the signal addresses to be tested corresponding to the external communication links of the battery array management unit.

2. The communication test method for the battery array management unit according to claim 1, wherein Before sending the test instructions for the target signal address, the method further includes: Determine the signal addresses to be tested and the signal names to be tested according to the communication protocol used by the external communication link; Use a preset Python script, with the signal addresses to be tested and the signal names to be tested as the script inputs, to establish a one-to-one mapping relationship between each of the signal addresses to be tested and the signal constants; the signal constants include the target signal constants.

3. The communication test method of the battery array management unit according to claim 1, characterized in that, The step of, based on the test cases in the test script that call the target signal constants, sending test instructions for the target signal address to the simulation parsing node communicatively connected to the battery array management unit, so that the simulation parsing node performs signal operations on the target signal address and conducts signal tests according to the results of the signal operations, includes: Based on the read test cases in the test script that call the first signal constants, send signal read instructions for the first signal address to the simulation parsing node communicatively connected to the battery array management unit and receive the read values fed back by the simulation parsing node to conduct read tests; the first signal addresses and the first signal constants have a pre-established mapping relationship; and / or, Based on the write test cases in the test script that call the second signal constants, send signal write instructions for the second signal address to the simulation parsing node, so that the simulation parsing node writes the write values included in the signal write instructions to the second signal address to conduct write tests; the second signal addresses and the second signal constants have a pre-established mapping relationship; the first signal addresses and the second signal addresses are both the signal addresses to be tested corresponding to the communication protocol of the battery array management unit.

4. The communication test method of the battery array management unit according to claim 3, characterized in that, The step of, based on the read test cases in the test script that call the first signal constants, sending signal read instructions for the first signal address to the simulation parsing node communicatively connected to the battery array management unit and receiving the read values fed back by the simulation parsing node to conduct read tests, includes: Based on the read test cases in the test script that call the first signal constants, send signal read instructions for the first signal address to the simulation parsing node; Obtain, from the system variables established by the simulation parsing node, the read values grabbed by the simulation parsing node from the first signal address in the external communication link; Compare the read values with preset expected values and determine the read test results for the first signal address according to the comparison results.

5. The communication test method of the battery array management unit according to claim 3, characterized in that, In the described test script, a write test case for calling the second signal constant is invoked to send a signal write instruction for the second signal address to the simulation parsing node, so that the simulation parsing node writes the write value included in the signal write instruction to the second signal address for write testing, including: In the test script, a write test case for calling the second signal constant is invoked to send a signal write instruction for the second signal address to the simulation parsing node, so that the simulation parsing node writes the write value included in the signal write instruction to the second signal address in the external communication link; Based on the signal reading operation associated with the second signal address, it is determined whether the write of the signal write instruction is successful to obtain a write test result for the second signal address.

6. The communication test method for the battery array management unit according to any one of claims 1 to 5, characterized in that, The test script includes test packages corresponding to different signal operation tests, and each test package reserves a setting interface to set the signal constant corresponding to the signal address to be tested.

7. A communication test system for a battery array management unit, characterized in that, It includes a test tool and a simulation parsing node; The simulation parsing node is communicatively connected to the battery array management unit to be tested based on the application layer communication protocol of Ethernet; The test tool is used to execute the communication test method of the battery array management unit according to any one of claims 1 to 6.

8. An electronic device, comprising a memory and a processor, characterized in that A computer program is stored in the memory, and the processor is configured to run the computer program to execute the communication test method of the battery array management unit according to any one of claims 1 to 6.

9. A computer device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, the steps of the communication test method of the battery array management unit according to any one of claims 1 to 6 are implemented.