CN113590168B - Method, device, equipment, medium and program product for upgrading embedded equipment - Google Patents

Method, device, equipment, medium and program product for upgrading embedded equipment Download PDF

Info

Publication number
CN113590168B
CN113590168B CN202110861904.3A CN202110861904A CN113590168B CN 113590168 B CN113590168 B CN 113590168B CN 202110861904 A CN202110861904 A CN 202110861904A CN 113590168 B CN113590168 B CN 113590168B
Authority
CN
China
Prior art keywords
original
block
current
differential data
image file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110861904.3A
Other languages
Chinese (zh)
Other versions
CN113590168A (en
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.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202110861904.3A priority Critical patent/CN113590168B/en
Publication of CN113590168A publication Critical patent/CN113590168A/en
Application granted granted Critical
Publication of CN113590168B publication Critical patent/CN113590168B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/658Incremental updates; Differential updates

Abstract

The disclosure provides an embedded device upgrading method, an embedded device upgrading device, a medium and a program product, and relates to the technical field of computers, in particular to a system upgrading technology. The specific implementation scheme is as follows: the original image file and the target image file are respectively subjected to block processing in a first direction; if the current target block in the target image file meets the bidirectional reference condition, acquiring a plurality of original blocks corresponding to the current target block, wherein the original blocks comprise forward original blocks and backward original blocks, and the original blocks belong to the original image file; performing first differential operation on the corresponding current target block by adopting a plurality of original blocks to obtain current first differential data; and upgrading the current original partition of the original image file in the embedded equipment by adopting the current first differential data and the corresponding plurality of original partitions. The method and the device can find the most approximately matched partition, further obtain the optimal differential data and effectively improve the differential rate.

Description

Method, device, equipment, medium and program product for upgrading embedded equipment
Technical Field
The present disclosure relates to a system upgrade technology in the field of computer technology, and in particular, to an embedded device upgrade method, apparatus, device, medium, and program product.
Background
The embedded device is a special computer small-sized device which takes the application as a center and cuts software and hardware to adapt to the specific application environment through computer technology. Embedded devices are widely used, such as smartphones, wearable devices, wireless headphones, speakers, etc.
For updating and maintaining product functions or data, it is necessary to upgrade the embedded device. At present, when the embedded equipment is upgraded, a differential upgrading mode is generally adopted. Specifically, the method is a forward differential mode, a reverse differential mode or a combination mode of the forward differential mode and the reverse differential mode.
Disclosure of Invention
The present disclosure provides an embedded device upgrade method, apparatus, device, medium, and program product.
According to a first aspect of the present disclosure, there is provided an embedded device upgrade method, including:
the original image file and the target image file are respectively subjected to block processing in a first direction;
if the current target block in the target image file meets the bidirectional reference condition, acquiring a plurality of original blocks corresponding to the current target block, wherein the original blocks comprise forward original blocks and backward original blocks, and the original blocks belong to the original image file;
Performing first differential operation on the corresponding current target block by adopting the plurality of original blocks to obtain current first differential data;
and upgrading the current original partition of the original image file in the embedded equipment by adopting the current first differential data and the corresponding multiple original partitions.
According to a second aspect of the present disclosure, there is provided an embedded device upgrade apparatus, including:
the blocking processing unit is used for respectively carrying out blocking processing in a first direction on the original image file and the target image file;
the block acquisition unit is used for acquiring a plurality of original blocks corresponding to the current target block if the current target block in the target image file meets the bidirectional reference condition, wherein the original blocks comprise forward original blocks and backward original blocks, and the original blocks belong to the original image file;
the differential operation unit is used for performing first differential operation on the current target blocks corresponding to the plurality of original block pairs to obtain current first differential data;
and the upgrading unit is used for upgrading the current original partition of the original image file in the embedded equipment by adopting the current first differential data and the corresponding plurality of original partitions.
According to a third aspect of the present disclosure, there is provided an embedded device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of the first aspects.
According to a fourth aspect of the present disclosure, there is provided a non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method according to any one of the first aspects.
According to a fourth aspect of the present disclosure, there is provided a computer program product comprising: a computer program stored in a readable storage medium, from which it can be read by at least one processor of an embedded device, the at least one processor executing the computer program causing the embedded device to perform the method of the first aspect.
According to the technology of the present disclosure, since a plurality of original partitions including both a forward original partition and a backward original partition belonging to an original image file are referenced to perform a differential operation on a current target partition to obtain differential data in case that a bidirectional reference condition is satisfied. Therefore, the most approximately matched partition can be found, the optimal differential data can be obtained, and the differential rate is effectively improved.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the disclosure, nor is it intended to be used to limit the scope of the disclosure. Other features of the present disclosure will become apparent from the following specification.
Drawings
The drawings are for a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
FIG. 1 is a schematic diagram of a prior art forward differential upgrade;
FIG. 2 is a schematic diagram of a prior art reverse differential upgrade;
fig. 3 is an application scenario schematic diagram of an embedded device upgrade method provided according to the present disclosure;
fig. 4 is a flowchart of an embedded device upgrade method provided according to a first embodiment of the present disclosure;
FIG. 5 is a flow chart of an embedded device upgrade method provided according to a second embodiment of the present disclosure;
FIG. 6a is a first schematic diagram of forward differential in an embedded device upgrade method provided in accordance with a second embodiment of the present disclosure;
FIG. 6b is a second schematic diagram of forward differential in an embedded device upgrade method provided according to a second embodiment of the present disclosure;
FIG. 7 is a flow chart of an embedded device upgrade method provided according to a third embodiment of the present disclosure;
FIG. 8 is a flow chart of an embedded device upgrade method provided according to a fourth embodiment of the present disclosure;
fig. 9 is a schematic structural diagram of an embedded device upgrade apparatus provided according to a fifth embodiment of the present disclosure;
fig. 10 is a block diagram of an embedded device used to implement an embedded device upgrade method of an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present disclosure to facilitate understanding, and should be considered as merely exemplary. Accordingly, one of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
It should be noted that, in the technical scheme of the disclosure, the related data processing includes obtaining, storing and applying personal information of the user, which all conform to the rules of related laws and regulations and do not violate the popular regulations of the public order.
For a clear understanding of the technical solutions of the present disclosure, first, the technical solutions of the prior art will be described in detail.
At present, when the embedded equipment is upgraded, a differential upgrading mode is generally adopted. Specifically, the method is a forward differential mode, a reverse differential mode or a combination mode of the forward differential mode and the reverse differential mode.
When forward difference is adopted for upgrading, after the original image file and the target image file are respectively subjected to forward direction blocking, for each target blocking in the target image file, a block write-back operation is required, so that corresponding original blocking in the original image file in the forward direction is cited. As shown in fig. 1, after the original image file and the target image file are respectively subjected to the blocking processing in the forward direction, a plurality of blocks identified as 0-N are provided. For the target partition identified as i, the original partition identified as i has been marked as a non-referenceable partition because it has been subjected to a block write back operation. The target block identified as i can only reference the original blocks identified as i to N in the original image file for differential operations to obtain corresponding differential data. The differential data and the referenced original blocks are then used to generate blocks for upgrade identified as i, and the blocks for upgrade identified as i are substituted for the i-th original block. I.e. a block write back operation identified as i is performed. After all target blocks are subjected to block write-back, restarting the embedded equipment, guiding the blocks used for upgrading after the block write-back is performed, and finishing upgrading of the embedded equipment. In fig. 1, a case is schematically shown in which a target block denoted by 2 refers to an original block denoted by 2 to N in an original image file to perform a differential operation to obtain corresponding differential data. When forward difference is adopted for upgrading, each target block can only depend on the blocks of the original image file in the forward direction. However, for each target block, it is possible to more closely match the forward original block, and it is also possible to more closely match the backward original block, and such a block only referencing the forward direction cannot enable each target block to find the block that is most closely matched, resulting in that the optimal differential data cannot be obtained, and the differential rate is low.
When the reverse difference is adopted for upgrading, the original image file and the target image file are reversed byte by byte respectively, and after the blocking processing in the reverse direction is carried out respectively, the corresponding original blocking in the original image file in the reverse direction is cited for each target blocking in the target image file because the block write-back operation is needed. As shown in fig. 2, after the original image file and the target image file are respectively subjected to the blocking processing in the reverse direction, there are a plurality of blocks identified as 0-N. For the target partition identified as i, the original partition after identified as i is marked as a non-referenceable partition because it has been subjected to a block write back operation. The target block identified as i can only reference the original blocks identified as 0 through i-1 in the original image file for differential operations to obtain the corresponding differential data. And generating a block for upgrading, which is identified as i, by adopting the differential data and the referenced original block, and replacing the i-th original block by the block for upgrading, which is identified as i. I.e. a block write back operation identified as i is performed. After all target blocks are subjected to block write-back, restarting the embedded equipment, guiding the blocks used for upgrading after the block write-back is performed, and finishing upgrading of the embedded equipment. In FIG. 2, a case is schematically shown in which a target block identified as N-1 refers to an original block identified as 0 to N-2 in an original image file for performing a differential operation to obtain corresponding differential data. When upgrading is performed by adopting the reverse difference, each target block can only depend on the blocks of the original image file in the reverse direction. Similar to the principle of forward differencing. For each target block, it is possible to more closely match the forward original block, and it is also possible to more closely match the backward original block, and such referencing only the block in the reverse direction does not enable each target block to find the block that is most closely matched, resulting in that the optimal differential data cannot be obtained, and the differential rate is low.
When the forward difference and the reverse difference are combined for upgrading, after the forward difference is carried out to obtain the difference data corresponding to each target block, the difference data are combined to form a forward difference packet. And obtaining differential data corresponding to each target block by adopting the reverse differential, and combining the differential data to form a reverse differential packet. And comparing the forward differential packet with the reverse differential packet to obtain the minimum differential data packet. And generating a partition for upgrading by adopting the differential data in the minimum differential data packet and the referenced original partition, thereby completing the upgrading of the embedded equipment. Although the upgrade mode has lower differential rate compared with the forward differential or reverse differential upgrade mode, the upgrade mode can occupy smaller space in the embedded equipment. The forward and reverse differencing processes are performed, however, still one-way references to the original partitions. So that the optimal differential data is not obtained, and the differential rate is still low.
The inventor found through creative research that, when facing the technical problems in the prior art, for each target block, the block most closely matched with the target block often appears in the forward original block and the backward original block in the original image file, so that in order to find the block most closely matched, both the forward original block and the backward original block are cited as the original blocks belonging to the original image file, no matter when forward differential or backward differential is performed, in the case that the bidirectional referencing condition is satisfied. And carrying out differential operation on the corresponding target blocks by adopting a plurality of original blocks to obtain differential data. And upgrading the current original blocks of the original image file in the embedded equipment by adopting the current differential data and the corresponding multiple original blocks. Through the differential operation, each target block can find the block which can be approximately matched, so that the optimal differential data can be obtained, and the differential rate is effectively improved.
The inventor proposes the technical scheme of the present disclosure based on the inventive findings. The following describes a network architecture and an application scenario of the embedded device upgrading method provided by the air-interface embodiment.
Fig. 3 is an application scenario schematic diagram of an embedded device upgrade method provided according to the present disclosure. As shown in fig. 3, the network architecture corresponding to the application scenario includes: an embedded device 1 and a server 2. When the embedded device 1 has new user function requirements, new performance improvement requirements, firmware data changes, partition data changes, system changes and the like, the embedded device 1 needs to be upgraded, and the server 2 can actively send an upgrade instruction to the embedded device. The upgrade instruction includes: a target image file. The embedded device may display upgrade hints. After the user agrees to upgrade through the operation interface of the embedded equipment, the embedded equipment is upgraded by adopting the embedded equipment upgrading method provided by the embodiment of the disclosure. To meet new user function requirements or new performance enhancement requirements or to adapt to changed firmware data, changed partition data or changed systems.
Embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings.
Fig. 4 is a flowchart of an embedded device upgrade method according to a first embodiment of the present disclosure, and as shown in fig. 4, an execution body of the embedded device upgrade method provided in the present embodiment is an embedded device upgrade apparatus. The embedded device upgrade apparatus may be located in an embedded device. The embedded device may be a smart phone, a wearable device, a wireless earphone, a sound box, a set top box, a vehicle terminal, etc. The method for upgrading the embedded device provided by the embodiment comprises the following steps:
step 401, performing a first-direction blocking process on the original image file and the target image file respectively.
In this embodiment, the original image file is a file that runs in a system partition of the embedded device and meets various functional requirements of the embedded device. The target image file is an image file that is required when the embedded device is upgraded.
In this embodiment, the original image file may be obtained from a system partition of the embedded device. And acquiring the target image file from a background server corresponding to the embedded equipment. When the target image file is acquired, an image file acquisition request may be sent to the server. The acquisition request includes: identification information of the target image file. And the server acquires the image file corresponding to the identification information as a target image file according to the acquisition request, and sends the target image file to the embedded equipment. Alternatively, as shown in fig. 3, the background server may actively send the target image file to the embedded device.
Specifically, in this embodiment, when the original image file and the target image file are respectively subjected to the blocking processing in the first direction, the original image file and the target image file are respectively divided into the same number of blocks along the first direction according to a preset size. Such as the original image file and the target image file are each blocked into blocks identified as 0 through N. After the original image file is partitioned, each partition is an original partition. After the target image file is partitioned, each partition is a target partition.
The first direction may be a forward direction or a reverse direction.
When the first direction is the reverse direction, it can be understood that before the original image file and the target image file are respectively subjected to the blocking processing in the reverse direction, the original image file and the target image file are respectively subjected to byte-by-byte inversion operation.
Step 402, if it is determined that the current target block in the target image file meets the bidirectional reference condition, obtaining a plurality of original blocks corresponding to the current target block, where the plurality of original blocks include a forward original block and a backward original block, and the plurality of original blocks belong to the original image file.
In this embodiment, for each target block in the target image file, processing is performed sequentially according to the first direction. And judging whether the bidirectional reference condition is met or not according to the current target block in the target image file. And if the bidirectional reference condition is determined to be met, acquiring a plurality of original blocks including at least one forward original block and at least one backward original block in the original image file, and referencing the plurality of original blocks to perform differential operation on the current target block.
Wherein the forward original block is an original block before the current original block in the same position as the current target block. The backward original block is an original block after the current original block in the same position as the current target block.
For example, for a current target tile identified as i, in the case where the current target tile i satisfies the bi-directional reference condition, a plurality of original tiles identified as i-k through i+h are acquired as original tiles referenced by the current target tile identified as i. Wherein k >0, h >0. The values of k and h may be the same or different.
And step 403, performing a first differential operation on the corresponding current target block by adopting a plurality of original blocks to obtain current first differential data.
The first differential operation is a differential operation performed on a current target block when the target image file is subjected to block processing in a first direction, and the obtained differential data is first differential data.
Specifically, in this embodiment, a differential algorithm may be used to perform a first differential operation on the corresponding current target partition according to the plurality of original partitions. Current first differential data is obtained.
The differential algorithm may be bsdiff, hpatchdiff, xdelta, etc., which is not limited in this embodiment.
In this embodiment, a current target block and a plurality of referenced original blocks are respectively input into a differential algorithm, the differential algorithm performs a first differential operation on the corresponding current target block based on the plurality of original blocks, determines corresponding current first differential data, and outputs the current first differential data.
And step 404, upgrading the current original partition of the original image file in the embedded device by adopting the current first differential data and the corresponding plurality of original partitions.
In this embodiment, the current first differential data and the corresponding plurality of original blocks are combined to obtain a current upgrade block capable of replacing the current original block. And replacing the current original block with the current upgrading block, namely performing block write-back operation, and further completing upgrading of the current original block after restarting the embedded equipment.
According to the embedded equipment upgrading method provided by the embodiment, the original image file and the target image file are subjected to block processing in the first direction respectively; if the current target block in the target image file meets the bidirectional reference condition, acquiring a plurality of original blocks corresponding to the current target block, wherein the original blocks comprise forward original blocks and backward original blocks, and the original blocks belong to the original image file; performing first differential operation on the corresponding current target block by adopting a plurality of original blocks to obtain current first differential data; and upgrading the current original partition of the original image file in the embedded equipment by adopting the current first differential data and the corresponding plurality of original partitions. Because under the condition that the bidirectional reference condition is met, the multiple original blocks which belong to the original image file and comprise the forward original blocks and the backward original blocks are referenced to perform differential operation on the current target block so as to obtain differential data. Therefore, the most approximately matched partition can be found, the optimal differential data can be obtained, and the differential rate is effectively improved.
Fig. 5 is a flowchart of an embedded device upgrade method according to a second embodiment of the present disclosure, and as shown in fig. 5, the embedded device upgrade method according to the present embodiment further refines steps 402 and 404 and further includes other steps on the basis of the embedded device upgrade method provided in the previous embodiment, and then the embedded device upgrade method provided in the present embodiment includes the following steps:
step 501, the original image file and the target image file are respectively subjected to blocking processing in the first direction.
In this embodiment, the implementation manner of step 501 is similar to that of step 401 in the first embodiment, and will not be described in detail here.
Step 502, judging whether the current target block in the target image file meets the bidirectional reference condition, if yes, executing step 503, otherwise executing step 508.
In this embodiment, determining whether the current target partition in the target image file satisfies the bidirectional reference condition may specifically be determining whether the current target partition is a head-to-tail target partition of the target image file. If the current target block is determined to be the head-to-tail target block, the bidirectional reference condition is determined not to be met, otherwise, the bidirectional reference condition is determined to be met.
Specifically, since the first target block and the last target block in the target image file can only reference the unidirectional original block in the original image file, the bidirectional reference condition is not satisfied. The middle target blocks except the head target block and the tail target block in the target image file can refer to the forward original block in the original image file and the backward original block in the original image file, so that the bidirectional reference condition is met.
Step 503, determining whether the first direction is a forward direction, if so, executing step 504, otherwise executing step 505.
In this embodiment, if it is determined that the current target block satisfies the bidirectional reference condition, that is, the current target block is an intermediate target block except for the head-to-tail target block, it is determined whether the direction in which the original image file and the target image file are respectively blocked is the forward direction.
Step 504, at least one forward original partition corresponding to the current target partition is obtained from the preset reference space, and the current original partition and at least one backward original partition corresponding to the current target partition are obtained from the original image file.
In this embodiment, if it is determined that the direction in which the original image file and the target image file are respectively partitioned is the forward direction, when a plurality of original partitions corresponding to the current target partition are acquired, since the forward original partition in the original image file in the plurality of original partitions is already in an unavailable state due to the block write-back operation, the forward original partition is written into the preset reference space for storage before the block write-back operation is performed on the forward original partition. And further acquiring at least one forward original partition corresponding to the current target partition from a preset reference space. The current original block and the backward original block in the original image file are in available states, so that the current original block and at least one backward original block corresponding to the current target block are obtained from the original image file.
For the current target block identified as i, the k forward original blocks corresponding to the current target block are obtained from a preset reference space, and the current original block identified as i and the h backward original blocks are obtained from the original image file. The number of backward original blocks may be all backward original blocks. I.e. h=n-i. N is the number of target blocks. k may be a preset number or a number of all forward original partitions stored in a preset reference space.
As shown in fig. 6a, for the current target partition identified as 2, forward original partitions identified as 0 and 1 are stored in the preset reference space, and then the forward original partitions identified as 0 and 1 are acquired from the preset reference space. The current original block identified as 2 and the backward original block identified as 3 to N are obtained from the original image file. As shown in fig. 6b, for the target partition identified as 3, forward original partitions identified as 1 and 2 are stored in the preset reference space, and then the forward original partitions identified as 1 and 2 are acquired from the preset reference space. The current original block identified as 3 and the backward original block identified as 4 to N are obtained from the original image file.
According to the embedded equipment upgrading method provided by the embodiment, when the first direction is the forward direction, a plurality of original blocks corresponding to the current target block are obtained, wherein the plurality of original blocks comprise forward original blocks and backward original blocks, and the method comprises the following steps: acquiring at least one forward original partition corresponding to the current target partition from a preset reference space; and acquiring a current original block and at least one backward original block corresponding to the current target block from the original image file. The forward original partition can be stored into the preset reference space before the forward original partition is unavailable, so that at least one forward original partition corresponding to the current target partition can be obtained from the preset reference space for the current target partition, and the bidirectional reference requirement in the forward difference can be met.
Step 505, obtaining a current original block and at least one forward original block corresponding to the current target block from the original image file, and obtaining at least one backward original block corresponding to the current target block from a preset reference space.
In this embodiment, if it is determined that the directions of performing the block processing on the original image file and the target image file are opposite directions, when a plurality of original blocks corresponding to the current target block are acquired, since a backward original block in the original image file in the plurality of original blocks is already in an unavailable state due to the block write-back operation, before the block write-back operation is performed on the backward original block, the backward original block is written into a preset reference space for storage. And further acquiring at least one backward original partition corresponding to the current target partition from a preset reference space. The current original block and the forward original block in the original image file are in available states, so that the current original block and at least one forward original block corresponding to the current target block are obtained from the original image file.
For the current target block identified as i, the k backward original blocks corresponding to the current target block are obtained from a preset reference space, and the current original block identified as i and the h forward original blocks are obtained from the original image file. The number of forward raw partitions may be all forward raw partitions, similar to that in step 504. I.e. h=n-i. N is the number of target blocks. k may be a preset number or a number of all backward original partitions stored in a preset reference space.
In the method for upgrading embedded equipment provided in the embodiment, when the second direction is the reverse direction, a plurality of original blocks corresponding to the current target block are obtained, wherein the plurality of original blocks include a forward original block and a backward original block, and the method includes: acquiring a current original block and at least one forward original block corresponding to a current target block from an original image file; and acquiring at least one backward original partition corresponding to the current target partition from a preset reference space. The backward original partition can be stored in the preset reference space before the backward original partition is unavailable, so that at least one backward original partition corresponding to the current target partition can be obtained from the preset reference space for the current target partition, and the requirement of bidirectional reference in the process of reverse difference can be met.
And step 506, performing a first differential operation on the corresponding current target block by using the plurality of original blocks to obtain current first differential data.
In this embodiment, the implementation manner of step 506 is similar to that of step 403 in the first embodiment, and will not be described in detail here.
And step 507, upgrading the current original blocks of the original image file in the embedded device by adopting the current first differential data and the corresponding plurality of original blocks.
In this embodiment, the current first differential data and the corresponding multiple original blocks are combined to obtain a current upgrade block; and replacing the current original block with the current upgrading block to finish upgrading of the current original block.
After the current original block is replaced by the current upgrading block, judging whether all original blocks are replaced by the corresponding upgrading blocks, if so, indicating that the block write-back operation of all target blocks meeting the bidirectional reference condition is completed, and further, after the embedded equipment is restarted, upgrading all target blocks meeting the bidirectional reference condition can be completed.
Step 508, determining whether the forward original partition or the backward original partition is stored in the preset reference space, if yes, executing step 509, otherwise executing step 512.
In this embodiment, if it is determined that the current target block does not meet the bidirectional reference condition, that is, when the current target block meets the unidirectional reference condition, it is determined whether a forward original block or a backward original block is stored in the preset reference space. If the forward original block is stored in the preset reference space, the current target block is the last target block and the first direction is the forward direction. If the backward partitions are stored in the preset reference space, the current target partition is the first partition, and the first direction is the reverse direction.
Illustratively, the last target tile in the forward direction is the target tile identified as N. The first target tile in the reverse direction is the target tile identified as 0.
Step 509, obtaining at least one forward original partition or at least one backward original partition corresponding to the current target partition from the preset reference space, and obtaining the current original partition corresponding to the current target partition from the original image file.
In this embodiment, for the last target block whose first direction is the forward direction, before the block write-back operation is not performed on the forward original block, the forward original block is written into the preset reference space for storage. At least one forward original partition corresponding to the current target partition is acquired from the preset reference space. And for the first target block with the first direction being the reverse direction, writing the backward original block into a preset reference space for storage before performing no block write-back operation on the backward original block. At least one backward raw partition corresponding to the current target partition is acquired from the preset reference space. And whether the first direction is a forward direction or a reverse direction, acquiring a current original block corresponding to the current target block from the original image file.
And 510, performing a first differential operation on the corresponding current target block by adopting the forward original block or the backward original block and the current original block to obtain current first differential data.
In this embodiment, for the last target block in the forward direction, at least one forward original block and the current original block are referenced when performing the differential operation. And for the first target block in the reverse direction, at least one backward original block and the current original block are referenced when the differential operation is performed. Compared with the forward direction difference or the reverse direction difference in the prior art, only one original block is referenced, the block which can be matched approximately can be found, and further, the optimal difference data of the last target block in the forward direction or the first target block in the reverse direction can be obtained, and the difference rate of the target block in the position is effectively improved.
In step 511, the current original block of the original image file in the embedded device is updated by using the current first differential data, the forward original block or the backward original block.
In this embodiment, for the forward direction, the current first differential data, the forward original partition and the current original partition are used to upgrade the current original partition of the original image file in the embedded device. And for the reverse direction, upgrading the current original partition of the original image file in the embedded equipment by adopting the current first differential data, the reverse original partition and the current original partition.
Step 512, obtaining the unidirectional original block corresponding to the current target block from the original image file.
In this embodiment, if it is determined that the forward original block or the backward original block is not stored in the preset reference space, it is indicated that the current target block is the first target block in the forward direction or the last target block in the reverse direction. Then for the first target block in the forward direction or the last target block in the reverse direction, the unidirectional original block corresponding to the current target block is obtained from the original image file since there is no forward original block or backward original block in front of it.
Wherein for the first target tile in the forward direction, the unidirectional original tile includes all original tiles identified as 0 through N. For the last target tile in the reverse direction, the unidirectional original tile includes all original tiles identified as 0 through N-1
In step 513, a first differential operation is performed on the corresponding current target block by using the unidirectional original block, so as to obtain current first differential data.
And step 514, upgrading the current original block of the original image file in the embedded device by adopting the current first differential data and the unidirectional original block.
In this embodiment, the current target block is to refer to the unidirectional original block. The current target block in steps 403-404 refers to a plurality of original blocks, but the specific implementation is similar, and will not be described in detail herein.
According to the embedded equipment upgrading method provided by the embodiment, when the fact that the current target block in the target image file does not meet the bidirectional reference condition is determined, and the forward original block or the backward original block is not stored in the preset reference space, the unidirectional original block corresponding to the current target block is obtained from the original image file; performing first differential operation on the corresponding current target block by adopting the unidirectional original block so as to obtain current first differential data; and upgrading the current original partition of the original image file in the embedded equipment by adopting the current first differential data and the unidirectional original partition. Because the current target block in this case is only the first target block in the forward direction or the last target block in the reverse direction, even if the reference of the unidirectional original block is performed during the differential operation, all the original blocks or most of the original blocks can be referenced, so that the block which can be most approximately matched can be found, further, the optimal differential data can be obtained, and the differential rate of the first target block or the last target block is effectively improved.
In an optional implementation manner, in the method for upgrading an embedded device provided in the second embodiment, in step 504, step 505 or step 509, at least one forward original partition or at least one backward original partition corresponding to a current target partition is obtained from a preset reference space, and specifically includes:
acquiring all original blocks from a preset reference space; all original partitions are determined as at least one forward original partition or at least one backward original partition corresponding to the current target partition.
Specifically, in this embodiment, since the storage space of the embedded device is limited, the forward original blocks or backward original blocks corresponding to all the current target blocks cannot be stored in the preset reference space infinitely, and only a limited number of forward original blocks or backward original blocks can be stored. Therefore, in order to enable the current target block to be more approximately matched with the original block, the difference rate of the current target block is further improved, and all original blocks stored in the preset reference space are determined to be corresponding forward original blocks or backward original blocks so as to conduct difference operation with the corresponding current target block.
Fig. 7 is a flowchart of an embedded device upgrade method according to a third embodiment of the present disclosure, as shown in fig. 7, in this embodiment, before step 404 or step 507, the method further includes the following steps:
Step 701, storing the current original block into a preset reference space.
Step 702, marking the current original block in the original image file as unavailable.
Specifically, in this embodiment, after determining the current differential data corresponding to the current target block, in order to prevent the current original block from being unavailable due to the block write-back operation, the current original block is stored into the preset reference space before the current target block is upgraded. And marking the current original block in the original image file as an unavailable state. And then upgrading the current target block. After the current original block is stored in the preset reference space, the forward original block or the backward original block stored in the preset reference space can be referenced when the differential data corresponding to the subsequent target block is determined. And when the subsequent target block is upgraded, referencing the forward original block or the backward original block stored in the preset reference space. Therefore, the current original block is stored in the preset reference space, and the current original block can be effectively prevented from being covered. When the subsequent target block is subjected to differential operation and upgrading, the corresponding forward original block or backward original block is smoothly referenced.
As an alternative implementation manner, in this embodiment, step 701 includes the following steps:
step 701a, judging whether the size of the remaining space in the preset reference space is larger than or equal to the size of the current original block, if yes, executing step 701b, otherwise executing step 701c.
Step 701b, storing the current original partition into a preset reference space.
In step 701c, the original block stored in the preset reference space first is deleted according to the first-in first-out policy, and the current original block is stored in the preset reference space.
Specifically, in the present embodiment, since the storage space of the preset reference space is limited. And judging whether the size of the residual space in the preset reference space is larger than or equal to the size of the current original block when the current original block is stored in the preset reference space, if so, indicating that enough residual space is used for storing the current original block, and storing the current original block in the preset reference space. If not, it is indicated that there is insufficient remaining space to store the current original chunk. Then, in order to make the subsequent target block capable of referencing the forward original block or the backward original block as close as possible to the corresponding original block, deleting the original block stored first in the preset reference space according to the first-in first-out strategy, and storing the current original block in the preset reference space.
For example, as shown in fig. 6a and 6b, when the preset reference space can only store 2 original blocks, the original blocks with the number of 0 are deleted and the original blocks with the number of 2 are stored into the preset reference space since the original blocks with the number of 2 cannot be stored any more in the residual space.
According to the embedded equipment upgrading method provided by the embodiment, when the current original block is stored in the preset reference space, whether the size of the residual space in the preset reference space is larger than or equal to the size of the current original block is judged; and if the size of the residual space is determined to be larger than or equal to the size of the current original block, storing the current original block into a preset reference space. The size of the residual space is smaller than the size of the current original partition, and the original partition which is firstly stored in the preset reference space is deleted according to a first-in first-out strategy; storing the current original block into a preset reference space. Under the condition that the storage space of the preset reference space is limited, the forward original block or the backward original block nearest to the current target block can be stored in the preset reference space as much as possible, and the difference rate of the difference data corresponding to the current target block can be improved.
As an alternative implementation manner, in this embodiment, before step 701, determining an additional storage space in the embedded device is further included; and determining the additional storage space as a preset reference space.
Detecting whether an idle storage space with a preset size exists in the embedded equipment or not when the additional storage space is determined in the embedded equipment;
if the free storage space with the preset size exists, the free storage space is determined to be the additional storage space. If the fact that the free storage space with the preset size does not exist is determined, determining the priority of the stored data in the embedded equipment; deleting the data with the lowest priority to expand the idle storage space with the preset size; the free memory is determined to be additional memory.
Specifically, in this embodiment, since the storage space of the embedded device is limited, when determining the preset reference space, it is necessary to detect a free storage space of a preset size from the embedded device as an additional storage space, and further determine the additional storage space as the preset reference space. But there are cases where no additional storage space is detected when upgrading the embedded device. It is necessary to open up this portion of the free space of a preset size. Specifically, the data with the lowest priority is deleted, and the data is used as a preset reference space after the idle storage space with the preset size is expanded, so that the smooth progress of the upgrading of the embedded equipment is ensured.
Fig. 8 is a flow chart of an upgrade method of an embedded device according to a fourth embodiment of the present disclosure, as shown in fig. 8, where the upgrade method of an embedded device according to the present embodiment is further applicable to an upgrade mode combining forward differential and reverse differential, and the upgrade method of an embedded device according to the present embodiment further includes the following steps:
in step 801, if it is determined that all the target blocks have corresponding first differential data, then all the first differential data are combined to form a first differential data packet.
In this embodiment, it is determined whether all target blocks of the target image file have corresponding first differential data, if so, all the first differential data are combined, and the formed differential data packet is a first differential data packet.
Step 802, obtaining a second differential data packet between the original image file and the target image file.
The second differential data packet is formed by combining a plurality of second differential data, wherein the current second differential data is differential data between the current target block and a plurality of corresponding original blocks after the target image file and the original image file are subjected to block processing in a second direction.
In this embodiment, the server may perform the second-direction blocking processing on the original image file and the target image file in a similar manner to any one of the embodiments above, to obtain a plurality of original blocks corresponding to the current target divided data, and further perform the second differential operation on the corresponding current target block by using the plurality of original blocks, so as to obtain the current second differential data, and perform the merging operation on all the second differential data to form the second differential data packet.
Step 803, the first differential data packet and the second differential data packet are compared to obtain a minimum differential data packet.
Specifically, in this embodiment, the first differential data packet and the second differential data packet are compared in size, and the minimum differential data packet in the first differential data packet and the second differential data packet is determined.
Step 804, if it is determined that the minimum differential data packet is the first differential data packet, upgrading the current original partition of the original image file in the embedded device by using the current differential data in the first differential data packet and the corresponding plurality of original partitions.
And step 805, if the minimum differential data packet is determined to be the second differential data packet, upgrading the current original partition of the original image file in the embedded device by using the current differential data in the second differential data packet and the corresponding plurality of original partitions.
When the first direction is the forward direction, the first differential data packet is the forward differential data packet. The second direction is a reverse direction, and the second differential data packet is a reverse differential data packet. Conversely, when the first direction is the reverse direction, the first differential data packet is the reverse differential data packet. The second direction is a forward direction, and the second differential data packet is a forward differential data packet.
In this embodiment, after the minimum differential data packet is selected from the first differential data packet and the second differential data packet, if the minimum differential data packet is the first differential data packet, when upgrading the embedded device, the current differential data in the first differential data packet and the corresponding multiple original blocks are used to upgrade the current original blocks of the original image file in the embedded device. And if the minimum differential data packet is the second differential data packet, upgrading the current original block of the original image file in the embedded equipment by adopting the current differential data in the second differential data packet and the corresponding plurality of original blocks. The differential rate can be further improved.
As an alternative implementation, in this embodiment, step 802 includes the following steps:
step 802a, a differential data packet acquisition request is sent to a server, where the acquisition request includes differential data packet identification information.
Step 802b, receiving a second differential data packet sent by the server.
In this embodiment, the second direction differential operation is performed by the server in a similar manner to any one of the embodiments, and by sending a differential data packet obtaining request to the server, the embedded device may obtain a corresponding second differential data packet from the server, so that the server side may perform the second direction differential operation, and further may smoothly perform the method for upgrading the combination of the forward direction differential and the reverse direction differential in the above embodiment in the embedded device.
Fig. 9 is a schematic structural diagram of an embedded device upgrade apparatus provided according to a fifth embodiment of the present disclosure, and as shown in fig. 9, an embedded device upgrade apparatus 900 provided in the present embodiment includes: a block processing unit 901, a block acquisition unit 902, a differential operation unit 903, and an upgrade unit 904.
The blocking processing unit 901 is configured to perform blocking processing in a first direction on the original image file and the target image file respectively. The block obtaining unit 902 is configured to obtain a plurality of original blocks corresponding to a current target block if it is determined that the current target block in the target image file meets the bidirectional reference condition, where the plurality of original blocks include a forward original block and a backward original block, and the plurality of original blocks all belong to the original image file. The differential operation unit 903 is configured to perform a first differential operation on the current target partition corresponding to the plurality of original partition pairs, so as to obtain current first differential data. And the upgrading unit 904 is configured to upgrade the current original partition of the original image file in the embedded device by using the current first differential data and the corresponding multiple original partitions.
The embedded device upgrading apparatus provided in this embodiment may execute the technical scheme of the method embodiment shown in fig. 4, and its implementation principle and technical effects are similar to those of the method embodiment shown in fig. 4, and are not described in detail herein.
Optionally, the first direction is a forward direction; accordingly, the block acquisition unit 902 includes: the device comprises a first block acquisition module and a second block acquisition module.
The first block acquisition module is used for acquiring at least one forward original block corresponding to the current target block from a preset reference space. And the second block acquisition module is used for acquiring the current original block and at least one backward original block corresponding to the current target block from the original image file.
Optionally, the second direction is a reverse direction; in response to this, the control unit,
the block acquisition unit 902 includes: the system comprises a third block acquisition module and a fourth block acquisition module.
The third block obtaining module is used for obtaining a current original block and at least one forward original block corresponding to the current target block from the original image file. And the fourth block acquisition module is used for acquiring at least one backward original block corresponding to the current target block from the preset reference space.
Optionally, the block obtaining unit 902 is further configured to, if it is determined that the current target block in the target image file does not meet the bidirectional reference condition, obtain, from the preset reference space, at least one forward original block or at least one backward original block corresponding to the current target block if it is determined that the forward original block or the backward original block is stored in the preset reference space, and obtain, from the original image file, the current original block corresponding to the current target block. The difference operation unit 903 is further configured to perform a first difference operation on the corresponding current target block by using the forward original block or the backward original block and the current original block, so as to obtain current first difference data. The upgrading unit 904 is further configured to upgrade a current original partition of the original image file in the embedded device by using the current first differential data, the forward original partition, or the backward original partition.
Optionally, the block obtaining unit 902 is further configured to obtain, if it is determined that the forward original block or the backward original block is not stored in the preset reference space, a unidirectional original block corresponding to the current target block from the original image file. The differential operation unit 903 is further configured to perform a first differential operation on the corresponding current target partition by using the unidirectional original partition pair, so as to obtain current first differential data. The upgrading unit 904 is further configured to upgrade the current original partition of the original image file in the embedded device by using the current first differential data and the unidirectional original partition.
Optionally, the block obtaining unit 902 is specifically configured to obtain all original blocks from a preset reference space; all original partitions are determined as at least one forward original partition or at least one backward original partition corresponding to the current target partition.
Optionally, the embedded device upgrading apparatus provided in this embodiment further includes: a block storage unit and a status marking unit.
The block storage unit is used for storing the current original block into a preset reference space. And the state marking unit is used for marking the current original block in the original image file as an unavailable state.
Optionally, the block storage unit includes: the device comprises a space judging module and a first block storage module.
The space judging module is used for judging whether the size of the residual space in the preset reference space is larger than or equal to the size of the current original partition. The first block storage module is used for storing the current original block into a preset reference space if the size of the residual space is larger than or equal to the size of the current original block.
Optionally, the embedded device upgrading apparatus provided in this embodiment further includes: the block deleting module and the second block storing module.
And the block deleting module is used for deleting the original block which is firstly stored in the preset reference space according to a first-in first-out strategy if the size of the residual space is smaller than the size of the current original block. And the second block storage module is used for storing the current original block into a preset reference space.
Optionally, the embedded device upgrading apparatus provided in this embodiment further includes: a first space determining unit, a second space determining unit.
The first space determining unit is used for determining the extra storage space in the embedded device. And a second space determining unit for determining the additional storage space as a preset reference space.
Optionally, the first space determining unit includes: the device comprises a space detection module and a space determination module.
The space detection module is used for detecting whether the idle storage space with a preset size exists in the embedded equipment. And the space determining module is used for determining the free storage space as the extra storage space if the free storage space with the preset size exists.
Optionally, the space determination module includes: the system comprises a priority determining sub-module, a data deleting sub-module and a space determining sub-module.
The priority determining submodule is used for determining the priority of the stored data in the embedded equipment if the fact that the idle storage space with the preset size does not exist is determined. And the data deleting sub-module is used for deleting the data with the lowest priority so as to expand the idle storage space with the preset size. And the space determination submodule is used for determining the free storage space as the extra storage space.
Optionally, the upgrade unit includes: the block merging module and the block replacing module.
The block merging module is used for merging the current first differential data and the corresponding plurality of original blocks to obtain the current upgrading block. And the block replacement module is used for replacing the current original block with the current upgrading block so as to complete the upgrading of the current original block.
Optionally, the embedded device upgrading apparatus provided in this embodiment further includes: the system comprises a block merging unit, a data packet acquisition unit and a data packet comparison unit.
And the block merging unit is used for merging all the first differential data to form a first differential data packet if determining that all the target blocks have the corresponding first differential data. The data packet acquisition unit is used for acquiring a second differential data packet between the original image file and the target image file; the second differential data packet is formed by combining a plurality of second differential data, wherein the current second differential data is differential data between the current target block and a plurality of corresponding original blocks after the target image file and the original image file are subjected to block processing in a second direction. And the data packet comparison unit is used for comparing the first differential data packet with the second differential data packet so as to obtain a minimum differential data packet.
Optionally, the upgrading unit is specifically configured to upgrade, if it is determined that the minimum differential data packet is the first differential data packet, the current original partition of the original image file in the embedded device by using the current differential data in the first differential data packet and the corresponding multiple original partitions.
Optionally, the upgrading unit is specifically configured to upgrade, if it is determined that the minimum differential data packet is the second differential data packet, the current original partition of the original image file in the embedded device by using the current differential data in the second differential data packet and the corresponding multiple original partitions.
Optionally, the data packet acquiring unit includes: a request sending module and a data packet receiving module.
The request sending module is used for sending a differential data packet acquisition request to the server, wherein the acquisition request comprises differential data packet identification information. And the data packet receiving module is used for receiving the second differential data packet sent by the server.
The technical scheme of the method embodiment shown in fig. 5 and fig. 7 to fig. 8 may be executed by the embedded device upgrading apparatus provided in this embodiment, and the implementation principle and the technical effect are similar to those of the method embodiment shown in fig. 5 and fig. 7 to fig. 8, and are not described in detail herein.
According to embodiments of the present disclosure, the present disclosure also provides an embedded device, a readable storage medium, and a computer program product.
According to an embodiment of the present disclosure, the present disclosure also provides a computer program product comprising: computer program stored in a readable storage medium, from which the computer program can be read by at least one processor of an embedded device, the at least one processor executing the computer program causing an electronic device to perform the solution provided by any one of the embodiments described above.
Fig. 10 is a block diagram of an embedded device used to implement an embedded device upgrade method of an embodiment of the present disclosure. As shown in fig. 10, the embedded device 1000 may represent various forms of mobile apparatuses, such as personal digital processing, cellular telephones, smart phones, wearable devices, and other similar computing apparatuses. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 10, the embedded device 1000 includes a computing unit 1001 that can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM) 1002 or a computer program loaded from a storage unit 1008 into a Random Access Memory (RAM) 1003. In the RAM 1003, various programs and data required for the operation of the device 1000 can also be stored. The computing unit 1001, the ROM 1002, and the RAM 1003 are connected to each other by a bus 1004. An input/output (I/O) interface 1005 is also connected to bus 1004.
Various components in device 1000 are connected to I/O interface 1005, including: an input unit 1006 such as a keyboard, a mouse, and the like; an output unit 1007 such as various types of displays, speakers, and the like; a storage unit 1008 such as a magnetic disk, an optical disk, or the like; and communication unit 1009 such as a network card, modem, wireless communication transceiver, etc. Communication unit 1009 allows embedded device 1000 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunications networks.
The computing unit 1001 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of computing unit 1001 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 1001 performs the respective methods and processes described above, for example, the traffic light recognition result processing method. For example, in some embodiments, the traffic light recognition result processing method may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as the storage unit 1008. In some embodiments, part or all of the computer program may be loaded and/or installed onto device 1000 via ROM 1002 and/or communication unit 1009. When the computer program is loaded into RAM 1003 and executed by computing unit 1001, one or more steps of the neural network model training method for network congestion control described above may be performed. Alternatively, in other embodiments, the computing unit 1001 may be configured to perform the neural network model training method for network congestion control in any other suitable way (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for carrying out methods of the present disclosure may be written in any combination of one or more programming languages. These program code may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus such that the program code, when executed by the processor or controller, causes the functions/operations specified in the flowchart and/or block diagram to be implemented. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and pointing device (e.g., a mouse or trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), and the internet.
The computer system may include a client and a server. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service ("Virtual Private Server" or simply "VPS") are overcome. The server may also be a server of a distributed system or a server that incorporates a blockchain.
The present disclosure provides an embedded device upgrade method, apparatus, device, medium, and program product, which are applied to a system upgrade technology in the field of computer technology. Because under the condition that the bidirectional reference condition is met, the multiple original blocks which belong to the original image file and comprise the forward original blocks and the backward original blocks are referenced to perform differential operation on the current target block so as to obtain differential data. Therefore, the most approximately matched partition can be found, the optimal differential data can be obtained, and the differential rate is effectively improved.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps recited in the present application may be performed in parallel or sequentially or in a different order, provided that the desired results of the disclosed embodiments are achieved, and are not limited herein.
The above detailed description should not be taken as limiting the scope of the present disclosure. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present disclosure are intended to be included within the scope of the present disclosure.

Claims (36)

1. An embedded device upgrade method, comprising:
the original image file and the target image file are respectively subjected to block processing in a first direction;
if the current target block in the target image file meets the bidirectional reference condition, acquiring a plurality of original blocks corresponding to the current target block, wherein the original blocks comprise forward original blocks and backward original blocks, and the original blocks belong to the original image file;
performing first differential operation on the corresponding current target block by adopting the plurality of original blocks to obtain current first differential data;
and upgrading the current original partition of the original image file in the embedded equipment by adopting the current first differential data and the corresponding multiple original partitions.
2. The method of claim 1, wherein the first direction is a forward direction;
the obtaining a plurality of original blocks corresponding to the current target block, wherein the original blocks comprise a forward original block and a backward original block, and the method comprises the following steps:
acquiring at least one forward original partition corresponding to the current target partition from a preset reference space;
and acquiring a current original block and at least one backward original block corresponding to the current target block from the original image file.
3. The method of claim 1, wherein the second direction is a reverse direction;
the obtaining a plurality of original blocks corresponding to the current target block, wherein the plurality of original blocks comprise a forward original block and a backward original block, and the method comprises the following steps:
acquiring a current original block and at least one forward original block corresponding to the current target block from an original image file;
and acquiring at least one backward original partition corresponding to the current target partition from a preset reference space.
4. A method according to any of claims 1-3, further comprising, if it is determined that the current target chunk in the target image file does not meet the bi-directional reference condition:
if it is determined that the forward original block or the backward original block is stored in the preset reference space, at least one forward original block or at least one backward original block corresponding to the current target block is obtained from the preset reference space, and the current original block corresponding to the current target block is obtained from the original image file;
performing first differential operation on the corresponding current target block by adopting the forward original block or the backward original block and the current original block to obtain current first differential data;
And upgrading the current original block of the original image file in the embedded equipment by adopting the current first differential data, the forward original block or the backward original block and the current original block.
5. The method of claim 4, further comprising, if it is determined that no forward original chunk or no backward original chunk is stored in the preset reference space:
acquiring unidirectional original blocks corresponding to the current target blocks from the original image file;
performing first differential operation on the corresponding current target block by adopting the unidirectional original block to obtain current first differential data;
and upgrading the current original partition of the original image file in the embedded equipment by adopting the current first differential data and the unidirectional original partition.
6. The method according to any one of claims 2-3, 5, wherein obtaining at least one forward original partition or at least one backward original partition corresponding to the current target partition from a preset reference space comprises:
acquiring all original blocks from the preset reference space;
and determining all original blocks as at least one forward original block or at least one backward original block corresponding to the current target block.
7. The method of any of claims 2-3, 5, further comprising:
storing the current original block into a preset reference space;
the current original block in the original image file is marked as unavailable.
8. The method of claim 7, wherein the storing the current original chunk into the preset reference space comprises:
judging whether the size of the residual space in the preset reference space is larger than or equal to the size of the current original partition;
and if the size of the residual space is larger than or equal to the size of the current original block, storing the current original block into a preset reference space.
9. The method of claim 8, if it is determined that the remaining space size is smaller than the size of the current original chunk, further comprising:
deleting the original partition firstly stored in a preset reference space according to a first-in first-out strategy;
storing the current original block into a preset reference space.
10. The method of claim 8 or 9, further comprising:
determining additional storage space in the embedded device;
and determining the additional storage space as a preset reference space.
11. The method of claim 10, wherein the determining additional storage space in the embedded device comprises:
Detecting whether an idle storage space with a preset size exists in the embedded equipment;
and if the free storage space with the preset size exists, determining the free storage space as an additional storage space.
12. The method of claim 11, if it is determined that there is no free storage space of a preset size, further comprising:
determining the priority of stored data in the embedded device;
deleting the data with the lowest priority to expand the idle storage space with the preset size;
the free storage space is determined to be additional storage space.
13. The method of any of claims 1-3, 5, 8-9, 11-12, the upgrading the current original partition of the original image file in the embedded device with the current first differential data and the corresponding plurality of original partitions, comprising:
combining the current first differential data and a plurality of corresponding original blocks to obtain a current upgrading block;
and replacing the current upgrading block with the current original block to finish upgrading of the current original block.
14. The method of any one of claims 1-3, 5, 8-9, 11-12, further comprising:
If all the target blocks are determined to have the corresponding first differential data, combining all the first differential data to form a first differential data packet;
acquiring a second differential data packet between the original image file and the target image file; the second differential data packet is formed by combining a plurality of second differential data, the current second differential data is differential data between the current target block and a plurality of corresponding original blocks after the target image file and the original image file are subjected to block processing in a second direction;
and comparing the first differential data packet with the second differential data packet to obtain a minimum differential data packet.
15. The method of claim 14, the upgrading the current original partition of the original image file in the embedded device using the current first differential data and the corresponding plurality of original partitions, comprising:
and if the minimum differential data packet is determined to be the first differential data packet, upgrading the current original partition of the original image file in the embedded equipment by adopting the current differential data in the first differential data packet and the corresponding plurality of original partitions.
16. The method of claim 14, further comprising, if the minimum differential packet is determined to be the second differential packet:
And upgrading the current original partition of the original image file in the embedded equipment by adopting the current differential data in the second differential data packet and a plurality of corresponding original partitions.
17. The method of claim 14, the obtaining a second differential data packet between the original image file and the target image file, comprising:
sending a differential data packet acquisition request to a server, wherein the acquisition request comprises differential data packet identification information;
and receiving the second differential data packet sent by the server.
18. An embedded device upgrade apparatus, comprising:
the blocking processing unit is used for respectively carrying out blocking processing in a first direction on the original image file and the target image file;
the block acquisition unit is used for acquiring a plurality of original blocks corresponding to the current target block if the current target block in the target image file meets the bidirectional reference condition, wherein the original blocks comprise forward original blocks and backward original blocks, and the original blocks belong to the original image file;
the differential operation unit is used for performing first differential operation on the current target blocks corresponding to the plurality of original block pairs to obtain current first differential data;
And the upgrading unit is used for upgrading the current original partition of the original image file in the embedded equipment by adopting the current first differential data and the corresponding plurality of original partitions.
19. The apparatus of claim 18, wherein the first direction is a forward direction;
the block acquisition unit includes:
the first block acquisition module is used for acquiring at least one forward original block corresponding to the current target block from a preset reference space;
and the second block acquisition module is used for acquiring the current original block and at least one backward original block corresponding to the current target block from the original image file.
20. The apparatus of claim 18, wherein the second direction is a reverse direction;
the block acquisition unit includes:
the third block acquisition module is used for acquiring a current original block and at least one forward original block corresponding to the current target block from the original image file;
and the fourth block acquisition module is used for acquiring at least one backward original block corresponding to the current target block from a preset reference space.
21. The apparatus according to any one of claims 18-20, the block obtaining unit is further configured to, if it is determined that the current target block in the target image file does not meet the bidirectional reference condition, obtain at least one forward original block or at least one backward original block corresponding to the current target block from the preset reference space if it is determined that the forward original block or the backward original block is stored in the preset reference space, and obtain the current original block corresponding to the current target block from the original image file;
The differential operation unit is further configured to perform a first differential operation on the corresponding current target block by using the forward original block or the backward original block and the current original block, so as to obtain current first differential data;
the upgrading unit is further configured to upgrade a current original partition of an original image file in the embedded device by using the current first differential data, the forward original partition, or the backward original partition.
22. The apparatus of claim 21, the block obtaining unit further configured to obtain, if it is determined that the forward original block or the backward original block is not stored in the preset reference space, a unidirectional original block corresponding to the current target block from the original image file;
the differential operation unit is further configured to perform a first differential operation on the corresponding current target block by using the unidirectional original block, so as to obtain current first differential data;
and the upgrading unit is also used for upgrading the current original block of the original image file in the embedded equipment by adopting the current first differential data and the unidirectional original block.
23. The apparatus according to any one of claims 19-20, 22, wherein the block acquisition unit is specifically configured to acquire all original blocks from the preset reference space; and determining all original blocks as at least one forward original block or at least one backward original block corresponding to the current target block.
24. The apparatus of any one of claims 19-20, 22, further comprising:
the block storage unit is used for storing the current original blocks into a preset reference space;
and the state marking unit is used for marking the current original block in the original image file as an unavailable state.
25. The apparatus of claim 24, wherein the chunk store comprises:
the space judging module is used for judging whether the size of the residual space in the preset reference space is larger than or equal to the size of the current original partition;
and the first block storage module is used for storing the current original block into a preset reference space if the size of the residual space is determined to be larger than or equal to the size of the current original block.
26. The apparatus of claim 25, further comprising:
the block deleting module is used for deleting the original block which is firstly stored in the preset reference space according to a first-in first-out strategy if the size of the residual space is smaller than the size of the current original block;
and the second block storage module is used for storing the current original block into a preset reference space.
27. The apparatus of claim 25 or 26, further comprising:
A first space determining unit configured to determine an additional storage space in the embedded device;
and the second space determining unit is used for determining the extra storage space as a preset reference space.
28. The apparatus of claim 27, wherein the first spatial determination unit comprises:
the space detection module is used for detecting whether a free storage space with a preset size exists in the embedded equipment;
and the space determining module is used for determining the free storage space as the extra storage space if the free storage space with the preset size exists.
29. The apparatus of claim 28, the space determination module comprising:
the priority determining submodule is used for determining the priority of the stored data in the embedded equipment if the fact that the idle storage space with the preset size does not exist is determined;
the data deleting sub-module is used for deleting the data with the lowest priority to expand the idle storage space with the preset size;
and the space determination submodule is used for determining the free storage space as an additional storage space.
30. The apparatus of any of claims 18-20, 22, 25-26, 28-29, the upgrade unit comprising:
The block merging module is used for merging the current first differential data and the corresponding plurality of original blocks to obtain a current upgrading block;
and the block replacement module is used for replacing the current upgrading block with the current original block so as to finish upgrading of the current original block.
31. The apparatus of any one of claims 18-20, 22, 25-26, 28-29, further comprising:
the block merging unit is used for merging all the first differential data to form a first differential data packet if all the target blocks are determined to have the corresponding first differential data;
the data packet acquisition unit is used for acquiring a second differential data packet between the original image file and the target image file; the second differential data packet is formed by combining a plurality of second differential data, the current second differential data is differential data between the current target block and a plurality of corresponding original blocks after the target image file and the original image file are subjected to block processing in a second direction;
and the data packet comparison unit is used for comparing the first differential data packet with the second differential data packet so as to obtain a minimum differential data packet.
32. The apparatus of claim 31, wherein the upgrading unit is specifically configured to upgrade, if it is determined that the minimum differential data packet is the first differential data packet, a current original partition of the original image file in the embedded device by using current differential data in the first differential data packet and a corresponding plurality of original partitions.
33. The apparatus of claim 31, wherein the upgrading unit is specifically configured to upgrade, if it is determined that the minimum differential data packet is the second differential data packet, the current original block of the original image file in the embedded device by using the current differential data in the second differential data packet and the corresponding plurality of original blocks.
34. The apparatus of claim 31, the data packet acquisition unit comprising:
the request sending module is used for sending a differential data packet acquisition request to the server, wherein the acquisition request comprises differential data packet identification information;
and the data packet receiving module is used for receiving the second differential data packet sent by the server.
35. An embedded device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
The memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-17.
36. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of any one of claims 1-17.
CN202110861904.3A 2021-07-29 2021-07-29 Method, device, equipment, medium and program product for upgrading embedded equipment Active CN113590168B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110861904.3A CN113590168B (en) 2021-07-29 2021-07-29 Method, device, equipment, medium and program product for upgrading embedded equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110861904.3A CN113590168B (en) 2021-07-29 2021-07-29 Method, device, equipment, medium and program product for upgrading embedded equipment

Publications (2)

Publication Number Publication Date
CN113590168A CN113590168A (en) 2021-11-02
CN113590168B true CN113590168B (en) 2024-03-01

Family

ID=78251565

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110861904.3A Active CN113590168B (en) 2021-07-29 2021-07-29 Method, device, equipment, medium and program product for upgrading embedded equipment

Country Status (1)

Country Link
CN (1) CN113590168B (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5508782A (en) * 1990-02-17 1996-04-16 Canon Kabushiki Kaisha Lighting unit cooling device control and combined exhaust device
WO2005043279A2 (en) * 2003-10-31 2005-05-12 Disksites Research And Development Ltd. Device, system and method for storage and access of computer files
CN107391145A (en) * 2017-07-27 2017-11-24 中兴通讯股份有限公司 AKU preparation method and device, the method and device of upgrade file
CN109002312A (en) * 2018-09-10 2018-12-14 京信通信系统(中国)有限公司 Method for upgrading software, device and upgrade server and equipment
CN110515646A (en) * 2019-07-26 2019-11-29 华为技术有限公司 A kind of difference upgrade method and relevant device
WO2020082984A1 (en) * 2018-10-25 2020-04-30 华为技术有限公司 Firmware upgrade method and apparatus, and terminal
CN111158737A (en) * 2019-12-30 2020-05-15 深圳云天励飞技术有限公司 Increment upgrading method and related equipment
CN111221682A (en) * 2020-01-07 2020-06-02 四川长虹电器股份有限公司 Method for mirroring storage system
CN111796856A (en) * 2020-08-26 2020-10-20 北京紫光展锐通信技术有限公司 Differential upgrading method and device, storage medium and computer equipment
CN112988716A (en) * 2021-05-15 2021-06-18 杰为软件系统(深圳)有限公司 Cloud edge collaborative digital equipment modeling method

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7457934B2 (en) * 2006-03-22 2008-11-25 Hitachi, Ltd. Method and apparatus for reducing the amount of data in a storage system
US20150127995A1 (en) * 2013-11-01 2015-05-07 Commvault Systems, Inc. Systems and methods for differential health checking of an information management system
US11487625B2 (en) * 2019-10-31 2022-11-01 Rubrik, Inc. Managing files according to categories

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5508782A (en) * 1990-02-17 1996-04-16 Canon Kabushiki Kaisha Lighting unit cooling device control and combined exhaust device
WO2005043279A2 (en) * 2003-10-31 2005-05-12 Disksites Research And Development Ltd. Device, system and method for storage and access of computer files
CN107391145A (en) * 2017-07-27 2017-11-24 中兴通讯股份有限公司 AKU preparation method and device, the method and device of upgrade file
CN109002312A (en) * 2018-09-10 2018-12-14 京信通信系统(中国)有限公司 Method for upgrading software, device and upgrade server and equipment
WO2020082984A1 (en) * 2018-10-25 2020-04-30 华为技术有限公司 Firmware upgrade method and apparatus, and terminal
CN111104149A (en) * 2018-10-25 2020-05-05 华为技术有限公司 Firmware upgrading method and device and terminal
CN110515646A (en) * 2019-07-26 2019-11-29 华为技术有限公司 A kind of difference upgrade method and relevant device
CN111158737A (en) * 2019-12-30 2020-05-15 深圳云天励飞技术有限公司 Increment upgrading method and related equipment
CN111221682A (en) * 2020-01-07 2020-06-02 四川长虹电器股份有限公司 Method for mirroring storage system
CN111796856A (en) * 2020-08-26 2020-10-20 北京紫光展锐通信技术有限公司 Differential upgrading method and device, storage medium and computer equipment
CN112988716A (en) * 2021-05-15 2021-06-18 杰为软件系统(深圳)有限公司 Cloud edge collaborative digital equipment modeling method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"铁路信号安全计算机平台镜像远程更新软件设计与实现";耿佳灿等;《铁道通信信号》;48-51 *

Also Published As

Publication number Publication date
CN113590168A (en) 2021-11-02

Similar Documents

Publication Publication Date Title
US20230120580A1 (en) Access control method and apparatus for shared memory, electronic device and autonomous vehicle
CN113961510B (en) File processing method, device, equipment and storage medium
CN112884086A (en) Model training method, device, equipment, storage medium and program product
CN114841315A (en) Method and system for implementing hybrid expert model, electronic device and storage medium
CN113590168B (en) Method, device, equipment, medium and program product for upgrading embedded equipment
CN113378855A (en) Method for processing multitask, related device and computer program product
CN115759209B (en) Quantification method and device of neural network model, electronic equipment and medium
CN110413207B (en) Method, apparatus and program product for reducing data recovery time of a storage system
EP4020327A2 (en) Method and apparatus for training data processing model, electronic device and storage medium
CN113225265B (en) Flow control method, device, equipment and computer storage medium
CN114579054A (en) Data processing method and device, electronic equipment and computer readable medium
CN115695853A (en) Video processing method, electronic device and computer program product
CN113657408A (en) Method and device for determining image characteristics, electronic equipment and storage medium
CN111342981A (en) Arbitration method between devices in local area network environment, electronic device and local area network system
CN114202947B (en) Internet of vehicles data transmission method and device and automatic driving vehicle
CN113032512B (en) Road network data updating method, device, equipment, storage medium and product
CN112732319B (en) File upgrading method, device, equipment and storage medium
US20220284902A1 (en) Delay estimation method and apparatus for smart rearview mirror, and electronic device
CN115482422B (en) Training method of deep learning model, image processing method and device
CN115379000B (en) Service platform capacity expansion method and device, electronic equipment and storage medium
CN113900734B (en) Application program file configuration method, device, equipment and storage medium
CN111478949B (en) Data processing method and device
EP3905654A1 (en) Method and apparatus for detecting echo delay and electronic device
CN117873731A (en) Execution method, device, chip, equipment and storage medium of computing task
CN117459719A (en) Reference frame selection method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant