Battery equipment upgrade method, device, computer equipment and storage medium

Through incremental updates and integrity verification, the data waste and equipment stability problems in the OTA upgrade method are solved, efficient and safe battery equipment upgrades are achieved, and the needs of modern automation equipment for remote upgrade technology are met.

CN118363641BActive Publication Date: 2024-08-30SHENZHEN ZHIAN NEW ENERGY TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410797184.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-20
Publication Date
2024-08-30
Estimated Expiration
2044-06-20

AI Technical Summary

Technical Problem

The existing OTA upgrade method results in data waste, time-consuming downloading and installation, and the new firmware may be defective or incompatible, resulting in reduced device performance or complete failure.

Method used

By obtaining the device material number and current version of the charger, request the latest version information from the firmware server, perform incremental update differential processing, generate incremental upgrade files, and perform upgrades during the lowest usage period of the device to perform integrity verification and stability Safety assessment to ensure upgrade security and efficiency.

Benefits of technology

It significantly reduces the amount of data transmission and storage requirements, shortens the upgrade time, improves the efficiency and availability of the equipment, and ensures the stability and security of the upgraded equipment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118363641B
    Figure CN118363641B
Patent Text Reader

Abstract

The present invention relates to an upgrade method, device, computer device and storage medium for battery equipment. The latest version information is obtained by sending charger information to a firmware server to ensure information matching. Then, the versions are compared to determine whether an update is required to avoid unnecessary operations. If an update is required, the server generates an incremental upgrade file to reduce the amount and time of data transmission. After receiving the file, the device performs an integrity check and selects a low-usage period to perform the upgrade to ensure normal operation. After the upgrade, data is collected for stability assessment. If the check fails, it can be rolled back to the current version. The overall upgrade efficiency and security are improved to meet the needs of remote device upgrades.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of battery equipment, and in particular to a method and device for upgrading battery equipment, a computer device and a storage medium. Background Art

[0002] In today's society, with the advancement of technology and the popularization of automation, equipment such as drones and automated guided vehicles (AGVs) are becoming more and more common. These devices generally rely on small battery-powered systems. With their widespread use, the demand for intelligence and customization of these systems is also increasing. In particular, remote upgrades of these battery systems, that is, software updates through OTA (Over-The-Air) technology, have become an important means to maintain device functionality and performance.

[0003] However, current OTA upgrades usually use a full update method, which requires downloading and replacing all firmware on the device, rather than just updating the changed parts. This method not only wastes a lot of data transmission and storage, but also makes the download and installation process time-consuming due to the large size of the update file, which in serious cases will reduce the efficiency and usability of the device. Especially on battery-powered devices, long updates not only waste device usage time, but may also consume additional energy.

[0004] In addition, if the new firmware is defective or incompatible with the existing hardware configuration, it may cause device performance degradation, or even worse, complete device failure or irreparable hardware damage. Summary of the invention

[0005] The main purpose of the present invention is to provide a battery device upgrade method, device, computer device and storage medium to solve the technical problems that the current OTA upgrade method causes data waste, time-consuming download and installation, reduces device efficiency, and if the new firmware is defective or incompatible, it may cause device performance degradation, or even complete failure or hardware damage.

[0006] To achieve the above-mentioned purpose, the present invention provides a battery device upgrade method, comprising: obtaining the device part number and current version of the charger, and sending the device part number to the firmware server, and the firmware server feedbacks the latest version corresponding to the device part number to the charger according to the device part number; judging whether the current version of the charger is the latest version; if not, sending an incremental update request to the firmware server, and the firmware server responding to the incremental update request, performing differential processing on the current version and the latest version to obtain an incremental upgrade file, and feeding back the incremental upgrade file to the charger; accepting the incremental upgrade file sent by the firmware server, and performing integrity check on the incremental upgrade file; after the incremental upgrade file is passed through the In the case of integrity verification, temporarily store the incremental upgrade file, and upgrade the charger through the incremental upgrade file during the period of lowest usage of the battery device; restart the charger, and collect preliminary operation data of the charger after the charger is restarted; perform stability evaluation on the upgraded charger according to the preliminary operation data to obtain charger upgrade stability evaluation data, and determine whether the upgraded charger passes the stability verification according to the charger upgrade stability evaluation data; if the upgraded charger fails to pass the stability verification, control the charger to roll back from the latest version to the current version, and if the upgraded charger passes the stability verification, end the upgrade process.

[0007] Further, the firmware server responds to the incremental update request, performs differential processing on the current version and the latest version to obtain an incremental upgrade file, and feeds the incremental upgrade file back to the charger, including: the firmware server responds to the incremental update request, loads and stores the current version file corresponding to the current version and the latest version file corresponding to the latest version into the update file processing area of ​​the firmware server; decodes and decompresses the current version file and the latest version file to obtain the current version file in binary format and the latest version file in binary format; generates numerical fingerprints for the current version file and the latest version file respectively to obtain the digital fingerprint of the current version file and the digital fingerprint of the latest version file; identifies Identify data changes between the current version file and the latest version file, wherein the data changes include: data content of file addition, file deletion and file modification; construct an incremental data packet containing all data changes based on the data changes between the current version file and the latest version file; perform data compression on the incremental data packet, and encapsulate the compressed incremental data packet into a complete incremental upgrade file, wherein the file header information of the incremental upgrade file includes: the version number of the current version, the version number of the latest version, the current version file digital fingerprint and the latest version file digital fingerprint; generate an incremental upgrade file digital fingerprint for the incremental upgrade file, and feed back the incremental upgrade file and the incremental upgrade file digital fingerprint to the charger together.

[0008] Further, the data changes between the current version file and the latest version file are identified, and based on the data changes between the current version file and the latest version file, an incremental data packet containing all data changes is constructed, including: identifying all strings in the current version file, and substrings in each string starting from each position to the end of the string, and constructing a current version suffix array of the current version file based on the substrings; identifying all strings in the latest version file, and substrings in each string starting from each position to the end of the string, and constructing a latest version suffix array of the latest version file based on the substrings; using the lexicographic order as the sorting basis, using a merge sort algorithm to sort the current version suffix array and the latest version suffix array respectively, to obtain the sorted current version suffix array and the sorted latest version suffix array; comparing the suffix characters in the current version suffix array and the latest version suffix array in turn, until the first unmatched character is found, and recording the number of matched characters as the longest common prefix length; starting with the first unmatched character found, continuing to execute "comparing the current version suffix array and the latest version suffix array" The steps of "comparing the suffix characters in the group one by one in turn" are performed until the suffix characters in the current version suffix array and the latest version suffix array are compared, and a longest common prefix length array is generated; determining the longest common prefix length value exceeding a preset threshold in the longest common prefix length array, and mapping the longest common prefix length value exceeding the preset threshold to the current version suffix array and the latest version suffix array, extracting the same character strings in the current version suffix array and the latest version suffix array; mapping the same character strings in the current version suffix array and the latest version suffix array to the current version file and the latest version file to obtain the unchanged content area between the current version file and the latest version file; respectively eliminating the unchanged content area in the current version file and the latest version file to obtain the difference content area of ​​the current version file and the difference content area of ​​the latest version file; determining the data change between the current version file and the latest version file based on the difference content area of ​​the current version file and the difference content area of ​​the latest version file, and constructing an incremental data packet containing all data changes according to the data change between the current version file and the latest version file.

[0009] Furthermore, based on the difference content area of ​​the current version file and the difference content area of ​​the latest version file, the data changes between the current version file and the latest version file are determined, and based on the data changes between the current version file and the latest version file, an incremental data packet containing all data changes is constructed, including: dividing the difference content area of ​​the current version file and the difference content area of ​​the latest version file into multiple difference blocks; identifying the position of each difference block in the current version file and the latest version file in turn; if the difference block is not identified in the current version file but is identified in the latest version file, recording the content of the difference block and the difference block in the latest version The position information of the difference block in the file is recorded, and an identifier is added to the difference block mark; if the difference block is identified in the current version file but not in the latest version file, the content of the difference block and the position information of the difference block in the current version file are recorded, and a deletion identifier is marked for the difference block; if the difference block is identified in the current version file and is also identified in the latest version file, the content of the difference block and the position information of the difference block in the current version file and the position information of the difference block in the latest version file are recorded, and a movement identifier is marked for the difference block; the recorded content and the identified content are optimized and merged, and the incremental data packet is constructed according to the optimization and merging results.

[0010] Further, performing an integrity check on the incremental upgrade file includes: generating an incremental upgrade file verification fingerprint for the incremental upgrade file, and using the incremental upgrade file verification fingerprint to compare with the incremental upgrade file digital fingerprint; if the incremental upgrade file digital fingerprint and the incremental upgrade file verification fingerprint are consistent, determining that the incremental upgrade file passes the first integrity check;

[0011] Decompress the incremental upgrade file, and obtain the version number of the current version and the version number of the latest version from the decompressed file; send the version number of the current version to the firmware server, and the firmware server obtains the current version file according to the version number of the current version and generates a current version file verification fingerprint corresponding to the current version file according to the current version file, and feeds the current version file verification fingerprint back to the charging device; compare the current version file verification fingerprint with the current version file digital fingerprint, and if the current version file verification fingerprint is consistent with the current version file digital fingerprint, it is determined that the incremental upgrade file has passed the second integrity check; The version number of the latest version is sent to the firmware server. The firmware server obtains the latest version file according to the version number of the latest version and generates a latest version file verification fingerprint corresponding to the latest version file according to the current version file, and feeds back the latest version file verification fingerprint to the charging device; the latest version file verification fingerprint is compared with the latest version file digital fingerprint. If the latest version file verification fingerprint is consistent with the latest version file digital fingerprint, it is determined that the incremental upgrade file has passed the third integrity check; if the incremental upgrade file has passed three integrity checks, it is determined that the incremental upgrade file has passed the integrity check.

[0012] Further, the stability of the charger after the upgrade process is evaluated according to the preliminary operation data to obtain the charger upgrade stability evaluation data, including: extracting basic data of multiple key performance indicators from the preliminary operation data, wherein the key performance indicators include: startup time, charging rate, battery temperature and error frequency in the system log; standardizing the basic data of each of the key performance indicators to convert the basic data of each of the key performance indicators into a basic form with a mean of a first threshold and a standard deviation of a second threshold; assigning a weight value to each of the key performance indicators, and calculating each key performance indicator score according to the weight value and basic data corresponding to the key performance indicator; performing a nonlinear logarithmic transformation on each of the key performance indicator scores to obtain a first key performance indicator score array; performing a nonlinear exponential transformation on each of the key performance indicator scores to obtain a second key performance indicator score array; performing matrix merging of the first key performance indicator score array and the second key performance indicator score array to obtain a target array matrix; performing principal component analysis on the target array matrix to extract the first principal component in the target array matrix; using the first principal component as a new score indicator, and using the numerical data corresponding to the first principal component as the charger upgrade stability evaluation data.

[0013] Furthermore, judging whether the charger after the upgrade processing has passed the stability check according to the charger upgrade stability evaluation data includes: judging whether each numerical data in the charger upgrade stability evaluation data exceeds the target threshold value; if each numerical data exceeds the target threshold value, determining that the charger after the upgrade processing has passed the stability check.

[0014] The present invention also provides an upgrade device for a battery device, which is applied to a battery device upgrade system. The battery device upgrade system includes the battery device and a firmware server. The battery device includes a charger. The upgrade device for the battery device includes: a feedback unit, which is used to obtain a device part number and a current version of the charger, and send the device part number to the firmware server, and the firmware server feeds back the latest version corresponding to the device part number to the charger according to the device part number; a judgment unit, which is used to judge whether the current version of the charger is the latest version; a processing unit, which is used to send an incremental update request to the firmware server if not, and the firmware server responds to the incremental update request to perform differential processing on the current version and the latest version to obtain an incremental upgrade file, and feed back the incremental upgrade file to the charger; a verification unit, which is used to accept the firmware server. The charger is configured to store the incremental upgrade file sent by the charger and perform integrity check on the incremental upgrade file; an upgrade unit, configured to temporarily store the incremental upgrade file if the incremental upgrade file passes the integrity check, and upgrade the charger through the incremental upgrade file during the period when the battery device usage rate is the lowest; a restart unit, configured to restart the charger and collect preliminary operation data of the charger after the charger is restarted; an evaluation unit, configured to perform stability evaluation on the upgraded charger according to the preliminary operation data, obtain upgrade stability evaluation data of the charger, and determine whether the upgraded charger passes the stability check according to the upgrade stability evaluation data; a rollback unit, configured to control the charger to roll back from the latest version to the current version if the upgraded charger fails to pass the stability check.

[0015] The present invention also provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any one of the above methods when executing the computer program.

[0016] The present invention also 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 any of the above-mentioned methods are implemented.

[0017] The upgrade method, device, computer device and storage medium of the battery device provided by the present invention obtain the device material number and current version of the charger, and send this information to the firmware server. The server feeds back the corresponding latest version information according to the device material number, ensuring that the information between the charger and the server is accurately matched, and providing the necessary basic data for the subsequent incremental update. Then, by comparing the current version of the charger with the latest version provided by the server, it is determined whether an update is required, avoiding unnecessary update operations, saving resources and improving efficiency. Then, if the firmware of the charger is not the latest version, the server will be requested to perform an incremental update. After the server responds to this request, it performs differential processing between the current version and the latest version to generate an incremental upgrade file. This incremental update method significantly reduces the amount of data transmission and storage requirements, and shortens the time required for the upgrade. After the charger receives the incremental upgrade file, it performs an integrity check to ensure that the upgrade file is not damaged or tampered with during the transmission process. This verification step is the key to ensuring the security of the upgrade. Once the incremental upgrade file passes the integrity check, the file will be temporarily stored, and the upgrade will be performed during the period when the battery device usage rate is the lowest, minimizing the impact on the normal use of the device. After the upgrade is completed, the device is restarted and preliminary operation data is collected. This step is to ensure that the upgraded device can start and run normally, and provide data support for further stability evaluation. The charger is evaluated for stability based on the collected operating data. This evaluation ensures that the upgraded device runs stably and meets the expected performance. If the upgraded device fails the stability check, the system will control the charger to roll back from the latest version to the current version to prevent performance issues or device failures that may be caused by the new firmware.

[0018] In summary, this technical solution significantly improves the efficiency of data transmission and the security of the upgrade process through incremental updates and integrity verification. Choosing to upgrade during the period of lowest device usage and providing a rollback mechanism further ensures the high availability and stability of the device. Overall, this solution effectively improves the efficiency and security of OTA upgrades for battery-powered devices and meets the needs of modern automation equipment for remote upgrade technology. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 is a schematic diagram of the steps of a method for upgrading a battery device in one embodiment of the present invention;

[0020] Figure 2 is a structural block diagram of an upgrading device for a battery device in one embodiment of the present invention;

[0021] Figure 3 It is a schematic block diagram of the structure of a computer device according to an embodiment of the present invention.

[0022] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0023] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0024] Reference Figure 1 In one embodiment of the present invention, a method for upgrading a battery device includes:

[0025] S1, obtaining the device part number and the current version of the charger, and sending the device part number to the firmware server, and the firmware server feeds back the latest version corresponding to the device part number to the charger according to the device part number.

[0026] S2, determining whether the current version of the charger is the latest version.

[0027] S3: If not, an incremental update request is sent to the firmware server, and the firmware server responds to the incremental update request, performs differential processing on the current version and the latest version to obtain an incremental upgrade file, and feeds the incremental upgrade file back to the charger.

[0028] S4, accepting the incremental upgrade file sent by the firmware server, and performing integrity check on the incremental upgrade file.

[0029] S5, when the incremental upgrade file passes the integrity check, temporarily storing the incremental upgrade file, and upgrading the charger using the incremental upgrade file during the period when the battery device usage rate is the lowest.

[0030] S6, restarting the charger and collecting preliminary operation data of the charger after the charger is restarted.

[0031] S7, performing stability evaluation on the upgraded charger according to the preliminary operation data to obtain charger upgrade stability evaluation data, and determining whether the upgraded charger passes stability verification according to the charger upgrade stability evaluation data.

[0032] S8, when the charger after the upgrade process fails to pass the stability check, controlling the charger to roll back from the latest version to the current version; and when the charger after the upgrade process passes the stability check, ending the upgrade process.

[0033] That is, in this technical solution, a method for incremental upgrade of battery equipment is proposed, and the specific steps and technical effects are as follows: First, by obtaining the device material number and current version of the charger, and sending this information to the firmware server, the server feeds back the corresponding latest version information based on the device material number. This step ensures that the information between the charger and the server is accurately matched, and provides the necessary basic data for subsequent incremental updates. Then, by comparing the current version of the charger with the latest version provided by the server, it is determined whether an update is required. This step avoids unnecessary update operations, saves resources and improves efficiency. Next, if the firmware of the charger is not the latest version, the server will be requested to perform an incremental update. After the server responds to this request, it performs differential processing between the current version and the latest version to generate an incremental upgrade file. This incremental update method significantly reduces the amount of data transmission and storage requirements, and shortens the time required for the upgrade. After the charger receives the incremental upgrade file, it performs an integrity check to ensure that the upgrade file has not been damaged or tampered with during the transmission process. This verification step is the key to ensuring the security of the upgrade. Once the incremental upgrade file passes the integrity check, the file will be temporarily stored, and the upgrade will be performed during the period when the battery device usage rate is the lowest, minimizing the impact on the normal use of the device. After the upgrade is complete, the device is restarted and preliminary operating data is collected. This step is to ensure that the device can start and run normally after the upgrade, and provide data support for further stability evaluation. The charger is evaluated for stability based on the collected operating data. This evaluation ensures that the upgraded device runs stably and meets the expected performance. If the upgraded device fails the stability check, the system will control the charger to roll back from the latest version to the current version. This mechanism provides a safety guarantee to prevent performance issues or device failures that may be caused by the new firmware.

[0034] In summary, this technical solution significantly improves the efficiency of data transmission and the security of the upgrade process through incremental updates and integrity verification. Choosing to upgrade during the period of lowest device usage and providing a rollback mechanism further ensures the high availability and stability of the device. Overall, this solution effectively improves the efficiency and security of OTA upgrades for battery-powered devices and meets the needs of modern automation equipment for remote upgrade technology.

[0035] In one example, the firmware server performs differential processing on the current version and the latest version in response to the incremental update request to obtain an incremental upgrade file, and feeds the incremental upgrade file back to the charger, including: the firmware server loads and stores the current version file corresponding to the current version and the latest version file corresponding to the latest version into the update file processing area of ​​the firmware server in response to the incremental update request; decodes and decompresses the current version file and the latest version file to obtain the current version file in binary format and the latest version file in binary format; generates numerical fingerprints for the current version file and the latest version file respectively to obtain the digital fingerprint of the current version file and the digital fingerprint of the latest version file; Identify data changes between the current version file and the latest version file, wherein the data changes include: data content of file addition, file deletion and file modification; construct an incremental data packet containing all data changes based on the data changes between the current version file and the latest version file; perform data compression on the incremental data packet, and encapsulate the compressed incremental data packet into a complete incremental upgrade file, wherein the file header information of the incremental upgrade file includes: the version number of the current version, the version number of the latest version, the current version file digital fingerprint and the latest version file digital fingerprint; generate an incremental upgrade file digital fingerprint for the incremental upgrade file, and feed back the incremental upgrade file and the incremental upgrade file digital fingerprint to the charger together.

[0036] In this example, the firmware server responds to the incremental update request, performs differential processing on the current version and the latest version, generates an incremental upgrade file, and feeds it back to the charger. The specific steps are as follows: First, the firmware server loads and stores the current version and the latest version files to the update file processing area. This ensures that the server can access these files for subsequent processing. Next, the current version and the latest version files are decoded and decompressed to obtain their binary formats. This step provides the basis for subsequent data processing. Subsequently, digital fingerprints are generated for the current version and the latest version files respectively to identify data changes. This helps to determine the differences between files, including the data content of file additions, deletions, and modifications. Based on the data changes between the current version and the latest version files, an incremental data packet containing all changes is constructed. This helps to reduce the amount of transmitted data and improve efficiency. The incremental data packet is compressed and encapsulated into a complete incremental upgrade file. The file header information includes the current version number, the latest version number, the current version file digital fingerprint, and the latest version file digital fingerprint to ensure the integrity and accuracy of the file. Finally, a digital fingerprint is generated for the incremental upgrade file, and the file and the digital fingerprint are fed back to the charger together. This helps to verify the integrity of the file and ensure the security of the upgrade process. The entire technical solution reduces data transmission and storage requirements and improves upgrade efficiency through differential processing and incremental updates. At the same time, digital fingerprints and integrity checks ensure the accuracy and security of upgrade files. Overall, this technical solution effectively improves the OTA upgrade efficiency and security of battery equipment and meets the needs of modern automation equipment for remote upgrade technology.

[0037] In one example, data changes between the current version file and the latest version file are identified, and based on the data changes between the current version file and the latest version file, an incremental data packet containing all data changes is constructed, including: identifying all strings in the current version file, and substrings in each string starting from each position to the end of the string, and constructing a current version suffix array of the current version file based on the substrings; identifying all strings in the latest version file, and substrings in each string starting from each position to the end of the string, and constructing a latest version suffix array of the latest version file based on the substrings; using the lexicographic order as the sorting basis, using a merge sort algorithm to sort the current version suffix array and the latest version suffix array respectively, to obtain the sorted current version suffix array and the sorted latest version suffix array; comparing the suffix characters in the current version suffix array and the latest version suffix array in turn, until the first unmatched character is found, and recording the number of matched characters as the longest common prefix length; starting with the first unmatched character found as the starting character, continuing to execute "comparing the current version suffix array and the latest version suffix array". The steps of "comparing the suffix characters in the current version suffix array in pairs one by one" are performed until the suffix characters in the current version suffix array and the latest version suffix array are compared, and a longest common prefix length array is generated; determining the longest common prefix length value exceeding a preset threshold in the longest common prefix length array, and mapping the longest common prefix length value exceeding the preset threshold to the current version suffix array and the latest version suffix array, extracting the same character strings in the current version suffix array and the latest version suffix array; mapping the same character strings in the current version suffix array and the latest version suffix array to the current version file and the latest version file to obtain the unchanged content area between the current version file and the latest version file; removing the unchanged content area from the current version file and the latest version file respectively to obtain the difference content area of ​​the current version file and the difference content area of ​​the latest version file; determining the data change between the current version file and the latest version file based on the difference content area of ​​the current version file and the difference content area of ​​the latest version file, and constructing an incremental data packet containing all data changes according to the data change between the current version file and the latest version file.

[0038] In this example, all strings and all substrings of each string in the current version file and the latest version file are first identified, and the suffix array of the current version file and the suffix array of the latest version file are constructed based on these substrings. The technical effect of this step is to prepare for the subsequent comparison and identification of data changes. Through the construction of the suffix array, the comparison and matching of strings can be performed more efficiently. Next, the suffix arrays of the current version and the latest version are sorted by the merge sort algorithm, and the lexicographic order is used as the sorting basis to obtain the sorted suffix array of the current version and the latest version. The technical effect of this step is to make the subsequent character comparison more orderly and efficient, laying the foundation for identifying the longest common prefix length. Subsequently, the suffix characters in the suffix arrays of the current version and the latest version are compared pair by pair, the number of matching characters is recorded as the longest common prefix length, and the longest common prefix length array is generated. The technical effect of this step is to find the same parts in the two files, providing a basis for the subsequent identification of different content. After determining the value of the longest common prefix length that exceeds the preset threshold, it is mapped to the suffix array to extract the unchanged content area in the two files. The technical effect of this step is to exclude the parts that do not need to be changed and accurately locate the difference content of the files. Finally, the unchanged content area is removed to obtain the difference content area between the current version file and the latest version file, and the data changes are determined based on these difference contents to build an incremental data package containing all data changes. The entire technical solution can accurately capture and process data changes between file versions by efficiently identifying the changed parts of the file and generating incremental data packages, thereby improving the transmission efficiency of data changes and the accuracy of file updates.

[0039] In one example, based on the difference content area of ​​the current version file and the difference content area of ​​the latest version file, the data changes between the current version file and the latest version file are determined, and based on the data changes between the current version file and the latest version file, an incremental data packet containing all data changes is constructed, including: dividing the difference content area of ​​the current version file and the difference content area of ​​the latest version file into multiple difference blocks; identifying the position of each difference block in the current version file and the latest version file in turn; if the difference block is not identified in the current version file but is identified in the latest version file, recording the content of the difference block and the difference between the difference block in the latest version file The position information of the difference block in this file is recorded, and an identifier is added to the difference block mark; if the difference block is identified in the current version file but not in the latest version file, the content of the difference block and the position information of the difference block in the current version file are recorded, and a deletion identifier is marked for the difference block; if the difference block is identified in the current version file and is also identified in the latest version file, the content of the difference block and the position information of the difference block in the current version file and the position information of the difference block in the latest version file are recorded, and a movement identifier is marked for the difference block; the recorded content and the identified content are optimized and merged, and the incremental data packet is constructed according to the optimization and merging results.

[0040] In this example, first, according to the difference content area between the current version file and the latest version file, they are divided into multiple difference blocks. The technical effect of this step is to subdivide the changes of the file into smaller units so as to more accurately identify and process the changes of the file. Subsequently, the position of each difference block in the current version file and the latest version file is identified one by one. If a difference block exists in the current version file but does not exist in the latest version file, the content of the difference block and the position information in the current version file are recorded and marked as deleted. If a difference block does not exist in the current version file but exists in the latest version file, the content of the difference block and the position information in the latest version file are recorded and marked as added. If a difference block exists in both version files, the content of the difference block and the position information in the two version files are recorded and marked as moved. The technical effect of these steps is to accurately identify the change type and position information of each difference block, providing an accurate data basis for the subsequent incremental data package construction. Finally, the content and identification of the records are optimized and merged, and the incremental data package is constructed according to the optimized merge results. The technical effect of this step is to integrate all data change information into an incremental data package, so that the changes between file versions can be clearly recorded and transmitted, improving the transmission efficiency of data changes and the accuracy of file updates. The entire technical solution builds an incremental data package containing all data changes by carefully identifying and processing the differences between file versions, achieving accurate capture and processing of file changes, and providing an efficient solution for file version management and updates.

[0041] In one example, the incremental upgrade file is subjected to an integrity check, including: generating an incremental upgrade file verification fingerprint for the incremental upgrade file, and using the incremental upgrade file verification fingerprint to compare with the incremental upgrade file digital fingerprint; if the incremental upgrade file digital fingerprint and the incremental upgrade file verification fingerprint are consistent, it is determined that the incremental upgrade file has passed the first integrity check; decompressing the incremental upgrade file, and obtaining the version number of the current version and the version number of the latest version from the decompressed file; sending the version number of the current version to the firmware server, the firmware server obtaining the current version file according to the version number of the current version and generating a current version file verification fingerprint corresponding to the current version file according to the current version file, and feeding back the current version file verification fingerprint to the charging device; using the current version file verification fingerprint to compare with the The digital fingerprint of the current version file is compared with the digital fingerprint of the current version file. If the verification fingerprint of the current version file is consistent with the digital fingerprint of the current version file, it is determined that the incremental upgrade file has passed the second integrity check; the version number of the latest version is sent to the firmware server, and the firmware server obtains the latest version file according to the version number of the latest version and generates the latest version file verification fingerprint corresponding to the latest version file according to the current version file, and feeds back the latest version file verification fingerprint to the charging device; the latest version file verification fingerprint is compared with the digital fingerprint of the latest version file. If the verification fingerprint of the latest version file is consistent with the digital fingerprint of the latest version file, it is determined that the incremental upgrade file has passed the third integrity check; when the incremental upgrade file passes three integrity checks, it is determined that the incremental upgrade file has passed the integrity check.

[0042] In this example, the technical solution for integrity verification of the incremental upgrade file includes the following steps: First, generate a verification fingerprint for the incremental upgrade file and compare it with the file digital fingerprint. The technical effect of this step is to ensure the integrity of the file and confirm that the file has not been tampered with by verifying the consistency of the fingerprint and the digital fingerprint. Next, the incremental upgrade file is decompressed to extract the version numbers of the current version and the latest version. Then the current version number is sent to the firmware server, and the server obtains the current version file according to the version number, generates the corresponding verification fingerprint, and feeds it back to the charging device. Then compare the verification fingerprint of the current version file with the digital fingerprint to confirm the accuracy and integrity of the file. Subsequently, the version number of the latest version is sent to the firmware server, the latest version file is obtained and the verification fingerprint is generated, which is fed back to the charging device. Then compare the verification fingerprint of the latest version file with the digital fingerprint to ensure the integrity and correctness of the latest version file. Finally, when the incremental upgrade file passes three integrity checks, it is confirmed that the file has passed the integrity check. The entire technical solution verifies the integrity of the file through multiple checks to ensure the security and reliability of the file during transmission and update, thereby effectively performing firmware upgrades and ensuring the stability of the system.

[0043] In one example, the charger after the upgrade process is evaluated for stability according to the preliminary operation data to obtain the charger upgrade stability evaluation data, including: extracting basic data of multiple key performance indicators from the preliminary operation data, wherein the key performance indicators include: startup time, charging rate, battery temperature and error frequency in the system log; standardizing the basic data of each of the key performance indicators to convert the basic data of each of the key performance indicators into a basic form with a mean of a first threshold and a standard deviation of a second threshold; assigning a weight value to each of the key performance indicators, and calculating each key performance indicator score according to the weight value and basic data corresponding to the key performance indicator; performing a nonlinear logarithmic transformation on each of the key performance indicator scores to obtain a first key performance indicator score array; performing a nonlinear exponential transformation on each of the key performance indicator scores to obtain a second key performance indicator score array; performing matrix merging of the first key performance indicator score array and the second key performance indicator score array to obtain a target array matrix; performing principal component analysis on the target array matrix to extract the first principal component in the target array matrix; using the first principal component as a new score indicator, and using the numerical data corresponding to the first principal component as the charger upgrade stability evaluation data.

[0044] In this example, the technical solution for evaluating the stability of the charger includes the following steps: First, extract the basic data of the key performance indicators from the preliminary operation data, including the startup time, charging rate, battery temperature, and error frequency in the system log. The technical effect of this step is to obtain the original data of the key performance indicators to provide a basis for subsequent evaluation. Then, the basic data of each key performance indicator is standardized to convert it into a basic form with a mean and standard deviation that meet specific thresholds. This helps to unify the data of different performance indicators for subsequent comparison and evaluation. Subsequently, a weight value is assigned to each key performance indicator, and the score of each indicator is calculated based on these weight values ​​and the basic data. The technical effect of this step is to perform a weighted evaluation of different indicators based on importance to obtain the score of each indicator. Then, each key performance indicator score is subjected to nonlinear logarithmic transformation and nonlinear exponential transformation to obtain the first and second key performance indicator score arrays. This helps to process and evaluate the scores more reasonably. Then, the first and second key performance indicator score arrays are merged to form a target array matrix. Then, the target array matrix is ​​subjected to principal component analysis to extract the first principal component. This step helps to reduce the data dimension and extract the most representative main information.

[0045] Finally, the first principal component is used as a new scoring index, and its corresponding numerical data is used as the charger upgrade stability evaluation data. The entire technical solution converts the raw data into a comprehensive evaluation index through multi-step processing and analysis, so as to comprehensively evaluate and compare the stability of the charger.

[0046] In one example, judging whether the charger after the upgrade processing has passed the stability check according to the charger upgrade stability evaluation data includes: judging whether each numerical data in the charger upgrade stability evaluation data exceeds a target threshold value; if each numerical data exceeds the target threshold value, determining that the charger after the upgrade processing has passed the stability check.

[0047] In this example, the technical solution for judging whether the charger after the upgrade process has passed the stability check based on the charger upgrade stability evaluation data includes the following steps: First, check each numerical data in the charger upgrade stability evaluation data to determine whether they all exceed the set target threshold. The technical effect of this step is to quantitatively compare the stability evaluation data of the charger to determine whether the expected stability standard is met. If all numerical data exceed the target threshold, it is determined that the charger after the upgrade process has passed the stability check. This means that the charger has shown stable performance after the upgrade process and meets the expected requirements. The entire technical solution realizes the effective evaluation and judgment of the stability of the charger after the upgrade process by analyzing and comparing the charger upgrade stability evaluation data, and setting and verifying the target threshold. Through this process, it can be ensured that the charger can still maintain stable performance after the upgrade process, thereby improving the reliability and safety of the charger.

[0048] Reference Figure 2 In one embodiment of the present invention, an upgrade device for a battery device is applied to a battery device upgrade system. The battery device upgrade system includes the battery device and a firmware server. The battery device includes a charger. The upgrade device for the battery device includes:

[0049] Feedback unit 1 is used to obtain the device part number and current version of the charger, and send the device part number to the firmware server, and the firmware server feeds back the latest version corresponding to the device part number to the charger according to the device part number.

[0050] A judging unit 2, used for judging whether the current version of the charger is the latest version;

[0051] Processing unit 3, for sending an incremental update request to the firmware server if no, and the firmware server responds to the incremental update request, performs differential processing on the current version and the latest version to obtain an incremental upgrade file, and feeds the incremental upgrade file back to the charger;

[0052] The verification unit 4 is used to receive the incremental upgrade file sent by the firmware server and perform integrity verification on the incremental upgrade file.

[0053] The upgrade unit 5 is used to temporarily store the incremental upgrade file if the incremental upgrade file passes the integrity check, and upgrade the charger using the incremental upgrade file during the period when the battery device usage rate is the lowest.

[0054] The restart unit 6 is used to restart the charger and collect preliminary operation data of the charger after the charger is restarted.

[0055] The evaluation unit 7 is used to perform stability evaluation on the upgraded charger according to the preliminary operation data, obtain the charger upgrade stability evaluation data, and determine whether the upgraded charger passes the stability check according to the charger upgrade stability evaluation data.

[0056] The rollback unit 8 is used to control the charger to roll back from the latest version to the current version when the charger after the upgrade process fails to pass the stability check.

[0057] In this embodiment, for the specific implementation of each unit in the above device embodiment, please refer to the above method embodiment, which will not be repeated here.

[0058] Reference Figure 3 In an embodiment of the present invention, a computer device is also provided. The computer device may be a server, and its internal structure may be as follows: Figure 3 As shown. The computer device includes a processor, a memory, a display screen, an input device, a network interface and a database connected through a system bus. Among them, the processor designed by the computer 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 internal 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 the corresponding data in this embodiment. 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 above method is implemented.

[0059] Those skilled in the art will understand that Figure 3 The structure shown in the figure is merely a block diagram of a portion of the structure related to the solution of the present invention, and does not constitute a limitation on the computer device to which the solution of the present invention is applied.

[0060] An embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the above method is implemented. It can be understood that the computer-readable storage medium in this embodiment can be a volatile readable storage medium or a non-volatile readable storage medium.

[0061] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media provided by the present invention and used in the embodiments may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double-speed data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM.

[0062] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, device, article or method including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, device, article or method. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the presence of other identical elements in the process, device, article or method including the element.

[0063] The above description is only a preferred embodiment of the present invention, and does not limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made by using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A method for upgrading a battery device, characterized in that: Applied to a battery device upgrade system, the battery device upgrade system includes the battery device and a firmware server, the battery device includes a charger, and the battery device upgrade method includes: Obtain the device part number and current version of the charger, and send the device part number to the firmware server, and the firmware server feeds back the latest version corresponding to the device part number to the charger according to the device part number; Determining whether the current version of the charger is the latest version; If not, an incremental update request is sent to the firmware server, and the firmware server responds to the incremental update request, performs differential processing on the current version and the latest version to obtain an incremental upgrade file, and feeds the incremental upgrade file back to the charger; Accepting the incremental upgrade file sent by the firmware server and performing integrity check on the incremental upgrade file; If the incremental upgrade file passes the integrity check, temporarily storing the incremental upgrade file, and upgrading the charger using the incremental upgrade file during the period when the battery device usage rate is the lowest; Restarting the charger and collecting preliminary operation data of the charger after the charger is restarted; Performing a stability evaluation on the upgraded charger according to the preliminary operation data to obtain charger upgrade stability evaluation data, and judging whether the upgraded charger passes the stability check according to the charger upgrade stability evaluation data; If the charger after the upgrade process fails to pass the stability check, control the charger to roll back from the latest version to the current version, and if the charger after the upgrade process passes the stability check, end the upgrade process; wherein, the stability of the charger after the upgrade process is evaluated according to the preliminary operation data to obtain the charger upgrade stability evaluation data, including: extracting basic data of multiple key performance indicators from the preliminary operation data, wherein the key performance indicators include: startup time, charging rate, battery temperature and error frequency in the system log; standardizing the basic data of each of the key performance indicators to convert the basic data of each of the key performance indicators into a basic form with a mean of a first threshold value and a standard deviation of a second threshold value; assigning a weight value to each of the key performance indicators, and calculating each key performance indicator score according to the weight value and basic data corresponding to the key performance indicator; performing a nonlinear logarithmic transformation on each of the key performance indicator scores to obtain a first key performance indicator score array; performing a nonlinear exponential transformation on each of the key performance indicator scores to obtain a second key performance indicator score array; performing matrix merging of the first key performance indicator score array and the second key performance indicator score array to obtain a target array matrix; performing principal component analysis on the target array matrix to extract the first principal component in the target array matrix; using the first principal component as a new score indicator, and using the numerical data corresponding to the first principal component as the charger upgrade stability evaluation data.

2. The upgrading method according to claim 1, characterized in that: The firmware server performs differential processing on the current version and the latest version in response to the incremental update request to obtain an incremental upgrade file, and feeds the incremental upgrade file back to the charger, including: The firmware server, in response to the incremental update request, loads and stores the current version file corresponding to the current version and the latest version file corresponding to the latest version into an update file processing area of ​​the firmware server; Decoding and decompressing the current version file and the latest version file to obtain the current version file and the latest version file in binary format; Generating numerical fingerprints for the current version file and the latest version file respectively, to obtain the current version file digital fingerprint and the latest version file digital fingerprint; Identify data changes between the current version file and the latest version file, wherein the data changes include: data content of file addition, file deletion and file modification; According to the data changes between the current version file and the latest version file, construct an incremental data package containing all data changes; Performing data compression processing on the incremental data packet, and encapsulating the compressed incremental data packet into a complete incremental upgrade file, wherein the file header information of the incremental upgrade file includes: the version number of the current version, the version number of the latest version, the digital fingerprint of the current version file, and the digital fingerprint of the latest version file; An incremental upgrade file digital fingerprint is generated for the incremental upgrade file, and the incremental upgrade file and the incremental upgrade file digital fingerprint are fed back to the charger together.

3. The upgrading method according to claim 2, characterized in that: Identify data changes between the current version file and the latest version file, and construct an incremental data package containing all data changes based on the data changes between the current version file and the latest version file, including: Identify all strings in the current version file, and substrings in each string starting from each position to the end of the string, and construct a current version suffix array of the current version file based on the substrings; Identify all strings in the latest version file, and substrings in each string starting from each position to the end of the string, and construct a latest version suffix array of the latest version file based on the substrings; Taking the lexicographic order as the sorting basis, the merge sort algorithm is used to sort the current version suffix array and the latest version suffix array respectively, so as to obtain the sorted current version suffix array and the sorted latest version suffix array; Compare the suffix characters in the current version suffix array and the latest version suffix array in pairs in sequence until the first unmatched character is found, and record the number of matched characters as the longest common prefix length; Taking the first unmatched character found as the starting character, continue to perform the step of "comparing the suffix characters in the current version suffix array and the latest version suffix array pair by pair" until the suffix characters in the current version suffix array and the latest version suffix array are compared, and generate a longest common prefix length array; Determine the longest common prefix length value that exceeds a preset threshold in the longest common prefix length array, and map the longest common prefix length value that exceeds the preset threshold to the current version suffix array and the latest version suffix array, and extract the same character string in the current version suffix array and the latest version suffix array; Map the same character strings in the current version suffix array and the latest version suffix array to the current version file and the latest version file to obtain the unchanged content area between the current version file and the latest version file; In the current version file and the latest version file, the unchanged content area is removed respectively to obtain the difference content area of ​​the current version file and the difference content area of ​​the latest version file; Based on the difference content area of ​​the current version file and the difference content area of ​​the latest version file, determine the data changes between the current version file and the latest version file, and construct an incremental data packet containing all data changes based on the data changes between the current version file and the latest version file.

4. The upgrading method according to claim 3, characterized in that: Based on the difference content area of ​​the current version file and the difference content area of ​​the latest version file, determine the data changes between the current version file and the latest version file, and construct an incremental data packet containing all data changes according to the data changes between the current version file and the latest version file, including: Dividing the difference content area of ​​the current version file and the difference content area of ​​the latest version file into a plurality of difference blocks; Identify the position of each difference block in the current version file and the latest version file in turn; If the difference block is not identified in the current version file but is identified in the latest version file, the content of the difference block and the position information of the difference block in the latest version file are recorded, and a mark is added to the difference block mark; If the difference block is identified in the current version file but not in the latest version file, the content of the difference block and the position information of the difference block in the current version file are recorded, and a deletion mark is marked on the difference block; If the difference block is identified in the current version file and the table is also identified in the latest version file, the content of the difference block and the position information of the difference block in the current version file and the position information of the difference block in the latest version file are recorded, and a movement identifier is marked on the difference block; The record content and the identification content are optimized and merged, and the incremental data packet is constructed according to the optimization and merging result.

5. The upgrading method according to claim 2, characterized in that: Performing integrity check on the incremental upgrade file includes: Generating an incremental upgrade file verification fingerprint for the incremental upgrade file, and using the incremental upgrade file verification fingerprint to compare with the incremental upgrade file digital fingerprint; If the digital fingerprint of the incremental upgrade file is consistent with the verification fingerprint of the incremental upgrade file, it is determined that the incremental upgrade file has passed the first integrity check; Decompress the incremental upgrade file, and obtain the version number of the current version and the version number of the latest version from the decompressed file; Sending the version number of the current version to the firmware server, the firmware server obtaining the current version file according to the version number of the current version and generating a current version file verification fingerprint corresponding to the current version file according to the current version file, and feeding back the current version file verification fingerprint to the charging device; The current version file verification fingerprint is compared with the current version file digital fingerprint. If the current version file verification fingerprint is consistent with the current version file digital fingerprint, it is determined that the incremental upgrade file has passed the second integrity check; Sending the version number of the latest version to the firmware server, the firmware server obtaining the latest version file according to the version number of the latest version and generating a latest version file verification fingerprint corresponding to the latest version file according to the current version file, and feeding back the latest version file verification fingerprint to the charging device; The latest version file verification fingerprint is compared with the latest version file digital fingerprint. If the latest version file verification fingerprint is consistent with the latest version file digital fingerprint, it is determined that the incremental upgrade file has passed the third integrity check; When the incremental upgrade file passes the integrity check three times, it is determined that the incremental upgrade file passes the integrity check.

6. The upgrading method according to claim 1, characterized in that: Determining whether the charger after the upgrade process passes the stability verification according to the charger upgrade stability evaluation data includes: It is determined whether each numerical data in the charger upgrade stability evaluation data exceeds a target threshold value. If each numerical data exceeds the target threshold value, it is determined that the charger after the upgrade process passes the stability check.

7. A battery equipment upgrade device, characterized in that: Applied to a battery device upgrade system, the battery device upgrade system includes the battery device and a firmware server, the battery device includes a charger, and the battery device upgrade device includes: A feedback unit, used to obtain the device part number and current version of the charger, and send the device part number to the firmware server, and the firmware server feeds back the latest version corresponding to the device part number to the charger according to the device part number; A judging unit, used for judging whether the current version of the charger is the latest version; a processing unit, configured to, if not, send an incremental update request to the firmware server, wherein the firmware server performs differential processing on the current version and the latest version in response to the incremental update request to obtain an incremental upgrade file, and feed the incremental upgrade file back to the charger; A verification unit, configured to receive the incremental upgrade file sent by the firmware server and perform integrity verification on the incremental upgrade file; An upgrading unit, configured to temporarily store the incremental upgrading file if the incremental upgrading file passes the integrity check, and upgrade the charger using the incremental upgrading file during a period of time when the battery device usage rate is the lowest; a restart unit, configured to restart the charger and collect preliminary operation data of the charger after the charger is restarted; an evaluation unit, configured to perform a stability evaluation on the upgraded charger according to the preliminary operation data, obtain upgraded stability evaluation data of the charger, and determine whether the upgraded charger passes the stability check according to the upgraded stability evaluation data of the charger; A rollback unit, configured to control the charger to roll back from the latest version to the current version if the charger after the upgrade process fails to pass the stability check; wherein, the stability of the charger after the upgrade process is evaluated according to the preliminary operation data to obtain the charger upgrade stability evaluation data, including: extracting basic data of multiple key performance indicators from the preliminary operation data, wherein the key performance indicators include: startup time, charging rate, battery temperature and error frequency in the system log; standardizing the basic data of each of the key performance indicators to convert the basic data of each of the key performance indicators into a basic form with a mean of a first threshold value and a standard deviation of a second threshold value; assigning a weight value to each of the key performance indicators, and calculating each key performance indicator score according to the weight value and basic data corresponding to the key performance indicator; performing a nonlinear logarithmic transformation on each of the key performance indicator scores to obtain a first key performance indicator score array; performing a nonlinear exponential transformation on each of the key performance indicator scores to obtain a second key performance indicator score array; performing matrix merging of the first key performance indicator score array and the second key performance indicator score array to obtain a target array matrix; performing principal component analysis on the target array matrix to extract the first principal component in the target array matrix; using the first principal component as a new score indicator, and using the numerical data corresponding to the first principal component as the charger upgrade stability evaluation data.

8. A computer device comprising a memory and a processor, wherein a computer program is stored in the memory, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Software upgrading method of battery pack and battery pack

    CN116521201A

  • Battery equipment upgrading method and device, equipment and storage medium

    CN117608616A