CN117170716A - A power exchange cabinet program upgrade method, device, computer equipment and storage medium - Google Patents

A power exchange cabinet program upgrade method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN117170716A
CN117170716A CN202311301721.1A CN202311301721A CN117170716A CN 117170716 A CN117170716 A CN 117170716A CN 202311301721 A CN202311301721 A CN 202311301721A CN 117170716 A CN117170716 A CN 117170716A
Authority
CN
China
Prior art keywords
firmware
upgraded
new version
new
file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311301721.1A
Other languages
Chinese (zh)
Inventor
周亚平
黄润明
苏晓芃
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Wondware Technology Co ltd
Original Assignee
Shenzhen Wondware Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Wondware Technology Co ltd filed Critical Shenzhen Wondware Technology Co ltd
Priority to CN202311301721.1A priority Critical patent/CN117170716A/en
Publication of CN117170716A publication Critical patent/CN117170716A/en
Pending legal-status Critical Current

Links

Landscapes

  • Stored Programmes (AREA)

Abstract

The embodiment of the invention belongs to the technical field of power conversion cabinets, and relates to a method, a device, computer equipment and a storage medium for upgrading a power conversion cabinet program, wherein the method comprises the following steps: receiving a firmware update request to be updated issued by an upper computer, and downloading a difference patch file and a compressed package file by a battery exchange cabinet; extracting the backup current version firmware from the local storage of the power conversion cabinet, and combining the difference patch file with the current version firmware by using a bspatich algorithm to generate new version firmware; comparing the new MD5 value of the new version firmware with the MD5 value of the firmware to be upgraded based on an MD5 algorithm, and downloading if the new MD5 value is completely consistent with the MD5 value of the firmware to be upgraded; and running the new version firmware, monitoring various parameters of the running new version firmware, comparing version information, prompting the completion of upgrading if the parameters are completely consistent, and simultaneously storing the new version firmware as a backup file. Compared with the prior art, the method has the remarkable effects of less occupied resources, less network downloading transmission quantity, high upgrading efficiency and low consumption flow in the aspect of updating the program firmware of the power conversion cabinet.

Description

一种换电柜程序升级方法、装置、计算机设备及存储介质A power exchange cabinet program upgrade method, device, computer equipment and storage medium

技术领域Technical field

本发明涉及换电柜技术领域,尤其涉及一种换电柜程序升级方法、装置、计算机设备及存储介质。The present invention relates to the technical field of power replacement cabinets, and in particular to a power replacement cabinet program upgrade method, device, computer equipment and storage medium.

背景技术Background technique

随着新能源的快速发展,针对电池充电安全的换电柜安装部署也越来越多。然而,换电柜在实际运行中,经常会碰到客户需求的变更以及软件逻辑纠正等一系列问题需要处理。由于换电柜大多都是安装部署在户外且位置相对分散的地方,如果说每一次变更,需要安排运维人员现场完成升级处理,就会造成巨大的运维成本浪费。With the rapid development of new energy, more and more power swap cabinets are installed and deployed for battery charging safety. However, in actual operation of power swapping cabinets, a series of problems such as changes in customer requirements and software logic corrections often need to be dealt with. Since most of the power swapping cabinets are installed and deployed outdoors in relatively scattered locations, if every change requires operation and maintenance personnel to complete the upgrade on-site, it will cause huge waste of operation and maintenance costs.

目前普遍关于换电柜程序的更新都是基于移动网络的远程更新。然而,随着人们对换电柜功能的需求越来越丰富,审美度的越来越高,间接造成换电柜逻辑处理的固件体积越来越大,资源占用越来越多,导致了固件体积越大在更新时,网络下载传输变慢,硬件存储资源占用多,升级效率就越低,同时还会造成过高的数据流量费。At present, the update of the power replacement cabinet program is generally based on the remote update of the mobile network. However, as people's demand for the functions of power swap cabinets becomes more and more abundant, and their aesthetics become higher and higher, the firmware that indirectly causes the logic processing of power swap cabinets becomes larger and larger, occupying more and more resources, resulting in the firmware The larger the size, the slower the network download and transmission will be when updating, and the more hardware storage resources will be occupied, the lower the upgrade efficiency will be, and it will also cause excessive data traffic charges.

发明内容Contents of the invention

本发明实施例的目的在于提出一种换电柜程序升级方法、装置、计算机设备及存储介质,以解决现有的换电柜在更新时,网络下载传输慢,硬件存储资源占用多,升级效率低,以及造成使用的流量费过高的问题。The purpose of the embodiments of the present invention is to propose a method, device, computer equipment and storage medium for upgrading the program of a power replacement cabinet, so as to solve the problem of slow network download transmission, high hardware storage resource usage, and high upgrade efficiency when updating the existing power replacement cabinet. Low, and causing the problem of excessively high traffic charges.

为了解决上述技术问题,本发明实施例提供一种换电柜程序升级方法,采用了如下的技术方案:In order to solve the above technical problems, embodiments of the present invention provide a power exchange cabinet program upgrade method, which adopts the following technical solutions:

接收上位机下发的待升级固件更新请求,换电柜下载差异补丁文件和压缩包文件,所述压缩包文件包括待升级固件的版本信息和MD5值;Receive the update request of the firmware to be upgraded issued by the host computer, and the power exchange cabinet downloads the difference patch file and the compressed package file. The compressed package file includes the version information and MD5 value of the firmware to be upgraded;

从所述换电柜本地存储中提取备份的当前版本固件,利用bspatch算法将所述差异补丁文件与当前版本固件进行合并,生成新版本固件,所述新版本固件包括新版本信息和新MD5值;Extract the backed up current version of the firmware from the local storage of the power swap cabinet, and use the bspatch algorithm to merge the difference patch file with the current version of the firmware to generate a new version of the firmware. The new version of the firmware includes new version information and a new MD5 value. ;

基于MD5算法比对新版本固件的新MD5值与待升级固件的MD5值是否完全一致,若完全一致则下载所述新版本固件;Based on the MD5 algorithm, compare whether the new MD5 value of the new version of the firmware is completely consistent with the MD5 value of the firmware to be upgraded, and if they are completely consistent, download the new version of the firmware;

运行所述新版本固件,监测所述新版本固件运行的各项参数并比对新版本信息与待升级固件的版本信息是否完全一致,若完全一致则提示升级完成,同时保存所述新版本固件作为备份文件。Run the new version of the firmware, monitor various parameters of the new version of the firmware and compare whether the new version information is completely consistent with the version information of the firmware to be upgraded. If they are completely consistent, it will prompt that the upgrade is completed and save the new version of the firmware. as a backup file.

进一步的,所述接收上位机下发的待升级固件更新请求的步骤之前,还包括步骤:Further, before the step of receiving the firmware update request to be upgraded issued by the host computer, the step also includes the following steps:

获取待升级固件,上位机运行bsdiff工具,将所述待升级固件与换电柜的当前版本固件进行二进制差异对比,生成差异补丁文件。Obtain the firmware to be upgraded, run the bsdiff tool on the host computer, compare the binary differences between the firmware to be upgraded and the current version of the firmware of the power swap cabinet, and generate a difference patch file.

进一步的,所述差异补丁文件的生成步骤包括:Further, the steps of generating the difference patch file include:

利用bsdiff工具匹配所述待升级固件与当前版本固件之间的最长相同字符串;Use the bsdiff tool to match the longest identical string between the firmware to be upgraded and the current version of the firmware;

对每一字符串中相同的部位进行标识,得到所述待升级固件与当前版本固件的差异字符位置信息,生成包含差异字符位置信息和已知字符串信息的二进制文件;Identify the same parts in each string, obtain the difference character position information between the firmware to be upgraded and the current version of the firmware, and generate a binary file containing the difference character position information and known string information;

压缩二进制文件得到差异补丁文件。Compress binary files to get differential patch files.

进一步的,所述获取待升级固件时,先利用MD5算法校验待升级固件的MD5值,若校验通过则可获取,若校验不通过则生成MD5值校验异常信息并反馈给上位机。Further, when obtaining the firmware to be upgraded, the MD5 algorithm is first used to verify the MD5 value of the firmware to be upgraded. If the verification passes, it can be obtained. If the verification fails, the MD5 value verification exception information is generated and fed back to the host computer. .

进一步的,所述监测所述新版本固件运行的各项参数有异常,及比对新版本信息与待升级固件的版本信息不完全一致,则提示升级失败,生成所述新版本固件的异常信息反馈给上位机,并退出升级反回当前版本固件的运行。Further, if there are abnormalities in various parameters monitoring the operation of the new version of the firmware, and if the comparison of the new version information and the version information of the firmware to be upgraded are not completely consistent, an upgrade failure will be prompted and abnormal information of the new version of the firmware will be generated. Feedback to the host computer, and exit the upgrade to return to the running of the current version of the firmware.

为了解决上述技术问题,本发明实施例还提供一种换电柜程序升级装置,包括:In order to solve the above technical problems, embodiments of the present invention also provide a power exchange cabinet program upgrade device, which includes:

下载模块,用于接收上位机下发的待升级固件更新请求,换电柜下载差异补丁文件和压缩包文件,所述压缩包文件包括待升级固件的版本信息和MD5值;The download module is used to receive the update request of the firmware to be upgraded issued by the host computer, and the power exchange cabinet downloads the difference patch file and the compressed package file. The compressed package file includes the version information and MD5 value of the firmware to be upgraded;

合并模块,用于从所述换电柜本地存储中提取备份的当前版本固件,利用bspatch算法将所述差异补丁文件与当前版本固件进行合并,生成新版本固件,所述新版本固件包括新版本信息和新MD5值;A merging module, used to extract the backup current version firmware from the local storage of the power exchange cabinet, use the bspatch algorithm to merge the difference patch file with the current version firmware, and generate a new version firmware, where the new version firmware includes a new version message and new MD5 value;

校验模块,用于基于MD5算法比对新版本固件的新MD5值与待升级固件的MD5值是否完全一致,若完全一致则下载所述新版本固件;The verification module is used to compare whether the new MD5 value of the new version of the firmware is completely consistent with the MD5 value of the firmware to be upgraded based on the MD5 algorithm. If they are completely consistent, download the new version of the firmware;

监测模块,用于运行所述新版本固件,监测所述新版本固件运行的各项参数并比对新版本信息与待升级固件的版本信息是否完全一致,若完全一致则提示升级完成,同时保存所述新版本固件作为备份文件。The monitoring module is used to run the new version of the firmware, monitor various parameters of the new version of the firmware and compare whether the new version information is completely consistent with the version information of the firmware to be upgraded. If they are completely consistent, it will prompt that the upgrade is completed and save it at the same time. The new version of the firmware serves as a backup file.

进一步的,其特征在于,所述接收上位机下发的待升级固件更新请求之前,还包括:Further, it is characterized in that, before receiving the firmware update request to be upgraded issued by the host computer, it also includes:

差异模块,用于获取待升级固件,上位机运行bsdiff工具,将所述待升级固件与换电柜的当前版本固件进行二进制差异对比,生成差异补丁文件。The difference module is used to obtain the firmware to be upgraded. The host computer runs the bsdiff tool to compare the binary differences between the firmware to be upgraded and the current version of the firmware of the power swap cabinet to generate a difference patch file.

进一步的,其特征在于,所述差异补丁文件的生成包括:Further, it is characterized in that the generation of the difference patch file includes:

利用bsdiff工具匹配所述待升级固件与当前版本固件之间的最长相同字符串;Use the bsdiff tool to match the longest identical string between the firmware to be upgraded and the current version of the firmware;

对每一字符串中相同的部位进行标识,得到所述待升级固件与当前版本固件的差异字符位置信息,生成包含差异字符位置信息和已知字符串信息的二进制文件;Identify the same parts in each string, obtain the difference character position information between the firmware to be upgraded and the current version of the firmware, and generate a binary file containing the difference character position information and known string information;

压缩二进制文件得到差异补丁文件。Compress binary files to get differential patch files.

为了解决上述技术问题,本发明实施例还提供一种计算机设备,采用了如下所述的技术方案:In order to solve the above technical problems, embodiments of the present invention also provide a computer device, which adopts the following technical solution:

包括存储器和处理器,所述存储器中存储有程序升级可读指令,所述处理器执行所述程序升级可读指令时实现如上任一项所述的换电柜程序升级方法的步骤。It includes a memory and a processor, and program upgrade readable instructions are stored in the memory. When the processor executes the program upgrade readable instructions, the steps of the power exchange cabinet program upgrade method described in any one of the above are implemented.

为了解决上述技术问题,本发明实施例还提供一种计算机可读存储介质,采用了如下所述的技术方案:In order to solve the above technical problems, embodiments of the present invention also provide a computer-readable storage medium, which adopts the following technical solution:

所述计算机可读存储介质上存储有程序升级可读指令,所述程序升级可读指令被处理器执行时实现如上任一项所述的换电柜程序升级方法的步骤。The computer-readable storage medium stores program upgrade readable instructions. When the program upgrade readable instructions are executed by the processor, the steps of the power exchange cabinet program upgrade method described in any one of the above are implemented.

本发明提供了一种换电柜程序升级方法,通过接收上位机下发的待升级固件更新请求,换电柜下载差异补丁文件和压缩包文件;从所述换电柜本地存储中提取备份的当前版本固件,利用bspatch算法将所述差异补丁文件与当前版本固件进行合并,生成新版本固件;基于MD5算法比对新版本固件的新MD5值与待升级固件的MD5值是否完全一致,若完全一致则下载所述新版本固件;运行所述新版本固件,监测所述新版本固件运行的各项参数并比对新版本信息与待升级固件的版本信息是否完全一致,若完全一致则提示升级完成,同时保存所述新版本固件作为备份文件。与现有技术相比具有在换电柜程序固件更新方面具有占用资源少,网络下载传输量少,升级效率高,消耗流量低的显著效果。The invention provides a method for upgrading a power exchange cabinet program. By receiving a firmware update request to be upgraded issued by a host computer, the power exchange cabinet downloads a difference patch file and a compressed package file; and extracts the backup program from the local storage of the power exchange cabinet. For the current version of the firmware, use the bspatch algorithm to merge the difference patch file with the current version of the firmware to generate a new version of the firmware; based on the MD5 algorithm, compare whether the new MD5 value of the new version of the firmware is completely consistent with the MD5 value of the firmware to be upgraded. If so, If they are consistent, download the new version of the firmware; run the new version of the firmware, monitor the parameters of the new version of the firmware and compare whether the new version information is completely consistent with the version information of the firmware to be upgraded. If they are completely consistent, an upgrade will be prompted. Done while saving the new version of the firmware as a backup file. Compared with the existing technology, it has the remarkable effects of consuming less resources, less network download and transmission volume, high upgrade efficiency, and low traffic consumption in terms of updating the program firmware of the power exchange cabinet.

附图说明Description of drawings

为了更清楚地说明本发明中的方案,下面将对本发明实施例描述中所需要使用的附图作一个简单介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to explain the solution of the present invention more clearly, a brief introduction will be given below to the drawings needed to describe the embodiments of the present invention. Obviously, the drawings in the following description are some embodiments of the present invention, which are of great significance to this field. Ordinary technicians can also obtain other drawings based on these drawings without exerting creative work.

图1是本发明可以应用于其中的示例性系统架构图;Figure 1 is an exemplary system architecture diagram in which the present invention may be applied;

图2是本发明换电柜程序升级方法的较佳实施例流程图;Figure 2 is a flow chart of a preferred embodiment of the power exchange cabinet program upgrade method of the present invention;

图3是本发明换电柜程序升级装置的结构示意图;Figure 3 is a schematic structural diagram of the power exchange cabinet program upgrade device of the present invention;

图4是本发明计算机设备的的较佳实施例示意图。Figure 4 is a schematic diagram of a preferred embodiment of the computer equipment of the present invention.

具体实施方式Detailed ways

除非另有定义,本文所使用的所有的技术和科学术语与属于本发明的技术领域的技术人员通常理解的含义相同;本文中在申请的说明书中所使用的术语只是为了描述具体的实施例的目的,不是旨在于限制本发明;本发明的说明书和权利要求书及上述附图说明中的术语“包括”和“具有”以及它们的任何变形,意图在于覆盖不排他的包含。本发明的说明书和权利要求书或上述附图中的术语“第一”、“第二”等是用于区别不同对象,而不是用于描述特定顺序。Unless otherwise defined, all technical and scientific terms used herein have the same meanings as commonly understood by those skilled in the technical field belonging to the present invention; the terms used herein in the specification of the application are for the purpose of describing specific embodiments only. It is not intended to limit the present invention; the terms "including" and "having" and any variations thereof in the description and claims of the present invention and the above description of the drawings are intended to cover non-exclusive inclusion. The terms "first", "second", etc. in the description and claims of the present invention or the above-mentioned drawings are used to distinguish different objects, rather than describing a specific sequence.

在本文中提及“实施例”意味着,结合实施例描述的特定特征、结构或特性可以包含在本发明的至少一个实施例中。在说明书中的各个位置出现该短语并不一定均是指相同的实施例,也不是与其它实施例互斥的独立的或备选的实施例。本领域技术人员显式地和隐式地理解的是,本文所描述的实施例可以与其它实施例相结合。Reference herein to "an embodiment" means that a particular feature, structure or characteristic described in connection with the embodiment can be included in at least one embodiment of the invention. The appearances of this phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those skilled in the art understand, both explicitly and implicitly, that the embodiments described herein may be combined with other embodiments.

为了使本技术领域的人员更好地理解本发明方案,下面将结合附图,对本发明实施例中的技术方案进行清楚、完整地描述。In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings.

如图1所示,系统架构100可以包括终端设备101,网络102和服务器103。网络102用以在终端设备101和服务器103之间提供通信链路的介质。网络102可以包括各种连接类型,例如有线、无线通信链路或者光纤电缆等等。As shown in Figure 1, the system architecture 100 may include a terminal device 101, a network 102 and a server 103. The network 102 is a medium used to provide a communication link between the terminal device 101 and the server 103 . Network 102 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.

用户可以使用终端设备101通过网络102与服务器103交互,以接收或发送消息等。终端设备101上可以安装有各种通讯客户端应用,例如网页浏览器应用、购物类应用、搜索类应用、即时通信工具、邮箱客户端、社交平台软件等。The user can use the terminal device 101 to interact with the server 103 through the network 102 to receive or send messages, etc. Various communication client applications can be installed on the terminal device 101, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.

终端设备101可以是具有显示屏并且支持网页浏览的各种电子设备,包括但不限于智能手机、平板电脑、电子书阅读器、MP3播放器(Moving Picture Experts Group AudioLayer III,动态影像专家压缩标准音频层面3)、MP4(Moving Picture Experts GroupAudio Layer IV,动态影像专家压缩标准音频层面4)播放器、膝上型便携计算机和台式计算机等等。The terminal device 101 may be a variety of electronic devices that have a display screen and support web browsing, including but not limited to smartphones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group AudioLayer III, Moving Picture Experts Group Audio Layer III, Moving Picture Experts Group Audio Layer III). Layer 3), MP4 (Moving Picture Experts GroupAudio Layer IV, Moving Picture Experts GroupAudio Layer IV, Moving Picture Experts Compression Standard Audio Layer 4) players, laptops and desktop computers, etc.

服务器103可以是提供各种服务的服务器,例如对终端设备101上显示的页面提供支持的后台服务器。The server 103 may be a server that provides various services, such as a backend server that provides support for pages displayed on the terminal device 101.

需要说明的是,本发明实施例所提供的换电柜程序升级方法一般由服务器/终端设备执行,相应地,应用于换电柜程序升级装置一般设置于服务器/终端设备中。It should be noted that the power exchange cabinet program upgrade method provided by the embodiment of the present invention is generally executed by a server/terminal device. Correspondingly, a device for power exchange cabinet program upgrade is generally provided in the server/terminal device.

应该理解,图1中的终端设备101、网络102和服务器103的数目仅仅是示意性的。根据实现需要,可以具有任意数目的终端设备、网络和服务器。It should be understood that the numbers of terminal devices 101, networks 102 and servers 103 in Figure 1 are only illustrative. Depending on implementation needs, there can be any number of end devices, networks, and servers.

继续参考图2,示出了根据本发明的换电柜程序升级方法的较佳实施例流程图。所述的换电柜程序升级方法,包括:步骤S0、步骤S1、步骤S2、步骤S3和步骤S4。Continuing to refer to FIG. 2 , a flow chart of a preferred embodiment of the power exchange cabinet program upgrade method according to the present invention is shown. The power exchange cabinet program upgrade method includes: step S0, step S1, step S2, step S3 and step S4.

在步骤S0中,获取待升级固件,上位机运行bsdiff工具,将所述待升级固件与换电柜的当前版本固件进行二进制差异对比,生成差异补丁文件。In step S0, the firmware to be upgraded is obtained, and the host computer runs the bsdiff tool to compare the binary differences between the firmware to be upgraded and the current version of the firmware of the power swap cabinet to generate a difference patch file.

在本发明实施例中,待升级固件是事先做好的,在下发待升级固件前,上位机需要先进行差异处理,其中,bsdiff是用来做差异的工具,例如,二进制差异对比法将新文件A和备份文件B进行从头到尾的对比,如遇到不同的地方就标记后放在C文件里,这个C文件称为差异补丁文件。In the embodiment of the present invention, the firmware to be upgraded is prepared in advance. Before issuing the firmware to be upgraded, the host computer needs to perform difference processing first. Among them, bsdiff is a tool used to make differences. For example, the binary difference comparison method will File A and backup file B are compared from beginning to end. If they encounter differences, they are marked and placed in file C. This C file is called a difference patch file.

进一步的,所述差异补丁文件的生成步骤包括:Further, the steps of generating the difference patch file include:

利用bsdiff工具匹配所述待升级固件与当前版本固件之间的最长相同字符串;Use the bsdiff tool to match the longest identical string between the firmware to be upgraded and the current version of the firmware;

对每一字符串中相同的部位进行标识,得到所述待升级固件与当前版本固件的差异字符位置信息,生成包含差异字符位置信息和已知字符串信息的二进制文件;Identify the same parts in each string, obtain the difference character position information between the firmware to be upgraded and the current version of the firmware, and generate a binary file containing the difference character position information and known string information;

压缩二进制文件得到差异补丁文件。Compress binary files to get differential patch files.

在本发明实施例中,bsdiff工具的算法是通过匹配最长相同字符串,对相同的部分用0代替,最后再用常规的压缩算法进行压缩。其差异原理如下比喻:In the embodiment of the present invention, the algorithm of the bsdiff tool is to match the longest identical string, replace the identical parts with 0, and finally use a conventional compression algorithm to compress. The difference principle is as follows:

待升级固件:abedsfasdfaods,其中,abedsfa为最长相同字符,sdfaods为额外字符;Firmware to be upgraded: abedsfa sdfaods, where abedsfa is the longest identical character and sdfaods is the extra character;

当前版本固件:abcdsfaaa,其中,abcdsfa为最长相同字符,aa不同于sdfaods。Current version of firmware: abcdsfa aa, where abcdsfa is the longest same character, aa is different from sdfaods.

可以看出,待升级固件中包含的最长相同字符为abedsfa,可标识为0020000的差异字符串,因其含有大量的“0”而可被高效的压缩,而剩下的字符sdfaods是额外增加的,也不同于尾词的aa,可作为额外字符串,因此,n个压缩的差异字符串+额外字符串则形成差异补丁文件。再比如,若如差异文件是“000000”,可以用“60”两个字符代替,意思为6个0,实现高效压缩。It can be seen that the longest identical character contained in the firmware to be upgraded is abedsfa, which can be identified as a difference string of 0020000. It can be efficiently compressed because it contains a large number of "0"s, and the remaining characters sdfaods are additional characters. , is also different from the aa of the last word, which can be used as an extra string. Therefore, n compressed difference strings + extra strings form a difference patch file. For another example, if the difference file is "000000", you can use the two characters "60" instead, which means 6 zeros, to achieve efficient compression.

需要说明的是,换电柜的相邻两个版本固件之间差异其实都是很小的,因此,差异补丁文件起到加快转换的作用。It should be noted that the difference between two adjacent versions of firmware of the power swap cabinet is actually very small. Therefore, the difference patch file plays a role in speeding up the conversion.

进一步的,所述获取待升级固件时,先利用MD5算法校验待升级固件的MD5值,若校验通过则可获取,若校验不通过则生成MD5值校验异常信息并反馈给上位机。Further, when obtaining the firmware to be upgraded, the MD5 algorithm is first used to verify the MD5 value of the firmware to be upgraded. If the verification passes, it can be obtained. If the verification fails, the MD5 value verification exception information is generated and fed back to the host computer. .

在步骤S1中,接收上位机下发的待升级固件更新请求,换电柜下载差异补丁文件和压缩包文件,所述压缩包文件包括待升级固件的版本信息和MD5值。In step S1, after receiving the update request of the firmware to be upgraded issued by the host computer, the power exchange cabinet downloads the difference patch file and the compressed package file. The compressed package file includes the version information and MD5 value of the firmware to be upgraded.

在本发明实施例中,根据实际应用方案,换电柜是安装部署在户外且位置相对分散的各个地方,采用基于移动网络远程更新换电柜的程序,但有区别于现有技术,具体的是,依据请求下载差异补丁文件和压缩包文件,其中,差异补丁文件具有区别新旧版本的不同程序位置信息,便于程序位置的点对点替换修正的升级,无需整个版本的固件整体升级所带来的占资、耗时、低效和耗流量的缺陷问题,也无需工作人员到每一个换电柜现场一一升级处理,做到了远程高效升级的显著效果。In the embodiment of the present invention, according to the actual application plan, the power exchange cabinet is installed and deployed outdoors in various places with relatively scattered locations. A program for remotely updating the power exchange cabinet based on the mobile network is used, but it is different from the existing technology. Specifically, Yes, download the difference patch file and compressed package file according to the request. Among them, the difference patch file has different program location information that distinguishes the old and new versions, which facilitates the point-to-point replacement and correction upgrade of the program location without the overhead caused by the overall upgrade of the entire version of the firmware. It eliminates the defects of capital, time-consuming, inefficiency and traffic consumption, and eliminates the need for staff to go to each power-swapping cabinet site to upgrade and deal with them one by one, achieving the remarkable effect of remote and efficient upgrade.

在步骤S202中,从所述换电柜本地存储中提取备份的当前版本固件,利用bspatch算法将所述差异补丁文件与当前版本固件进行合并,生成新版本固件,所述新版本固件包括新版本信息和新MD5值。In step S202, extract the backed up current version firmware from the local storage of the power exchange cabinet, use the bspatch algorithm to merge the difference patch file with the current version firmware, and generate a new version firmware, where the new version firmware includes a new version message and new MD5 value.

在本发明实施例中,换电柜本地存储中提取备份的当前版本固件可直接调用,差异补丁文件包含有新旧版本固件的不同程序位置的信息,利用bspatch算法能够快速标识到当前版本固件中与差异补丁文件的具体差异位置,只需点对点替换掉当前版本固件中的信息,无需全部搜索和替换,能够合并形成的新版本固件。In the embodiment of the present invention, the backup of the current version of the firmware extracted from the local storage of the power exchange cabinet can be directly called. The difference patch file contains information about the different program locations of the old and new versions of the firmware. The bspatch algorithm can be used to quickly identify the current version of the firmware and the The specific difference location of the difference patch file only needs to replace the information in the current version of the firmware point-to-point. There is no need to search and replace all, and the new version of the firmware can be merged.

bspatch是用来做合并的工具,例如,文件A和文件B生成了差文件C。当有程序需要升级时,这时已知条件就是备份文件B和差异文件C,然后通过bspatch解析出差异文件C的信息,再和备份文件B合并生成新的文件,这个新的文件原则上就应该是文件A。bspatch is a tool used for merging. For example, file A and file B generate the difference file C. When a program needs to be upgraded, the known conditions are backup file B and difference file C. Then the information of difference file C is parsed through bspatch, and then merged with backup file B to generate a new file. In principle, this new file is It should be file A.

在步骤S203中,基于MD5算法比对新版本固件的新MD5值与待升级固件的MD5值是否完全一致,若完全一致则下载所述新版本固件。In step S203, the new MD5 value of the new version of the firmware is compared with the MD5 value of the firmware to be upgraded based on the MD5 algorithm. If they are completely consistent, the new version of the firmware is downloaded.

在本发明实施例中,MD5算法是一种信息摘要算法,其英文为MD5 Message-DigestAlgorithm,是一种被广泛使用的密码散列函数,可以产生出一个128位(16字节)的散列值(hash value),用于对新版本固件的新MD5值与待升级固件的MD5值的比对,确保新版本固件的信息完整一致性。In the embodiment of the present invention, the MD5 algorithm is a message digest algorithm. Its English name is MD5 Message-DigestAlgorithm. It is a widely used cryptographic hash function that can generate a 128-bit (16-byte) hash. Value (hash value), used to compare the new MD5 value of the new version of the firmware with the MD5 value of the firmware to be upgraded to ensure the completeness and consistency of the information of the new version of the firmware.

当新版本固件的新MD5值与待升级固件的MD5值不完全一致时,则返回步骤S1重新下载、核对、合并及比对MD5值,若3次不成功,则终止额并不难次升级请求。When the new MD5 value of the new version of the firmware is not completely consistent with the MD5 value of the firmware to be upgraded, return to step S1 to re-download, check, merge and compare the MD5 values. If it fails three times, it is not difficult to terminate the upgrade. ask.

在步骤S204中,运行所述新版本固件,监测所述新版本固件运行的各项参数并比对新版本信息与待升级固件的版本信息是否完全一致,若完全一致则提示升级完成,同时保存所述新版本固件作为备份文件。In step S204, run the new version of the firmware, monitor various parameters of the operation of the new version of the firmware and compare whether the new version information is completely consistent with the version information of the firmware to be upgraded. If they are completely consistent, it will prompt that the upgrade is completed and save it at the same time. The new version of the firmware serves as a backup file.

在本发明实施例中,对于下载后的新版本固件执行首次运行的过程中,需对各项功能以及性能指标的数据参数等做运行监测,若正常运行,则最终升级完成。若监测新版本固件运行的各项参数有异常,及比对新版本信息与待升级固件的版本信息不完全一致,则提示升级失败,生成新版本固件的异常信息反馈给上位机,并退出升级反回当前版本固件的运行。In the embodiment of the present invention, during the first operation of the downloaded new version of firmware, it is necessary to monitor the operation of various functions and data parameters of performance indicators. If it runs normally, the final upgrade is completed. If there are any abnormalities in the parameters of the new version of the firmware, and the comparison of the new version information and the version information of the firmware to be upgraded is not completely consistent, it will prompt that the upgrade failed, generate the abnormal information of the new version of the firmware and feed it back to the host computer, and exit the upgrade. Returns the operation of the current version of firmware.

在本发明实施例中,提供了一种换电柜程序升级方法,包括:接收上位机下发的待升级固件更新请求,换电柜下载差异补丁文件和压缩包文件;从所述换电柜本地存储中提取备份的当前版本固件,利用bspatch算法将所述差异补丁文件与当前版本固件进行合并,生成新版本固件;基于MD5算法比对新版本固件的新MD5值与待升级固件的MD5值是否完全一致,若完全一致则下载所述新版本固件;运行所述新版本固件,监测所述新版本固件运行的各项参数并比对新版本信息与待升级固件的版本信息是否完全一致,若完全一致则提示升级完成,同时保存所述新版本固件作为备份文件。与现有技术相比,本发明在换电柜程序固件更新方面具有占用资源少,网络下载传输量少,升级效率高,消耗流量低的显著效果。In an embodiment of the present invention, a method for upgrading a power exchange cabinet program is provided, which includes: receiving a firmware update request to be upgraded issued by a host computer, downloading a difference patch file and a compressed package file from the power exchange cabinet; Extract the backed up current version of the firmware from the local storage, use the bspatch algorithm to merge the difference patch file with the current version of the firmware, and generate a new version of the firmware; based on the MD5 algorithm, compare the new MD5 value of the new version of the firmware with the MD5 value of the firmware to be upgraded. Whether it is completely consistent, if it is completely consistent, download the new version of the firmware; run the new version of the firmware, monitor the parameters of the new version of the firmware and compare whether the new version information is completely consistent with the version information of the firmware to be upgraded, If they are completely consistent, it will prompt that the upgrade is completed, and the new version of the firmware will be saved as a backup file. Compared with the existing technology, the present invention has the remarkable effects of occupying less resources, less network download and transmission volume, high upgrade efficiency, and low traffic consumption in updating the program firmware of the power exchange cabinet.

本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机可读指令来指令相关的硬件来完成,该计算机可读指令可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,前述的存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)等非易失性存储介质,或随机存储记忆体(Random Access Memory,RAM)等。Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be implemented by instructing relevant hardware through computer-readable instructions. The computer-readable instructions can be stored in a computer-readable storage medium. , when executed, the program may include the processes of the above method embodiments. Among them, the aforementioned storage medium can be a non-volatile storage medium such as a magnetic disk, an optical disk, a read-only memory (Read-Only Memory, ROM), or a random access memory (Random Access Memory, RAM).

应该理解的是,虽然附图的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,其可以以其他的顺序执行。而且,附图的流程图中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,其执行顺序也不必然是依次进行,而是可以与其他步骤或者其他步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。It should be understood that although various steps in the flowchart of the accompanying drawings are shown in sequence as indicated by arrows, these steps are not necessarily performed in the order indicated by arrows. Unless explicitly stated in this article, the execution of these steps is not strictly limited in order, and they can be executed in other orders. Moreover, at least some of the steps in the flow chart of the accompanying drawings may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but may be executed at different times, and their execution order is also It does not necessarily need to be performed sequentially, but may be performed in turn or alternately with other steps or sub-steps of other steps or at least part of the stages.

参考图3,作为对上述图2所示方法的实现,本发明提供了一种换电柜程序升级装置的实施例,该装置实施例与图2所示的方法实施例相对应,该装置具体可以应用于各种电子设备中,本实施例的换电柜程序升级装置200包括:差异模块210、下载模块220、合并模块230、校验模块240以及监测模块250,其中:Referring to Figure 3, as an implementation of the method shown in Figure 2 above, the present invention provides an embodiment of a power exchange cabinet program upgrade device. The device embodiment corresponds to the method embodiment shown in Figure 2. The device is specifically It can be applied to various electronic devices. The power exchange cabinet program upgrade device 200 of this embodiment includes: a difference module 210, a download module 220, a merging module 230, a verification module 240 and a monitoring module 250, wherein:

差异模块210,用于获取待升级固件,上位机运行bsdiff工具,将所述待升级固件与换电柜的当前版本固件进行二进制差异对比,生成差异补丁文件;The difference module 210 is used to obtain the firmware to be upgraded. The host computer runs the bsdiff tool to compare the binary differences between the firmware to be upgraded and the current version of the firmware of the power exchange cabinet to generate a difference patch file;

下载模块220,用于接收上位机下发的待升级固件更新请求,换电柜下载差异补丁文件和压缩包文件,所述压缩包文件包括待升级固件的版本信息和MD5值;The download module 220 is used to receive the update request of the firmware to be upgraded issued by the host computer, and the power exchange cabinet downloads the difference patch file and the compressed package file. The compressed package file includes the version information and MD5 value of the firmware to be upgraded;

合并模块230,用于从所述换电柜本地存储中提取备份的当前版本固件,利用bspatch算法将所述差异补丁文件与当前版本固件进行合并,生成新版本固件,所述新版本固件包括新版本信息和新MD5值;The merging module 230 is used to extract the backup current version firmware from the local storage of the power exchange cabinet, use the bspatch algorithm to merge the difference patch file with the current version firmware, and generate a new version of firmware, where the new version firmware includes new Version information and new MD5 value;

校验模块240,用于基于MD5算法比对新版本固件的新MD5值与待升级固件的MD5值是否完全一致,若完全一致则下载所述新版本固件;The verification module 240 is used to compare whether the new MD5 value of the new version of the firmware is completely consistent with the MD5 value of the firmware to be upgraded based on the MD5 algorithm. If they are completely consistent, download the new version of the firmware;

监测模块250,用于运行所述新版本固件,监测所述新版本固件运行的各项参数并比对新版本信息与待升级固件的版本信息是否完全一致,若完全一致则提示升级完成,同时保存所述新版本固件作为备份文件。The monitoring module 250 is used to run the new version of the firmware, monitor various parameters of the new version of the firmware and compare whether the new version information is completely consistent with the version information of the firmware to be upgraded. If they are completely consistent, it will prompt that the upgrade is completed. At the same time Save the new version of firmware as a backup file.

在本发明实施例中,待升级固件是预先做好,存放在上位机的存储模块中,存储模块还存储有各个换电柜对应备份的当前版本固件,AB0001、AB0002、AB0003、AB0004……AB000n,在上位机中先做好差异补丁文件,在通过HTTP通信协议的方式下发到各个换电柜供其下载、合成、校验和监测,最终实现自动高效的程序升级。与现有技术相比,本发明在换电柜程序固件更新方面具有占用资源少,网络下载传输量少,升级效率高,消耗流量低的显著效果。In the embodiment of the present invention, the firmware to be upgraded is prepared in advance and stored in the storage module of the host computer. The storage module also stores the current version of the firmware corresponding to the backup of each power swap cabinet, AB0001, AB0002, AB0003, AB0004...AB000n , first prepare the difference patch file in the host computer, and then send it to each power exchange cabinet through HTTP communication protocol for downloading, synthesis, verification and monitoring, and finally realize automatic and efficient program upgrade. Compared with the existing technology, the present invention has the remarkable effects of occupying less resources, less network download and transmission volume, high upgrade efficiency, and low traffic consumption in updating the program firmware of the power exchange cabinet.

为解决上述技术问题,本发明实施例还提供计算机设备。具体请参阅图4,是本发明计算机设备的的较佳实施例示意图。In order to solve the above technical problems, embodiments of the present invention also provide computer equipment. Please refer to FIG. 4 specifically, which is a schematic diagram of a preferred embodiment of the computer equipment of the present invention.

所述计算机设备30包括通过系统总线相互通信连接存储器31、处理器32、网络接口33。需要指出的是,图中仅示出了具有组件31-33的计算机设备30,但是应理解的是,并不要求实施所有示出的组件,可以替代的实施更多或者更少的组件。其中,本技术领域技术人员可以理解,这里的计算机设备是一种能够按照事先设定或存储的指令,自动进行数值计算和/或信息处理的设备,其硬件包括但不限于微处理器、专用集成电路(ApplicationSpecific Integrated Circuit,ASIC)、可编程门阵列(Field-Programmable GateArray,FPGA)、数字处理器(Digital Signal Processor,DSP)、嵌入式设备等。The computer device 30 includes a memory 31, a processor 32, and a network interface 33 that are connected to each other through a system bus. It should be noted that only the computer device 30 having components 31 - 33 is shown in the figure, but it should be understood that implementation of all the components shown is not required, and more or less components may be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and/or information processing according to preset or stored instructions. Its hardware includes but is not limited to microprocessors, special-purpose Integrated circuits (ApplicationSpecific Integrated Circuit, ASIC), programmable gate array (Field-Programmable GateArray, FPGA), digital processor (Digital Signal Processor, DSP), embedded devices, etc.

所述计算机设备可以是桌上型计算机、笔记本、掌上电脑及云端服务器等计算设备。所述计算机设备可以与用户通过键盘、鼠标、遥控器、触摸板或声控设备等方式进行人机交互。The computer device may be a desktop computer, a notebook, a PDA, a cloud server and other computing devices. The computer device can perform human-computer interaction with the user through keyboard, mouse, remote control, touch panel or voice control device.

所述存储器31至少包括一种类型的可读存储介质,所述可读存储介质包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、随机访问存储器(RAM)、静态随机访问存储器(SRAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、可编程只读存储器(PROM)、磁性存储器、磁盘、光盘等。在一些实施例中,所述存储器31可以是所述计算机设备30的内部存储单元,例如该计算机设备30的硬盘或内存。在另一些实施例中,所述存储器31也可以是所述计算机设备30的外部存储设备,例如该计算机设备30上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。当然,所述存储器31还可以既包括所述计算机设备30的内部存储单元也包括其外部存储设备。本实施例中,所述存储器31通常用于存储安装于所述计算机设备30的操作系统和各类应用软件,例如换电柜程序升级方法的程序升级可读指令等。此外,所述存储器31还可以用于暂时地存储已经输出或者将要输出的各类数据。The memory 31 includes at least one type of readable storage medium, which includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static memory, etc. Random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disks, optical disks, etc. In some embodiments, the memory 31 may be an internal storage unit of the computer device 30 , such as a hard disk or memory of the computer device 30 . In other embodiments, the memory 31 may also be an external storage device of the computer device 30 , such as a plug-in hard disk, a smart media card (SMC), or a secure digital device equipped on the computer device 30 . (Secure Digital, SD) card, Flash Card, etc. Of course, the memory 31 may also include both the internal storage unit of the computer device 30 and its external storage device. In this embodiment, the memory 31 is usually used to store operating systems and various application software installed on the computer device 30 , such as program upgrade readable instructions of the power replacement cabinet program upgrade method, etc. In addition, the memory 31 can also be used to temporarily store various types of data that have been output or will be output.

所述处理器32在一些实施例中可以是中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器、或其他数据处理芯片。该处理器32通常用于控制所述计算机设备30的总体操作。本实施例中,所述处理器32用于运行所述存储器31中存储的程序升级可读指令或者处理数据,例如运行所述换电柜程序升级方法的程序升级可读指令。In some embodiments, the processor 32 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips. The processor 32 is generally used to control the overall operation of the computer device 30 . In this embodiment, the processor 32 is configured to run the program upgrade readable instructions stored in the memory 31 or process data, for example, run the program upgrade readable instructions of the power exchange cabinet program upgrade method.

所述网络接口33可包括无线网络接口或有线网络接口,该网络接口33通常用于在所述计算机设备30与其他电子设备之间建立通信连接。The network interface 33 may include a wireless network interface or a wired network interface. The network interface 33 is generally used to establish a communication connection between the computer device 30 and other electronic devices.

申请提供的计算机设备,具有占用资源少,网络下载传输量少,升级效率高,消耗流量低的显著效果。The computer equipment provided by the application has the remarkable effects of occupying less resources, less network download and transmission volume, high upgrade efficiency, and low traffic consumption.

本发明还提供了另一种实施方式,即提供一种计算机可读存储介质,所述计算机可读存储介质存储有程序升级可读指令,所述程序升级可读指令可被至少一个处理器执行,以使所述至少一个处理器执行如上述的换电柜程序升级方法的步骤。The present invention also provides another implementation manner, that is, a computer-readable storage medium is provided. The computer-readable storage medium stores program upgrade readable instructions, and the program upgrade readable instructions can be executed by at least one processor. , so that the at least one processor executes the steps of the above-mentioned power replacement cabinet program upgrade method.

通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本发明各个实施例所述的方法。Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus the necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is better. implementation. Based on this understanding, the technical solution of the present invention can be embodied in the form of a software product in essence or the part that contributes to the existing technology. The computer software product is stored in a storage medium (such as ROM/RAM, disk, CD), including several instructions to cause a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in various embodiments of the present invention.

显然,以上所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例,附图中给出了本发明的较佳实施例,但并不限制本发明的专利范围。本发明可以以许多不同的形式来实现,相反地,提供这些实施例的目的是使对本发明的公开内容的理解更加透彻全面。尽管参照前述实施例对本发明进行了详细的说明,对于本领域的技术人员来而言,其依然可以对前述各具体实施方式所记载的技术方案进行修改,或者对其中部分技术特征进行等效替换。凡是利用本发明说明书及附图内容所做的等效结构,直接或间接运用在其他相关的技术领域,均同理在本发明专利保护范围之内。Obviously, the above-described embodiments are only some of the embodiments of the present invention, rather than all embodiments. The preferred embodiments of the present invention are shown in the drawings, but do not limit the patent scope of the present invention. The invention may be embodied in many different forms; rather, these embodiments are provided in order to provide a thorough understanding of the disclosure of the invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing specific embodiments, or make equivalent substitutions for some of the technical features. . Any equivalent structures made using the contents of the description and drawings of the present invention and used directly or indirectly in other related technical fields shall likewise fall within the scope of patent protection of the present invention.

Claims (10)

1. The method for upgrading the program of the power exchange cabinet is characterized by comprising the following steps of:
receiving a firmware update request to be updated issued by an upper computer, and downloading a difference patch file and a compression package file by a battery exchange cabinet, wherein the compression package file comprises version information and MD5 values of the firmware to be updated;
extracting a backup current version firmware from the local storage of the battery-changing cabinet, and combining the difference patch file with the current version firmware by using a bspatich algorithm to generate a new version firmware, wherein the new version firmware comprises new version information and a new MD5 value;
comparing whether a new MD5 value of the new version firmware is completely consistent with the MD5 value of the firmware to be upgraded or not based on an MD5 algorithm, and downloading the new version firmware if the new MD5 value is completely consistent with the MD5 value of the firmware to be upgraded;
and running the new version firmware, monitoring various parameters of the running new version firmware, comparing whether the new version information is completely consistent with the version information of the firmware to be upgraded, prompting the completion of upgrading if the new version information is completely consistent with the version information of the firmware to be upgraded, and simultaneously storing the new version firmware as a backup file.
2. The method for upgrading a power conversion cabinet program according to claim 1, wherein before the step of receiving the firmware update request to be upgraded issued by the host computer, the method further comprises the steps of:
and acquiring the firmware to be upgraded, running a bsdiff tool by the upper computer, performing binary difference comparison on the firmware to be upgraded and the current version firmware of the battery exchange cabinet, and generating a difference patch file.
3. The method for upgrading a battery cabinet program according to claim 2, wherein the step of generating the difference patch file includes:
matching the longest identical character string between the firmware to be upgraded and the current version firmware by using a bsdiff tool;
identifying the same part in each character string to obtain difference character position information of the firmware to be upgraded and the current version firmware, and generating a binary file containing the difference character position information and known character string information;
compressing the binary file to obtain a difference patch file.
4. The method for upgrading a program of a battery cabinet according to claim 2, wherein when the firmware to be upgraded is obtained, firstly, an MD5 algorithm is used to check the MD5 value of the firmware to be upgraded, if the verification is passed, the firmware to be upgraded can be obtained, and if the verification is not passed, the MD5 value verification exception information is generated and fed back to the upper computer.
5. The method for upgrading a program of a power conversion cabinet according to claim 2, wherein the monitoring that the parameters of the new version firmware are abnormal and comparing the new version information with the version information of the firmware to be upgraded is not completely consistent, prompting that the upgrade is failed, generating the abnormal information of the new version firmware to be fed back to the upper computer, and exiting the upgrade to return to the operation of the current version firmware.
6. The utility model provides a trade electric cabinet procedure upgrading device which characterized in that includes:
the downloading module is used for receiving a firmware update request to be upgraded issued by the upper computer, and the power conversion cabinet downloads a difference patch file and a compression package file, wherein the compression package file comprises version information and MD5 values of the firmware to be upgraded;
the merging module is used for extracting the backed-up current version firmware from the local storage of the battery-changing cabinet, merging the difference patch file with the current version firmware by utilizing a bspatich algorithm to generate new version firmware, wherein the new version firmware comprises new version information and a new MD5 value;
the verification module is used for comparing whether the new MD5 value of the new version firmware is completely consistent with the MD5 value of the firmware to be upgraded or not based on the MD5 algorithm, and downloading the new version firmware if the new MD5 value of the new version firmware is completely consistent with the MD5 value of the firmware to be upgraded;
and the monitoring module is used for running the new version firmware, monitoring various parameters of the running of the new version firmware, comparing whether the new version information is completely consistent with the version information of the firmware to be upgraded, prompting the completion of upgrading if the new version information is completely consistent with the version information of the firmware to be upgraded, and simultaneously storing the new version firmware as a backup file.
7. The device for upgrading a power conversion cabinet program according to claim 6, wherein before receiving a firmware update request to be upgraded issued by the host computer, the device further comprises:
the difference module is used for acquiring the firmware to be upgraded, the upper computer runs the bsdiff tool, and the firmware to be upgraded and the current version firmware of the battery-changing cabinet are subjected to binary difference comparison to generate a difference patch file.
8. The battery cabinet program upgrade apparatus of claim 7, wherein the generation of the difference patch file comprises:
matching the longest identical character string between the firmware to be upgraded and the current version firmware by using a bsdiff tool;
identifying the same part in each character string to obtain difference character position information of the firmware to be upgraded and the current version firmware, and generating a binary file containing the difference character position information and known character string information;
compressing the binary file to obtain a difference patch file.
9. A computer device comprising a memory having program upgrade readable instructions stored therein and a processor that when executed implements the steps of the battery cabinet program upgrade method of any one of claims 1 to 5.
10. A computer readable storage medium, wherein program upgrade readable instructions are stored on the computer readable storage medium, which when executed by a processor, implement the steps of the battery cabinet program upgrade method of any one of claims 1 to 5.
CN202311301721.1A 2023-10-07 2023-10-07 A power exchange cabinet program upgrade method, device, computer equipment and storage medium Pending CN117170716A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311301721.1A CN117170716A (en) 2023-10-07 2023-10-07 A power exchange cabinet program upgrade method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311301721.1A CN117170716A (en) 2023-10-07 2023-10-07 A power exchange cabinet program upgrade method, device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117170716A true CN117170716A (en) 2023-12-05

Family

ID=88937472

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311301721.1A Pending CN117170716A (en) 2023-10-07 2023-10-07 A power exchange cabinet program upgrade method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117170716A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118132121A (en) * 2024-05-07 2024-06-04 天津布尔科技有限公司 Firmware upgrade method, device, computer equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115712447A (en) * 2022-11-15 2023-02-24 成都长城开发科技股份有限公司 Method and system for realizing incremental upgrading of intelligent electric meter
CN116841599A (en) * 2023-06-30 2023-10-03 山东省计算中心(国家超级计算济南中心) Incremental differential algorithm optimization method based on multithreading libdivsufsort and lzo

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115712447A (en) * 2022-11-15 2023-02-24 成都长城开发科技股份有限公司 Method and system for realizing incremental upgrading of intelligent electric meter
CN116841599A (en) * 2023-06-30 2023-10-03 山东省计算中心(国家超级计算济南中心) Incremental differential algorithm optimization method based on multithreading libdivsufsort and lzo

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118132121A (en) * 2024-05-07 2024-06-04 天津布尔科技有限公司 Firmware upgrade method, device, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
CN112507027B (en) Kafka-based incremental data synchronization method, device, equipment and medium
CN112052141B (en) Data fragment verification method and device, computer equipment and readable storage medium
CN112765271A (en) Block chain transaction index storage method and device, computer equipment and medium
CN114626352B (en) Report automatic generation method, device, computer equipment and storage medium
CN110764798A (en) Microcode upgrading method, device, computer equipment and storage medium
CN113703821A (en) Cloud mobile phone updating method, device, equipment and storage medium
CN115268941A (en) Traffic migration method, device, equipment and storage medium for new and old systems
CN112965721A (en) Android-based project compiling method and device, computer equipment and storage medium
CN114968725A (en) Task dependency relationship correction method and device, computer equipment and storage medium
CN117170716A (en) A power exchange cabinet program upgrade method, device, computer equipment and storage medium
CN114143308A (en) File uploading information processing method and device, computer equipment and storage medium
CN112364187B (en) Automobile accessory database building method, device and equipment based on big data
CN114615325A (en) Message push method, device, computer equipment and storage medium
CN111475468B (en) Log access method, device, equipment and storage medium of newly-added system
CN111552663A (en) File consistency verification method, device, computer equipment and storage medium
CN115328764B (en) Test code optimization method based on automated testing and related equipment
CN115455020A (en) Incremental data synchronization method and device, computer equipment and storage medium
CN113220353B (en) Hard disk startup item sorting method, system, terminal and storage medium
CN117472402A (en) A BMS differentiated data management method, device, electronic equipment and storage medium
CN114385573A (en) Method and device for initializing DRBD block device, computer device and storage medium
CN115526731A (en) Task batch processing method and device, computer equipment and storage medium
CN116185760A (en) A dynamic monitoring method, device, equipment and storage medium for service operation
CN114995850A (en) Installation package picture processing method, device, computer equipment and storage medium
CN113806372A (en) New data information construction method and device, computer equipment and storage medium
CN112632192A (en) Node maintenance method and device, computer equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20231205

RJ01 Rejection of invention patent application after publication