Embedded equipment upgrading method, device, equipment, medium and program product

文档序号:189951 发布日期:2021-11-02 浏览:17次 中文

阅读说明:本技术 嵌入式设备升级方法、装置、设备、介质及程序产品 (Embedded equipment upgrading method, device, equipment, medium and program product ) 是由 郭超 王泰格 于 2021-07-29 设计创作,主要内容包括:本公开提供了一种嵌入式设备升级方法、装置、设备、介质及程序产品,涉及计算机技术领域,尤其涉及系统升级技术。具体实现方案为:对原始镜像文件和目标镜像文件分别进行第一方向的分块处理;若确定目标镜像文件中的当前目标分块满足双向引用条件,则获取与当前目标分块对应的多个原始分块,多个原始分块中包括前向原始分块和后向原始分块,多个原始分块均属于原始镜像文件;采用多个原始分块对对应的当前目标分块进行第一差分操作,以获得当前第一差分数据;采用当前第一差分数据及对应的多个原始分块对嵌入式设备中原始镜像文件的当前原始分块进行升级。本公开能够找到最能近似匹配的分块,进而能够获得最优差分数据,有效提高差分率。(The present disclosure provides a method, an apparatus, a device, a medium, and a program product for upgrading an embedded device, which relate to the field of computer technologies, and in particular, to a system upgrading technology. The specific implementation scheme is as follows: respectively carrying out blocking processing in a first direction on an original image file and a target image file; 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 a forward original block and a backward original block, and all the original blocks belong to the original image file; performing first differential operation on a corresponding current target block by adopting a plurality of original blocks to obtain current first differential data; and upgrading the current original blocks of the original image file in the embedded equipment by adopting the current first differential data and the corresponding plurality of original blocks. The method and the device can find the block which can be most approximately matched, further can obtain the optimal differential data, and effectively improve the differential rate.)

1. An embedded device upgrading method comprises the following steps:

respectively carrying out blocking processing in a first direction on an original image file and a target image file;

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 a forward original block and a backward original block, and all 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 blocks of the original image file in the embedded equipment by adopting the current first differential data and the corresponding original blocks.

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, the plurality of original blocks including a forward original block and a backward original block, includes:

acquiring at least one forward original block corresponding to a current target block 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 of a plurality of original blocks corresponding to the current target block, the plurality of original blocks including a forward original block and a backward original block, includes:

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 block corresponding to the current target block from a preset reference space.

4. The method according to any one of claims 1 to 3, further comprising, if it is determined that the current target block in the target image file does not satisfy the bidirectional reference condition:

if the forward original blocks or the backward original blocks are determined to be stored in the preset reference space, acquiring at least one forward original block or at least one backward original block corresponding to the current target block from the preset reference space, and acquiring the current original block corresponding to the current target block from the original image file;

performing first differential operation on a 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 there is no forward original partition or backward original partition stored in the preset reference space:

acquiring a one-way original block corresponding to a current target block from an original image file;

performing first differential operation on the corresponding current target block by adopting the one-way original block to obtain current first differential data;

and upgrading the current original blocks of the original image file in the embedded equipment by adopting the current first differential data and the unidirectional original blocks.

6. The method according to any one of claims 2-5, wherein 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 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-6, further comprising:

storing the current original blocks into a preset reference space;

and marking the current original block in the original image file as an unavailable state.

8. The method of claim 7, wherein the storing the current original chunk to a 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 block or not;

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.

9. The method of claim 8, if it is determined that the size of the remaining space is smaller than the size of the current original partition, further comprising:

deleting the original blocks which are firstly stored in a preset reference space according to a first-in first-out strategy;

and storing the current original block into a preset reference space.

10. The method of claim 8 or 9, further comprising:

determining an additional storage space in the embedded device;

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 a preset size of free storage space 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, further comprising, if it is determined that there is no free storage space with a predetermined size:

determining the priority of stored data in the embedded equipment;

deleting the data with the lowest priority to expand a preset size of free storage space;

determining the free storage space as an additional storage space.

13. The method of any of claims 1-12, wherein upgrading a current original partition of an original image file in the embedded device using the current first difference data and a corresponding plurality of original partitions comprises:

merging the current first differential data and the corresponding original blocks to obtain current upgrading blocks;

replacing the current original block with the current upgrading block to finish upgrading of the current original block.

14. The method of any of claims 1-13, 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, and the current second differential data is the differential data between the current target block and the corresponding plurality of original blocks after the target image file and the original image file are subjected to blocking processing in the second direction;

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, wherein upgrading a current original partition of an original image file in the embedded device using the current first differential data and a corresponding plurality of original partitions comprises:

and if the minimum differential data packet is determined to be the first differential data packet, upgrading the current original blocks of the original image file in the embedded device by adopting the current differential data in the first differential data packet and the corresponding original blocks.

16. The method of claim 14, if the smallest differential packet is determined to be the second differential packet, further comprising:

and upgrading the current original blocks of the original image file in the embedded equipment by adopting the current differential data in the second differential data packet and the corresponding original blocks.

17. The method of claim 14, wherein obtaining the second differential data packet between the original image file and the target image file comprises:

sending a differential data packet acquisition request to a server, wherein the acquisition request comprises identification information of the differential data packet;

and receiving the second differential data packet sent by the server.

18. An embedded device upgrade apparatus, comprising:

the block processing unit is used for respectively carrying out block processing in a first direction on the original image file and the target image file;

the device comprises a block obtaining unit, a block obtaining unit and a block selecting unit, wherein the block obtaining unit is used for obtaining a plurality of original blocks corresponding to a current target block if the current target block in a target image file meets a bidirectional reference condition, the original blocks comprise a forward original block and a backward original block, and the original blocks all belong to the original image file;

the difference operation unit is used for carrying out first difference operation on the corresponding current target block by adopting the plurality of original blocks so as to obtain current first difference data;

and the upgrading unit is used for upgrading the current original blocks of the original image file in the embedded equipment by adopting the current first differential data and the corresponding original blocks.

19. The apparatus of claim 18, wherein the first direction is a forward direction;

the block acquisition unit includes:

the first block acquiring 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 acquiring 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:

a third block obtaining module, configured to obtain, from an original image file, a current original block and at least one forward original block that correspond to the current target block;

and the fourth block acquiring 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 17 to 20, wherein the block obtaining unit is further configured to, if it is determined that the current target block in the target image file does not satisfy the bidirectional reference condition, obtain, 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 from the preset reference space, and obtain, from the original image file, the current original block corresponding to the current target block;

the differential operation unit is further configured to perform a first differential operation on a corresponding current target block by using the forward original block or the backward original block and the current original block to obtain current first differential data;

the upgrading unit is further configured to upgrade a current original block of the original image file in the embedded device by using the current first differential data, the forward original block or the backward original block, and the current original block.

22. The apparatus according to claim 21, wherein the block obtaining unit is further configured to obtain a unidirectional original block corresponding to the current target block from the original image file if it is determined that the forward original block or the backward original block is not stored in the preset reference space;

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 to obtain current first differential data;

the upgrading unit 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 and the unidirectional original partition.

23. The apparatus according to any one of claims 19 to 22, wherein the block obtaining unit is specifically configured to obtain 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 of claims 19-23, 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 blocks in the original image file into unavailable states.

25. The apparatus of claim 24, wherein the block storage unit comprises:

the space judgment 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 block or not;

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 blocks which are firstly stored in a preset reference space according to a first-in first-out strategy if the size of the residual space is smaller than that of the current original blocks;

and the second block storage module is used for storing the current original blocks into a preset reference space.

27. The apparatus of claim 25 or 26, further comprising:

a first space determination unit for determining an additional storage space in the embedded device;

a second space determination unit for determining the additional 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 preset size of free storage space exists in the embedded equipment;

the space determining module is used for determining the free storage space as an extra storage space if the free storage space with the preset size is determined to exist.

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 condition that the idle storage space with the preset size does not exist is determined;

the data deleting submodule is used for deleting the data with the lowest priority so as to expand the idle storage space with the preset size;

a space determination submodule for determining the free storage space as an extra storage space.

30. The apparatus of any of claims 18-29, the upgrade unit, comprising:

the block merging module is used for merging the current first differential data and the corresponding original blocks to obtain a current upgrading block;

and the block replacing module is used for replacing the current original block with the current upgrading block so as to finish upgrading the current original block.

31. The apparatus of any of claims 18-30, 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, and the current second differential data is the differential data between the current target block and the corresponding plurality of original blocks after the target image file and the original image file are subjected to blocking processing in the second direction;

and the data packet comparison unit compares the first differential data packet with the second differential data packet 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, the current original blocks 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 blocks.

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 blocks 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 packet retrieving unit, comprising:

the request sending module is used for sending a differential data packet obtaining request to a server, wherein the obtaining request comprises identification information of the differential data packet;

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 content of the first and second substances,

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 having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-17.

37. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1-17.

Technical Field

The present disclosure relates to system upgrading technologies in the field of computer technologies, and in particular, to a method, an apparatus, a device, a medium, and a program product for upgrading an embedded device.

Background

The embedded equipment is special small computer equipment which takes application as a center and cuts software and hardware to adapt to a specific application environment through a computer technology. Embedded devices are widely used, such as smart phones, wearable devices, wireless headsets, speakers, etc.

Upgrading of embedded devices is essential for updating and maintaining product functions or data. At present, a differential upgrading mode is generally adopted when the embedded equipment is upgraded. In particular, a forward differential, a backward differential, or a combination of a forward differential and a backward differential.

Disclosure of Invention

The disclosure provides a method, an apparatus, a device, a medium and a program product for upgrading an embedded device.

According to a first aspect of the present disclosure, there is provided an embedded device upgrade method, including:

respectively carrying out blocking processing in a first direction on an original image file and a target image file;

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 a forward original block and a backward original block, and all 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 blocks of the original image file in the embedded equipment by adopting the current first differential data and the corresponding original blocks.

According to a second aspect of the present disclosure, there is provided an embedded device upgrade apparatus, including:

the block processing unit is used for respectively carrying out block processing in a first direction on the original image file and the target image file;

the device comprises a block obtaining unit, a block obtaining unit and a block selecting unit, wherein the block obtaining unit is used for obtaining a plurality of original blocks corresponding to a current target block if the current target block in a target image file meets a bidirectional reference condition, the original blocks comprise a forward original block and a backward original block, and the original blocks all belong to the original image file;

the difference operation unit is used for carrying out first difference operation on the corresponding current target block by adopting the plurality of original blocks so as to obtain current first difference data;

and the upgrading unit is used for upgrading the current original blocks of the original image file in the embedded equipment by adopting the current first differential data and the corresponding original blocks.

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 content of the first and second substances,

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 having stored thereon computer instructions for causing the computer to perform the method of any one of the first aspect.

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 the computer program can be read by at least one processor of an embedded device, execution of the computer program by the at least one processor causing the embedded device to perform the method of the first aspect.

According to the technology disclosed by the invention, under the condition that the bidirectional reference condition is met, a plurality of original blocks which belong to the original image file and comprise the forward original blocks and the backward original blocks are referred to perform differential operation on the current target block so as to obtain differential data. Therefore, the block which can be most approximately matched can be found, the optimal differential data can be obtained, and the differential rate is effectively improved.

It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.

Drawings

The drawings are included to provide 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 a schematic diagram of an application scenario of an embedded device upgrade method provided in accordance with the present disclosure;

fig. 4 is a flowchart illustrating an upgrade method for an embedded device according to a first embodiment of the disclosure;

fig. 5 is a flowchart illustrating an upgrade method for an embedded device according to a second embodiment of the disclosure;

fig. 6a is a first schematic diagram of forward difference in an embedded device upgrade method according to a second embodiment of the present disclosure;

fig. 6b is a second schematic diagram of forward differencing in an embedded device upgrade method provided according to a second embodiment of the present disclosure;

fig. 7 is a flowchart illustrating an upgrade method for an embedded device according to a third embodiment of the disclosure;

fig. 8 is a flowchart illustrating an upgrade method for an embedded device according to a fourth embodiment of the 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 the embedded device upgrade method of the embodiments of the present disclosure.

Detailed Description

Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those 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 solution of the present disclosure, the data processing includes the acquisition, storage, application, etc. of the personal information of the user, which all conform to the regulations of the relevant laws and regulations, and do not violate the custom of the public order.

For clear understanding of the technical solutions of the present disclosure, the technical solutions of the prior art will be described in detail first.

At present, a differential upgrading mode is generally adopted when the embedded equipment is upgraded. In particular, a forward differential, a backward differential, or a combination of a forward differential and a backward differential.

When upgrading is carried out by adopting forward difference, after forward direction blocking processing is carried out on an original image file and a target image file respectively, for each target block in the target image file, as block write-back operation is needed, the corresponding original blocks in the forward direction original image file are all quoted. As shown in fig. 1, after the original image file and the target image file are respectively subjected to forward blocking, there are multiple blocks marked as 0-N. For the target partition identified as i, the original partition identified as i before is marked as a non-referable partition because the original partition has already been subject to the block write back operation. Therefore, the target partition marked as i can only refer to the original partitions marked as i to N in the original image file for differential operation to obtain corresponding differential data. And then generating a partition for upgrading identified as i by adopting the differential data and the quoted original partition, and replacing the partition for upgrading identified as i with the ith original partition. I.e. a block write back operation is performed, identified as i. And after all the target blocks are subjected to block write-back, restarting the embedded equipment, guiding the blocks for upgrading after the operation blocks are written back, and finishing the upgrading of the embedded equipment. Fig. 1 illustrates a case where a target partition identified as 2 refers to original partitions identified as 2 to N in an original image file to perform a difference operation to obtain corresponding difference data. Therefore, when upgrading is carried out by adopting the forward difference, each target block can only depend on the block of the original image file in the forward direction. However, each target partition may be more closely matched with the forward original partition and may be more closely matched with the backward original partition, and this method only refers to the partition in the forward direction and cannot make each target partition find the partition that can be most closely matched, so that the optimal differential data cannot be obtained, and the differential ratio is low.

When upgrading is carried out by adopting reverse difference, the original image file and the target image file are respectively inverted byte by byte, and after the partitioning processing in the reverse direction is respectively carried out, aiming at each target partition in the target image file, the corresponding original partition in the original image file in the reverse direction is referred as 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 the identification of i is marked as a non-referable partition because the original partition has already been subjected to the block write back operation. Therefore, the target partition marked as i can only refer to the original partitions marked as 0 to i-1 in the original image file for differential operation to obtain corresponding differential data. And generating a partition for upgrading identified as i by adopting the differential data and the quoted original partition, and replacing the partition for upgrading identified as i with the ith original partition. I.e. a block write back operation is performed, identified as i. And after all the target blocks are subjected to block write-back, restarting the embedded equipment, guiding the blocks for upgrading after the operation blocks are written back, and finishing the upgrading of the embedded equipment. Fig. 2 illustrates a case where the target partition marked N-1 refers to the original partitions marked 0 to N-2 in the original image file to perform a difference operation to obtain corresponding difference data. Therefore, when upgrading is carried out by adopting 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 differentiation. For each target block, it is possible to more approximately match the forward original block and to more approximately match the backward original block, and this method only refers to the block in the backward direction, and cannot make each target block find the block that can most approximately match, so that the optimal differential data cannot be obtained, and the differential ratio is low.

And when upgrading is carried out by adopting a mode of combining forward difference and reverse difference, 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 then, after the difference data corresponding to each target block is obtained by adopting the reverse difference, the difference data are combined to form a reverse difference packet. And comparing the forward differential packet with the reverse differential packet to obtain a minimum differential data packet. And generating a block for upgrading by adopting the differential data in the minimum differential data packet and the quoted original block, and further finishing upgrading the embedded equipment. Although the upgrading mode has lower difference ratio compared with the upgrading mode of forward difference or reverse difference, the upgrading mode can occupy smaller space in the embedded device. The process of forward differencing and backward differencing is still a one-way reference to the original partition. Therefore, the optimal differential data is not obtained, and the differential ratio is still low.

Therefore, in the face of the technical problems in the prior art, the inventor finds through creative research that, for each target partition, a partition most closely matched with the target partition often appears in multiple partitions of a forward original partition and a backward original partition in an original image file, so in order to find the most closely matched partition, in both forward difference and backward difference, under the condition that a bidirectional reference condition is satisfied, multiple original partitions belonging to the original image file and including both the forward original partition and the backward original partition are referred. And carrying out differential operation on the corresponding target blocks by adopting a plurality of original blocks to obtain differential data. And then upgrading the current original blocks of the original image file in the embedded equipment by adopting the current differential data and the corresponding plurality of original blocks. Through the differential operation, each target block can find the block which can be matched most approximately, so that the optimal differential data can be obtained, and the differential rate is effectively improved.

The inventor proposes a technical scheme of the present disclosure based on the above-mentioned creative discovery. The network architecture and the application scenario of the method for upgrading an embedded device provided by the embodiment of the present disclosure are described below.

Fig. 3 is a schematic view of an application scenario of an embedded device upgrade method provided in accordance with 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, changes of firmware data, changes of partition data, changes of a system and the like, the embedded device needs to be upgraded, and the server 2 can actively send an upgrade instruction to the embedded device. The upgrading instruction comprises the following steps: a target image file. The embedded device can display the upgrade prompt message. After the user agrees to upgrade through the operation interface of the embedded device, the embedded device is upgraded by adopting the method for upgrading the embedded device provided by the embodiment of the disclosure. To meet new user functional 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 below in detail with reference to the accompanying drawings.

Fig. 4 is a schematic flowchart of an embedded device upgrade method according to a first embodiment of the present disclosure, and as shown in fig. 4, an execution main body of the embedded device upgrade method provided in this embodiment is an embedded device upgrade apparatus. The embedded device upgrading device can be positioned in the embedded device. The embedded device can be a smart phone, a wearable device, a wireless earphone, a sound box, a set top box, a vehicle-mounted terminal and the like. The method for upgrading the embedded device provided by the embodiment includes the following steps:

step 401, respectively performing blocking processing in a first direction on the original image file and the target image file.

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 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 can 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. Or as shown in fig. 3, the background server may also 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 the preset size. For example, the original image file and the target image file are both blocked into blocks marked as 0 to N. After the original image file is partitioned, each partition is an original partition. And 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 all the plurality of original blocks belong to the original image file.

In this embodiment, each target partition in the target image file is sequentially processed according to the first direction. And judging whether the bidirectional reference condition is met or not aiming at the current target block in the target image file. And if the condition of bidirectional reference is met, acquiring a plurality of original blocks which belong to the original image file and comprise at least one forward original block and at least one backward original block, and then referencing the 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 at the same position as the current target block. The backward original block is an original block subsequent to the current original block at the same position as the current target block.

Illustratively, for a current target block identified as i, in the case that the current target block i satisfies the bidirectional reference condition, a plurality of original blocks identified as i-k to i + h are obtained as original blocks referenced by the current target block identified as i. Wherein k >0 and h > 0. The values of k and h may be the same or different.

In step 403, a plurality of original blocks are used to perform a first difference operation on the corresponding current target block to obtain current first difference data.

The first differential operation is the differential operation performed on the current target block when the target image file is subjected to the block processing in the first direction, and the obtained differential data is first differential data.

Specifically, in this embodiment, a difference algorithm may be adopted to perform a first difference operation on the corresponding current target block according to the plurality of original blocks. Current first differential data is obtained.

The difference algorithm may be bsdiff, hpatchdiff, Xdelta, etc., which is not limited in this embodiment.

In this embodiment, the current target block and the plurality of cited 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 block of the original image file in the embedded device by using 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 merged to obtain a current upgrade block that can replace the current original block. And replacing the current original block with the current upgrade block, namely performing block write-back operation, and then completing the upgrade of the current original block after the embedded device is restarted.

In the method for upgrading the embedded device provided by the embodiment, the original image file and the target image file are respectively subjected to blocking 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 a forward original block and a backward original block, and all the original blocks belong to the original image file; performing first differential operation on a corresponding current target block by adopting a plurality of original blocks to obtain current first differential data; and upgrading the current original blocks of the original image file in the embedded equipment by adopting the current first differential data and the corresponding plurality of original blocks. Under the condition that the bidirectional reference condition is met, a plurality of original blocks which belong to the original image file and comprise the forward original blocks and the backward original blocks are referred to perform differential operation on the current target block to obtain differential data. Therefore, the block which can be most approximately matched can be found, the optimal differential data can be obtained, and the differential rate is effectively improved.

Fig. 5 is a schematic 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 this embodiment further refines step 402 and step 404 on the basis of the embedded device upgrade method according to the previous embodiment, and further includes other steps, then the embedded device upgrade method according to this embodiment includes the following steps:

step 501, respectively performing blocking processing in a first direction on an original image file and a target image file.

In this embodiment, the implementation manner of step 501 is similar to that of step 401 in the first embodiment, and is not described here again.

Step 502, judging whether the current target block in the target image file meets the bidirectional reference condition, if so, executing step 503, otherwise, executing step 508.

In this embodiment, the specific step of determining whether the current target block in the target image file satisfies the bidirectional reference condition may be determining whether the current target block is a head-to-tail target block of the target image file. And if the current target block is determined to be the head target block and the tail target block, determining that the bidirectional reference condition is not met, otherwise, determining that the bidirectional reference condition is met.

Specifically, since the first target block and the last target block in the target image file can only refer to the unidirectional original block in the original image file, the bidirectional reference condition is not satisfied. The intermediate target blocks positioned in the target image file except the head target block and the tail target block can refer to the forward original blocks in the original image file and can also refer to the backward original blocks in the original image file, so that the bidirectional reference condition is met.

In step 503, it is determined whether the first direction is a forward direction, if so, step 504 is executed, otherwise, step 505 is executed.

In this embodiment, if it is determined that the current target block meets the bidirectional reference condition, that is, the current target block is an intermediate target block except the head and tail target blocks, it is determined whether the direction in which the original image file and the target image file are respectively blocked is a forward direction.

Step 504, at least one forward original block corresponding to the current target block is obtained from the preset reference space, and the current original block and at least one backward original block corresponding to the current target block 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 obtained, because a forward original partition in the original image file among the plurality of original partitions is already in an unavailable state due to a block write-back operation, the forward original partition is written into a preset reference space for storage before the block write-back operation is not 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. And the current original block and the backward original block in the original image file are both in an available state, 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.

Illustratively, for a current target block identified as i, 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 h backward original blocks are obtained from an original image file. Wherein, the number of the backward original blocks may be all the backward original blocks. I.e. h-N-i. And N is the number of target blocks. k may be a preset number or the number of all forward original blocks 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 obtained from the preset reference space. And acquiring the current original block marked as 2 and the backward original blocks marked as 3 to N from the original image file. As shown in fig. 6b, for the target partition identified as 3, the 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 obtained from the preset reference space. And acquiring a current original block marked as 3 and backward original blocks marked as 4 to N from the original image file.

The method for upgrading an embedded device according to this embodiment obtains a plurality of original blocks corresponding to a current target block when a first direction is a forward direction, where the plurality of original blocks include a forward original block and a backward original block, and includes: acquiring at least one forward original block corresponding to a current target block 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 method has the advantages that the forward original blocks can be stored in the preset reference space before the forward original blocks are unavailable, and then at least one forward original block corresponding to the current target block can be obtained from the preset reference space for the current target block, so that the requirement of bidirectional reference in forward differential time 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 direction in which the original mirror image file and the target mirror image file are respectively partitioned is the reverse direction, when a plurality of original partitions corresponding to the current target partition are obtained, since a backward original partition in the original mirror image file among the plurality of original partitions is already in an unavailable state due to a block write-back operation, the backward original partition is written into a preset reference space for storage before the block write-back operation is not performed on the backward original partition. And then at least one backward original block corresponding to the current target block is obtained from the preset reference space. And the current original block and the forward original block in the original image file are both in an available state, 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.

Illustratively, for a current target block identified as i, 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 h forward original blocks are obtained from an original image file. Similar to step 504, the number of forward original partitions may be all forward original partitions. I.e. h-N-i. And N is the number of target blocks. k may be a preset number or the number of all backward raw patches stored in a preset reference space.

In the method for upgrading an embedded device provided in this embodiment, when the second direction is a reverse direction, obtaining a plurality of original blocks corresponding to a current target block, where 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 the current target block from an original image file; and acquiring at least one backward original block corresponding to the current target block from a preset reference space. The backward original blocks can be stored in the preset reference space before the backward original blocks are unavailable, and then at least one backward original block corresponding to the current target block can be obtained from the preset reference space for the current target block, so that the requirement of bidirectional reference in reverse difference can be met.

Step 506, performing a first difference operation on the corresponding current target block by using the plurality of original blocks to obtain current first difference data.

In this embodiment, the implementation manner of step 506 is similar to that of step 403 in the first embodiment, and is not described herein again.

And 507, upgrading the current original blocks of the original image file in the embedded device by using the current first differential data and the corresponding plurality of original blocks.

In this embodiment, the current first differential data and the corresponding original blocks are merged to obtain a current upgrade block; and replacing the current original block with the current upgrading block to finish the upgrading of the current original block.

After the current original blocks are replaced by the current upgrading blocks, whether all the original blocks are replaced by the corresponding upgrading blocks is judged, if all the original blocks are replaced, block write-back operation of all target blocks meeting the bidirectional reference condition is completed, and then after the embedded device is restarted, upgrading of all the target blocks meeting the bidirectional reference condition can be completed.

Step 508, determining whether the preset reference space stores the forward original partition or the backward original partition, if yes, executing step 509, otherwise executing step 512.

In this embodiment, if it is determined that the current target block does not satisfy the bidirectional reference condition, that is, when the current target block satisfies the unidirectional reference condition, it is determined whether the forward original block or the backward original block is stored in the preset reference space. If the forward original block is determined to be 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 block is determined to be stored in the preset reference space, it is indicated that the current target block is the first block and the first direction is the reverse direction.

Illustratively, the last target partition in the forward direction is the target partition identified as N. The first target block in the reverse direction is the target block identified as 0.

Step 509, obtaining at least one forward original block or at least one backward original block corresponding to the current target block from the preset reference space, and obtaining the current original block corresponding to the current target block from the original image file.

In this embodiment, for the last target partition whose first direction is the forward direction, before the block write-back operation is not performed on the forward original partition, the forward original partition is written into the preset reference space for storage. At least one forward original partition corresponding to the current target partition is obtained 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 the preset reference space for storage before performing the block write-back operation on the backward original block. At least one backward original partition corresponding to the current target partition is obtained from the preset reference space. And whether the first direction is the forward direction or the reverse direction, the current original block corresponding to the current target block is obtained from the original image file.

Step 510, performing 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 to obtain current first difference data.

In this embodiment, when performing the difference operation on the last target partition in the forward direction, at least one forward original partition and the current original partition are referred to. And when the difference operation is carried out on the first target block in the reverse direction, at least one backward original block and the current original block are referred. Compared with the forward difference or the backward difference in the prior art, only one original block is introduced, the block which can be most approximately matched can be found, the optimal difference data of the last target block in the forward direction or the first target block in the backward direction can be obtained, and the difference rate of the target block at the position can be effectively improved.

And 511, upgrading the current original block of the original image file in the embedded device by adopting the current first differential data, the forward original block or the backward original block and the current original block.

In this embodiment, for the forward direction, the current original partition of the original image file in the embedded device is upgraded by using the current first differential data, the forward original partition, and the current original partition. And for the reverse direction, upgrading the current original block of the original image file in the embedded equipment by adopting the current first differential data, the reverse original block and the current original block.

And step 512, acquiring the one-way original blocks corresponding to the current target blocks from the original image file.

In this embodiment, if it is determined that the preset reference space does not store the forward original partition or the backward original partition, it indicates that the current target partition is the first target partition in the forward direction or the last target partition in the backward direction. And aiming at the first target block in the forward direction or the last target block in the reverse direction, acquiring the one-way original block corresponding to the current target block from the original image file because the front of the target block is not provided with the forward original block or the backward original block.

Wherein, for the first target block in the forward direction, the unidirectional original blocks include all original blocks identified as 0 to N. For the last target partition in the reverse direction, the unidirectional original partitions include all original partitions identified as 0 to N-1

Step 513, performing a first difference operation on the corresponding current target block by using the unidirectional original block to obtain current first difference data.

And 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 partition is to refer to a unidirectional original partition. In steps 403 to 404, a plurality of original blocks are referenced for the current target block, but the specific implementation is similar, and details are not repeated here.

In the method for upgrading an embedded device provided by this embodiment, when it is determined that a current target block in a target image file does not satisfy a bidirectional reference condition and a forward original block or a backward original block is not stored in a preset reference space, a unidirectional original block corresponding to the current target block is obtained from the original image file; performing first differential operation on a corresponding current target block by adopting a unidirectional original block to obtain current first differential data; and upgrading the current original blocks of the original image file in the embedded equipment by adopting the current first differential data and the unidirectional original blocks. In this case, the current target block is only the first target block in the forward direction or the last target block in the reverse direction, so that even if the unidirectional original block is referred during the differential operation, all or most of the original blocks can be referred, and the block which can be most closely matched can be found, so that the optimal differential data can be obtained, and the differential ratio of the first target block or the last target block can be effectively improved.

As 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, which specifically includes:

acquiring all original blocks from a 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.

Specifically, in this embodiment, since the storage space of the embedded device itself is limited, the forward original partitions or the backward original partitions corresponding to all the current target partitions cannot be stored in the preset reference space indefinitely, and only a limited number of forward original partitions or backward original partitions can be stored. Therefore, in order to enable the current target block to be more approximately matched with the original block and further improve the difference rate of the current target block, all the original blocks stored in the preset reference space are determined as corresponding forward original blocks or backward original blocks so as to perform difference operation with the corresponding current target block.

Fig. 7 is a schematic 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 to a preset reference space.

Step 702, mark the current original block in the original image file as unavailable state.

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, before upgrading the current target block, the current original block is stored in the preset reference space. 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 upgrading the subsequent target blocks, referencing the forward original blocks or the backward original blocks stored in the preset reference space. Therefore, the current original blocks are stored in the preset reference space, and the current original blocks can be effectively prevented from being covered. And smoothly referencing the corresponding forward original block or backward original block when the subsequent target block is subjected to differential operation and upgrading.

As an optional implementation manner, in this embodiment, step 701 includes the following steps:

in step 701a, it is determined whether the size of the remaining space in the preset reference space is greater than or equal to the size of the current original partition, if so, step 701b is executed, otherwise, step 701c is executed.

And step 701b, storing the current original block into a preset reference space.

And 701c, deleting the original blocks which are firstly stored in the preset reference space according to a first-in first-out strategy, and storing the current original blocks in the preset reference space.

Specifically, in the present embodiment, the storage space due to the preset reference space is limited. Therefore, 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, if yes, the fact that enough residual space is available for storing the current original block is indicated, and the current original block is stored in the preset reference space. If not, the situation that the current original block is not stored in enough residual space is indicated. In order to enable the subsequent target blocks to refer to the forward original blocks or backward original blocks as close as possible to the corresponding original blocks, the original blocks firstly stored in the preset reference space are deleted according to a first-in first-out strategy, and the current original blocks are stored in the preset reference space.

Illustratively, as shown in fig. 6a and 6b, the preset reference space can only contain 2 original blocks, when the original block with the reference number 2 is stored in the preset reference space, since the original block with the reference number 2 can not be stored any more due to the size of the remaining space, the original block with the reference number 0 is deleted, and the original block with the reference number 2 is stored in the preset reference space.

In the method for upgrading an embedded device provided by this embodiment, when a current original block is stored in a preset reference space, it is determined whether the size of a remaining space in the preset reference space is greater than or equal to the size of the current original block; 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. If the size of the residual space is smaller than that of the current original block, deleting the original block which is firstly stored in a preset reference space according to a first-in first-out strategy; and 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 far as possible, and then the difference rate of the differential data corresponding to the current target block can be improved.

As an optional implementation manner, in this embodiment, before step 701, determining an additional storage space in the embedded device is further included; a step of determining the additional storage space as a preset reference space.

When the extra storage space is determined in the embedded equipment, detecting whether a preset size of free storage space exists in the embedded equipment;

and if the free storage space with the preset size exists, determining the free storage space as the extra storage space. If the situation that the idle storage space with the preset size does not exist is determined, the priority of the stored data in the embedded equipment is determined; deleting the data with the lowest priority to expand a preset size of free storage space; the free storage space is determined as the extra storage space.

Specifically, in this embodiment, since the storage space of the embedded device is limited, when the preset reference space is determined, a free storage space with a preset size needs to be detected from the embedded device as an additional storage space, and then the additional storage space is determined as the preset reference space. There are cases where no additional storage space is detected while the embedded device is being upgraded. Therefore, it is necessary to open up the empty space of the predetermined size. Specifically, the data with the lowest priority is deleted, and after the free storage space with the preset size is expanded, the data is used as the preset reference space to ensure the smooth upgrading of the embedded device.

Fig. 8 is a schematic flowchart of an embedded device upgrading method according to a fourth embodiment of the present disclosure, and as shown in fig. 8, the embedded device upgrading method provided in this embodiment is further applicable to an upgrading mode combining forward difference and reverse difference, and the embedded device upgrading method provided in this embodiment further includes the following steps:

step 801, if it is determined that all the target blocks have corresponding first differential data, merging all the first differential data to form a first differential data packet.

In this embodiment, whether all target blocks of the target image file have corresponding first differential data is determined, and if yes, all the first differential data are merged to form a differential data packet as a first differential data packet.

Step 802, a second differential data packet between the original image file and the target image file is obtained.

The second differential data packet is formed by combining a plurality of second differential data, and the current second differential data is the differential data between the current target block and the corresponding plurality of original blocks after the target image file and the original image file are subjected to blocking processing in the second direction.

In this embodiment, in a manner similar to any one of the above embodiments, the server may perform blocking processing on the original image file and the target image file in the second direction, respectively, to obtain a plurality of original blocks corresponding to the current target separation data, and then perform second differential operation on the corresponding current target block by using the plurality of original blocks to obtain current second differential data, and perform merging operation on all the second differential data to form a second differential data packet.

Step 803, comparing the first differential data packet with the second differential data packet to obtain a minimum differential data packet.

Specifically, in this embodiment, the size of the first differential packet is compared with that of the second differential packet, and the smallest differential packet of the first differential packet and the second differential packet is determined.

Step 804, if the minimum differential data packet is determined to be the first differential data packet, the current differential data in the first differential data packet and the corresponding plurality of original blocks are adopted to upgrade the current original blocks of the original image file in the embedded device.

Step 805, if the minimum differential data packet is determined to be the second differential data packet, the current differential data in the second differential data packet and the corresponding plurality of original blocks are adopted to upgrade the current original blocks of the original image file in the embedded device.

When the first direction is a forward direction, the first differential data packet is a forward differential data packet. The second direction is a reverse direction, and the second differential packet is a reverse differential packet. On the contrary, when the first direction is the reverse direction, the first differential packet is a reverse differential packet. The second direction is a forward direction, and the second differential packet is a forward differential 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 the embedded device is upgraded, the current original blocks of the original image file in the embedded device are upgraded by using the current differential data in the first differential data packet and the corresponding plurality of original blocks. And if the minimum differential data packet is a second differential data packet, upgrading the current original blocks of the original image file in the embedded equipment by adopting the current differential data in the second differential data packet and the corresponding original blocks. The difference ratio can be further improved.

As an alternative implementation manner, in this embodiment, step 802 includes the following steps:

step 802a, a differential data packet acquisition request is sent to a server, and the acquisition request includes identification information of the differential data packet.

And step 802b, receiving a second differential data packet sent by the server.

In this embodiment, the difference operation in the second direction is performed by the server in a manner similar to that in any of the above embodiments, and the embedded device sends a difference data packet obtaining request to the server, so that the corresponding second difference data packet can be obtained from the server, and the server side can perform the difference operation in the second direction, and further the upgrade method in which the forward difference and the reverse difference are combined in the above embodiments can be smoothly performed in the embedded device.

Fig. 9 is a schematic structural diagram of an embedded device upgrade apparatus according to a fifth embodiment of the present disclosure, and as shown in fig. 9, an embedded device upgrade apparatus 900 provided in this embodiment includes: a block processing unit 901, a block acquisition unit 902, a difference operation unit 903, and an upgrade unit 904.

The blocking processing unit 901 is configured to perform blocking processing in a first direction on an original image file and a target image file, respectively. A block obtaining unit 902, 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 satisfies a bidirectional reference condition, where the plurality of original blocks include a forward original block and a backward original block, and all of the plurality of original blocks belong to the original image file. A difference operation unit 903, configured to perform a first difference operation on the corresponding current target block by using the multiple original blocks to obtain current first difference data. An upgrading unit 904, configured to upgrade a current original partition of the original image file in the embedded device by using the current first differential data and the corresponding plurality of original partitions.

The embedded device upgrading apparatus provided in this embodiment may execute the technical solution of the method embodiment shown in fig. 4, and the implementation principle and technical effect of the apparatus are similar to those of the method embodiment shown in fig. 4, which are not described in detail herein.

Optionally, the first direction is a forward direction; accordingly, the block acquiring unit 902 includes: the device comprises a first block acquisition module and a second block acquisition module.

The first block acquiring module is configured to acquire at least one forward original block corresponding to a current target block from a preset reference space. And the second block acquiring 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; accordingly, the number of the first and second electrodes,

the block acquisition unit 902 includes: the third block acquiring module and the fourth block acquiring module.

The third block obtaining module is configured to obtain, from the original image file, a current original block and at least one forward original block that correspond to the current target block. And the fourth block acquiring 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 satisfy the bidirectional reference condition, obtain, 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 from 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 partition by using the forward original partition or the backward original partition and the current original partition, so as to obtain current first difference 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, the forward original partition or the backward original partition and the current 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, the unidirectional original block corresponding to the current target block from the original image file. The difference operation unit 903 is further configured to perform a first difference operation on the corresponding current target partition by using the unidirectional original partition to obtain current first difference 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; 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.

Optionally, the upgrade apparatus for an embedded device provided in this embodiment further includes: a block storage unit and a state marking unit.

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 blocks in the original image file into unavailable states.

Optionally, the block storage unit includes: the device comprises a space judgment module and a first block storage module.

The space judgment 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 block. 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 that of the current original block.

Optionally, the upgrade apparatus for an embedded device provided in this embodiment further includes: a block deleting module and a second block storing module.

And the block deleting module is used for deleting the original blocks which are 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 that of the current original blocks. And the second block storage module is used for storing the current original blocks into a preset reference space.

Optionally, the upgrade apparatus for an embedded device provided in this embodiment further includes: a first space determination unit and a second space determination unit.

The first space determining unit is used for determining the extra storage space in the embedded device. A second space determining unit for determining the additional storage space as a preset reference space.

Optionally, the first space determination unit comprises: the device comprises a space detection module and a space determination module.

The space detection module is used for detecting whether a preset size of free storage space exists in the embedded device. 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 is determined to exist.

Optionally, the space determining module includes: 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 device if it is determined that the preset-size free storage space does not exist. And the data deleting submodule 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: a block merging module and a block replacing module.

The block merging module is used for merging the current first differential data and the corresponding original blocks to obtain the current upgrading block. And the block replacing module is used for replacing the current original block with the current upgrading block so as to finish upgrading the current original block.

Optionally, the upgrade apparatus for an embedded device provided in this embodiment further includes: a block merging unit, a data packet obtaining unit and a data packet comparing unit.

The block merging unit is configured to merge all the first differential data to form a first differential data packet if it is determined that all the target blocks have 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, and the current second differential data is the differential data between the current target block and the corresponding plurality of original blocks after the target image file and the original image file are subjected to blocking processing in the second direction. And the data packet comparison unit compares the first differential data packet with the second differential data packet 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 blocks 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 blocks.

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 blocks 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.

Optionally, the packet obtaining unit includes: a request sending module and a data packet receiving module.

The request sending module is used for sending a differential data packet obtaining request to the server, wherein the obtaining request comprises identification information of the differential data packet. And the data packet receiving module is used for receiving the second differential data packet sent by the server.

The embedded device upgrading apparatus provided in this embodiment may execute the technical solutions of the method embodiments shown in fig. 5 and 7-8, and the implementation principles and technical effects thereof are similar to those of the method embodiments shown in fig. 5 and 7-8, and are not described in detail herein.

The present disclosure also provides an embedded device, a readable storage medium, and a computer program product according to embodiments of the present disclosure.

According to an embodiment of the present disclosure, the present disclosure also provides a computer program product comprising: a computer program, stored in a readable storage medium, from which at least one processor of the embedded device can read the computer program, the at least one processor executing the computer program causing the electronic device to perform the solution provided by any of the embodiments described above.

Fig. 10 is a block diagram of an embedded device used to implement the embedded device upgrade method of the embodiments of the present disclosure. As shown in fig. 10, the embedded device 1000 may represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples 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 necessary for the operation of the device 1000 can also be stored. The calculation 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.

A number of 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 a communication unit 1009 such as a network card, a modem, a wireless communication transceiver, or the like. The communication unit 1009 allows the embedded device 1000 to exchange information/data with other devices through a computer network such as the internet and/or various telecommunication networks.

Computing unit 1001 may be a variety of general and/or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 1001 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various dedicated Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The calculation unit 1001 executes the respective methods and processes described above, such as the traffic light recognition result processing method. For example, in some embodiments, the traffic light identification result processing method may be implemented as a computer software program tangibly embodied in 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 communications unit 1009. When the computer program is loaded into RAM 1003 and executed by the 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 by any other suitable means (e.g., by means of firmware) to perform a neural network model training method for network congestion control.

Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a 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 that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.

Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes 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 codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. 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. A 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 a pointing device (e.g., a mouse or a 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 can 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, speech, or tactile input.

The systems and techniques described here can be implemented in a computing system that includes a back-end 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 back-end, 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 clients and servers. A client and server are generally 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 as to solve the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS service ("Virtual Private Server", or simply "VPS"). The server may also be a server of a distributed system, or a server incorporating a blockchain.

The present disclosure provides a method, an apparatus, a device, a medium, and a program product for upgrading an embedded device, which are applied to a system upgrading technology in the field of computer technologies. Under the condition that the bidirectional reference condition is met, a plurality of original blocks which belong to the original image file and comprise the forward original blocks and the backward original blocks are referred to perform differential operation on the current target block to obtain differential data. Therefore, the block which can be most approximately matched can be found, the optimal differential data can be obtained, and the differential rate is effectively improved.

It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present application may be executed in parallel, sequentially, or in different orders, and are not limited herein as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved.

The above detailed description should not be construed as limiting the scope of the disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present disclosure should be included in the scope of protection of the present disclosure.

29页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:应用部署方法、应用部署系统和计算机可读存储介质

网友询问留言

已有0条留言

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

精彩留言,会给你点赞!