CN107577474B - Processing method and device for upgrading file and electronic equipment - Google Patents

Processing method and device for upgrading file and electronic equipment Download PDF

Info

Publication number
CN107577474B
CN107577474B CN201710817077.1A CN201710817077A CN107577474B CN 107577474 B CN107577474 B CN 107577474B CN 201710817077 A CN201710817077 A CN 201710817077A CN 107577474 B CN107577474 B CN 107577474B
Authority
CN
China
Prior art keywords
file
files
independent
divided
effective
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710817077.1A
Other languages
Chinese (zh)
Other versions
CN107577474A (en
Inventor
刘清友
田德利
刘金刚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hisense Visual Technology Co Ltd
Original Assignee
Hisense Visual Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hisense Visual Technology Co Ltd filed Critical Hisense Visual Technology Co Ltd
Priority to CN201710817077.1A priority Critical patent/CN107577474B/en
Publication of CN107577474A publication Critical patent/CN107577474A/en
Application granted granted Critical
Publication of CN107577474B publication Critical patent/CN107577474B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The disclosure discloses a processing method and a device for upgrading files, wherein the method comprises the following steps: segmenting the obtained original upgrade file into a plurality of continuous segmentation files; sequentially carrying out effective data detection on each segmented file obtained by segmentation, and judging whether each segmented file is an effective file; screening out all effective files, and combining the continuous effective files into the same file to obtain a plurality of independent files; and generating a configuration file corresponding to each independent file, wherein the configuration file is used for recording the storage information of each independent file. According to the technical scheme, the effective files are combined, the number of independent files is reduced, the reading and writing times of the independent files can be reduced, the writing time of the upgrade files is reduced, and the upgrade speed is increased.

Description

Processing method and device for upgrading file and electronic equipment
Technical Field
The present disclosure relates to the field of computer communications, and in particular, to a method and an apparatus for processing an upgrade file, an electronic device, and a computer-readable storage medium.
Background
The embedded software is software designed based on an embedded system, is one kind of computer software, and consists of a program and documents thereof, such as a common mobile phone, a palm computer, a digital camera, a set-top box, an MP3 player and the like, which are the results of intelligently transforming traditional products by using an embedded software technology.
At present, many Micro Control Unit (MCU) chips can generally adopt a Bootloader (Bootloader) method to upgrade embedded software, and the main upgrading process is to delete data of an original file from a memory and burn the data of an upgraded file into the memory. When the embedded software is upgraded by adopting the method, the data of all the upgrade files need to be burnt into the memory, and if the upgrade files are large, the time consumed by upgrading is long.
When upgrading large files (16G, 32G, 64G) such as patches, in order to improve the upgrading speed, the prior art checks whether the data is valid data or not in the upgrading process by cutting the files into multiple parts, and invalid data is not written any more, so that the writing time is shortened. But for how to cut the file size, there is a contradiction:
1. if the upgrade file is cut to be too large, for example, each divided file is cut to be 200M in size, only a few M or a few bytes of valid data may be present inside 200M, the remaining 99% of data is invalid data, and writing of a large amount of invalid data results in waste of time.
2. Cutting the upgrade file too small results in cutting too many split files, thereby increasing the number of times of reading the split files, and continuously reading the split files for effective data verification also consumes a lot of time.
In summary, it takes a lot of time to write the upgrade file by using the prior art.
Disclosure of Invention
In order to solve the problem that the writing of the upgrade file takes long time in the related art, the disclosure provides a method for processing the upgrade file.
In one aspect, the present disclosure provides a method for processing an upgrade file, including:
segmenting the obtained original upgrade file into a plurality of continuous segmentation files;
sequentially carrying out effective data detection on each segmented file obtained by segmentation, and judging whether each segmented file is an effective file;
screening out all effective files, and combining the continuous effective files into the same file to obtain a plurality of independent files;
and generating a configuration file corresponding to each independent file, wherein the configuration file is used for recording the storage information of each independent file.
In another aspect, the present disclosure provides another method for processing an upgrade file, including:
in the process of manufacturing the upgrade file, the obtained original upgrade file is segmented into a plurality of continuous segmentation files;
sequentially carrying out effective data detection on each segmented file obtained by segmentation, and judging whether each segmented file is an effective file;
generating a configuration file for recording the storage information of the effective file for the effective file;
the configuration file is used for controlling the equipment to be upgraded connected with the configuration file to write in all the effective files according to the effective file storage information recorded by the configuration file in the file upgrading process.
In addition, the present disclosure also provides a processing apparatus for upgrading a file, including:
the file segmentation module is used for segmenting the acquired original upgrade file into a plurality of continuous segmentation files;
the effective detection module is used for sequentially carrying out effective data detection on each segmented file obtained by segmentation and judging whether each segmented file is an effective file;
the file merging module is used for screening out all effective files and merging the continuous effective files into the same file to obtain a plurality of independent files;
and the file configuration module is used for generating a configuration file corresponding to each independent file, and the configuration file is used for recording the storage information of each independent file.
Further, the present disclosure also provides an electronic device, including:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to execute the processing method of the upgrade file.
The present disclosure also provides a computer-readable storage medium, in which a computer program is stored, and the computer program can be executed by a processor to implement the processing method for upgrading a file.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects:
according to the technical scheme, the original upgrade files are segmented into the continuous segmentation files, all the effective files are screened out through effective data detection, the continuous effective files are combined into the same independent file, the number of the independent files is reduced, the configuration files recorded with the storage information of the independent files are generated for each independent file, writing operation can be conducted on each independent file according to the configuration files in the upgrade process, due to the fact that the effective files are combined, the number of the independent files is reduced, the reading and writing times of the independent files can be reduced, the writing time of the upgrade files is shortened, and the upgrade speed is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
FIG. 1 is a schematic illustration of an implementation environment according to the present disclosure;
FIG. 2 is a block diagram illustrating a server in accordance with an exemplary embodiment;
FIG. 3 is a flow diagram illustrating a method of processing an upgrade file, according to an example embodiment;
FIG. 4 is a detailed flowchart of step 320 of the corresponding embodiment of FIG. 3;
FIG. 5 is a detailed flow diagram illustrating a method of processing an upgrade file according to another exemplary embodiment;
FIG. 6 is a diagram illustrating the segmentation of an upgrade file according to the prior art;
FIG. 7 is a schematic diagram of an upgrade file segmentation performed by the upgrade file processing method provided by the present disclosure;
FIG. 8 is a flow diagram illustrating another method of processing an upgrade file, according to an exemplary embodiment;
FIG. 9 is a detailed flowchart of step 820 of the corresponding embodiment of FIG. 8;
FIG. 10 is a flowchart illustrating an existing upgrade flow and the upgrade flow of the present disclosure in detail in accordance with another exemplary embodiment;
FIG. 11 is a flowchart of details of step 830 of the corresponding embodiment of FIG. 8;
FIG. 12 is a flowchart illustrating yet another method of processing an upgrade file, according to an exemplary embodiment;
FIG. 13 is a block diagram illustrating an upgrade file processing apparatus according to an exemplary embodiment;
fig. 14 is a block diagram illustrating an upgrade file processing apparatus according to another exemplary embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the invention, as detailed in the appended claims.
FIG. 1 is a schematic illustration of an implementation environment according to the present disclosure. The implementation environment includes: a server 110 and a smart device 120;
the association between the server 110 and the smart device 120 includes the network association and/or the protocol of hardware and the data association therebetween. The server 110 is mainly responsible for making the upgrade file and generating a configuration file for managing the writing position of the upgrade file, and the intelligent device 120 reads the corresponding upgrade file from the server 110 through the network according to the content recorded by the configuration file and writes the upgrade file into the memory, so as to update the file in the memory. When a large amount of intelligent devices 120 are to be upgraded, the upgrade files manufactured by the server 110 may be stored in storage media such as a usb disk, so that a plurality of intelligent devices 120 that need to be upgraded may read the contents of the upgrade files from the usb disk respectively for upgrading, and the upgrading may be completed as long as the intelligent devices 120 are powered on, without relying on network connection.
The smart device 120 may be a mobile terminal, such as a smart phone or a tablet computer. The intelligent device can also be various intelligent household devices, such as an intelligent television, an intelligent television set top box, an intelligent air conditioner, an intelligent camera and the like.
Referring to fig. 2, fig. 2 is a schematic diagram of a server structure provided by an embodiment of the present invention, the server 200 may have a relatively large difference due to a difference in configuration or performance, and may include one or more Central Processing Units (CPUs) 222 (e.g., one or more processors) and a memory 232, one or more storage media 230 (e.g., one or more mass storage devices) storing an application 242 or data 244, wherein the memory 232 and the storage media 230 may be transient storage or persistent storage, the program stored in the storage media 230 may include one or more modules (not shown) each of which may include a series of instructions operating on the server 200, further, the central processing unit 222 may be configured to communicate with the storage media 230, perform a series of instruction operations in the storage media 230 on the server 200, the server 200 may further include one or more power supplies 226, one or more wired or wireless network interfaces 250, one or more input/output interfaces 258, and/or more input/output systems 241, one or more operation systems such as a Windows transform (tm) system, a Windows (tm) and a Windows (tm) system) may perform the steps shown in fig. 5-ts 2, a Windows (tm) based on the above-ttt 2, the above-ttx ttt.
It will be understood by those skilled in the art that all or part of the steps for implementing the following embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
FIG. 3 is a flow diagram illustrating a method of processing an upgrade file, according to an example embodiment. The scope of applicability and execution body of the method for processing an upgrade file, for example, is for the server 110 of the implementation environment shown in fig. 1. As shown in fig. 3, the processing method of the upgrade file, which may be executed by the server 110, may include the following steps.
In step 310, the obtained original upgrade file is segmented into a plurality of continuous segmented files.
It should be noted that the original upgrade file is used for upgrading the embedded software and is made by the server 110. Valid data and invalid data are contained in the original upgrade file, wherein the default data of the flash (flash memory) is 0x00 or 0xff, and the default data of the flash used in the exemplary embodiment of the present disclosure may be 0x 00. That is, the 0x00 field in the original upgrade file is invalid data, and the other fields are valid data.
Specifically, the data rule of the original upgrade file may be analyzed, and assuming that valid data in the original upgrade file is uniformly distributed, the original upgrade file may be divided into divided files with uniform sizes, that is, each divided file has the same size (for example, 10M). Assuming that the valid data in the original upgrade file is concentrated in the middle position of the file, and the front and back position valid data is less, the front and back part data can be divided into smaller parts (for example, 5M) and the middle part data can be divided into larger parts (for example, 50M).
Taking each split file as an example of 10M, the original upgrade file (named emmc. bin) may be split into N consecutive split files (named emmc. bin aa, emmc. bin ab, emmc. bin ac, emmc. bin ad … …, in that order). The first split file (emmc. binaaa) is data between the start position of the original upgrade file and the 10M position, the second split file (emmc. binaab) is data between the 10M position (excluding the 10M position) and the 20M position of the original upgrade file, the third split file (emmc. binaac) is data between the 20M position (excluding the 20M position) and the 30M position of the original upgrade file, and so on.
In step 320, valid data detection is sequentially performed on each of the segmented files obtained by the segmentation, and whether each of the segmented files is a valid file is determined.
It should be noted that if a certain divided file is not all invalid data, the divided file is a valid file. In other words, if a certain split file is all invalid data (i.e., flash default data), the split file is an invalid file, that is, as long as valid data (i.e., not flash default data) exists, the split file belongs to a valid file. Therefore, whether each of the divided files emmc. binaaa, emmc. binaab, emmc. binaac and emmc. binaad … … is a valid file can be sequentially judged.
Optionally, as shown in fig. 4, step 320 may specifically include the following steps:
in step 321, calculating the information abstract value of the invalid file with the same size as the storage space of each divided file according to the size of the storage space of each divided file;
assuming that the size of each of the divided files is 10M, the message digest value of the invalid file with the same size of 10M may be calculated, and the message digest value may be calculated by the existing MD5 algorithm (message digest algorithm) or hash algorithm, which is not described herein again. It should be noted that, if the digest values of two files are the same, it indicates that the contents of the two files are the same. Otherwise, the contents of the two files are not the same.
In step 322, calculating the information summary value of each divided file;
in step 323, comparing the information abstract value of each divided file with the information abstract value of an invalid file with the same storage space size; if the two files are consistent, the split file is an invalid file; and if the two files are not consistent, the split file is a valid file.
The digest value of each divided file may also be calculated by using the MD5 algorithm listed above, so as to obtain the digest value corresponding to each divided file. Comparing the information abstract value of each divided file with the information abstract value of the invalid file, wherein if the information abstract value of a certain divided file is the same as the information abstract value of the invalid file with the same size, the contents of the divided file and the invalid file are the same, namely the divided file is the invalid file; otherwise, the file is a valid file.
In step 330, all valid files are screened out, and consecutive valid files are combined into the same file to obtain a plurality of independent files.
Specifically, effective divided files (i.e., effective files) are sequentially screened out, and the effective files which are continuous in the front and back are combined into the same file. For example, if the first divided file is a valid file, the second divided file is also a valid file, and the third divided file is not a valid file, the first divided file and the second divided file are merged to be an independent file. And if the fourth divided file is also a valid file and the fifth divided file is not a valid file, taking the fourth divided file as an independent file, and so on, screening out all valid files, and combining the continuous valid files into one file to obtain independent files.
In step 340, a configuration file corresponding to each independent file is generated, where the configuration file is used to record storage information of each independent file.
It should be noted that the independent file may be one valid file, or may include multiple consecutive valid files, where an independent file corresponds to a configuration file, and the configuration file records storage information corresponding to the independent file. The storage information comprises the name of the effective file in the independent file and the storage position of the independent file in the flash. If the independent file contains several consecutive active files, the storage information may be the name and flash start storage location of the first active file among the several active files. The Flash start storage location is the starting location where the first valid file is to be written.
Optionally, step 340 may generate a configuration file corresponding to each independent file, where the configuration file is used to record storage information of each independent file, and the method specifically includes the following steps:
in step 341, the storage location of each divided file is sequentially obtained according to the size of the storage space of each divided file.
For example, assuming that each of the divided files is 10M, the storage location of each of the divided files should be sequentially incremented from the flash start storage location. I.e. the first split file from the beginning to the 10M position, the second split file from the 10M (excluding 10M) to the 20M position, the third split file from the 20M (excluding 20M) to the 30M position, and so on, the storage locations are sequentially incremented. Assuming that the size of each divided file is different and is 10M, 15M, 10M, 20M in sequence, the storage location of the first divided file is from the beginning to the 10M location, the storage location of the second divided file is from 10M (excluding 10M) to the 25M location, the storage location of the third divided file is from 25M (excluding 20M) to the 35M location, the storage location of the third divided file is from 35M (excluding 35M) to the 55M location, and so on, the storage locations are increased.
In step 342, a configuration file for recording storage information of each independent file is generated according to the divided files contained in each independent file, and the configuration file is used for controlling the storage position of each independent file.
If an independent file only contains one divided file, the configuration file corresponding to the independent file records the storage information of the divided file, for example, the name of the divided file and the storage location of the divided file obtained in step 341.
If an independent file contains two consecutive split files, the storage information recorded in the independent file may be the name of the first split file and the storage location (i.e., the starting write location) of the first split file.
Fig. 5 is a detailed flowchart of the present disclosure, and as shown in fig. 5, the original upgrade file is divided into N consecutive split files, each split file may be 10M, and then the first split file (emmc. binaaa) is first judged to judge whether it is a valid file, and if it is a valid file, the name of the valid file and the start position of the flash (recorded as 00000) are recorded. And judging whether the second split file (emmc. binaab) is a valid file or not by adopting the same method, if not, generating a configuration file for the first split file by using the first split file as an independent file, wherein the name and the storage position (namely the flash initial position 00000) of the first split file are recorded in the configuration file. And continuously judging whether the third divided file is an effective file, if so, recording the name of the third divided file and the initial position of the flash (at the moment, the initial position of the flash is shifted by 20M relative to the initial position and is recorded as 00020), continuously judging whether the fourth divided file is an effective file, if so, continuously judging the fifth divided file, if not, combining the third divided file and the fourth divided file into an independent file, generating a configuration file for the independent file, and recording the name of the third divided file and the initial position of the flash (namely 0020) in the configuration file.
If the first divided file is not an effective file, the Flash starting position is synchronously increased by 10M, whether the second divided file is an effective file or not is continuously judged, and if the second divided file is an effective file, the name (emmc. binary ab) and the Flash starting position (recorded as 00010) of the second divided file are recorded. And continuously judging whether the third split file is a valid file, if not, generating a configuration file for the second split file, and recording the name and the flash starting position (namely 00010) of the first valid file in the configuration file.
That is, if a certain divided file is a valid file, the file name and the flash start position of the divided file are recorded. And continuously judging whether the next divided file is an effective file, if not, generating a configuration file for the previous divided file, and synchronously increasing the initial position of the flash. If the file is an effective file, the front and back continuous divided files are combined to form a file, and only one configuration file is generated, so that the reading and writing times of the file can be reduced during upgrading, and the writing speed of the upgraded file is increased.
According to the technical scheme provided by the above exemplary embodiment of the present disclosure, the original upgrade file is divided into the continuous divided files, all the valid files are screened out through valid data detection, and the continuous valid files are combined into the same independent file, so that the number of independent files is reduced, and the configuration file recorded with the independent file storage information is generated for each independent file, so that each independent file can be written according to the configuration file in the upgrade process.
Optionally, after the step 340, the scheme provided by the embodiment of the present disclosure may further include the following steps:
and sending the configuration file corresponding to each independent file to the equipment to be upgraded, so that the equipment to be upgraded writes each independent file into a corresponding storage position according to the storage information of each independent file recorded by the configuration file.
The device to be upgraded may be various intelligent devices 120 that need software upgrading, such as an intelligent television, an intelligent set-top box, and the like. The server 110 compresses each independent file to complete the production of the upgrade file. The server 110 sends the configuration file corresponding to each independent file to the device to be upgraded, and the device to be upgraded reads the corresponding independent file from the server 110 according to the storage information (file name and storage location) of the corresponding independent file recorded by each configuration file, decompresses the corresponding independent file, and writes the independent file into the corresponding storage location of the flash.
As shown in fig. 6, in the prior art, an original upgrade file is divided into 200M divided files, where the first divided file has only 3 valid data, the second divided file has mostly valid data, and the third divided file has invalid data, and the first divided file and the second divided file need to be written in during writing, and since the first divided file has only 3 valid data, the ratio of the invalid data is large, and much time is wasted in writing a large amount of invalid data, thereby reducing the writing speed.
As shown in fig. 7, compared with the prior art, the first divided file in fig. 6 is divided into 3 small files, all the first small files are invalid data and are not written in, the second 10M file has 3 valid data written in, and all the third small files are invalid data and are not written in, so that the occupation ratio of invalid data is greatly reduced compared with the prior art, the time consumed by writing invalid data is reduced, and the writing speed is improved. For the second split file in fig. 6, even though the present disclosure splits the second split file into 3 small files, since the three small files are all valid files and are merged into one file, the number of reads and writes is not increased because of the small split.
The original upgrade file is divided into small files by optimizing the manufacturing mode of the upgrade file, invalid files larger than 10M are unlikely to exist if each divided file is 10M, and meanwhile, continuous valid files are combined, so that the reading, decompressing and writing times are reduced, the read data are enabled to be valid as much as possible, and the optimal upgrade rate is achieved.
As shown in fig. 8, the present disclosure also provides another processing method of upgrading a file, which may be performed by the server 110 shown in fig. 1, and which may include the following steps.
In step 810, in the process of making the upgrade file, segmenting the obtained original upgrade file into a plurality of continuous segmented files;
it should be explained that, in the prior art, when upgrading a large file, even if data is compressed in advance, the upgrade file also needs to be read, decompressed and then written again. In the prior art, it is better to check whether the data is valid data or not in the writing process, and invalid data is not written any more, so that the upgrading speed is improved. But reading invalid data, decompressing and comparing data in the upgrading process also consumes a lot of time. The larger the file, the more invalid content, and the longer it takes. According to the method and the device, the comparison and elimination of the invalid data are completed when the upgrade file is manufactured, so that a large amount of time is not consumed to read, decompress and compare the invalid data when the upgrade is actually executed, the time consumed by the upgrade is reduced, and the upgrade speed is increased.
It should be noted that the original upgrade file is used for upgrading the embedded software and is made by the server 110. Valid data and invalid data are contained in the original upgrade file, wherein the default data of the flash (flash memory) is 0x00 or 0xff, and the default data of the flash used in the exemplary embodiment of the present disclosure may be 0x 00. That is, the 0x00 field in the original upgrade file is invalid data, and the other fields are valid data.
Specifically, the data rule of the original upgrade file may be analyzed, and assuming that valid data in the original upgrade file is uniformly distributed, the original upgrade file may be divided into divided files with uniform sizes, that is, each divided file has the same size (for example, 10M). Assuming that the valid data in the original upgrade file is concentrated in the middle position of the file, and the front and back position valid data is less, the front and back part data can be divided into smaller parts (for example, 5M) and the middle part data can be divided into larger parts (for example, 50M).
Taking each split file as an example of 10M, the original upgrade file (named emmc. bin) may be split into N consecutive split files (named emmc. bin aa, emmc. bin ab, emmc. bin ac, emmc. bin ad … …, in that order). The first split file (emmc. binaaa) is data between the start position of the original upgrade file and the 10M position, the second split file (emmc. binaab) is data between the 10M position (excluding the 10M position) and the 20M position of the original upgrade file, the third split file (emmc. binaac) is data between the 20M position (excluding the 20M position) and the 30M position of the original upgrade file, and so on.
In step 820, performing valid data detection on each segmented file obtained by segmentation in sequence, and judging whether each segmented file is a valid file;
it should be noted that if a certain divided file is not all invalid data, the divided file is a valid file. In other words, if a certain split file is all invalid data (i.e., flash default data), the split file is an invalid file, that is, as long as valid data (i.e., not flash default data) exists, the split file belongs to a valid file. Therefore, whether each of the divided files emmc. binaaa, emmc. binaab, emmc. binaac and emmc. binaad … … is a valid file can be sequentially judged.
Optionally, as shown in fig. 9, step 820 may specifically include the following steps:
in step 821, calculating the information abstract value of the invalid file with the same size as the storage space of each divided file according to the size of the storage space of each divided file;
assuming that the size of each of the divided files is 10M, the message digest value of the invalid file with the same size of 10M may be calculated, and the message digest value may be calculated by the existing MD5 algorithm (message digest algorithm) or hash algorithm, which is not described herein again. It should be noted that, if the digest values of two files are the same, it indicates that the contents of the two files are the same. Otherwise, the contents of the two files are not the same.
In step 822, calculating an information digest value of each divided file;
in step 823, the information digest value of each divided file is compared with the information digest value of the invalid file with the same storage space size; if the two files are consistent, the split file is an invalid file; and if the two files are not consistent, the split file is a valid file.
The digest value of each divided file may also be calculated by using the MD5 algorithm listed above, so as to obtain the digest value corresponding to each divided file. Comparing the information abstract value of each divided file with the information abstract value of the invalid file, wherein if the information abstract value of a certain divided file is the same as the information abstract value of the invalid file with the same size, the contents of the divided file and the invalid file are the same, namely the divided file is the invalid file; otherwise, the file is a valid file.
In step 830, generating a configuration file for recording the storage information of the valid file for the valid file;
the configuration file is used for controlling the equipment to be upgraded connected with the configuration file to write in all the effective files according to the effective file storage information recorded by the configuration file in the file upgrading process.
If a certain divided file is a valid file, a configuration file is generated for the divided file, the configuration file records the storage information of the divided file, and the storage information comprises the name and the corresponding storage position of the divided file. So that each split file belonging to a valid file has a corresponding configuration file.
To reduce the storage space of the active files, the server 110 may compress the active files. In the file upgrading process, after receiving an upgrade signal sent by a device to be upgraded, the server 110 sends the configuration file to the device to be upgraded, where the device to be upgraded may be various intelligent devices 120 that need software upgrading, such as an intelligent television, an intelligent set-top box, and the like. In the upgrading process, the device to be upgraded reads the corresponding segmented file from the server 110 according to the storage information of the corresponding segmented file recorded by the configuration file, and writes the corresponding segmented file into the corresponding storage position in the flash after decompression.
As shown in fig. 10, the left side is an upgrade process of the prior art, and the right side is an upgrade process of the present disclosure, and it can be seen from the figure that, in the file upgrade process of the prior art, part of the upgrade files need to be read sequentially, then decompression and invalid data comparison are performed, and finally, the valid file is written into an appointed flash position. Obviously, in the file upgrading process, much time is wasted in reading, decompressing and comparing invalid data. As can be seen from the right part of fig. 10 in the upgrading process of the present disclosure, in the file upgrading process, the corresponding valid file can be directly read and written into the corresponding storage location of the flash according to the valid file storage information recorded by the configuration file, and the comparison of invalid data is not required in the upgrading process, so that the upgrading time is saved, and the upgrading speed is increased.
As can be seen from the right part of fig. 10, in the process of manufacturing the upgrade file, according to an exemplary embodiment of the present disclosure, by segmenting the original upgrade file into segmented files of 200M size one by one and calculating the digest information value of the 200M invalid file, it is determined whether the digest information value of each segmented file is equal to the digest information value of the invalid file by calculating the digest information value of each segmented file in turn. The divided files with the equal information abstract values belong to invalid files, and the configuration files recorded with the writing positions and the file names are generated for the divided files with the unequal information abstract values, so that invalid data are removed when the files are upgraded, time is not wasted in reading, decompressing and comparing the invalid data in the upgrading process, and the writing of the valid files can be completed directly according to the configuration files.
For example, when the smart device 120 is upgraded by using an upgrade file stored in a usb disk, the time consumed for reading, decompressing, and comparing the invalid data is saved in the upgrade file manufacturing process, so that the upgrade process is not affected by the size of the flash, the comparison of the invalid data is performed without consuming time, and the upgrade time is greatly optimized.
Optionally, the step 830 of generating a configuration file for the valid file may include:
and sequentially obtaining the storage position of each divided file according to the size of the storage space of each divided file.
Specifically, assuming that the original upgrade file is split into split files each of 200M size, the write location of each split file should be sequentially shifted by 200M. For example, the first split file writing start position is recorded as 00000, the second split file writing start position is recorded as 00200, the third split file writing start position is recorded as 00400, and so on.
And after judging whether each divided file is an effective file, generating a corresponding configuration file for the effective divided file according to the storage position of each divided file, wherein the configuration file is used for controlling the storage position of the corresponding divided file.
Specifically, it can be sequentially determined whether each of the divided files is a valid file through steps 821 and 823, and if so, the configuration file is skipped to be generated for the invalid file, but the writing start position of the next divided file is synchronously incremented by 200M. If the file is the valid file, generating a configuration file for the valid file, and recording the writing initial position of the valid file in the configuration file.
For example, if the first split file is a valid file, a configuration file is generated for the valid split file, and the write start location and the file name (e.g., location as 00000, name emmc. binaa) of the split file are recorded in the configuration file. If the second split file is also a valid file, a configuration file is also generated for the second split file, and the writing position and the file name of the split file (for example, the position is 00200 and the name is emmc. binary) are recorded in the configuration file. If the third split file is not a valid file, then generating the configuration file is skipped, but the flash write location is synchronously incremented by 200M. Assuming that the fourth split file is a valid file, the writing location and the file name of the split file are recorded in the configuration file (e.g., the writing location is recorded as 00600, and the name is emmc.
Optionally, as shown in fig. 11, the step 830 of generating a configuration file for recording the storage information of the valid file for the valid file may specifically include the following steps:
in step 831, all valid files are screened out, and the continuous valid files are combined into one file to obtain a plurality of independent files;
in step 832, a configuration file corresponding to each independent file is generated, and the configuration file is used for recording the storage information of each independent file.
That is, in the process of making the upgrade file, the continuous valid files may be merged into one valid file, and a configuration file is generated for the merged valid file. For example, if the first and second divided files are both valid files and the third divided file is not a valid file, the first and second divided files may be merged into one valid file and a configuration file may be generated for the merged file.
As shown in fig. 12, in the process of making an upgrade file, the original upgrade file may be divided into N consecutive split files, each split file may be 10M, then each split file is sequentially determined, and if a certain split file is a valid file, the file name and the flash start position of the split file are recorded. And continuously judging whether the next divided file is an effective file, if not, generating a configuration file for the previous divided file, and synchronously increasing the initial position of the flash. If the file is a valid file, the front and back continuous divided files are combined to form a file, and only one configuration file is generated. And saving the final configuration file, and compressing and saving the effective file.
As shown in fig. 12, in the process of writing the upgrade file, the corresponding valid file can be directly read according to the valid file storage information recorded by the configuration file, and the corresponding valid file is written into the storage location corresponding to the flash after decompression. Because the invalid data are removed when the upgrade file is manufactured, the invalid data do not need to be read, decompressed and compared in the upgrade process, so that the time consumed in the upgrade process is shorter, and the upgrade speed is higher.
The following is an embodiment of the apparatus of the present disclosure, which may be used to execute an embodiment of a processing method for upgrading a file executed by the server 110 of the present disclosure. For details not disclosed in the embodiments of the apparatus of the present disclosure, please refer to the embodiments of the processing method for upgrading files of the present disclosure.
Fig. 13 is a block diagram illustrating an upgrade file processing apparatus, which may be used in the server 110 of the implementation environment shown in fig. 1, to perform all or part of the steps of the upgrade file processing method shown in any one of fig. 3-5, according to an exemplary embodiment. As shown in fig. 13, the apparatus includes, but is not limited to: a file splitting module 1310, a validity detection module 1320, a file merging module 1330, and a file configuration module 1340.
A file splitting module 1310, configured to split the obtained original upgrade file into multiple continuous split files;
an effective detection module 1320, configured to perform effective data detection on each segmented file obtained by segmentation in sequence, and determine whether each segmented file is an effective file;
a file merging module 1330, configured to filter out all valid files, merge consecutive valid files into a same file, and obtain a plurality of independent files;
the file configuration module 1340 is configured to generate a configuration file corresponding to each independent file, where the configuration file is used to record storage information of each independent file.
The implementation process of the functions and actions of each module in the device is specifically detailed in the implementation process of the corresponding step in the processing method of the upgrade file, and is not described herein again.
The file splitting module 1310 may be, for example, one of the physical structures of the central processors 222 in fig. 2.
The validity detection module 1320, the file merging module 1330, and the file configuration module 1340 may also be functional modules for executing corresponding steps in the processing method of the upgrade file. It is understood that these modules may be implemented in hardware, software, or a combination of both. When implemented in hardware, these modules may be implemented as one or more hardware modules, such as one or more application specific integrated circuits. When implemented in software, the modules may be implemented as one or more computer programs executing on one or more processors, such as programs stored in memory 232 for execution by central processor 222 of FIG. 2.
Fig. 14 is a block diagram illustrating an upgrade file processing apparatus, which may be used in the server 110 of the implementation environment shown in fig. 1, to perform all or part of the steps of the upgrade file processing method shown in any one of fig. 8 to 12, according to another exemplary embodiment. As shown in fig. 14, the processing device of the upgrade file includes but is not limited to: a file segmentation module 1410, a file detection module 1420, and an active configuration module 1430.
The file segmentation module 1410 is configured to segment the obtained original upgrade file into a plurality of continuous segmented files in the upgrade file manufacturing process;
the file detection module 1420 is configured to perform valid data detection on each segmented file obtained by segmentation in sequence, and determine whether each segmented file is a valid file;
an effective configuration module 1430, configured to generate a configuration file for recording storage information of the effective file if the split file is an effective file;
the configuration file is used for controlling the equipment to be upgraded connected with the configuration file to write in all the effective files according to the effective file storage information recorded by the configuration file in the file upgrading process.
The implementation process of the functions and actions of each module in the device is specifically detailed in the implementation process of the corresponding step in the processing method of the upgrade file, and is not described herein again.
Optionally, the present disclosure further provides an electronic device, which may be used in the server 110 in the implementation environment shown in fig. 1 to execute all or part of the steps of the method for processing the upgrade file shown in any one of fig. 3 to 5 and fig. 8 to 12. The electronic device includes:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to execute the processing method of the upgrade file described in the above exemplary embodiment.
The specific manner in which the processor of the electronic device in this embodiment performs operations has been described in detail in the embodiment of the processing method related to the upgrade file, and will not be elaborated here.
In an exemplary embodiment, a storage medium is also provided that is a computer-readable storage medium, such as may be transitory and non-transitory computer-readable storage media, including instructions. The storage medium stores a computer program executable by the central processor 222 of the server 200 to perform the above-described processing method of the upgrade file.
It will be understood that the invention is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the invention is limited only by the appended claims.

Claims (9)

1. A processing method for upgrading files is characterized by comprising the following steps:
segmenting the obtained original upgrade file into a plurality of continuous segmentation files;
sequentially carrying out effective data detection on each segmented file obtained by segmentation, and judging whether each segmented file is an effective file;
screening out all effective files, and combining the continuous effective files into the same file to obtain a plurality of independent files;
and generating a configuration file corresponding to each independent file, wherein the configuration file is used for recording the storage information of each independent file.
2. The method according to claim 1, wherein the sequentially performing valid data detection on each segmented file obtained by segmentation to determine whether each segmented file is a valid file comprises:
calculating the information abstract value of the invalid file with the same size as the storage space of each divided file according to the size of the storage space of each divided file;
calculating the information abstract value of each divided file;
comparing the information abstract value of each divided file with the information abstract value of an invalid file with the same storage space size; if the two files are consistent, the split file is an invalid file; and if the two files are not consistent, the split file is a valid file.
3. The method according to claim 1, wherein the generating a configuration file corresponding to each independent file, the configuration file being used for recording storage information of each independent file, includes:
sequentially obtaining the storage position of each divided file according to the size of the storage space of each divided file;
and generating a configuration file for recording the storage information of each independent file according to the divided files contained in each independent file, wherein the configuration file is used for controlling the storage position of each independent file.
4. The method according to claim 1, wherein the generating a configuration file corresponding to each independent file, the configuration file being used after recording the storage information of each independent file, the method further comprises:
and sending the configuration file corresponding to each independent file to the equipment to be upgraded, so that the equipment to be upgraded writes each independent file into a corresponding storage position according to the storage information of each independent file recorded by the configuration file.
5. A processing method for upgrading files is characterized by comprising the following steps:
in the process of manufacturing the upgrade file, the obtained original upgrade file is segmented into a plurality of continuous segmentation files;
sequentially carrying out effective data detection on each segmented file obtained by segmentation, and judging whether each segmented file is an effective file;
screening out all effective files, and combining the continuous effective files into one file to obtain a plurality of independent files;
generating a configuration file corresponding to each independent file, wherein the configuration file is used for recording the storage information of each independent file; the configuration file is used for controlling the equipment to be upgraded connected with the configuration file to write in all the effective files according to the effective file storage information recorded by the configuration file in the file upgrading process.
6. The method according to claim 5, wherein the sequentially performing valid data detection on each segmented file obtained by segmentation to determine whether each segmented file is a valid file comprises:
calculating the information abstract value of the invalid file with the same size as the storage space of each divided file according to the size of the storage space of each divided file;
calculating the information abstract value of each divided file;
comparing the information abstract value of each divided file with the information abstract value of an invalid file with the same storage space size; if the two files are consistent, the split file is an invalid file; and if the two files are not consistent, the split file is a valid file.
7. A processing apparatus for upgrading a file, comprising:
the file segmentation module is used for segmenting the acquired original upgrade file into a plurality of continuous segmentation files;
the effective detection module is used for sequentially carrying out effective data detection on each segmented file obtained by segmentation and judging whether each segmented file is an effective file;
the file merging module is used for screening out all effective files and merging the continuous effective files into the same file to obtain a plurality of independent files;
and the file configuration module is used for generating a configuration file corresponding to each independent file, and the configuration file is used for recording the storage information of each independent file.
8. An electronic device, characterized in that the electronic device comprises:
a processor;
a memory for storing processor-executable instructions; wherein the processor is configured to perform the processing method of the upgrade file of any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program executable by a processor to perform the processing method of upgrading a file according to any one of claims 1 to 6.
CN201710817077.1A 2017-09-12 2017-09-12 Processing method and device for upgrading file and electronic equipment Active CN107577474B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710817077.1A CN107577474B (en) 2017-09-12 2017-09-12 Processing method and device for upgrading file and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710817077.1A CN107577474B (en) 2017-09-12 2017-09-12 Processing method and device for upgrading file and electronic equipment

Publications (2)

Publication Number Publication Date
CN107577474A CN107577474A (en) 2018-01-12
CN107577474B true CN107577474B (en) 2020-07-10

Family

ID=61036504

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710817077.1A Active CN107577474B (en) 2017-09-12 2017-09-12 Processing method and device for upgrading file and electronic equipment

Country Status (1)

Country Link
CN (1) CN107577474B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109086065A (en) * 2018-08-16 2018-12-25 深圳市元征科技股份有限公司 A kind of method for upgrading software, system and terminal device
CN109299085A (en) * 2018-11-07 2019-02-01 平安医疗健康管理股份有限公司 A kind of data processing method, electronic equipment and storage medium
CN113515747B (en) * 2021-05-17 2024-02-09 深圳市友华通信技术有限公司 Equipment upgrading method, device, equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101002406A (en) * 2004-06-10 2007-07-18 三星电子株式会社 Apparatus and method for efficient generation of delta files for over-the-air upgrades in a wireless network
CN105867934A (en) * 2016-04-13 2016-08-17 厦门雅迅网络股份有限公司 Method for remote file upgrade based on bisection method and MD5 checking
CN106648751A (en) * 2016-11-22 2017-05-10 深圳市元征软件开发有限公司 Method for rapidly upgrading embedded software and embedded device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6925365B2 (en) * 2002-08-05 2005-08-02 Daimlerchrysler Corporation Flash loader for vehicle electronic control units

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101002406A (en) * 2004-06-10 2007-07-18 三星电子株式会社 Apparatus and method for efficient generation of delta files for over-the-air upgrades in a wireless network
CN105867934A (en) * 2016-04-13 2016-08-17 厦门雅迅网络股份有限公司 Method for remote file upgrade based on bisection method and MD5 checking
CN106648751A (en) * 2016-11-22 2017-05-10 深圳市元征软件开发有限公司 Method for rapidly upgrading embedded software and embedded device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于MD5算法的重复数据删除技术的研究与改进;廖海生 等;《计算机测量与控制》;20101231;第18卷(第3期);第635-638页 *

Also Published As

Publication number Publication date
CN107577474A (en) 2018-01-12

Similar Documents

Publication Publication Date Title
US11006127B2 (en) System and method for foveated compression of image frames in a system on a chip
CN107577474B (en) Processing method and device for upgrading file and electronic equipment
CN106951521B (en) Method, device and system for reading and writing log file
JP2008065834A (en) Fusion memory device and method
CN111292225B (en) Partitioning graphics data for large-scale graphics processing
CN110583018B (en) System and method for intelligent data/frame compression in a system-on-chip
EP3414666B1 (en) System and method for multi-tile data transactions in a system on a chip
TWI634421B (en) Electronic apparatus for data access and data access method therefor
JP2010061518A (en) Apparatus and method for storing data and program
CN109088636B (en) Data processing method and system, electronic equipment and storage medium
WO2018161791A1 (en) Method and device for compressing executable file
CN105320669A (en) Method and device for data storage and method and device for data reading
US20210248710A1 (en) Electronic device and method for saving image
CN113031871A (en) Data adding and aggregating method and device, electronic equipment and readable storage medium
CN110851433B (en) Key optimization method for key value storage system, storage medium, electronic device and system
WO2020113421A1 (en) Method for mounting file system, terminal device, and storage medium
CN113377391B (en) Method, device, equipment and medium for making and burning image file
CN114817176A (en) Distributed file storage system and method based on Nginx + MinIO + Redis
CN113641643A (en) File writing method and device
WO2021087662A1 (en) Memory allocation method and apparatus, terminal, and computer readable storage medium
CN108735239B (en) Audio playing control method and terminal equipment
CN111596973B (en) Data storage method and device under on-chip execution mode and terminal
WO2023231064A1 (en) Optimization method for storage apparatus, and storage apparatus and computer-readable storage medium
CN109542531B (en) File layout adjustment method and device
CN111008048B (en) File loading method and device and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 266000, No. 218, Bay Road, Qingdao economic and Technological Development Zone, Shandong

Applicant after: Hisense Video Technology Co., Ltd

Address before: 266555 Qingdao economic and Technological Development Zone, Shandong, Hong Kong Road, No. 218

Applicant before: HISENSE ELECTRIC Co.,Ltd.

GR01 Patent grant
GR01 Patent grant