Communication method and device, electronic equipment and medium

By automatically capturing and compiling the communication protocols of dynamic environment devices, a communication program between the battery management system and the dynamic environment devices is generated, which solves the problems of heavy workload and low accuracy caused by handwritten code and realizes efficient and accurate communication.

CN120825535APending Publication Date: 2025-10-21YUNDA INTELLIGENT STORAGE TECH (HEBEI) CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511014390.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-23
Publication Date
2025-10-21

AI Technical Summary

Technical Problem

In the prior art, the communication protocols between the battery management system and the dynamic environment equipment are diverse and cumbersome, and the handwritten code method is labor-intensive and prone to errors, resulting in inaccurate communication.

Method used

By automatically capturing the communication protocol of the dynamic environment equipment and filling it and the target internal data of the battery management system into the preset blank template, the device communication code is automatically generated, and the corresponding communication program is generated by compiling and imported into the dynamic environment equipment communication software to realize communication.

Benefits of technology

It greatly reduces the workload, improves the accuracy of code generation and the efficiency of communication protocol testing, and reduces manpower and time costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120825535A_ABST
    Figure CN120825535A_ABST
Patent Text Reader

Abstract

The invention discloses a communication method and device, electronic equipment and a medium, and relates to the field of communication, and the method comprises the steps: grabbing a communication protocol of moving ring equipment through an automatic grabbing mode, and filling a preset blank template with the grabbed communication protocol and target internal data of a battery management system, so as to automatically generate an equipment communication code; the corresponding communication program is generated in a compiling mode, and finally the communication program is imported into the dynamic ring equipment communication software, so that the battery management system can communicate with the dynamic ring equipment by operating the dynamic ring equipment communication software, and compared with a handwritten code mode, the workload is greatly reduced, and the working efficiency is improved. And the code generation accuracy is greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communications, and in particular to a communication method, device, electronic equipment and medium. Background Art

[0002] An electrochemical energy storage system consists of a battery pack, a BMS (Battery Management System), a PCS (Power Conversion System), an EMS (Energy Management System), and dynamic and environmental equipment. The BMS is the brain of the entire electrochemical energy storage system and the data exchange hub for the entire electrochemical energy storage system. The BMS typically needs to connect to various dynamic and environmental equipment such as fire protection, liquid cooling, air conditioning, access control, and water immersion to collect and control the energy storage system's temperature and humidity, as well as fire detection and fire action execution, and forward this data to the site data center EMS.

[0003] The existing communication protocols for dynamic environment devices are diverse and cumbersome. In order to enable BMS to connect to multiple dynamic environment devices, most of them currently adopt the method of handwritten code, that is, manually writing multiple different codes that can be recognized by BMS according to the communication protocols of multiple dynamic environment devices. Part of this code is used for BMS to transmit signals to dynamic environment devices, and the other part is used for dynamic environment devices to transmit signals to BMS. Therefore, the handwritten code method is extremely labor-intensive and prone to errors. Summary of the Invention

[0004] The purpose of the present invention is to provide a communication method, device, electronic device and medium. This solution captures the communication protocol of the dynamic environment equipment by automatic capture, and fills the captured communication protocol and the target internal data of the battery management system into a preset blank template to automatically generate the device communication code, and generates the corresponding communication program by compilation. Finally, the communication program is imported into the dynamic environment equipment communication software. The battery management system can achieve the purpose of mutual communication with the dynamic environment equipment by running the dynamic environment equipment communication software. Compared with the method of handwriting code, the workload is greatly reduced and the accuracy of code generation is greatly improved.

[0005] To solve the above technical problems, the present invention provides a communication method, comprising:

[0006] Obtain target internal data of the battery management system;

[0007] Grab the communication protocol of the dynamic ring device, and fill the grab result and the target internal data into a preset blank template to obtain a filled template;

[0008] Converting the filled template into a corresponding device communication code;

[0009] Compiling the device communication code using a communication protocol library and obtaining a communication program corresponding to the device communication code;

[0010] The communication program corresponding to the device communication code is imported into the dynamic environment device communication software, so that the battery management system uses the dynamic environment device communication software to select and run the communication program corresponding to the device communication code, so that the battery management system and the dynamic environment device can communicate with each other.

[0011] Optionally, the communication protocol of the dynamic environment device is captured, and the capture result and the target internal data are filled into a preset blank template, including:

[0012] Capturing protocol data in the communication protocol, the correspondence between the protocol data and target internal data, and the conversion relationship;

[0013] The protocol data, the target internal data, the correspondence and conversion relationship between the protocol data and the target internal data are filled into the preset blank template.

[0014] Optionally, after the battery management system uses the dynamic environment device communication software to select and run the communication program corresponding to the device communication code, the battery management system further includes:

[0015] Determining whether the communication data sent by the battery management system to the dynamic environment device is accurate;

[0016] If the communication data sent by the battery management system to the dynamic environment device is inaccurate, a corresponding alarm will be issued.

[0017] Optionally, determining whether the communication data sent by the battery management system to the dynamic environment device is accurate includes:

[0018] Determine the correspondence and conversion relationship between protocol data in the communication protocol and target internal data according to the device communication code;

[0019] Generate corresponding test cases according to the preset test internal data, the correspondence and conversion relationship between the protocol data in the communication protocol and the target internal data;

[0020] Compiling the test case using the communication protocol library and obtaining a test program corresponding to the test case;

[0021] Importing the test program into the dynamic environment equipment communication software;

[0022] Running the dynamic environment device communication software through the battery management system so that the battery management system executes the test program using the dynamic environment device communication software;

[0023] Whether the communication data sent by the battery management system to the dynamic environment device is accurate is determined according to the execution result of the test program.

[0024] Optionally, the battery management system executes the test program using the dynamic environment device communication software, and determines whether the communication data sent by the battery management system to the dynamic environment device is accurate according to the execution result of the test program, including:

[0025] After executing the test program using the dynamic environment device communication software, the battery management system captures the preset test internal data through the dynamic environment device communication software and converts it into bus data after sending it to the bus. The battery management system and the dynamic environment device perform data transmission via the bus.

[0026] Determining whether the preset test internal data is equal to the bus data;

[0027] If the preset test internal data is equal to the bus data, it is determined that the communication data sent by the battery management system to the dynamic environment device is accurate;

[0028] If the preset test internal data is not equal to the bus data, it is determined that the communication data sent by the battery management system to the dynamic environment device is inaccurate.

[0029] Optionally, after the battery management system executes the test program using the dynamic environment device communication software, the method further includes:

[0030] Generate a corresponding test report based on the execution result of the test program.

[0031] To solve the above technical problems, the present invention further provides a communication device, comprising:

[0032] An acquisition module is used to obtain target internal data of the battery management system;

[0033] A capture module is used to capture the communication protocol of the dynamic environment device and fill the capture result and the target internal data into a preset blank template to obtain a filled template;

[0034] A conversion module, configured to convert the filled template into a corresponding device communication code;

[0035] A compiling module, configured to compile the device communication code using a communication protocol library and obtain a communication program corresponding to the device communication code;

[0036] The communication module is used to import the communication program corresponding to the device communication code into the dynamic environment device communication software, so that the battery management system uses the dynamic environment device communication software to select and run the communication program corresponding to the device communication code, so that the battery management system and the dynamic environment device can communicate with each other.

[0037] Optionally, the capture module includes:

[0038] A capture unit, configured to capture protocol data in the communication protocol, a correspondence between the protocol data and target internal data, and a conversion relationship;

[0039] A filling unit is used to fill the protocol data, the target internal data, the correspondence relationship and the conversion relationship between the protocol data and the target internal data into the preset blank template.

[0040] To solve the above technical problems, the present invention further provides an electronic device, comprising:

[0041] memory for storing computer programs;

[0042] A processor is configured to implement the steps of the communication method described above when executing the computer program.

[0043] To solve the above technical problems, the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the communication method described above are implemented.

[0044] The purpose of the present invention is to provide a communication method, device, electronic device and medium. This solution captures the communication protocol of the dynamic environment equipment by automatic capture, and fills the captured communication protocol and the target internal data of the battery management system into a preset blank template to automatically generate the device communication code, and generates the corresponding communication program by compilation. Finally, the communication program is imported into the dynamic environment equipment communication software. The battery management system can achieve the purpose of mutual communication with the dynamic environment equipment by running the dynamic environment equipment communication software. Compared with the method of handwriting code, the workload is greatly reduced and the accuracy of code generation is greatly improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0046] Figure 1A process flow chart of a communication method provided by the present invention;

[0047] Figure 2 A schematic structural diagram of a communication device provided by the present invention;

[0048] Figure 3 This is a structural diagram of an electronic device provided by the present invention. DETAILED DESCRIPTION

[0049] The core of the present invention is to provide a communication method, device, electronic device and medium. This solution automatically captures the communication protocol of the dynamic environment device, and fills the captured communication protocol and the target internal data of the battery management system into a preset blank template to automatically generate the device communication code, and generates the corresponding communication program by compiling. Finally, the communication program is imported into the dynamic environment device communication software. The battery management system can achieve the purpose of mutual communication with the dynamic environment device by running the dynamic environment device communication software. Compared with the method of handwriting code, the workload is greatly reduced and the accuracy of code generation is greatly improved.

[0050] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.

[0051] Please refer to Figure 1 , Figure 1 This is a process flow chart of a communication method provided by the present invention. The communication method includes:

[0052] S11: Acquire target internal data of the battery management system;

[0053] S12: Grab the communication protocol of the dynamic ring device, and fill the grabbing results and target internal data into a preset blank template to obtain a filled template;

[0054] S13: Convert the filled template into a corresponding device communication code;

[0055] S14: compile the device communication code using the communication protocol library and obtain a communication program corresponding to the device communication code;

[0056] S15: Import the communication program corresponding to the device communication code into the dynamic environment device communication software, so that the battery management system uses the dynamic environment device communication software to select and run the communication program corresponding to the device communication code, so that the battery management system and the dynamic environment device can communicate with each other.

[0057] In the present invention, considering that if the battery management system wants to communicate normally with the dynamic environment device, it is necessary to make the data to be sent by the battery management system and the data actually received by the dynamic environment device meet the preset conversion relationship, so this solution needs to first obtain the target internal data of the battery management system. In addition, because different dynamic environment devices convert different data after receiving the data transmitted by the battery management system, for example: the data to be sent by the battery management system is 10V battery cell voltage, if the conversion relationship corresponding to the communication protocol of the currently connected dynamic environment device is 5:1, then the data sent to the bus by the battery management system should be 2V battery cell voltage, so in order to ensure that the dynamic environment device currently connected to the battery management system can communicate normally with the battery management system, this solution also needs to capture the communication protocol of the dynamic environment device, and then fill the capture results and target internal data into the preset blank template to obtain the filled template. The purpose of this step is to make the battery management system and the currently connected dynamic environment device communicate in the same way according to the corresponding relationship, and to ensure that the battery management system has to send The data can be successfully converted by the passive ring device so that the battery management system and the currently connected dynamic ring device can communicate normally. In order to use the filled-in template, the filled-in template needs to be automatically converted into the corresponding device communication code and compiled to obtain the communication program corresponding to the device communication code. Finally, the dynamic ring device communication software with the communication program imported is run through the battery management system, so that the battery management system can communicate normally with the currently connected dynamic ring device. The captured communication protocol and target internal data can satisfy the corresponding conversion relationship. For example: if the target internal data is the battery cell voltage, the correspondence and conversion relationship between the protocol data in the communication protocol and the target internal data is target internal data = 10×protocol data. If the battery cell voltage in the subsequent target internal data is 10V, the protocol data is 1V, which satisfies the correspondence and conversion relationship between the extracted protocol data and the target internal data. Compared with the handwritten code method, this solution greatly reduces the workload and greatly improves the accuracy of code generation. In addition, because there are many types of dynamic environment devices, by following the communication method provided in this solution, the communication protocols corresponding to all dynamic environment devices connected to the battery management system can be converted into corresponding communication programs and stored uniformly in the dynamic environment device communication software. In this way, when the same type of dynamic environment device is connected to the battery management system for the second time, the battery management system can directly run the dynamic environment device communication software and communicate with the currently connected dynamic environment device, omitting the early capture process and greatly improving the efficiency of the solution.

[0058] It should be noted that compared to existing methods requiring manual coding, the technology in this application solves the time-consuming and error-prone nature of communication code writing, improving the efficiency of energy storage project delivery. Furthermore, the automated testing solution for dynamic environment equipment communication protocols improves the efficiency of communication protocol testing. It is suitable for on-site tooling testing, offline testing, and project site testing. It eliminates the need for manual test case writing, manual test execution, and the development of additional equipment, allowing for the completion of tedious comprehensive testing of dynamic environment equipment communication protocols at zero cost and with zero human effort.

[0059] This embodiment provides a communication method, which automatically captures the communication protocol of the dynamic environment device, and fills the captured communication protocol and the target internal data of the battery management system into a preset blank template to automatically generate the device communication code, and generates the corresponding communication program by compiling. Finally, the communication program is imported into the dynamic environment device communication software. The battery management system can achieve the purpose of mutual communication with the dynamic environment device by running the dynamic environment device communication software. Compared with the method of handwriting code, the workload is greatly reduced and the accuracy of code generation is greatly improved.

[0060] Based on the above embodiment:

[0061] As an optional embodiment, the communication protocol of the dynamic environment device is captured, and the capture results and target internal data are filled into a preset blank template, including:

[0062] Capture the protocol data in the communication protocol, the correspondence between the protocol data and the target internal data, and the conversion relationship;

[0063] The protocol data, target internal data, the correspondence between the protocol data and target internal data, and the conversion relationship are filled into the preset blank template.

[0064] In the present invention, considering that if the battery management system wants to communicate normally with the dynamic environment equipment, it is necessary to make the data to be sent by the battery management system and the data actually received by the dynamic environment equipment satisfy the preset conversion relationship, that is, the target internal data of the battery management system and the protocol data satisfy a certain correspondence and conversion relationship. For example: target internal data = 10×protocol data, then if the battery cell voltage in the subsequent target internal data is 10V, the protocol data is 1V, where the protocol data can correspond to the data sent to the bus by the battery management system. Therefore, in order to accurately capture the communication protocol and target internal data and fill them into the preset blank template, it is first necessary to determine the correspondence and conversion relationship between the protocol data and the target internal data. In this way, according to the corresponding conversion relationship, the preset blank template can be correctly filled, ensuring the integrity and accuracy of the solution.

[0065] As an optional embodiment, after the battery management system uses the dynamic environment device communication software to select and run the communication program corresponding to the device communication code, it also includes:

[0066] Determine whether the communication data sent by the battery management system to the dynamic environment equipment is accurate;

[0067] If the communication data sent by the battery management system to the dynamic environment equipment is inaccurate, a corresponding alarm will be issued.

[0068] In the present invention, considering that the battery management system needs to send corresponding data to the dynamic environment device so that the dynamic environment device can perform corresponding actions based on the received data, the accuracy of data transmission by the battery management system is crucial. Therefore, this solution also needs to determine whether the communication data sent by the battery management system to the dynamic environment device is accurate after running the device communication code through the battery management system. If the communication data sent by the battery management system to the dynamic environment device is inaccurate, a corresponding alarm will be issued to promptly remind the user or operator of the failure of the battery management system data transmission, thereby improving the accuracy and safety of the solution.

[0069] As an optional embodiment, determining whether the communication data sent by the battery management system to the dynamic environment device is accurate includes:

[0070] Determine the correspondence and conversion relationship between protocol data in the communication protocol and target internal data according to the device communication code;

[0071] Generate corresponding test cases based on the correspondence and conversion relationship between preset test internal data, protocol data in the communication protocol and target internal data;

[0072] Use the communication protocol library to compile the test case and obtain the test program corresponding to the test case;

[0073] Import the test program into the dynamic environment equipment communication software;

[0074] Run the dynamic environment equipment communication software through the battery management system so that the battery management system uses the dynamic environment equipment communication software to execute the test program;

[0075] The accuracy of the communication data sent by the battery management system to the dynamic environment equipment is determined based on the execution results of the test program.

[0076] In the present invention, considering that if the battery management system wants to communicate normally with the dynamic environment equipment, it is necessary to make the target internal data of the battery management system and the protocol data satisfy a certain correspondence and conversion relationship. For example: if the target internal data is the cell voltage, the correspondence and conversion relationship between the protocol data and the target internal data is target internal data = 10×protocol data. If the cell voltage in the subsequent target internal data is 10V, the protocol data is 1V, which satisfies the correspondence and conversion relationship between the extracted protocol data and the target internal data. Therefore, if this solution wants to determine whether the communication data sent by the battery management system to the dynamic environment equipment is accurate, it is necessary to first determine the correspondence and conversion relationship between the protocol data in the communication protocol and the target internal data according to the equipment communication code, and obtain the corresponding test program, and test it. After the program is imported into the dynamic environment equipment communication software, the battery management system can execute the test program after running the dynamic environment equipment communication software, and judge whether the communication data sent by the battery management system to the dynamic environment equipment is accurate based on the execution result of the test program. For example: if the target internal data is the battery cell voltage, the correspondence and conversion relationship between the protocol data and the target internal data is target internal data = 10×protocol data. If after executing the test program, it is detected that the battery cell voltage to be sent by the current target internal data is 10V, and the data sent to the bus is 1V, then it proves that the correspondence and conversion relationship between the protocol data and the target internal data are met. At this time, the function of the battery management system to send data is normal. Otherwise, it proves that the function of the battery management system to send data is abnormal, thereby improving the accuracy of the test process.

[0077] As an optional embodiment, the battery management system uses the dynamic environment device communication software to execute a test program, and determines whether the communication data sent by the battery management system to the dynamic environment device is accurate based on the execution result of the test program, including:

[0078] After the battery management system executes the test program using the dynamic environment equipment communication software, it captures the preset test internal data through the dynamic environment equipment communication software and converts it into bus data after sending it to the bus. The battery management system and the dynamic environment equipment transmit data through the bus;

[0079] Determine whether the preset test internal data is equal to the bus data;

[0080] If the preset test internal data is equal to the bus data, it is determined that the communication data sent by the battery management system to the dynamic environment equipment is accurate;

[0081] If the preset test internal data is not equal to the bus data, it is determined that the communication data sent by the battery management system to the dynamic environment device is inaccurate.

[0082] In the present invention, after the battery management system uses the dynamic environment equipment communication software to execute the test program, the dynamic environment equipment communication software captures the preset test internal data and converts it into bus data after sending it to the bus. That is, after the battery management system uses the dynamic environment equipment communication software to execute the test program, it captures data from the bus by capturing packets, and then compares it with the data sent by the battery management system to verify whether there is any abnormality in the data sending function of the battery management system. If the preset test internal data is equal to the bus data, it is determined that the communication data sent by the battery management system to the dynamic environment equipment is accurate; conversely, if the preset test internal data is not equal to the bus data, it is determined that the communication data sent by the battery management system to the dynamic environment equipment is inaccurate, thereby ensuring the integrity of the test process.

[0083] As an optional embodiment, after the battery management system executes the test program using the dynamic environment device communication software, it also includes:

[0084] Generate a corresponding test report based on the execution results of the test program.

[0085] In the present invention, in order to understand the test execution status of the data sending function of the battery management system, determine the reasons behind the abnormal test report, evaluate the quality of the battery management system and other factors, this solution will generate a corresponding test report based on the execution results of the test program after the battery management system uses the dynamic environment equipment communication software to execute the test program, so that users or operators can analyze the system and other factors of the battery management system according to the test report.

[0086] It should be noted that the present invention automatically generates communication protocol code based on the logical relationship between the communication protocol of the dynamic environment equipment and the internal data points of the battery management system, and automatically checks whether the communication protocol code meets the communication protocol development rules, thereby improving code development efficiency, code standardization, and code correctness. By capturing communication bus data and comparing it with the internal data points of the software on the master control unit device, automated testing of communication protocols for multiple communication modes is achieved. There is no need to develop test cases or manually execute tests. A one-click test is performed on the master control unit to generate a test report that fully covers all protocol points.

[0087] It should also be noted that the communication method between the master control unit and the dynamic environment equipment in the battery management system supports CAN (Controller Area Network, a serial communication protocol), Modbus-TCP (Modbus-Transmission Control Protocol, a serial communication protocol), Modbus-RTU (Modbus-Remote Terminal Unit, Modbus remote terminal equipment, an open communication protocol mainly based on serial link (RS232C or RS485)), etc. The communication method between the battery management system and the dynamic environment equipment proposed in this application is to first obtain the standard Modbus or CAN communication protocol provided by the dynamic environment equipment, capture the communication protocol into the standard equipment communication protocol table (preset blank template), fill in the relationship between the communication protocol points and the internal data points, and then generate the target code. The overall steps are as follows:

[0088] Step 1: Capture the communication protocol of the dynamic environment device into the standard communication protocol code generation template (preset blank template) and select the communication method;

[0089] Step 2: Fill in the correspondence and conversion relationship between the protocol points and internal data points in the table according to the rules;

[0090] Step 3: After completing the form, execute code generation. The code generation process will automatically verify whether the filled content meets the rules. If the verification passes, the device communication code will be automatically generated;

[0091] Step 4: Place the device communication code into the communication protocol library and compile it, so that the dynamic environment device communication software can support the integrated device protocol.

[0092] Step 5: The communication protocol library supports all previously developed communication protocols (communication protocols corresponding to various dynamic environment devices). Select the required protocol online at the project site and set parameters such as communication channel and communication rate to complete the configuration of the dynamic environment communication protocol.

[0093] It should also be noted that the dynamic environment equipment communication software can automatically generate test cases based on the communication protocol of the dynamic environment equipment. When the main control unit of the battery management system is running, the communication protocol test can be completed by selecting one-click test. No additional equipment, tools or operations are required. The automatic generation process of test cases is shown in the following steps:

[0094] Step 1: Capture the communication protocol of the dynamic environment device into the standard communication protocol code generation template (preset blank template) and select the communication method;

[0095] Step 2: Fill in the correspondence and conversion relationship between the protocol points and internal data points in the table according to the rules;

[0096] Step 3: After completing the form, execute code generation. The code generation process will automatically verify whether the filled content meets the rules. If the verification passes, the device communication code will be automatically generated;

[0097] Step 4: Put the test cases of the communication protocol into the communication protocol test case library and compile to generate the protocol automatic test process.

[0098] It should also be noted that the battery management system will use the dynamic environment equipment communication software to execute the test program after running the dynamic environment equipment communication software. That is, after the communication protocol of the dynamic environment equipment is configured at the project site, the corresponding test case will take effect without separate operation. The automatic test process corresponding to the test case is shown in the following steps:

[0099] Step 1: The main control unit selects the dynamic environment equipment to be tested and performs the test;

[0100] Step 2: The master control unit protocol automatically tests the process to capture the bus data sent and received, and then verifies the correctness of the data format such as data communication rate and check bit;

[0101] Step 3: The master control unit protocol automatic test process parses the verified packet data and verifies it with the internal data points of the software.

[0102] Step 4: The master control unit protocol automatic test process prints the test results into a standard test report.

[0103] Please refer to Figure 2 , Figure 2 This is a schematic diagram of the structure of a communication device provided by the present invention. The communication device includes:

[0104] An acquisition module 11 is used to acquire target internal data of the battery management system;

[0105] The capture module 12 is used to capture the communication protocol of the dynamic environment device and fill the capture results and the target internal data into a preset blank template to obtain a filled template;

[0106] A conversion module 13, configured to convert the filled template into a corresponding device communication code;

[0107] Compiler module 14, used to compile the device communication code using the communication protocol library and obtain the communication program corresponding to the device communication code;

[0108] The communication module 15 is used to import the communication program corresponding to the device communication code into the dynamic environment device communication software, so that the battery management system uses the dynamic environment device communication software to select and run the communication program corresponding to the device communication code, so that the battery management system and the dynamic environment device can communicate with each other.

[0109] The communication device provided in this embodiment corresponds to the above method and thus has the same beneficial effects as the above method. Therefore, for the embodiments of the communication device part, please refer to the description of the embodiments of the method part, which will not be repeated here.

[0110] As an optional embodiment, the crawling module includes:

[0111] A capture unit, used to capture protocol data in the communication protocol, the correspondence between the protocol data and the target internal data, and the conversion relationship;

[0112] The filling unit is used to fill the protocol data, the target internal data, the corresponding relationship and the conversion relationship between the protocol data and the target internal data into the preset blank template.

[0113] Please refer to Figure 3 , Figure 3 This is a schematic diagram of the structure of an electronic device provided by the present invention. The electronic device includes:

[0114] Memory 20, for storing computer programs;

[0115] The processor 21 is configured to implement the steps of the above communication method when executing a computer program.

[0116] The electronic device provided in this embodiment may include but is not limited to a smart phone, a tablet computer, a laptop computer, or a desktop computer.

[0117] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 can be implemented in at least one hardware form of a digital signal processor (DSP), a field programmable gate array (FPGA), and a programmable logic array (PLA). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 21 may be integrated with a graphics processing unit (GPU), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 may also include an artificial intelligence (AI) processor, which is used to process computing operations related to machine learning.

[0118] The memory 20 may include one or more computer-readable storage media, which may be non-transitory. The memory 20 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 20 is at least used to store the following computer program 201, wherein, after the computer program is loaded and executed by the processor 21, it can implement the relevant steps of the communication method disclosed in any of the aforementioned embodiments. In addition, the resources stored in the memory 20 may also include an operating system 202 and data 203, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 202 may include Windows, Unix, Linux, etc. The data 203 may include but is not limited to communication methods, etc.

[0119] In some embodiments, the electronic device may further include a display screen 22 , an input / output interface 23 , a communication interface 24 , a power supply 25 , and a communication bus 26 .

[0120] Those skilled in the art will understand that Figure 3 The structure shown in the figure does not constitute a limitation of the electronic device, and may include more or fewer components than shown in the figure.

[0121] The purpose of this embodiment is to provide an electronic device, in which the memory 20 is used to store computer programs, and the processor 21 is used to implement the steps of the above-mentioned communication method when executing the computer programs, so as to make the communication process more efficient and accurate.

[0122] The present invention also provides an embodiment corresponding to a computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the above-mentioned communication method are implemented.

[0123] It is understood that if the methods in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and executes all or part of the steps of the methods in each embodiment of the present invention. The aforementioned storage medium includes various media that can store program code, such as a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0124] The computer-readable storage medium provided in this embodiment corresponds to the above method and therefore has the same beneficial effects as the above method. Therefore, for the embodiments of the computer-readable storage medium part, please refer to the description of the embodiments of the method part, which will not be repeated here.

[0125] It should be noted that, in this specification, relational terms such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprises", "comprising" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element.

[0126] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention is not limited to the embodiments shown herein but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A communication method, characterized in that: include: Obtain target internal data of the battery management system; Grab the communication protocol of the dynamic ring device, and fill the grab result and the target internal data into a preset blank template to obtain a filled template; Converting the filled template into a corresponding device communication code; Compiling the device communication code using a communication protocol library and obtaining a communication program corresponding to the device communication code; The communication program corresponding to the device communication code is imported into the dynamic environment device communication software, so that the battery management system uses the dynamic environment device communication software to select and run the communication program corresponding to the device communication code, so that the battery management system and the dynamic environment device can communicate with each other.

2. The communication method according to claim 1, wherein: Grab the communication protocol of the dynamic environment device and fill the grab results and the target internal data into the preset blank template, including: Capturing protocol data in the communication protocol, the correspondence between the protocol data and target internal data, and the conversion relationship; The protocol data, the target internal data, the correspondence and conversion relationship between the protocol data and the target internal data are filled into the preset blank template.

3. The communication method according to claim 1 or 2, wherein: After the battery management system uses the dynamic environment device communication software to select and run the communication program corresponding to the device communication code, the battery management system further includes: Determining whether the communication data sent by the battery management system to the dynamic environment device is accurate; If the communication data sent by the battery management system to the dynamic environment device is inaccurate, a corresponding alarm will be issued.

4. The communication method according to claim 3, wherein: Determining whether the communication data sent by the battery management system to the dynamic environment device is accurate includes: Determine the correspondence and conversion relationship between protocol data in the communication protocol and target internal data according to the device communication code; Generate corresponding test cases according to the preset test internal data, the correspondence and conversion relationship between the protocol data in the communication protocol and the target internal data; Compiling the test case using the communication protocol library and obtaining a test program corresponding to the test case; Importing the test program into the dynamic environment equipment communication software; Running the dynamic environment device communication software through the battery management system so that the battery management system executes the test program using the dynamic environment device communication software; Whether the communication data sent by the battery management system to the dynamic environment device is accurate is determined according to the execution result of the test program.

5. The communication method according to claim 4, wherein: The battery management system executes the test program using the dynamic environment device communication software, and determines whether the communication data sent by the battery management system to the dynamic environment device is accurate according to the execution result of the test program, including: After executing the test program using the dynamic environment device communication software, the battery management system captures the preset test internal data through the dynamic environment device communication software and converts it into bus data after sending it to the bus. The battery management system and the dynamic environment device perform data transmission via the bus. Determining whether the preset test internal data is equal to the bus data; If the preset test internal data is equal to the bus data, it is determined that the communication data sent by the battery management system to the dynamic environment device is accurate; If the preset test internal data is not equal to the bus data, it is determined that the communication data sent by the battery management system to the dynamic environment device is inaccurate.

6. The communication method according to claim 4, wherein: After the battery management system executes the test program using the dynamic environment device communication software, the method further includes: Generate a corresponding test report based on the execution result of the test program.

7. A communication device, characterized in that: include: An acquisition module is used to obtain target internal data of the battery management system; A capture module is used to capture the communication protocol of the dynamic environment device and fill the capture result and the target internal data into a preset blank template to obtain a filled template; A conversion module, configured to convert the filled template into a corresponding device communication code; A compiling module, configured to compile the device communication code using a communication protocol library and obtain a communication program corresponding to the device communication code; The communication module is used to import the communication program corresponding to the device communication code into the dynamic environment device communication software, so that the battery management system uses the dynamic environment device communication software to select and run the communication program corresponding to the device communication code, so that the battery management system and the dynamic environment device can communicate with each other.

8. The communication device according to claim 7, wherein: The capture module includes: A capture unit, configured to capture protocol data in the communication protocol, a correspondence between the protocol data and target internal data, and a conversion relationship; A filling unit is used to fill the protocol data, the target internal data, the correspondence relationship and the conversion relationship between the protocol data and the target internal data into the preset blank template.

9. An electronic device, characterized in that: include: memory for storing computer programs; A processor, configured to implement the steps of the communication method according to any one of claims 1 to 6 when executing the computer program.

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 steps of the communication method according to any one of claims 1 to 6 are implemented.