Movatterモバイル変換


[0]ホーム

URL:


CN115421745A - Equipment remote upgrading method, device, terminal and storage medium - Google Patents

Equipment remote upgrading method, device, terminal and storage medium
Download PDF

Info

Publication number
CN115421745A
CN115421745ACN202210903792.8ACN202210903792ACN115421745ACN 115421745 ACN115421745 ACN 115421745ACN 202210903792 ACN202210903792 ACN 202210903792ACN 115421745 ACN115421745 ACN 115421745A
Authority
CN
China
Prior art keywords
file
subfile
storage space
sub
temporary storage
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
CN202210903792.8A
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.)
Xiamen Kecan Information Technology Co ltd
Kehua Data Co Ltd
Original Assignee
Xiamen Kecan Information Technology Co ltd
Kehua Data 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 Xiamen Kecan Information Technology Co ltd, Kehua Data Co LtdfiledCriticalXiamen Kecan Information Technology Co ltd
Priority to CN202210903792.8ApriorityCriticalpatent/CN115421745A/en
Publication of CN115421745ApublicationCriticalpatent/CN115421745A/en
Pendinglegal-statusCriticalCurrent

Links

Images

Classifications

Landscapes

Abstract

The application provides a method, a device, a terminal and a storage medium for remotely upgrading equipment, wherein the method comprises the following steps: judging whether the file size corresponding to each subfile in the upgrade package is larger than the temporary storage space of the target equipment or not according to each subfile in the upgrade package; if the file size corresponding to the subfile is larger than the temporary storage space, downloading the subfile to the temporary storage space in a segmented manner based on the offset address of the subfile and the size of the temporary storage space, replacing an original file corresponding to the current file segment in the local storage space by the current file segment downloaded to the temporary storage space before downloading the next file segment, and deleting the current file segment in the temporary storage space; and upgrading the target equipment based on the subfile. According to the method and the device, the subfiles are downloaded and written into the local storage space in a segmented mode, and the problem that the upgrade cannot be achieved when the size of the upgrade patch is larger than the residual storage space of the equipment can be solved.

Description

Method, device, terminal and storage medium for remotely upgrading equipment
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method, an apparatus, a terminal, and a storage medium for remotely upgrading a device.
Background
Most embedded devices in the market at present cannot be provided with larger storage space due to the limitation of cost. Upgrading such devices places a large limit on the size of the upgrade package. When the size of the upgrade package exceeds the remaining storage space of the device, the device often cannot be upgraded.
In order to upgrade the device, the upgrade method in the prior art mainly includes the following steps:
(1) Cutting the software to reduce the size of the upgrade package;
(2) Carrying out differential comparison on the upgrading packets of different versions to generate a differential patch packet, and only upgrading the differential patch packet;
(3) And the upgrading package is compressed through the compression software, so that the size of the upgrading package is reduced.
However, in any of the above methods, when the remaining space of the device is smaller than the size of the upgrade package, the device upgrade still cannot be realized.
Disclosure of Invention
The application provides a method, a device, a terminal and a storage medium for remotely upgrading equipment, which are used for solving the problem that the equipment cannot be upgraded due to small storage space of the equipment.
In a first aspect, the present application provides a method for remotely upgrading a device, which is applied to a target device, and includes:
judging whether the target equipment needs to be upgraded or not according to the total packet header information of the upgrade packet; the total packet header information comprises sub-packet information of at least one sub-file; the sub-package information comprises the file size and the offset address of the sub-file in the upgrading package;
if the target equipment needs to be upgraded, judging whether the file size corresponding to each subfile in the upgrade package is larger than the temporary storage space of the target equipment or not according to each subfile; if the file size corresponding to the subfile is larger than the temporary storage space, downloading the subfile to the temporary storage space in a segmented manner based on the offset address of the subfile and the size of the temporary storage space, replacing an original file corresponding to the current file segment in the local storage space by the current file segment downloaded to the temporary storage space before downloading the next file segment, and deleting the current file segment in the temporary storage space;
and upgrading the target equipment based on the subfile.
In a second aspect, the present application provides an apparatus for remotely upgrading a device, which is applied to a target device, and includes:
the upgrading judgment module is used for judging whether the target equipment needs to be upgraded according to total packet header information of an upgrading packet, wherein the total packet header information comprises sub-packet information of at least one subfile; the sub-package information comprises the file size and the offset address of the sub-file in the upgrading packet;
the segmented downloading module is used for judging whether the file size corresponding to each subfile in the upgrade package is larger than the temporary storage space of the target equipment or not aiming at each subfile in the upgrade package if the target equipment needs to be upgraded; if the file size corresponding to the subfile is larger than the temporary storage space, downloading the subfile to the temporary storage space in a segmented manner based on the offset address of the subfile and the size of the temporary storage space, replacing an original file corresponding to the current file segment in a local storage space by the current file segment downloaded to the temporary storage space before downloading the next file segment, and deleting the current file segment in the temporary storage space;
and the upgrading module is used for upgrading the target equipment based on the subfile.
In a third aspect, the present application provides a terminal, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the computer program to implement the steps of the method according to any one of the possible implementation manners of the first aspect.
In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the computer program implements the steps of the method according to any one of the possible implementation manners of the first aspect.
The embodiment of the application provides a method, a device, a terminal and a storage medium for remotely upgrading equipment, wherein the method comprises the steps of aiming at each subfile in an upgrade package, if the target equipment needs to be upgraded, judging whether the size of a file corresponding to the subfile is larger than the temporary storage space of the target equipment or not aiming at each subfile in the upgrade package; if the file size corresponding to the subfile is larger than the temporary storage space, downloading the subfile to the temporary storage space in a segmented manner based on the offset address of the subfile and the size of the temporary storage space, replacing an original file corresponding to the current file segment in a local storage space by the current file segment downloaded to the temporary storage space before downloading the next file segment, and deleting the current file segment in the temporary storage space; and upgrading the target equipment based on the subfile. This embodiment is through downloading the subfile segmentation to the space of keeping in, can solve the problem that the package size of upgrading can't be upgraded when being greater than the space of keeping in of equipment to improve upgrading efficiency.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required to be used in the embodiments or the prior art description will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings may be obtained according to these drawings without inventive labor.
Fig. 1 is a flowchart of an implementation of a method for remotely upgrading a device according to an embodiment of the present application;
fig. 2 is a complete flowchart of a device remote upgrade method provided in an embodiment of the present application;
FIG. 3 is a schematic structural diagram of an apparatus remote upgrade apparatus provided in an embodiment of the present application;
fig. 4 is a schematic diagram of a terminal provided in an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
To make the objects, technical solutions and advantages of the present application more clear, the following description is made by way of specific embodiments with reference to the accompanying drawings.
Referring to fig. 1, it shows a flowchart of an implementation of the method for remotely upgrading a device provided in the embodiment of the present application, which is detailed as follows:
s101: judging whether the target equipment needs to be upgraded or not according to the total packet header information of the upgrade packet; the total packet header information comprises sub-packet information of at least one sub-file; the sub-packet information includes a file size and an offset address of a sub-file in the upgrade packet.
Specifically, the execution subject of this embodiment is an upgradable target device.
When the upgrade package is manufactured, header processing is carried out on the upgrade package, and the size and version information of each subfile in the upgrade package, the size and version information of the upgrade package, the offset address of each subfile in the whole upgrade package and the like are counted. And storing the size and version information of each subfile in the upgrade package, the size and version information of the upgrade package, the offset address of each subfile in the whole upgrade package and the like as the total package header information of the upgrade package to the start position of the upgrade package.
In an embodiment of the present application, the total packet header information further includes an upgrade packet identifier, software version information, and hardware version information; fig. 2 shows a complete flowchart of the remote upgrade of the device provided in this embodiment, and as shown in fig. 2, before S101, the remote upgrade method of the device provided in this embodiment further includes:
when an upgrade order is monitored, judging whether an upgrade package is the upgrade package of the target equipment or not based on an upgrade package identifier in the upgrade order;
and if the upgrade package is the upgrade package of the target equipment, acquiring the total package header information of the upgrade package.
The specific implementation process of S101 includes:
and judging whether the target equipment needs to be upgraded or not based on the software version information and the hardware version information.
In this embodiment, after updating the upgrade package, the server sends an upgrade command to the target device, after monitoring the upgrade command, the target device determines whether the upgrade package is consistent with the identifier of the target device according to the upgrade package identifier carried in the upgrade command, if so, it determines that the upgrade package meets the upgrade condition, acquires and analyzes the total package header information of the upgrade package through the http \ https protocol, and then stores the total package header information into the local storage space. If not, ending the upgrading process.
TABLE 1
Figure BDA0003771002310000051
Specifically, data included in the total packet header information is shown in table 1, the total packet header information includes an upgrade packet identifier, a header information total length, software version information, hardware version information, other information, a subfile number, an upgrade packet protocol version number and reserved bits, and the sub-packet information includes an upgrade packet type, a subfile name, an MD5 value, an offset address of the subfile in the whole upgrade packet, a file size, and software version information.
As shown in fig. 2, after the total header information is obtained, the target device respectively determines whether software version information stored in the local storage space of the target device is consistent with software version information in the total header information, and whether hardware version information stored in the local storage space of the target device is consistent with hardware version information in the total header information; if the software version information stored in the local storage space by the target device is inconsistent with the software version information in the total header information, and the hardware version information stored in the local storage space by the target device is consistent with the hardware version information in the total header information, judging that the target device needs to be upgraded; otherwise, the target device is judged not to need to be upgraded, and the upgrading process is ended.
In one possible embodiment, the sub-packet information includes a sub-file name and sub-packet version information;
before S102, the method for remotely upgrading a device according to this embodiment further includes:
S102A: and if the sub-package version information of the sub-file corresponding to the same sub-file name in the local storage space is not consistent with the sub-package version information in the upgrading packet, executing the step of judging whether the file size corresponding to the sub-file is larger than the temporary storage space of the target device.
In one possible embodiment, the subpacket version information includes a subpacket version number and an MD5 value; the specific implementation process of S102A further includes:
and if the sub-packet version number of the sub-file corresponding to the same sub-file name in the local storage space is inconsistent with the sub-packet version number in the upgrade package, and the MD5 value of the sub-file in the local storage space is inconsistent with the MD5 value in the upgrade package, executing the step of judging whether the file size corresponding to the sub-file is larger than the temporary storage space of the target equipment.
In this embodiment, as shown in fig. 2, after determining that the upgrade package meets the upgrade condition, the target device sequentially downloads and upgrades each subfile in the upgrade package. Before downloading and upgrading the subfiles, firstly judging whether the number of the subfiles to be upgraded in the upgrade package is greater than zero, and if not, ending the upgrade process; if the sub-package version number of the sub-file corresponding to the same sub-file name in the local storage space is inconsistent with the sub-package version number in the upgrade package, and if the MD5 value of the sub-file in the local storage space is inconsistent with the MD5 value in the upgrade package, the sub-file is judged not to be downloaded. For the sub-files not downloaded, steps S102 to S104 are performed.
As shown in fig. 2, if the sub-packet version number of the sub-file corresponding to the same sub-file name in the local storage space is consistent with the sub-packet version number in the upgrade package, or the MD5 value of the sub-file in the local storage space is consistent with the MD5 value in the upgrade package, it is determined that the sub-file is downloaded, the number of the sub-file to be upgraded in the upgrade package is reduced by one, and the step of determining the number of the sub-file to be upgraded is returned to and repeatedly executed.
S102: if the target equipment needs to be upgraded, judging whether the file size corresponding to each subfile in the upgrade package is larger than the temporary storage space of the target equipment or not; and if the file size corresponding to the subfile is larger than the temporary storage space, downloading the subfile to the temporary storage space in a segmented manner based on the offset address of the subfile and the size of the temporary storage space, replacing the original file corresponding to the current file segment in the local storage space by adopting the current file segment downloaded to the temporary storage space before downloading the next file segment, and deleting the current file segment in the temporary storage space.
In this embodiment, the temporary storage space may be an unoccupied space of a local storage space in the target device, or may be a memory of the target device. As shown in fig. 2, if the file size corresponding to the subfile is larger than the temporary storage space, the subfile in the upgrade package is downloaded from the server in a segmented manner, and after the file is stored in the temporary storage space in a segmented manner each time, the original file of the storage address corresponding to the file segment in the local storage space is replaced by the file segment, and after the file segment is written in the local storage space, the file segment in the temporary storage space is deleted.
In a possible embodiment, the specific implementation flow of S102 includes:
step 1: determining the offset address of the current file segment in the subfile in the upgrade package based on the offset address of the subfile in the upgrade package and the address range of the file segment of the subfile downloaded last time in the upgrade package;
step 2: determining the address range of the current file segment in the subfile in the upgrade package based on the offset address of the current file segment in the subfile in the upgrade package and the size of the temporary storage space;
and step 3: sending a file segmentation downloading request to a server, wherein the file segmentation downloading request is used for indicating the server to send the file segmentation corresponding to the subfile in the upgrade package to the target device based on the address range of the current file segmentation of the subfile in the upgrade package;
and 4, step 4: and storing the file segments of the sub-file downloaded at the current time into the temporary storage space, and repeatedly executing the steps 1 to 4 until the end address of the file segment of the sub-file downloaded at the current time is the same as the end address of the sub-file.
Specifically, after the file segment of the sub file downloaded at the current time is saved in the temporary storage space instep 4, the address range of the file segment in the local storage space is determined based on the address range of the file segment of the sub file downloaded at the current time, the file segment of the sub file downloaded at the current time is adopted to replace the original file at the corresponding address range, and then the file segment downloaded at the current time in the temporary storage space is deleted to reserve a space for downloading the next file segment.
In an embodiment, after determining whether the file size corresponding to the sub-file is larger than the temporary storage space of the target device, the method provided in this embodiment further includes:
and if the file size of the subfile is not larger than the temporary storage space of the target equipment, downloading the subfile to the temporary storage space based on the offset address and the file size of the subfile.
Specifically, if the file size corresponding to the subfile is smaller than the temporary storage space in the target device, the address range of the subfile in the upgrade package is determined according to the offset address and the file size of the subfile in the upgrade package, a subfile downloading request is sent to the server, the server sends the subfile of the address range in the upgrade package to the target device according to the subfile downloading request, the target device acquires the subfile and stores the subfile in the temporary storage space, then the original file at the address range corresponding to the subfile in the local storage space is replaced by the subfile in the temporary storage space, and the subfile in the temporary storage space is deleted after the subfile is written into the local storage space.
S104: and upgrading the target equipment based on the subfile.
In a possible embodiment, the specific implementation flow of S104 includes:
calculating the sum of the sizes of the file segments written into the local storage space by the subfile;
and if the sum of the sizes of the file segments written into the local storage space by the subfile is equal to the file size of the subfile, judging that the subfile passes the integrity check, and upgrading the target equipment based on the subfile.
In this embodiment, as shown in fig. 2, after downloading the complete subfile, the integrity of the subfile is verified, and only after the integrity verification is passed, the target device can be upgraded based on the subfile, otherwise, the temporary file that is temporarily stored needs to be deleted, and the method returns to the step of determining the number of the subfiles to be upgraded in the upgrade package, and repeatedly executes the subsequent processes.
Specifically, if the subfile is completely stored in the local storage space at one time, the target device may calculate an MD5 value for the stored subfile, then determine whether the MD5 value of the subfile in the upgrade package is consistent with the calculated MD5 value, and if so, prove that the subfile passes integrity verification.
If the subfile segment is stored in the local storage space, the target device can calculate the sum of the sizes of the file segments written in the local storage space by the subfile; and if the sum of the sizes of the file segments written into the local storage space by the subfile is equal to the file size of the subfile, the subfile is proved to pass the integrity verification.
According to the embodiment, the integrity of the subfiles written into the local storage space is verified, so that the problem of failed upgrading caused by incomplete downloading of the subfiles and upgrading can be avoided.
In this embodiment, the upgrade package may be a compressed upgrade package or an uncompressed upgrade package. When the upgrade package is a compressed upgrade package, the specific implementation process of S104 includes:
and if the subfile passes the integrity check, decompressing the subfile, and storing the decompressed subfile to a corresponding storage address of the subfile in a local storage space. And then upgrading the target equipment based on the decompressed subfile, and deleting the compressed upgrade package of the subfile in the local storage space after upgrading.
Specifically, as shown in fig. 2, after the upgrading operation of the subfiles is completed, the number of the subfiles to be upgraded in the upgrade package is reduced by one, the step of judging the number of the subfiles to be upgraded is returned, the subsequent process is repeated until the number of the subfiles to be upgraded is equal to zero, and the upgrading process is ended.
Specifically, after upgrading of a subfile of the upgrade package is completed, the original sub-packet information in the local storage space is replaced by the current sub-packet information of the subfile. After the whole upgrade package is upgraded, the current total package head information of the upgrade package replaces the total package head information in the local storage space so as to wait for the verification of the upgrade package version in the next upgrade.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
In the following, embodiments of the apparatus of the present application are provided, and for details which are not described in detail therein, reference may be made to the corresponding method embodiments described above.
Fig. 3 shows a schematic structural diagram of an apparatus remote upgrade device provided in an embodiment of the present application, and for convenience of description, only parts related to the embodiment of the present application are shown, which are detailed as follows:
as shown in fig. 3, the deviceremote upgrade apparatus 100 includes:
theupgrade determining module 110 is configured to determine whether the target device needs to be upgraded according to total packet header information of an upgrade packet, where the total packet header information includes sub-packet information of at least one sub-file; the sub-package information comprises the file size and the offset address of the sub-file in the upgrading package;
thesegment downloading module 120 is configured to, if the target device needs to be upgraded, determine, for each subfile in the upgrade package, whether a file size corresponding to the subfile is larger than a temporary storage space of the target device; if the file size corresponding to the subfile is larger than the temporary storage space, downloading the subfile to the temporary storage space in a segmented manner based on the offset address of the subfile and the size of the temporary storage space, replacing an original file corresponding to the current file segment in the local storage space by the current file segment downloaded to the temporary storage space before downloading the next file segment, and deleting the current file segment in the temporary storage space;
and theupgrading module 130 is configured to upgrade the target device based on the subfile.
In one possible embodiment, thesegment download module 120 comprises:
step 1: determining the offset address of the current file segment in the subfile in the upgrade package based on the offset address of the subfile in the upgrade package and the address range of the file segment of the subfile downloaded last time in the upgrade package;
step 2: determining the address range of the current file segment in the subfile in the upgrade package based on the offset address of the current file segment in the subfile in the upgrade package and the size of the temporary storage space;
and 3, step 3: sending a file segmentation downloading request to a server, wherein the file segmentation downloading request is used for indicating the server to send the file segmentation corresponding to the subfile in the upgrade package to the target device based on the address range of the current file segmentation of the subfile in the upgrade package;
and 4, step 4: and storing the file segments of the sub file downloaded at the current time into the temporary storage space, and repeatedly executing the steps 1 to 4 until the ending address of the file segments of the sub file downloaded at the current time is the same as the ending address of the sub file.
In one possible embodiment, the sub-packet information includes a sub-file name and sub-packet version information; the deviceremote upgrade apparatus 100 further includes:
and the version information judging module is used for executing the step of judging whether the file size corresponding to the subfile is larger than the temporary storage space of the target equipment or not if the sub-package version information of the subfile corresponding to the same subfile name in the local storage space is inconsistent with the sub-package version information in the upgrading packet.
In one possible embodiment, the subpacket version information includes a subpacket version number and an MD5 value; the version information judgment module specifically comprises:
and if the sub-packet version number of the sub-file corresponding to the same sub-file name in the local storage space is inconsistent with the sub-packet version number of the upgrading packet, and the MD5 value of the sub-file in the local storage space is inconsistent with the MD5 value of the upgrading packet, executing the step of judging whether the file size corresponding to the sub-file is larger than the temporary storage space of the target equipment.
In one possible embodiment, the total header information further includes an upgrade package identifier, software version information, and hardware version information; the deviceremote upgrade apparatus 100 further comprises an identification verification module for:
when an upgrade order is monitored, judging whether an upgrade package is the upgrade package of the target equipment or not based on an upgrade package identifier in the upgrade order;
if the upgrade package is the upgrade package of the target equipment, acquiring the total package header information of the upgrade package;
theupgrade determining module 110 includes:
and judging whether the target equipment needs to be upgraded or not based on the software version information and the hardware version information.
The deviceremote upgrade apparatus 100 further includes:
and the subfile downloading module is used for downloading the subfile to the temporary storage space based on the offset address and the file size of the subfile if the file size of the subfile is not larger than the temporary storage space of the target equipment.
The remote upgrading device of equipment that this application embodiment provided can solve the problem that the upgrading package size can't be upgraded when being greater than the space of keeping in of equipment through downloading the subfile segmentation to the space of keeping in to improve upgrading efficiency.
Fig. 4 is a schematic diagram of a terminal provided in an embodiment of the present application. As shown in fig. 4, theterminal 4 of this embodiment includes: aprocessor 40, amemory 41 and acomputer program 42 stored in saidmemory 41 and executable on saidprocessor 40. Theprocessor 40 implements the steps in the above-described embodiments of the device remote upgrade method, such as steps 101 to 103 shown in fig. 1, when executing thecomputer program 42. Alternatively, theprocessor 40, when executing thecomputer program 42, implements the functions of the modules/units in the above-mentioned device embodiments, such as the functions of themodules 110 to 130 shown in fig. 3.
Illustratively, thecomputer program 42 may be partitioned into one or more modules/units, which are stored in thememory 41 and executed by theprocessor 40 to implement the scheme provided herein. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution of thecomputer program 42 in theterminal 4. For example, thecomputer program 42 may be divided into themodules 110 to 130 shown in fig. 3.
Theterminal 4 may be a desktop computer, a notebook, a palm computer, a cloud server, or other computing devices. Theterminal 4 may include, but is not limited to, aprocessor 40, amemory 41. Those skilled in the art will appreciate that fig. 4 is only an example of aterminal 4 and does not constitute a limitation ofterminal 4 and may include more or less components than those shown, or some components in combination, or different components, for example, the terminal may also include input output devices, network access devices, buses, etc.
TheProcessor 40 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Thememory 41 may be an internal storage unit of theterminal 4, such as a hard disk or a memory of theterminal 4. Thememory 41 may also be an external storage device of theterminal 4, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, provided on theterminal 4. Further, thememory 41 may also include both an internal storage unit and an external storage device of theterminal 4. Thememory 41 is used for storing the computer program and other programs and data required by the terminal. Thememory 41 may also be used to temporarily store data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the technical solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/terminal and method may be implemented in other ways. For example, the above-described apparatus/terminal embodiments are merely illustrative, and for example, the division of the modules or units is only one type of logical function division, and other division manners may exist in actual implementation, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
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 position, or may be distributed on multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit may be implemented in the form of hardware, or may also be implemented in the form of a software functional unit.
The integrated modules/units, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow in the method according to the embodiments described above may also be implemented by a computer program, which may be stored in a computer readable storage medium, and when the computer program is executed by a processor, the steps of the embodiments of the method for remotely upgrading devices may be implemented. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U.S. disk, removable hard disk, magnetic diskette, optical disk, computer Memory, read-Only Memory (ROM), random Access Memory (RAM), electrical carrier wave signal, telecommunications signal, and software distribution medium, etc. It should be noted that the computer readable medium may contain other components which may be suitably increased or decreased as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media which may not include electrical carrier signals and telecommunications signals in accordance with legislation and patent practice.
Furthermore, features of the embodiments shown in the drawings of the present application or of the various embodiments mentioned in the present description are not necessarily to be understood as embodiments independent of each other. Rather, each feature described in one example of one embodiment can be combined with one or more other desired features from other embodiments to yield yet further embodiments, which are not described in text or with reference to the accompanying drawings.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should 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; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (10)

1. A method for remotely upgrading equipment is applied to target equipment, and comprises the following steps:
judging whether the target equipment needs to be upgraded or not according to the total packet header information of the upgrade packet; the total packet header information comprises sub-packet information of at least one sub-file; the sub-package information comprises the file size and the offset address of the sub-file in the upgrading package;
if the target equipment needs to be upgraded, judging whether the file size corresponding to each subfile in the upgrade package is larger than the temporary storage space of the target equipment or not according to each subfile; if the file size corresponding to the subfile is larger than the temporary storage space, downloading the subfile to the temporary storage space in a segmented manner based on the offset address of the subfile and the size of the temporary storage space, replacing an original file corresponding to the current file segment in the local storage space by the current file segment downloaded to the temporary storage space before downloading the next file segment, and deleting the current file segment in the temporary storage space;
and upgrading the target equipment based on the subfile.
2. The method for remotely upgrading devices according to claim 1, wherein the downloading the subfile segment to the staging space based on the offset address of the subfile and the size of the staging space comprises:
step 1: determining the offset address of the current file segment in the subfile in the upgrade package based on the offset address of the subfile in the upgrade package and the address range of the file segment of the subfile downloaded last time in the upgrade package;
step 2: determining the address range of the current file segment in the subfile in the upgrade package based on the offset address of the current file segment in the subfile in the upgrade package and the size of the temporary storage space;
and step 3: sending a file segmentation downloading request to a server, wherein the file segmentation downloading request is used for indicating the server to send the file segmentation corresponding to the subfile in the upgrade package to the target device based on the address range of the current file segmentation of the subfile in the upgrade package;
and 4, step 4: and storing the file segments of the sub-file downloaded at the current time into the temporary storage space, and repeatedly executing the steps 1 to 4 until the end address of the file segment of the sub-file downloaded at the current time is the same as the end address of the sub-file.
3. The device remote upgrade method according to claim 1, wherein the upgrading the target device based on the subfile comprises:
calculating the sum of the sizes of the file segments written into the local storage space by the subfile;
and if the sum of the sizes of the file segments written into the local storage space by the subfile is equal to the file size of the subfile, judging that the subfile passes the integrity check, and upgrading the target equipment based on the subfile.
4. The device remote upgrade method of claim 1, wherein the sub-packet information includes sub-file names and sub-packet version information;
before the determining whether the file size corresponding to the sub-file is larger than the temporary storage space of the target device, the method further includes:
and if the sub-packet version information of the sub-file corresponding to the same sub-file name in the local storage space is not consistent with the sub-packet version information in the upgrade package, executing the step of judging whether the file size corresponding to the sub-file is larger than the temporary storage space of the target device.
5. The device remote upgrade method according to claim 4, wherein said subpacket version information includes a subpacket version number and an MD5 value;
if the sub-packet version information of the sub-file corresponding to the same sub-file name in the local storage space is inconsistent with the sub-packet version information of the upgrade package, the step of judging whether the file size corresponding to the sub-file is larger than the temporary storage space of the target device is executed, and the method comprises the following steps:
and if the sub-packet version number of the sub-file corresponding to the same sub-file name in the local storage space is not consistent with the sub-packet version number of the upgrading packet, and the MD5 value of the sub-file in the local storage space is not consistent with the MD5 value of the upgrading packet, executing the step of judging whether the file size corresponding to the sub-file is larger than the temporary storage space of the target device.
6. The device remote upgrade method of claim 1, wherein the overall header information further includes an upgrade package identification, software version information, and hardware version information;
before the step of judging whether the target device needs to be upgraded according to the total packet header information of the upgrade packet, the method further comprises the following steps:
when an upgrade order is monitored, judging whether an upgrade package is the upgrade package of the target equipment or not based on an upgrade package identifier in the upgrade order;
if the upgrade package is the upgrade package of the target equipment, acquiring the total package header information of the upgrade package;
the judging whether the target equipment needs to be upgraded according to the total packet header information of the upgrade packet comprises the following steps:
and judging whether the target equipment needs to be upgraded or not based on the software version information and the hardware version information.
7. The method for remotely upgrading a device according to claim 1, wherein after the determining whether the file size corresponding to the subfile is larger than the staging space of the target device, the method further comprises:
and if the file size of the subfile is not larger than the temporary storage space of the target equipment, downloading the subfile to the temporary storage space based on the offset address and the file size of the subfile.
8. An apparatus for remotely upgrading a device, applied to a target device, the apparatus comprising:
the upgrading judgment module is used for judging whether the target equipment needs to be upgraded or not according to the total packet header information of the upgrading packet, wherein the total packet header information comprises sub-packet information of at least one sub-file; the sub-package information comprises the file size and the offset address of the sub-file in the upgrading package;
the segmented downloading module is used for judging whether the file size corresponding to each subfile in the upgrading package is larger than the temporary storage space of the target equipment or not aiming at each subfile in the upgrading package if the target equipment needs to be upgraded; if the file size corresponding to the subfile is larger than the temporary storage space, downloading the subfile to the temporary storage space in a segmented manner based on the offset address of the subfile and the size of the temporary storage space, replacing an original file corresponding to the current file segment in the local storage space by the current file segment downloaded to the temporary storage space before downloading the next file segment, and deleting the current file segment in the temporary storage space;
and the upgrading module is used for upgrading the target equipment based on the subfile.
9. A terminal comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor when executing the computer program performs the steps of the method for remote upgrade of a device according to any of the preceding claims 1 to 7.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method for remotely upgrading a device according to any one of claims 1 to 7.
CN202210903792.8A2022-07-282022-07-28Equipment remote upgrading method, device, terminal and storage mediumPendingCN115421745A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202210903792.8ACN115421745A (en)2022-07-282022-07-28Equipment remote upgrading method, device, terminal and storage medium

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202210903792.8ACN115421745A (en)2022-07-282022-07-28Equipment remote upgrading method, device, terminal and storage medium

Publications (1)

Publication NumberPublication Date
CN115421745Atrue CN115421745A (en)2022-12-02

Family

ID=84195702

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202210903792.8APendingCN115421745A (en)2022-07-282022-07-28Equipment remote upgrading method, device, terminal and storage medium

Country Status (1)

CountryLink
CN (1)CN115421745A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN115884165A (en)*2022-12-162023-03-31雷沃工程机械集团有限公司Method for remotely writing ECU (electronic control Unit) on engineering machinery Internet of vehicles platform
CN116107612A (en)*2023-04-112023-05-12北京集度科技有限公司 Firmware over-the-air upgrade device, charging pile, device, method and program product
CN119521200A (en)*2024-11-082025-02-25青岛海尔科技有限公司 Upgrading method, system, storage medium and device for smart home appliances

Cited By (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN115884165A (en)*2022-12-162023-03-31雷沃工程机械集团有限公司Method for remotely writing ECU (electronic control Unit) on engineering machinery Internet of vehicles platform
CN115884165B (en)*2022-12-162024-10-11雷沃重工集团有限公司Method for remote brushing of ECU (electronic control Unit) on engineering machinery vehicle networking platform
CN116107612A (en)*2023-04-112023-05-12北京集度科技有限公司 Firmware over-the-air upgrade device, charging pile, device, method and program product
CN119521200A (en)*2024-11-082025-02-25青岛海尔科技有限公司 Upgrading method, system, storage medium and device for smart home appliances

Similar Documents

PublicationPublication DateTitle
CN115421745A (en)Equipment remote upgrading method, device, terminal and storage medium
CN112286565B (en)Embedded system differential upgrading method based on storage container
CN108650287B (en)Upgrading method and device for terminal device in Internet of things and computer readable medium
CN112765271A (en)Block chain transaction index storage method and device, computer equipment and medium
CN111475195A (en)Firmware upgrading method, device and system
CN110147242A (en)Upgrading in the downloading of space relies on inspection method and device, storage medium and terminal
CN105389177A (en)Software version confirmation method, device and system
CN112783541B (en)Equipment upgrading method, device and server
CN105786542A (en)Intelligent device and system update method of the intelligent device
CN108920962B (en) Firmware download signature verification method, firmware release method, mobile terminal and server
CN110022287A (en)A kind of asynchronous distributed document transmission method, terminal device and storage medium
CN119987828A (en) Firmware upgrade method, device, computer equipment, storage medium and program product
WO2021097624A1 (en)File processing method, file processing apparatus, and terminal device
CN110147246A (en)Version checking method and device, storage medium and the terminal of space download technology
CN110769030A (en)Method, terminal, server and storage medium for downloading file
CN113010195B (en)System upgrading method, storage medium and terminal equipment
CN108255549B (en)Server program visual control method and device
CN116980289A (en)Vehicle upgrading method and device, electronic equipment, vehicle and storage medium
CN114866530B (en)Method, device and computer storage medium for downloading upgrade data packet
CN116095064A (en)File downloading method, computer equipment and storage medium
CN116466986A (en)Equipment software upgrading method and device of energy storage system, communication module and medium
CN112433743B (en)File updating method and device, electronic equipment and storage medium
CN109901861B (en) A kind of electronic control unit software update method and device
CN110825406A (en)Software upgrading method and related equipment
CN115437660A (en)Firmware updating method and device, electronic equipment and storage medium

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination

[8]ページ先頭

©2009-2025 Movatter.jp