Differential upgrading method and device and operation machine

文档序号:1888750 发布日期:2021-11-26 浏览:24次 中文

阅读说明:本技术 一种差分升级方法、装置和作业机械 (Differential upgrading method and device and operation machine ) 是由 张伟胜 刘娟 宋勇鹏 于 2021-08-31 设计创作,主要内容包括:本发明提供一种差分升级方法、装置和作业机械,所述方法包括:根据目标边缘网关的当前插件编码与待升级插件编码,生成差分升级包;将所述差分升级包发送至所述目标边缘网关,以供所述目标边缘网关根据所述差分升级包对当前插件进行更新。本发明提供的差分升级方法、装置和作业机械,将设备边缘网关的功能模块进行细粒度划分,对其中的任一插件定义标准接口,使用动态链接库与差分技术相结合,同时利用OTA升级服务端进行后台管理,能根据每个插件的当前编码和待升级编码,生成差分补丁包,可以方便的对设备进行批量热更新,且有效地的节省了移动流量。(The invention provides a differential upgrading method, a differential upgrading device and a working machine, wherein the method comprises the following steps: generating a differential upgrade package according to the current plug-in code of the target edge gateway and the plug-in code to be upgraded; and sending the differential upgrade package to the target edge gateway so that the target edge gateway can update the current plug-in according to the differential upgrade package. According to the differential upgrading method, the differential upgrading device and the operation machine, the functional module of the equipment edge gateway is divided in a fine-grained manner, a standard interface is defined for any plug-in, a dynamic link library is combined with a differential technology, meanwhile, an OTA upgrading server is used for background management, a differential patch package can be generated according to the current code and the code to be upgraded of each plug-in, the equipment can be conveniently subjected to batch thermal updating, and the mobile flow is effectively saved.)

1. A differential upgrading method, comprising:

generating a differential upgrade package according to the current plug-in code of the target edge gateway and the plug-in code to be upgraded;

and sending the differential upgrade package to the target edge gateway so that the target edge gateway can update the current plug-in according to the differential upgrade package.

2. The differential upgrade method according to claim 1, wherein during the process of sending the differential upgrade package to the target edge gateway, if a communication connection with the target edge gateway is interrupted, sending the differential upgrade package to the target edge gateway is stopped;

after the communication connection with the target edge gateway is reestablished, receiving the length and check code information of the downloaded part sent by the target edge gateway;

checking the length and the check code information;

under the condition that the length and check code information passes the check, continuously sending a non-received part to the target edge gateway;

and under the condition that the length and check code information check is not passed, the differential upgrade packet is sent to the target edge gateway again.

3. The differential upgrade method according to claim 1, wherein generating a differential upgrade package according to a current plug-in code and a plug-in code to be upgraded of a target edge gateway includes:

calculating a first Hash check value of the plug-in to be upgraded;

respectively coding a current plug-in and a plug-in to be upgraded to generate a current plug-in code and a plug-in code to be upgraded;

comparing the current plug-in code with the plug-in code to be upgraded to generate an upgrade patch package, and calculating a second hash check value of the upgrade patch package;

and compressing the first hash check value, the upgrade patch package and the second hash check value to generate the differential upgrade package.

4. The differential upgrade method according to claim 1, further comprising, before generating the differential upgrade package according to the current plug-in code and the plug-in code to be upgraded of the target edge gateway:

receiving gateway information uploaded by a target edge gateway; the gateway information comprises version information of a current plug-in and equipment codes of the target edge gateway;

determining version information of the plug-in to be upgraded based on the gateway information;

and sending the gateway information and the version information of the plug-in to be upgraded to an upgrade control platform so as to obtain a determined configuration instruction fed back by the upgrade control platform.

5. The differential upgrade method according to claim 1, further comprising, before generating the differential upgrade package according to the current plug-in code and the plug-in code to be upgraded of the target edge gateway:

receiving gateway information uploaded by a target edge gateway; the gateway information comprises version information of the current plug-in and target edge gateway position information;

receiving mobile terminal position information uploaded by a mobile terminal;

and under the condition that the distance between the mobile terminal and the target edge gateway is determined to be smaller than the preset distance according to the position information of the target edge gateway and the position information of the mobile terminal, sending the version information of the current plug-in and the version information of the plug-in to be upgraded to the mobile terminal so as to obtain a configuration determining instruction fed back by the mobile terminal.

6. The differential upgrade method according to any one of claims 4 or 5, further comprising, before receiving the gateway information uploaded by the target edge gateway:

constructing all plug-in interfaces related to the target edge gateway and the hardware drive based on a C + + framework;

configuring a plug-in code for each plug-in interface and constructing a plug-in directory.

7. A differential upgrading method, comprising:

receiving a differential upgrade package sent by an upgrade server, wherein the differential upgrade package is determined according to a current plug-in code and a plug-in code to be upgraded;

and updating the current plug-in according to the differential upgrade package.

8. The differential upgrade method according to claim 7, wherein the updating a current plug-in according to the differential upgrade package includes:

decompressing the differential upgrade patch, and acquiring a first hash check value of the plug-in to be upgraded, an upgrade patch package and a second hash check value of the upgrade patch package;

verifying the upgrade patch package by using the second hash check value, and coding the current plug-in under the condition that the verification is passed to generate a current plug-in code;

generating a plug-in code to be upgraded according to the level patch package and the current plug-in code;

decoding the plug-in code to be upgraded to generate a plug-in to be upgraded;

and verifying the plug-in to be upgraded by using the first hash check value, and unloading the current plug-in to load the plug-in to be upgraded under the condition that the verification is passed.

9. A differential upgrading apparatus, comprising:

the processing unit is used for generating a differential upgrade package according to the current plug-in code and the plug-in code to be upgraded of the target edge gateway;

and the sending unit is used for sending the differential upgrade package to the target edge gateway so that the target edge gateway can update the current plug-in according to the differential upgrade package.

10. A differential upgrading apparatus, comprising:

the receiving unit is used for receiving a differential upgrading packet sent by an upgrading server side, and the differential upgrading packet is determined according to the current plug-in code and the plug-in code to be upgraded;

and the updating unit is used for updating the current plug-in according to the differential upgrading packet.

11. A work machine, characterized in that a differential upgrading device as claimed in claim 10 is provided on the work machine.

Technical Field

The invention relates to the technical field of communication, in particular to a differential upgrading method, a differential upgrading device and an operation machine.

Background

With the development of mobile internet, more and more terminal devices are connected to the internet, and remote problem diagnosis, fault repair, software upgrade, parameter update, remote command control, remote monitoring, remote data acquisition and the like can be conveniently performed by using Over-the-Air Technology (OTA). The electronic equipment of the commercial vehicle in the field of engineering machinery is more and more, software upgrading is needed, labor cost can be greatly saved by using the OTA technology, upgrading efficiency is improved, and batch management of the equipment is facilitated.

At present, most terminal devices adopt an embedded system, and do not have the capability of thermal updating, binary differential updating used by OTA differential updating, or updating by adopting other special modes, such as Beidou communication and the like.

The existing differential upgrading technology adopts a binary differential upgrading mode, so that the technical implementation difficulty is high; in addition, the binary system firmware is inconvenient for version management, the binary system differential firmware is easy to cause upgrading failure, and the binary system differential firmware is not easy to recover after the upgrading failure.

Disclosure of Invention

The invention provides a differential upgrading method, a differential upgrading device and an operating machine, which are used for overcoming the defects existing in the OTA upgrading of an embedded system in the prior art, and can be used for upgrading all plug-ins in an edge gateway in batches through an OTA management background.

In a first aspect, the present invention provides a differential upgrading method, comprising: generating a differential upgrade package according to the current plug-in code of the target edge gateway and the plug-in code to be upgraded; and sending the differential upgrade package to the target edge gateway so that the target edge gateway can update the current plug-in according to the differential upgrade package.

According to the differential upgrading method provided by the invention, in the process of sending the differential upgrading packet to the target edge gateway, if the communication connection between the differential upgrading packet and the target edge gateway is interrupted, the differential upgrading packet is stopped being sent to the target edge gateway; after the communication connection with the target edge gateway is reestablished, receiving the length and check code information of the downloaded part sent by the target edge gateway; checking the length and the check code information; under the condition that the length and check code information passes the check, continuously sending a non-received part to the target edge gateway; and under the condition that the length and check code information check is not passed, the differential upgrade packet is sent to the target edge gateway again.

According to the differential upgrading method provided by the invention, a differential upgrading packet is generated according to the current plug-in code and the plug-in code to be upgraded of the target edge gateway, and the method comprises the following steps: calculating a first Hash check value of the plug-in to be upgraded; respectively coding a current plug-in and a plug-in to be upgraded to generate a current plug-in code and a plug-in code to be upgraded; comparing the current plug-in code with the plug-in code to be upgraded to generate an upgrade patch package, and calculating a second hash check value of the upgrade patch package; and compressing the first hash check value, the upgrade patch package and the second hash check value to generate the differential upgrade package.

According to the differential upgrading method provided by the invention, before generating the differential upgrading packet according to the current plug-in code and the plug-in code to be upgraded of the target edge gateway, the method further comprises the following steps: receiving gateway information uploaded by a target edge gateway; the gateway information comprises version information of a current plug-in and equipment codes of the target edge gateway; determining version information of the plug-in to be upgraded based on the gateway information; and sending the gateway information and the version information of the plug-in to be upgraded to an upgrade control platform so as to obtain a determined configuration instruction fed back by the upgrade control platform.

According to the differential upgrading method provided by the invention, before generating the differential upgrading packet according to the current plug-in code and the plug-in code to be upgraded of the target edge gateway, the method further comprises the following steps: receiving gateway information uploaded by a target edge gateway; the gateway information comprises version information of the current plug-in and target edge gateway position information; receiving mobile terminal position information uploaded by a mobile terminal; and under the condition that the distance between the mobile terminal and the target edge gateway is determined to be smaller than the preset distance according to the position information of the target edge gateway and the position information of the mobile terminal, sending the version information of the current plug-in and the version information of the plug-in to be upgraded to the mobile terminal so as to obtain a configuration determining instruction fed back by the mobile terminal.

According to the differential upgrading method provided by the invention, before receiving the gateway information uploaded by the target edge gateway, the method further comprises the following steps: constructing all plug-in interfaces related to the target edge gateway and the hardware drive based on a C + + framework; configuring a plug-in code for each plug-in interface and constructing a plug-in directory.

In a second aspect, the present invention further provides another differential upgrade method, including: receiving a differential upgrade package sent by an upgrade server, wherein the differential upgrade package is determined according to a current plug-in code and a plug-in code to be upgraded; and updating the current plug-in according to the differential upgrade package.

According to the differential upgrade method provided by the present invention, the updating the current plug-in according to the differential upgrade package includes: decompressing the differential upgrade patch, and acquiring a first hash check value of the plug-in to be upgraded, an upgrade patch package and a second hash check value of the upgrade patch package; verifying the upgrade patch package by using the second hash check value, and coding the current plug-in under the condition that the verification is passed to generate a current plug-in code; generating a plug-in code to be upgraded according to the level patch package and the current plug-in code; decoding the plug-in code to be upgraded to generate a plug-in to be upgraded; and verifying the plug-in to be upgraded by using the first hash check value, and unloading the current plug-in to load the plug-in to be upgraded under the condition that the verification is passed.

In a third aspect, the present invention also provides a differential upgrading apparatus comprising: the processing unit is used for generating a differential upgrade package according to the current plug-in code and the plug-in code to be upgraded of the target edge gateway; and the sending unit is used for sending the differential upgrade package to the target edge gateway so that the target edge gateway can update the current plug-in according to the differential upgrade package.

In a fourth aspect, the present invention further provides another differential upgrading apparatus, including: the receiving unit is used for receiving a differential upgrading packet sent by an upgrading server side, and the differential upgrading packet is determined according to the current plug-in code and the plug-in code to be upgraded; and the updating unit is used for updating the current plug-in according to the differential upgrading packet.

In a fifth aspect, the present invention further provides a working machine, on which the differential upgrade apparatus is mounted.

In a sixth aspect, the present invention provides an electronic device, comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor executes the program to implement the steps of the differential upgrade method as described in any one of the above.

In a seventh aspect, the present invention also provides a non-transitory computer readable storage medium, on which a computer program is stored, which computer program, when executed by a processor, performs the steps of the differential upgrade method as described in any one of the above.

According to the differential upgrading method, the differential upgrading device and the operation machine, the functional module of the equipment edge gateway is divided in a fine-grained manner, a standard interface is defined for any plug-in, a dynamic link library is combined with a differential technology, meanwhile, an OTA upgrading server is used for background management, a differential patch package can be generated according to the current code and the code to be upgraded of each plug-in, the equipment can be conveniently subjected to batch thermal updating, and the mobile flow is effectively saved.

Drawings

In order to more clearly illustrate the technical solutions of the present invention or the prior art, the drawings needed for the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.

FIG. 1 is a schematic flow chart of a differential upgrade method provided by the present invention;

FIG. 2 is a signaling diagram of a differential upgrade method provided by the present invention;

FIG. 3 is a second schematic flowchart of the differential upgrade method provided by the present invention;

FIG. 4 is a schematic structural diagram of a differential upgrade apparatus provided in the present invention;

FIG. 5 is a second schematic structural diagram of a differential upgrade apparatus provided in the present invention;

fig. 6 is a schematic structural diagram of an electronic device provided in the present invention.

Detailed Description

In order to make the objects, technical solutions and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is obvious that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.

It should be noted that in the description of the embodiments of the present invention, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element. The terms "upper", "lower", and the like, indicate orientations or positional relationships based on the orientations or positional relationships shown in the drawings, and are only for convenience in describing the present invention and simplifying the description, but do not indicate or imply that the referred devices or elements must have a specific orientation, be constructed and operated in a specific orientation, and thus, should not be construed as limiting the present invention. The specific meanings of the above terms in the present invention can be understood by those skilled in the art according to specific situations.

The terms first, second and the like in the description and in the claims of the present application are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that embodiments of the application may be practiced in sequences other than those illustrated or described herein, and that the terms "first," "second," and the like are generally used herein in a generic sense and do not limit the number of terms, e.g., the first term can be one or more than one. In addition, "and/or" in the specification and claims means at least one of connected objects, a character "/" generally means that a preceding and succeeding related objects are in an "or" relationship.

The upgrade package in the prior art is divided into a complete upgrade package and a differential upgrade package. As the name implies, the complete upgrade package includes data files in the whole system partition of the terminal device; while the differential upgrade package only contains the parts that change between the two versions. Upgrading the computer by using the complete upgrade package to perform system reworking, requiring system partition formatting, and writing new system data into the partition; and the upgrading by using the differential upgrading packet does not need to format the system partition, but only rewrites the content of part of the memory segments.

However, when the terminal device is subjected to OTA upgrade by generating a differential upgrade package in the prior art, the terminal device mostly adopts an embedded system and does not have a hot-upgrade capability, and in addition, most of the binary differential upgrades used for differential upgrade lead to the disadvantages of difficult technical implementation, high upgrade failure rate and difficult recovery after upgrade failure.

In view of the above, the present invention provides a new differential upgrade method, apparatus and working machine.

The differential upgrade method, device and working machine provided by the present invention are described below with reference to fig. 1 to 6.

Fig. 1 is a schematic flow diagram of a differential upgrade method provided by the present invention, as shown in fig. 1, including but not limited to the following steps:

step 101: an upgrading server (hereinafter referred to as an OTA server) generates a differential upgrading packet according to the current plug-in code of the target edge gateway and the plug-in code to be upgraded;

step 102: and the OTA server side sends the differential upgrade package to the target edge gateway so that the target edge gateway can update the current plug-in according to the differential upgrade package.

As an alternative embodiment, the present invention provides an implementation step of generating a differential upgrade package according to a current plug-in code and a plug-in code to be upgraded of a target edge gateway:

1) setting an edge gateway needing version updating as a target edge gateway, and recording a current plug-in of the target edge gateway as: and A.so.1.0, updating the current plug-in by using the plug-in to be upgraded, and recording the plug-in to be upgraded as A.so.2.0.

And respectively calculating the Hash check values of the current plug-in and the plug-in to be upgraded, and storing the Hash check value (Hash value for short) of the plug-in to be upgraded in A.so.2.0.sig.

2) The current plug-in a.so.1.0 and the plug-in to be upgraded a.so.2.0 are respectively encoded by the upgrade server (hereinafter referred to as OTA server):

reading 8 bytes each time, calculating a crc8 check code to be added at the end, carrying out base64 coding on the formed 9 bytes in sequence, and adding a line break character after coding. And writing the current plug-in A.so.1.0 and the plug-in A.so.2.0 to be upgraded into a text file until the whole current plug-in A.so.1.0 and the whole plug-in A.so.2.0 to be upgraded are read, and generating a current plug-in code A.so.1.0.txt and a plug-in code A.so.2.0.txt to be upgraded.

It should be noted that if the number of bytes is less than 8 when the current plug-in a.so.1.0 and the plug-in to be upgraded a.so.2.0 are read for the last time, assuming that there are only 5 bytes, the crc8 check code of the 5 bytes is calculated and appended to the end, then the base64 encoding is performed, and a line swap character is added after the encoding, and the encoding is written into the above text file, so as to generate the current plug-in code a.so.1.0.txt and the plug-in to be upgraded a.so.2.0 txt.

3) Comparing the generated current plug-in code A.so.1.0.txt with the plug-in code A.so.2.0.txt to be upgraded by the OTA server side by using an online code comparison tool to obtain an upgrade patch package, and recording the upgrade patch package as follows: a.so.1.0 — 2.0.txt.patch. And then, calculating a hash check value (hash value for short) of the upgrade patch package A.so.1.0_2.0.txt.patch, and recording the hash check value as A.so.1.0_2.0. txt.patch.sig.

4) Compressing the upgrading patch package A.so.1.0_2.0.txt.patch, the Hash check value A.so.2.0.sig of the plug-in to be upgraded and the Hash check value A.so.1.0_2.0.txt.patch.sig of the upgrading patch package by the OTA server side to generate a differential upgrading package A.so.patch.tar.gz.

It should be noted that cyclic redundancy check (crc) is a data transmission error detection function, which can perform polynomial calculation on data and attach the obtained result to the frame, and the receiving device also executes a similar algorithm to ensure the correctness and integrity of data transmission. The crc8 check code is one of crc check codes: the error checking code is one of the most commonly used error checking codes in data communication field, and is characterized in that the length of the information field and the check field can be 8 bytes.

Base64 is one of the most common encoding methods for transmitting 8-Bit byte codes on a network, and Base64 is a method for representing binary data based on 64 printable characters. Base64 encoding is a binary to character process that may be used to convey longer identification information in the HTTP environment. Encoding using Base64 is not readable and requires decoding before reading.

Further, the OTA server may respond to the configuration determining instruction sent by the OTA control platform, and generate the generated differential upgrade packet a.so.patch.tar.gz of the target edge gateway to the target edge gateway.

The target edge gateway downloads the differential upgrade package A.so.patch.tar.gz, decompresses the differential upgrade package A.so.1.0_2.0.txt.patch, and obtains the hash check value A.so.2.0.sig of the plug-in to be upgraded and the hash check value A.so.1.0_2.0.txt.patch.sig of the upgrade patch package.

The Hash check value A.so.1.0_2.0.txt.patch of the upgrade patch package is used for checking the A.so.1.0_2.0.txt.patch of the upgrade patch package so as to judge whether data abnormity occurs in the transmission process and ensure the consistency of the A.so.1.0_2.0.txt.patch of the upgrade patch package before and after transmission.

And under the condition that the verification is passed, fusing the upgrade patch package A.so.1.0_2.0.txt.patch with the current plug-in code A.so.2.0.txt.1.0. txt by using a patch command to obtain the newly generated plug-in code A.so.2.0.txt to be upgraded.

And decoding the A.so.2.0.txt of the plug-in to be upgraded by using base64, reading the A.so.2.0.txt word by word, removing the escape character, and then decoding to obtain the A.so.2.0 of the plug-in to be upgraded. And then, judging whether the plug-in A.so.2.0 to be upgraded has data abnormality in the data transmission process according to the crc8 check code and the Hash check value A.so.2.0.sig of the plug-in to be upgraded.

And under the condition that the result of the crc8 check is determined to be normal, the edge gateway unloads the current plug-in A.so.1.0, reloads the plug-in A.so.2.0 to be upgraded and completes the hot update of the current plug-in of the target edge gateway.

According to the differential upgrading method provided by the invention, the functional module of the equipment edge gateway is divided in a fine-grained manner, a standard interface is defined for any plug-in, a dynamic link library is combined with a differential technology, and meanwhile, background management is carried out by using an OTA upgrading server, so that a differential patch package can be generated according to the current code and the code to be upgraded of each plug-in, the equipment can be conveniently subjected to batch hot updating, and the mobile flow is effectively saved.

Based on the content of the foregoing embodiment, as an optional embodiment, in the process of sending the differential upgrade package to the target edge gateway, if the communication connection with the target edge gateway is interrupted, the sending of the differential upgrade package to the target edge gateway is stopped;

after the communication connection with the target edge gateway is reestablished, receiving the length and check code information of the downloaded part sent by the target edge gateway;

checking the length and the check code information;

under the condition that the length and check code information passes the check, continuously sending a non-received part to the target edge gateway;

and under the condition that the length and check code information check is not passed, the differential upgrade packet is sent to the target edge gateway again.

Fig. 2 is a signaling diagram of the differential upgrade method provided by the present invention, and as shown in fig. 2, in the differential upgrade method provided by the present invention, in the process of downloading the differential upgrade packet from the OTA service end, the edge gateway uses Message Queue Telemetry Transport (MQTT) and is based on Secure socket protocol (SSL) or Transport Layer Security protocol (TLS) Transport, so that breakpoint continuous transmission can be effectively supported, upgrade efficiency when the mobile signal is unstable is improved, and mobile traffic is saved.

As an alternative embodiment, the present invention provides a method for downloading a differential upgrade package, including:

1) and sending the plug-in version information and the basic information of the plug-in to be updated in the target edge gateway to the OTA server. Wherein the basic information may include at least one of the following information: the application range of the current plug-in, the equipment code of the edge gateway, the current GPS coordinate, the ECU version, the instrument version, the vehicle VIN code and the like.

2) After receiving the plug-in version information and the basic information of the plug-in to be updated, the OTA server side filters the plug-in to be updated according to the equipment code, the current GPS coordinate, the ECU version, the instrument version, the vehicle VIN code and the like of the edge gateway, and determines the version of the plug-in to be updated.

3) And the OTA server configures the plug-in to be upgraded according to the version of the plug-in to be upgraded, and generates a corresponding differential upgrade package according to the plug-in to be upgraded and the current plug-in.

4) And the edge gateway downloads the differential upgrade package through an MQTT SSL/TLS protocol. MQTT is a message protocol based on a publish/subscribe paradigm under the ISO standard (ISO/IEC PRF 20922). It works on the TCP/IP suite and is a publish/subscribe messaging protocol designed for remote devices with poor hardware performance and in poor network conditions.

SSL or TLS is a security protocol that provides security and data integrity for network communications. TLS and SSL encrypt the network connection between the transport layer and the application layer.

Optionally, during the downloading process, the edge gateway may also upload the upgrade progress through MQTT SSL/TLS protocol.

And under the condition that the mobile internet signal is unstable, if the communication connection between the OTA service end and the target edge gateway is interrupted, the OTA service end stops continuously sending the differential upgrade packet.

When the signal is recovered, the edge gateway reestablishes the wireless communication connection with the OTA service end, and sends the length of the downloaded part and the check code information (such as the crc32 check code) to the OTA service end in the first time.

The OTA service terminal can verify whether the downloaded part of the data is correct according to the crc32 check code. And under the condition that the downloaded part of the data is determined to be normal (namely the length and the check code information are checked to pass), continuously sending the unreceived part to the edge gateway from the downloaded part until the whole differential upgrade package is sent.

In addition, if the length and check code information check is not passed, it indicates that the downloaded part of data is abnormal, and at this time, the OTA server resends the differential upgrade package to the target edge gateway.

After the differential upgrade package is downloaded, the target edge gateway starts to verify the differential upgrade package, and updates the current plug-in by using the plug-in to be upgraded in the differential upgrade package or unloads the current plug-in and reloads the plug-in to be upgraded under the condition that the verification is passed.

It should be noted that, in the differential upgrade method provided by the present invention, the firmware Transmission Protocol includes various protocols such as User Datagram Protocol (UDP), Transmission Control Protocol (TCP), or hypertext Transfer Protocol over secure Layer (HTTPS) that are used between the edge gateway and the OTA server, between the OTA server and the mobile terminal, or between the OTA server and the OTA console according to actual communication needs, so as to implement breakpoint Transmission.

According to the differential upgrading method provided by the invention, the differential firmware is transmitted by using MQTT + SSL/TSL, breakpoint continuous transmission is supported, the upgrading efficiency when the mobile signal is unstable is improved, and the mobile flow is saved.

Based on the content of the foregoing embodiment, as an optional embodiment, generating a differential upgrade package according to the current plug-in code and the plug-in code to be upgraded of the target edge gateway includes:

calculating a first Hash check value of the plug-in to be upgraded;

respectively coding a current plug-in and a plug-in to be upgraded to generate a current plug-in code and a plug-in code to be upgraded;

comparing the current plug-in code with the plug-in code to be upgraded to generate an upgrade patch package, and calculating a second hash check value of the upgrade patch package;

and compressing the first hash check value, the upgrade patch package and the second hash check value to generate the differential upgrade package.

Optionally, in the differential upgrade method provided by the invention, after receiving the version and basic information of the current plug-in uploaded by the target edge gateway,

when the difference upgrading packet is generated, the OTA server side calculates a hash check value of the plug-in to be upgraded, namely a first hash check value, and stores the result in the A.so.2.0.sig.

The OTA server re-encodes the current plug-in a.so.1.0 and the plug-in to be upgraded a.so.2.0, respectively, to generate the current plug-in code a.so.1.0.txt and the plug-in to be upgraded a.so.2.0.txt, and the encoding method may adopt the method described in the above embodiments, which is not described herein again.

Further, an online code comparison tool (e.g., diff tool) may be used to compare the current plug-in code a.so.1.0.txt with the plug-in code a.so.2.0.txt to be upgraded, generate an upgrade patch package, and calculate a hash check value of the upgrade patch package, and record the hash check value as a second hash check value.

And finally, compressing the first hash check value, the upgrade patch package and the second hash check value to generate the differential upgrade package.

In addition, in the differential upgrade method provided by the present invention, the generation of the differential upgrade package may be generated by a binary differential method.

The differential upgrading method provided by the invention is combined with a Hash check method to produce and generate a differential upgrading packet, not only carries out Hash check on the upgrading patch packet A.so.1.0_2.0.txt.patch, but also carries out secondary check on the plug-in to be upgraded A.so.2.0 received by the edge gateway through the crc8 check code, and can fully ensure the safety of the updated data.

With reference to fig. 2, the differential upgrade method provided by the present invention not only can implement batch update of the edge gateways supported by the OTA control platform background, but also can support manual upgrade of the mobile terminal, thereby facilitating field management of the edge gateway devices.

Based on the content of the foregoing embodiment, as an optional embodiment, before generating the differential upgrade package according to the current plug-in code and the plug-in code to be upgraded of the target edge gateway, the method further includes:

receiving gateway information uploaded by a target edge gateway; the gateway information comprises version information of a current plug-in and equipment codes of the target edge gateway;

determining version information of the plug-in to be upgraded based on the gateway information;

and sending the gateway information and the version information of the plug-in to be upgraded to an upgrade control platform so as to obtain a determined configuration instruction fed back by the upgrade control platform.

In the process of carrying out batch updating management on the edge gateways by utilizing the OTA control platform, the OTA server side pushes a differential upgrade package, and the upgrade flow is realized as follows:

1) the edge gateway collects the plug-in version information of the plug-in to be updated;

2) and the target edge gateway uploads at least one of version information of the plug-in to be updated, the application range of the current plug-in, the equipment code of the edge gateway, the current GPS coordinate, the ECU version, the instrument version, the vehicle VIN code and the like to the OTA server.

3) The OTA server configures the edge gateway to-be-upgraded plug-in version, which comprises the following steps: and the OTA server filters all the versions of the plug-ins to be upgraded according to the information of the equipment code, the ECU version, the instrument version, the vehicle VIN code and the like of the edge gateway, and screens out the plug-in codes to be upgraded which accord with the target edge gateway.

4) The OTA server sends the version information of the current plug-in and the version information of the plug-in to be upgraded together to an upgrade control platform (hereinafter referred to as an OTA control platform) so that the OTA control platform judges whether the current plug-in can be updated by the plug-in to be upgraded.

And if the judgment result is that the updating can be carried out, the OTA control platform feeds back a configuration determining instruction to the OTA server.

5) And the OTA server generates a differential upgrade package according to the method in the embodiment according to the current plug-in and the plug-in to be upgraded and sends the differential upgrade package to the target edge gateway.

6) And after the target edge gateway downloads the differential upgrade package, starting to check the differential upgrade package.

7) And under the condition that the verification is passed, unloading the current plug-in and reloading the plug-in to be upgraded.

The differential upgrading method provided by the invention uniformly manages the upgrading of each edge gateway by using the background of the OTA control platform, and can establish a detailed upgrading log in the OTA control platform, thereby facilitating version rollback and fault analysis.

Based on the content of the foregoing embodiment, as an optional embodiment, before generating the differential upgrade package according to the current plug-in code and the plug-in code to be upgraded of the target edge gateway, the method further includes:

receiving gateway information uploaded by a target edge gateway; the gateway information comprises version information of the current plug-in and target edge gateway position information;

receiving mobile terminal position information uploaded by a mobile terminal;

and under the condition that the distance between the mobile terminal and the target edge gateway is determined to be smaller than the preset distance according to the position information of the target edge gateway and the position information of the mobile terminal, sending the version information of the current plug-in and the version information of the plug-in to be upgraded to the mobile terminal so as to obtain a configuration determining instruction fed back by the mobile terminal.

The mobile terminal can be a mobile phone, a computer, an industrial personal computer or other electronic equipment capable of executing storage and operation capabilities.

In the process of updating and managing the edge gateway by using the mobile terminal, the OTA server side pushes a differential upgrade package, and the upgrade flow is realized as follows:

1) the edge gateway collects the plug-in version information of the plug-in to be updated;

2) and the target edge gateway uploads at least one of version information of the plug-in to be updated, the application range of the current plug-in, the equipment code of the edge gateway, the current GPS coordinate, the ECU version, the instrument version, the vehicle VIN code and the like to the OTA server.

3) The OTA server configures the version of the plug-in to be upgraded of the edge gateway, and the method comprises the following steps: and the OTA server filters all the versions of the plug-ins to be upgraded according to the information of the equipment code, the ECU version, the instrument version, the vehicle VIN code and the like of the edge gateway, and screens out the plug-in codes to be upgraded which accord with the target edge gateway.

4) Firstly, an OTA server configures a target edge gateway version to be upgraded, for example: and the OTA server takes the edge gateway within 500m near the GPS coordinate of the mobile terminal as a target edge gateway according to the position information (such as the GPS coordinate) of all the edge gateways and the position information (such as the GPS coordinate) of the mobile terminal, and pushes the version information of the plug-in to be upgraded and the version information of the current plug-in of the target edge gateway to the mobile terminal together.

And the mobile terminal judges whether the current plug-in can be updated by the plug-in to be upgraded or not according to the received version information of the current plug-in of the target edge gateway and the version information of the plug-in to be upgraded.

And if the judgment result is that the updating can be carried out, the mobile terminal feeds back a configuration determining instruction to the OTA service terminal.

5) After receiving the determined configuration instruction, the OTA server generates a differential upgrade package according to the method in the above embodiment according to the current plug-in and the plug-in to be upgraded, and sends the differential upgrade package to the target edge gateway.

6) And after the target edge gateway downloads the differential upgrade package, starting to check the differential upgrade package.

7) And under the condition that the verification is passed, unloading the current plug-in and reloading the plug-in to be upgraded.

The differential upgrading method provided by the invention can support the mobile terminal to manage and control the upgrading of the terminal equipment, and is convenient for maintaining and managing the terminal equipment on site; meanwhile, the background automatic upgrade management is combined with the manual management of the mobile terminal, so that the upgrade requirements under different scenes can be met.

Based on the content of the foregoing embodiment, as an optional embodiment, before receiving the gateway information uploaded by the target edge gateway, the method further includes: constructing all plug-in interfaces related to the target edge gateway and the hardware drive based on a C + + framework; configuring a plug-in code for each plug-in interface and constructing a plug-in directory; the plug-in code is generated after binary coding is carried out on the gateway information.

Specifically, before the differential upgrade is performed on the target edge gateway, the invention performs fine granularity on the functional module, namely the functional module is divided into a little smaller plug-in, so that the upgrade package is smaller during the subsequent generated differential upgrade.

As an optional embodiment, in the differential upgrade method provided in the present invention, the designing a program framework of an edge gateway in advance includes:

1) and (3) the C + + framework is used for realizing the construction of the standardized plug-in interface of windows, linux and/or Android dynamic loading/unloading plug-ins.

2) Defining each standardized plug-in interface, and performing fine-grained division on a module to be upgraded of the whole terminal equipment, for example: for the parsing of each Controller Area Network Identity (CAN ID), a plug-in is used to implement the interface parsing of each functional module, that is, the interface parsing of each functional module is implemented by means of the plug-in.

On the basis, after a program of the terminal device runs, a specified plug-in directory (plugin) is scanned, after the plug-ins are loaded, a preset plug-in interface is called to register the plug-ins to the Map, and a Map object is defined by the plug-ins of each category so as to store the plug-in interfaces. The dispatcher can use the queue to buffer according to the received message and use different plug-ins to process according to the message type.

It should be noted that the gateway information uploaded by the target edge gateway includes version information, function description information, device code, and other information related to each plug-in.

The differential upgrading method provided by the invention divides the functional module of the edge gateway into fine granularity points, defines a standard interface, realizes the fine granularity upgrading of the edge gateway by using a dynamic link library (a plug-in technology), generates a corresponding differential upgrading packet according to the upgrading requirements of different plug-ins in the edge gateway by using the differential technology, does not generate the differential upgrading packet according to the plug-ins which do not need to be subjected to version upgrading, provides a foundation for realizing hot upgrading, and can effectively save the mobile flow during upgrading.

Fig. 3 is a second schematic flowchart of the differential upgrade method provided in the present invention, as shown in fig. 2, which mainly includes, but is not limited to, the following steps:

step 301, a target edge gateway receives a differential upgrade package sent by an upgrade server, wherein the differential upgrade package is determined according to a current plug-in code and a plug-in code to be upgraded;

and step 302, the target edge gateway updates the current plug-in according to the differential upgrade package.

Referring to fig. 2, the differential upgrade method provided in the present invention mainly includes the following steps:

1) the current plug-in of the target edge gateway is recorded as: a.so.1.0, and the plug-in to be upgraded is marked as a.so.2.0. And respectively calculating the hash check values of the current plug-in and the plug-in to be upgraded, and storing the hash check value (hash value for short) of the plug-in to be upgraded in A.so.2.0.sig.

2) And the OTA server respectively encodes the current plug-in A.so.1.0 and the plug-in to be upgraded A.so.2.0 to generate a current plug-in code A.so.1.0.txt and a plug-in code to be upgraded A.so.2.0. txt.

3) The OTA server compares the generated current plug-in coding A.so.1.0.txt with the plug-in coding A.so.2.0.txt to be upgraded to generate an upgrade patch package: a.so.1.0 — 2.0.txt.patch. And calculating the Hash check value A.so.1.0_2.0.txt.patch of the upgrade patch package A.so.1.0_2.0.txt.patch.

4) Compressing the upgrading patch package A.so.1.0_2.0.txt.patch, the Hash check value A.so.2.0.sig of the plug-in to be upgraded and the Hash check value A.so.1.0_2.0.txt.patch.sig of the upgrading patch package by the OTA server side to generate a differential upgrading package A.so.patch.tar.gz.

Further, the OTA server responds to a configuration determining instruction sent by the OTA control platform, and generates the generated differential upgrade packet a.so.patch.tar.gz of the target edge gateway to the target edge gateway.

The target edge gateway downloads the differential upgrade package A.so.patch.tar.gz, decompresses the differential upgrade package A.so.1.0_2.0.txt.patch, and obtains the hash check value A.so.2.0.sig of the plug-in to be upgraded and the hash check value A.so.1.0_2.0.txt.patch.sig of the upgrade patch package.

And the target edge gateway fuses the upgrade patch package A.so.1.0_2.0.txt.patch and the current plug-in code A.so.2.0.txt A.so.1.0.txt to obtain the newly generated plug-in code A.so.2.0.txt to be upgraded.

And the target edge gateway decodes the plug-in code A.so.2.0.txt to be upgraded to obtain the plug-in A.so.2.0 to be upgraded.

And the target edge gateway unloads the current plug-in A.so.1.0 and reloads the plug-in A.so.2.0 to be upgraded, so as to complete the hot update of the current plug-in of the target edge gateway.

According to the differential upgrading method provided by the invention, the functional module of the equipment edge gateway is divided in a fine-grained manner, a standard interface is defined for any plug-in, a dynamic link library is combined with a differential technology, and meanwhile, background management is carried out by using an OTA upgrading server, so that a differential patch package can be generated according to the current code and the code to be upgraded of each plug-in, the equipment can be conveniently subjected to batch hot updating, and the mobile flow is effectively saved.

Based on the content of the foregoing embodiment, as an optional embodiment, the updating the current plug-in according to the differential upgrade package includes:

decompressing the differential upgrade patch, and acquiring a first hash check value of the plug-in to be upgraded, an upgrade patch package and a second hash check value of the upgrade patch package;

verifying the upgrade patch package by using the second hash check value, and coding the current plug-in under the condition that the verification is passed to generate a current plug-in code;

generating a plug-in code to be upgraded according to the level patch package and the current plug-in code;

decoding the plug-in code to be upgraded to generate a plug-in to be upgraded;

and verifying the plug-in to be upgraded by using the first hash check value, and unloading the current plug-in to load the plug-in to be upgraded under the condition that the verification is passed.

Optionally, the target edge gateway verifies the upgrade patch package a.so.1.0_2.0.txt.patch by using the second hash check value a.so.1.0_2.0.txt.patch of the upgrade patch package to determine whether data is abnormal in the transmission process, so as to ensure consistency of the upgrade patch package a.so.1.0_2.0.txt.patch before and after transmission.

And under the condition that the verification is passed, fusing the upgrade patch package A.so.1.0_2.0.txt.patch with the current plug-in code A.so.2.0.txt.1.0. txt by using a patch command to obtain the newly generated plug-in code A.so.2.0.txt to be upgraded.

And decoding the A.so.2.0.txt of the plug-in to be upgraded by using base64, reading the A.so.2.0.txt word by word, removing the escape character, and then decoding to obtain the A.so.2.0 of the plug-in to be upgraded. And then, judging whether the plug-in A.so.2.0 to be upgraded has data abnormality in the data transmission process according to the crc8 check code and the first Hash check value A.so.2.0 sig of the plug-in to be upgraded.

And under the condition that the result of the verification of the crc8 is determined to be normal, the target edge gateway unloads the current plug-in A.so.1.0, reloads the plug-in A.so.2.0 to be upgraded and completes the hot update of the current plug-in of the target edge gateway.

The differential upgrading method provided by the invention is combined with a Hash check method to produce and generate a differential upgrading packet, not only carries out Hash check on the upgrading patch packet A.so.1.0_2.0.txt.patch, but also carries out secondary check on the plug-in to be upgraded A.so.2.0 received by the edge gateway through the crc8 check code, and can fully ensure the safety of the updated data.

Fig. 4 is a schematic structural diagram of a differential upgrade apparatus provided in the present invention, and as shown in fig. 4, the differential upgrade apparatus mainly includes a processing unit 41 and a sending unit 42, where:

the processing unit 41 is mainly configured to generate a differential upgrade package according to the current plug-in code of the target edge gateway and the plug-in code to be upgraded;

the sending unit 42 is mainly configured to send the differential upgrade package to the target edge gateway, so that the target edge gateway updates the current plug-in according to the differential upgrade package.

Fig. 5 is a second schematic structural diagram of the differential upgrade apparatus provided in the present invention, as shown in fig. 5, mainly including a receiving unit 51 and an updating unit 52, wherein:

the receiving unit 51 is mainly used for receiving a differential upgrade package sent by an upgrade server, wherein the differential upgrade package is determined according to a current plug-in code and a plug-in code to be upgraded;

the updating unit 52 is mainly configured to update the current plug-in according to the differential upgrade package.

It should be noted that, when the differential upgrade apparatus provided in the embodiment of the present invention is in specific operation, the differential upgrade method described in any of the above embodiments may be executed, and details of this embodiment are not described herein.

The differential upgrading device provided by the invention divides the function module of the equipment edge gateway into fine granularity, defines a standard interface for any plug-in, combines a dynamic link library with a differential technology, and simultaneously carries out background management by using an OTA upgrading server, can generate a differential patch package according to the current code and the code to be upgraded of each plug-in, can conveniently carry out batch thermal upgrading on the equipment, and effectively saves the mobile flow.

As an alternative embodiment, the present invention further provides a working machine, on which the differential upgrade apparatus provided in any one of the above embodiments is mounted.

Wherein, the working machine can be various working vehicles such as excavator, forklift, road roller, etc., or various working devices which need to be upgraded by OTA periodically, the statement is not limited specifically,

according to the operation machine provided by the invention, the functional module of the equipment edge gateway is divided in a fine-grained manner by additionally arranging the differential upgrading device, a standard interface is defined for any plug-in, a dynamic link library is combined with a differential technology, and meanwhile, background management is carried out by utilizing an OTA upgrading server, so that a differential patch package can be generated according to the current code and the code to be upgraded of each plug-in, the equipment can be conveniently subjected to batch thermal updating, and the mobile flow is effectively saved.

Fig. 6 is a schematic structural diagram of an electronic device provided in the present invention, and as shown in fig. 6, the electronic device may include: a processor (processor)610, a communication Interface (Communications Interface)620, a memory (memory)630 and a communication bus 640, wherein the processor 610, the communication Interface 620 and the memory 630 communicate with each other via the communication bus 640. Processor 610 may invoke logic instructions in memory 630 to perform a differential upgrade method comprising: generating a differential upgrade package according to the current plug-in code of the target edge gateway and the plug-in code to be upgraded; and sending the differential upgrade package to the target edge gateway so that the target edge gateway can update the current plug-in according to the differential upgrade package.

Alternatively, the method comprises: receiving a differential upgrade package sent by an upgrade server, wherein the differential upgrade package is determined according to a current plug-in code and a plug-in code to be upgraded; and updating the current plug-in according to the differential upgrade package.

In addition, the logic instructions in the memory 630 may be implemented in software functional units and stored in a computer readable storage medium when the logic instructions are sold or used as independent products. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.

In another aspect, the present invention also provides a computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions, which when executed by a computer, enable the computer to perform the differential upgrade method provided by the above methods, the method comprising: generating a differential upgrade package according to the current plug-in code of the target edge gateway and the plug-in code to be upgraded; and sending the differential upgrade package to the target edge gateway so that the target edge gateway can update the current plug-in according to the differential upgrade package.

Alternatively, the method comprises: receiving a differential upgrade package sent by an upgrade server, wherein the differential upgrade package is determined according to a current plug-in code and a plug-in code to be upgraded; and updating the current plug-in according to the differential upgrade package.

In yet another aspect, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored, the computer program being implemented by a processor to perform the differential upgrade method provided in the above embodiments, the method including: generating a differential upgrade package according to the current plug-in code of the target edge gateway and the plug-in code to be upgraded; and sending the differential upgrade package to the target edge gateway so that the target edge gateway can update the current plug-in according to the differential upgrade package.

Alternatively, the method comprises: receiving a differential upgrade package sent by an upgrade server, wherein the differential upgrade package is determined according to a current plug-in code and a plug-in code to be upgraded; and updating the current plug-in according to the differential upgrade package.

The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.

Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.

Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

19页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种BMC固件升级方法、装置、电子设备及存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!