CN105808272B - Data upgrading method and device - Google Patents

Data upgrading method and device Download PDF

Info

Publication number
CN105808272B
CN105808272B CN201410843165.5A CN201410843165A CN105808272B CN 105808272 B CN105808272 B CN 105808272B CN 201410843165 A CN201410843165 A CN 201410843165A CN 105808272 B CN105808272 B CN 105808272B
Authority
CN
China
Prior art keywords
data
upgrading
difference
upgraded
terminal
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
CN201410843165.5A
Other languages
Chinese (zh)
Other versions
CN105808272A (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.)
Shenzhen TCL Digital Technology Co Ltd
Original Assignee
Shenzhen TCL Digital 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 Shenzhen TCL Digital Technology Co Ltd filed Critical Shenzhen TCL Digital Technology Co Ltd
Priority to CN201410843165.5A priority Critical patent/CN105808272B/en
Publication of CN105808272A publication Critical patent/CN105808272A/en
Application granted granted Critical
Publication of CN105808272B publication Critical patent/CN105808272B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a data upgrading method, which comprises the following steps: a first terminal acquires an upgrade configuration file; reading the data content of each partition of the sub-configuration file carrying the differential identifier as a first data content; when the first data content is empty, the first terminal packs the partition with the empty first data content into a differential upgrade package; the first terminal reads the data content of each partition of the sub-configuration file which does not carry the differential identifier as second data content; and when the second data content is not empty, the first terminal packs the subareas of which the second data content is not empty into the whole upgrading packet, generates data to be upgraded according to the differential upgrading packet and the whole upgrading packet, and sends the data to be upgraded to each terminal to be upgraded. The invention also discloses a data upgrading method and device. The invention ensures that the upgrading mode is not single any more, effectively finishes the upgrading operation on the intelligent terminal and improves the efficiency of the upgrading operation.

Description

Data updating method and device
Technical field
The present invention relates to technical field of data processing more particularly to data updating methods and device.
Background technique
As the fast development of intelligent terminal needs to constantly improve the function and application of intelligent terminal to intelligent end The system at end and the carry out updating operation of application.As intelligent terminal system is more and more huger, the updating operation of intelligent terminal Become to become increasingly complex.In the upgrading mode of intelligent terminal, OTA upgrading (update Over the air updates) is most often See with easily controllable upgrading mode, upgrade package is transmitted to by terminal by network, then the process upgraded.Due to network rings The reasons such as border, in downloading escalation process, the size of upgrade package often becomes the key factor for influencing upgrading effect and success or failure. OTA it is during upgrading there are different upgrade methods and strategies, different upgrade methods and strategy cut both ways, for example, subregion is whole Packet upgrading is most simple for upgrading, not easy to make mistakes, but disadvantage is it is also obvious that be exactly that upgrade package is too big, user can face length Time waits and network interruption leads to the puzzlements such as upgrading error.And difference upgrading substantially reduces the size of upgrade package, but not It is that all subregions to be upgraded are suitable for making the difference decilitre grade, has used certain limitation.Therefore, existing intelligent terminal Upgrading mode in upgrading mode it is single, can not effectively to intelligent terminal complete updating operation, cause the efficiency of updating operation inclined It is low.
Above content is only used to facilitate the understanding of the technical scheme, and is not represented and is recognized that above content is existing skill Art.
Summary of the invention
The main purpose of the present invention is to provide a kind of data updating method and devices, it is intended to solve existing intelligent terminal Upgrading mode in upgrading mode it is single, can not effectively to intelligent terminal complete updating operation, cause the efficiency of updating operation inclined Low problem.
To achieve the above object, a kind of data updating method provided by the invention, comprising steps of
First terminal obtains upgrading configuration;
When the first terminal has the sub- configuration file for carrying difference mark in the upgrading configuration, institute is read The data content for carrying each subregion of sub- configuration file of difference mark is stated as the first data content;
First data content is that empty subregion is packaged when first data content is empty by the first terminal Into difference upgrade package;
When the first terminal has the sub- configuration file for not carrying difference mark in the upgrading configuration, read The data content of each subregion of sub- configuration file for not carrying difference mark is as the second data content;
Second data content is not empty subregion when second data content is not sky by the first terminal It is packed into whole packet upgrade package, data to be upgraded is generated according to the difference upgrade package and the whole packet upgrade package, and will be described Data to be upgraded are sent to each terminal to be upgraded, so that each terminal to be upgraded completes upgrading behaviour according to the data to be upgraded Make.
Preferably, described according to the difference upgrade package and the whole packet upgrade package generates data to be upgraded, and will be described After the step of data to be upgraded are sent to each terminal to be upgraded, further includes:
The first terminal judges to identify in data to be upgraded with the presence or absence of difference after receiving data to be upgraded;
When the first terminal has the upgrading data for carrying difference mark in the data to be upgraded, each difference is integrated Decilitre grade data, when the differential data after the integration is valid data, more according to the difference upgrading data after the integration New each subregion is to complete difference updating operation;
The first terminal in the data to be upgraded exist do not carry difference mark upgrading data when, it is described not When the upgrading data for carrying difference mark are valid data, each point is updated according to the upgrading data for not carrying difference mark Area is to complete whole packet updating operation.
Preferably, first data content is empty when first data content is empty by the first terminal Subregion is packed into after the step in difference upgrade package, further includes:
When the sub- configuration file for not carrying difference mark is not present in the first terminal in the upgrading configuration, root Difference upgrading data are generated as data to be upgraded according to the difference upgrade package.
Preferably, the upgrading data creation method further include:
When the sub- configuration file for carrying difference mark is not present in the first terminal in the configuration file, according to described Whole packet upgrade package generates whole packet upgrading data as data to be upgraded.
In addition, to achieve the above object, the present invention furthermore provides a kind of data updating method, comprising steps of
Second terminal judges to whether there is in data to be upgraded after receiving the data to be upgraded that first terminal is sent Difference mark;
When the second terminal has the upgrading data for carrying difference mark in the data to be upgraded, each difference is integrated Decilitre grade data, when the differential data after the integration is valid data, more according to the difference upgrading data after the integration New each subregion is to complete difference updating operation;
The second terminal in the data to be upgraded exist do not carry difference mark upgrading data when, it is described not When the upgrading data for carrying difference mark are valid data, each point is updated according to the upgrading data for not carrying difference mark Area is to complete whole packet updating operation.
Preferably, before the step of in the judgement data to be upgraded with the presence or absence of difference mark, further includes:
The second terminal obtains upgrading configuration;
When the second terminal has the sub- configuration file for carrying difference mark in the upgrading configuration, institute is read The data content for carrying each subregion of sub- configuration file of difference mark is stated as the first data content;
First data content is that empty subregion is packaged when first data content is empty by the second terminal Into difference upgrade package;
When the second terminal has the sub- configuration file for not carrying difference mark in the upgrading configuration, read The data content of each subregion of sub- configuration file for not carrying difference mark is as the second data content;
Second data content is not empty subregion when second data content is not sky by the second terminal It is packed into whole packet upgrade package, data to be upgraded is generated according to the difference upgrade package and the whole packet upgrade package;
The data to be upgraded are sent to each first terminal by the second terminal.
In addition, to achieve the above object, the present invention furthermore provides a kind of data update device, comprising:
First obtains module, for obtaining upgrading configuration;
First read module, when for there is the sub- configuration file for carrying difference mark in the upgrading configuration, The data content of each subregion of sub- configuration file of the carrying difference mark is read as the first data content;
First generation module, for being empty point by first data content when first data content is empty Area is packed into difference upgrade package;
First read module is also used to have the son configuration for not carrying difference mark in the upgrading configuration When file, the data content of each subregion of sub- configuration file for not carrying difference mark is read as the second data content;
First generation module is also used to when second data content is not sky, by second data content It is not packed into whole packet upgrade package for empty subregion, number to be upgraded is generated according to the difference upgrade package and the whole packet upgrade package According to;
First sending and receiving module, for the data to be upgraded to be sent to each terminal to be upgraded, for each to be upgraded Terminal completes updating operation according to the data to be upgraded.
Preferably, the upgrading data generating device further include:
First judgment module, for after receiving the data to be upgraded, judging in data to be upgraded with the presence or absence of poor Minute mark is known;
First upgraded module, when for there are the upgrading data for carrying difference mark in the data to be upgraded, integration Each difference upgrades data, when the differential data after the integration is valid data, is upgraded according to the difference after the integration Data update each subregion to complete difference updating operation;It is also used to exist in the data to be upgraded and does not carry difference mark Upgrading data when, it is described do not carry difference mark upgrading data be valid data when, do not carry difference mark according to described The upgrading data of knowledge update each subregion to complete whole packet updating operation.
Preferably, first generation module is also used in the upgrading configuration there is no not carrying difference mark When the sub- configuration file known, difference upgrading data are generated as data to be upgraded according to the difference upgrade package.
Preferably, first generation module is also used to that the son for carrying difference mark is not present in the configuration file When configuration file, whole packet upgrading data are generated as data to be upgraded according to the whole packet upgrade package.
In addition, to achieve the above object, the present invention furthermore provides a kind of data update device, comprising:
Second judgment module, for judging data to be upgraded after receiving the data to be upgraded that first terminal is sent In with the presence or absence of difference identify;
Second upgraded module, when for there are the upgrading data for carrying difference mark in the data to be upgraded, integration Each difference upgrades data, when the differential data after the integration is valid data, is upgraded according to the difference after the integration Data update each subregion to complete difference updating operation;It is also used to exist in the data to be upgraded and does not carry difference mark Upgrading data when, it is described do not carry difference mark upgrading data be valid data when, do not carry difference mark according to described The upgrading data of knowledge update each subregion to complete whole packet updating operation.
Preferably, the data update device further include:
Second obtains module, for obtaining upgrading configuration;
Second read module, when for there is the sub- configuration file for carrying difference mark in the upgrading configuration, The data content of each subregion of sub- configuration file of the carrying difference mark is read as the first data content;
Second generation module, for being empty point by first data content when first data content is empty Area is packed into difference upgrade package;
Second read module is also used to have the son configuration for not carrying difference mark in the upgrading configuration When file, the data content of each subregion of sub- configuration file for not carrying difference mark is read as the second data content;
Second generation module is also used to when second data content is not sky, by second data content It is not packed into whole packet upgrade package for empty subregion, number to be upgraded is generated according to the difference upgrade package and the whole packet upgrade package According to;
Second sending and receiving module, for the data to be upgraded to be sent to each first terminal.
The present invention by combining the upgrading of whole packet subregion and difference upgrading automatically, so that upgrading mode is no longer single, Updating operation effectively is completed to intelligent terminal, improves the efficiency of updating operation.
Detailed description of the invention
Fig. 1 is the flow diagram of the first embodiment of data updating method of the present invention;
Fig. 2 is the flow diagram of the second embodiment of data updating method of the present invention;
Fig. 3 is the flow diagram of the 3rd embodiment of data updating method of the present invention;
Fig. 4 is the flow diagram of the fourth embodiment of data updating method of the present invention;
Fig. 5 is the functional block diagram of the first embodiment of data update device of the present invention;
Fig. 6 is the functional block diagram of the second embodiment of data update device of the present invention;
Fig. 7 is the functional block diagram of the 3rd embodiment of data update device of the present invention;
Fig. 8 is the functional block diagram of the fourth embodiment of data update device of the present invention.
The embodiments will be further described with reference to the accompanying drawings for the realization, the function and the advantages of the object of the present invention.
Specific embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
The primary solutions of the embodiment of the present invention are: first terminal obtains upgrading configuration;The first terminal exists When there is the sub- configuration file for carrying difference mark in the upgrading configuration, the son configuration for carrying difference mark is read The data content of each subregion of file is as the first data content;The first terminal, will when first data content is empty First data content is that empty subregion is packed into difference upgrade package;The first terminal is in the upgrading configuration When in the presence of the sub- configuration file for not carrying difference mark, the number of each subregion of sub- configuration file for not carrying difference mark is read According to content as the second data content;The first terminal is when second data content is not sky, by second data Content is not that empty subregion is packed into whole packet upgrade package, is generated according to the difference upgrade package and the whole packet upgrade package wait rise The data to be upgraded and are sent to each terminal to be upgraded by grade data, for each terminal to be upgraded according to wait rise Grade data complete updating operation.By combining the upgrading of whole packet subregion and difference upgrading automatically, so that upgrading mode is no longer It is single, updating operation effectively is completed to intelligent terminal, improves the efficiency of updating operation.
It is single due to upgrading mode in the upgrading mode of existing intelligent terminal, effectively intelligent terminal can not be completed to upgrade Operation, causes the efficiency of updating operation relatively low.
Based on the above issues, the present invention provides a kind of data updating method.The embodiment of the present invention is preferably in linux environment Lower use, but it is not limited solely to Linux system.
Referring to Fig.1, Fig. 1 is the flow diagram of the first embodiment of data updating method of the present invention.
In one embodiment, the data updating method includes:
Step S10, first terminal obtain upgrading configuration;
The first terminal starting is packaged script, and reading and being packaged configuration file is upgrading configuration, and the upgrading is matched It is as follows to set file content:
The upgrading configuration includes multiple sub- configuration files, it may for example comprise whole packet upgrading configuration and difference liter Grade configuration file;Or the upgrading configuration is also possible to only include a sub- configuration file, for example, only including whole Bao Sheng Grade configuration file or difference upgrading configuration, the first terminal judge in the packing path, that is, judge that the upgrading is matched It sets and whether carries difference mark in file.The difference mark is generated when making upgrading configuration, for example, it may be Fota.tgz, by fota.tgz to determine whether carrying difference mark, if judging to carry difference mark when there are fota.tgz Know, if it does not exist when fota.tgz, judgement does not carry difference mark.
The preferred intelligent terminal of first terminal, also can also be that other need the terminal of upgrade-system.
There is the sub- configuration file for carrying difference mark in the upgrading configuration in step S20, the first terminal When, the data content of each subregion of sub- configuration file for carrying difference mark is read as the first data content;
When the first terminal carries difference mark in the upgrading configuration, the carrying difference mark is read The data content of each subregion is as the first data content, i.e., this partial content is the data content of difference upgrading as the first data Content, and judge whether first data content is empty.For example, the content of each subregion compression in upgrading configuration is read, Whether the content for judging compression is empty.
First data content is empty when first data content is empty by step S30, the first terminal Subregion is packed into difference upgrade package;
First data are that empty subregion is packed into difference when first data content is empty by the first terminal Divide in upgrade package;When first data content is not sky, it is not packed into described in difference upgrade package for empty subregion. The first terminal, there is no when the sub- configuration file for carrying difference mark, upgrades in the configuration file according to the whole packet Packet generates whole packet upgrading data as data to be upgraded.
There is the son configuration text for not carrying difference mark in the upgrading configuration in step S40, the first terminal When part, the data content of each subregion of sub- configuration file for not carrying difference mark is read as the second data content;
The first terminal also judges in the upgrading configuration with the presence or absence of the son configuration text for not carrying difference mark Part, when there is the sub- configuration file for not carrying difference mark in the upgrading configuration, reading is described not to carry difference mark The data content for each subregion of sub- configuration file known is as the second data content, the judgement son configuration for not carrying difference mark Whether file is empty;When the sub- configuration file for not carrying difference mark being not present in the upgrading configuration, according to packing Difference upgrade package generate difference upgrading data as data to be upgraded.
Step S50, the first terminal are not when second data content is not sky, by second data content Empty subregion is packed into whole packet upgrade package, generates data to be upgraded according to the difference upgrade package and the whole packet upgrade package, And the data to be upgraded are sent to each terminal to be upgraded, so that each terminal to be upgraded is complete according to the data to be upgraded At updating operation.
Second data content is not empty subregion when second data content is not sky by the first terminal It is packed into whole packet upgrade package, data to be upgraded is generated according to the difference upgrade package and the whole packet upgrade package, and will be described Data to be upgraded are sent to each terminal to be upgraded, so that each terminal to be upgraded completes upgrading behaviour according to the data to be upgraded Make;When second data content is empty, this subregion is skipped, is not packed into the subregion that second data content is sky whole In packet upgrade package.
Specifically, the format of data to be upgraded and the format of subregion upgrade package are as follows with reference to the following table 1 to table 3:
Table 1 (data format to be upgraded)
Full packet subregion head
Subregion 1
1 content of subregion
Subregion 2
2 content of subregion
……
Subregion N head
Subregion N content
Table 2 (full packet subregion header structure)
Sign
Partition length
MD5 check value
Upgrade subregion list notation
In table 2, the legitimacy of the signature check label verifying upgrade package of Sign:4 byte
Partition length: the length of entire upgrade package, the length including packet header;
MD5 check value: the MD5 value of upgrade package content does not include the packet header Quan Bao;
Regeneration block list notation: the expression of 4 bytes records whether this upgrade package needs regeneration block.
Table 3 (subregion packet head-coating structure)
Sign
Partition length
MD5 check value
Partition name
Subregion path
Compress mode
Subregion offset
In table 3, the signature check of Sign:4 byte marks to verify the legitimacy of this subregion packet;Partition length: point The length of area's upgrade package;
MD5 check value: the MD5 value of subregion upgrade package content does not include full subregion packet packet header;
Partition name: subregion upgrade package title;
Subregion path: the corresponding subregion path of this subregion upgrade package;
Compress mode: the compress mode of this subregion upgrade package includes several compress modes: non, gzip, bzip2, zip;
Subregion offset: if rolled up in this subregion comprising multiple upgradings, need to formulate the byte number of subregion offset.
If there are the data to be upgraded that compress mode is zip compress mode, compressed format zip in data to be upgraded The subregion of compressed format is difference upgrade package.
Sign signature check mechanism, digital signature use advanced asymmetric-key encryption technology, effectively ensure ascending series According to safety and legitimacy.
The present embodiment by combining the upgrading of whole packet subregion and difference upgrading automatically, so that upgrading mode is no longer single One, updating operation effectively is completed to intelligent terminal, improves the efficiency of updating operation.
It is the flow diagram of the second embodiment of data updating method of the present invention referring to Fig. 2, Fig. 2.Based on above-mentioned data The first embodiment of upgrade method, after the step S50, further includes:
Step S60, the first terminal judge in data to be upgraded after receiving data to be upgraded with the presence or absence of difference Mark;
Step S70, it is whole when the first terminal has the upgrading data for carrying difference mark in the data to be upgraded Each difference upgrading data are closed, when the differential data after the integration is valid data, according to the difference liter after the integration Grade data update each subregion to complete difference updating operation;
Step S80, when there are the upgrading data for not carrying difference mark in the data to be upgraded in the first terminal, When the upgrading data for not carrying difference mark are valid data, more according to the upgrading data for not carrying difference mark New each subregion is to complete whole packet updating operation.
The first terminal based on the received complete in the process and above-mentioned first embodiment of updating operation by data to be upgraded Data to be upgraded generating process be inverse process.For the first terminal when receiving data to be upgraded, judgement is described wait rise Whether grade data are complete upgrading data and effective upgrading data, can be judged by the length of data to be upgraded, for example, When the length of data to be upgraded is matched with preset length, it is judged as complete and effective upgrading data;In the data to be upgraded When mismatching with preset length, it is judged as imperfect and invalid upgrading data.Also it can also be and judge the data to be upgraded Whether the default mark of carrying is judged as imperfect and invalid upgrading data when not carrying default mark;If carrying pre- bidding When knowledge, it is judged as complete and effective upgrading data.Also can also be in other embodiments of the present invention using other modes come Judge whether data to be upgraded are complete and valid data.
The first terminal judges that the data to be upgraded are after the data to be upgraded are complete and effective data No carrying difference mark, and if it exists, then integrate each difference upgrading data, determine integrate difference upgrading data it is correct after, update each A subregion.For example, updating rootfs subregion: ddif=/data/upgrade/rootfs.div of=/dev/ Mmcblk0p11dd is the standard commands of linux, function are as follows: specified file is copied in specified output file.Grammer Are as follows:
Dd [option]
If=input file (or device name)
Of=output file (or device name)
The difference updating operation of first terminal is completed through the above way.
There are whole packets to upgrade data in the data to be upgraded, then starts whole packet upgrading process, confirms each subregion upgrading After data are complete, correct, effective, each subregion is updated, whole packet updating operation is completed.
When the first terminal only includes difference upgrading data in the upgrading data, difference updating operation is completed;? When only including whole packet upgrading data, whole packet updating operation is completed.
The present embodiment by combining the upgrading of whole packet subregion and difference upgrading automatically, so that upgrading mode is no longer single One, updating operation effectively is completed to intelligent terminal, improves the efficiency of updating operation.
It is the flow diagram of the 3rd embodiment of data updating method of the present invention referring to Fig. 3, Fig. 3.
In one embodiment, the data updating method includes:
Step S100, second terminal judge data to be upgraded after receiving the data to be upgraded that first terminal is sent In with the presence or absence of difference identify;
Step S200, when there are the upgrading data for carrying difference mark in the data to be upgraded in the second terminal, Each difference upgrading data are integrated, when the differential data after the integration is valid data, according to the difference after the integration Upgrade data and updates each subregion to complete difference updating operation;
There are the upgrading data for not carrying difference mark in the data to be upgraded in step S300, the second terminal When, when the upgrading data for not carrying difference mark are valid data, according to the ascending series for not carrying difference mark According to each subregion of update to complete whole packet updating operation.
The second terminal based on the received complete in the process and above-mentioned first embodiment of updating operation by data to be upgraded Data to be upgraded generating process be inverse process.For the second terminal when receiving data to be upgraded, judgement is described wait rise Whether grade data are complete upgrading data and effective upgrading data, can be judged by the length of data to be upgraded, for example, When the length of data to be upgraded is matched with preset length, it is judged as complete and effective upgrading data;In the data to be upgraded When mismatching with preset length, it is judged as imperfect and invalid upgrading data.Also it can also be and judge the data to be upgraded Whether the default mark of carrying is judged as imperfect and invalid upgrading data when not carrying default mark;If carrying pre- bidding When knowledge, it is judged as complete and effective upgrading data.Also can also be in other embodiments of the present invention using other modes come Judge whether data to be upgraded are complete and valid data.
The second terminal judges that the data to be upgraded are after the data to be upgraded are complete and effective data No carrying difference mark, and if it exists, then integrate each difference upgrading data, determine integrate difference upgrading data it is correct after, update each A subregion.For example, updating rootfs subregion: ddif=/data/upgrade/rootfs.div of=/dev/ Mmcblk0p11dd is the standard commands of linux, function are as follows: specified file is copied in specified output file.Grammer Are as follows:
Dd [option]
If=input file (or device name)
Of=output file (or device name)
The difference updating operation of second terminal is completed through the above way.
There are whole packets to upgrade data in the data to be upgraded, then starts whole packet upgrading process, confirms each subregion upgrading After data are complete, correct, effective, each subregion is updated, whole packet updating operation is completed.
When the second terminal only includes difference upgrading data in the upgrading data, difference updating operation is completed;? When only including whole packet upgrading data, whole packet updating operation is completed.The preferred intelligent terminal of second terminal, also can also be other Need the terminal of upgrade-system.
The present embodiment by combining the upgrading of whole packet subregion and difference upgrading automatically, so that upgrading mode is no longer single One, updating operation effectively is completed to intelligent terminal, improves the efficiency of updating operation.
It is the flow diagram of the fourth embodiment of data updating method of the present invention referring to Fig. 4, Fig. 4.
In one embodiment, before the step S100, further includes:
Step S400, the second terminal obtain upgrading configuration;
The second terminal starting is packaged script, and reading and being packaged configuration file is upgrading configuration, and the upgrading is matched It is as follows to set file content:
The upgrading configuration includes multiple sub- configuration files, it may for example comprise whole packet upgrading configuration and difference liter Grade configuration file;Or the upgrading configuration is also possible to only include a sub- configuration file, for example, only including whole Bao Sheng Grade configuration file or difference upgrading configuration, the second terminal judge in the packing path, that is, judge that the upgrading is matched It sets and whether carries difference mark in file.The difference mark is generated when making upgrading configuration, for example, it may be Fota.tgz, by fota.tgz to determine whether carrying difference mark, if judging to carry difference mark when there are fota.tgz Know, if it does not exist when fota.tgz, judgement does not carry difference mark.
There is the sub- configuration file for carrying difference mark in the upgrading configuration in step S500, the second terminal When, the data content of each subregion of sub- configuration file for carrying difference mark is read as the first data content;
When the second terminal carries difference mark in the upgrading configuration, the carrying difference mark is read The data content of each subregion is as the first data content, i.e., this partial content is the data content of difference upgrading as the first data Content, and judge whether first data content is empty.For example, the content of each subregion compression in upgrading configuration is read, Whether the content for judging compression is empty.
First data content is sky when first data content is empty by step S600, the second terminal Subregion be packed into difference upgrade package;
First data are that empty subregion is packed into difference when first data content is empty by the second terminal Divide in upgrade package;When first data content is not sky, it is not packed into described in difference upgrade package for empty subregion. The second terminal, there is no when the sub- configuration file for carrying difference mark, upgrades in the configuration file according to the whole packet Packet generates whole packet upgrading data as data to be upgraded.
There is the son configuration text for not carrying difference mark in the upgrading configuration in step S700, the second terminal When part, the data content of each subregion of sub- configuration file for not carrying difference mark is read as the second data content;
The second terminal also judges in the upgrading configuration with the presence or absence of the son configuration text for not carrying difference mark Part, when there is the sub- configuration file for not carrying difference mark in the upgrading configuration, reading is described not to carry difference mark The data content for each subregion of sub- configuration file known is as the second data content, the judgement son configuration for not carrying difference mark Whether file is empty;When the sub- configuration file for not carrying difference mark being not present in the upgrading configuration, according to packing Difference upgrade package generate difference upgrading data as data to be upgraded.
Step S800, the second terminal is when second data content is not sky, not by second data content It is packed into whole packet upgrade package for empty subregion, number to be upgraded is generated according to the difference upgrade package and the whole packet upgrade package According to, and the data to be upgraded are sent to each first terminal.
Second data content is not empty subregion when second data content is not sky by the first terminal It is packed into whole packet upgrade package, data to be upgraded is generated according to the difference upgrade package and the whole packet upgrade package, and will be described Data to be upgraded are sent to each terminal to be upgraded, so that each terminal to be upgraded completes upgrading behaviour according to the data to be upgraded Make;When second data content is empty, this subregion is skipped, is not packed into the subregion that second data content is sky whole In packet upgrade package.
Specifically, reference table 1 is to table 3, it is the format of data to be upgraded and the format of subregion upgrade package.
The present embodiment by combining the upgrading of whole packet subregion and difference upgrading automatically, so that upgrading mode is no longer single One, updating operation effectively is completed to intelligent terminal, improves the efficiency of updating operation.
Corresponding, the present invention further provides a kind of data update devices.
It is the functional block diagram of the first embodiment of data update device of the present invention referring to Fig. 5, Fig. 5.
In one embodiment, the data update device includes: the first acquisition module 10, the first read module 20, first Generation module 30 and the first sending and receiving module 40.
Described first obtains module 10, for obtaining upgrading configuration;
The first terminal starting is packaged script, and reading and being packaged configuration file is upgrading configuration, and the upgrading is matched It is as follows to set file content:
The upgrading configuration includes multiple sub- configuration files, it may for example comprise whole packet upgrading configuration and difference liter Grade configuration file;Or the upgrading configuration is also possible to only include a sub- configuration file, for example, only including whole Bao Sheng Grade configuration file or difference upgrading configuration, the first terminal judge in the packing path, that is, judge that the upgrading is matched It sets and whether carries difference mark in file.The difference mark is generated when making upgrading configuration, for example, it may be Fota.tgz, by fota.tgz to determine whether carrying difference mark, if judging to carry difference mark when there are fota.tgz Know, if it does not exist when fota.tgz, judgement does not carry difference mark.
First read module 20, for there is the son configuration text for carrying difference mark in the upgrading configuration When part, the data content of each subregion of sub- configuration file for carrying difference mark is read as the first data content;
When the first terminal carries difference mark in the upgrading configuration, the carrying difference mark is read The data content of each subregion is as the first data content, i.e., this partial content is the data content of difference upgrading as the first data Content, and judge whether first data content is empty.For example, the content of each subregion compression in upgrading configuration is read, Whether the content for judging compression is empty.
First generation module 30, for being by first data content when first data content is empty Empty subregion is packed into difference upgrade package;
First data are that empty subregion is packed into difference when first data content is empty by the first terminal Divide in upgrade package;When first data content is not sky, it is not packed into described in difference upgrade package for empty subregion. The first terminal, there is no when the sub- configuration file for carrying difference mark, upgrades in the configuration file according to the whole packet Packet generates whole packet upgrading data as data to be upgraded.
First read module 20 is also used to have the son for not carrying difference mark in the upgrading configuration and match When setting file, the data content of each subregion of sub- configuration file for not carrying difference mark is read as the second data content;
The first terminal also judges in the upgrading configuration with the presence or absence of the son configuration text for not carrying difference mark Part, when there is the sub- configuration file for not carrying difference mark in the upgrading configuration, reading is described not to carry difference mark The data content for each subregion of sub- configuration file known is as the second data content, the judgement son configuration for not carrying difference mark Whether file is empty;When the sub- configuration file for not carrying difference mark being not present in the upgrading configuration, according to packing Difference upgrade package generate difference upgrading data as data to be upgraded.
First generation module 30 is also used to when second data content is not sky, will be in second data Hold and be not packed into whole packet upgrade package for empty subregion, is generated according to the difference upgrade package and the whole packet upgrade package to be upgraded Data;
First sending and receiving module 40, for the data to be upgraded to be sent to each terminal to be upgraded, for each wait rise Grade terminal completes updating operation according to the data to be upgraded.
Second data content is not empty subregion when second data content is not sky by the first terminal It is packed into whole packet upgrade package, data to be upgraded is generated according to the difference upgrade package and the whole packet upgrade package, and will be described Data to be upgraded are sent to each terminal to be upgraded, so that each terminal to be upgraded completes upgrading behaviour according to the data to be upgraded Make;When second data content is empty, this subregion is skipped, is not packed into the subregion that second data content is sky whole In packet upgrade package.
Specifically, reference table 1 is to table 3, it is the format of data to be upgraded and the format of subregion upgrade package.
The present embodiment by combining the upgrading of whole packet subregion and difference upgrading automatically, so that upgrading mode is no longer single One, updating operation effectively is completed to intelligent terminal, improves the efficiency of updating operation.
With reference to the functional block diagram for the second embodiment that Fig. 6, Fig. 6 are present invention upgrading data set.The data Update device further include: first judgment module 50 and the first upgraded module 60,
The first judgment module 50, for after receiving the data to be upgraded, judge in data to be upgraded whether There are difference marks;
First upgraded module 60, for there are the upgrading data for carrying difference mark in the data to be upgraded When, each difference upgrading data are integrated, when the differential data after the integration is valid data, according to the difference after the integration Decilitre grade data update each subregion to complete difference updating operation;It is also used to exist in the data to be upgraded and does not carry difference When the upgrading data that minute mark is known, when the upgrading data for not carrying difference mark are valid data, do not carried according to described The upgrading data of difference mark update each subregion to complete whole packet updating operation.
The first terminal based on the received complete in the process and above-mentioned first embodiment of updating operation by data to be upgraded Data to be upgraded generating process be inverse process.For the first terminal when receiving data to be upgraded, judgement is described wait rise Whether grade data are complete upgrading data and effective upgrading data, can be judged by the length of data to be upgraded, for example, When the length of data to be upgraded is matched with preset length, it is judged as complete and effective upgrading data;In the data to be upgraded When mismatching with preset length, it is judged as imperfect and invalid upgrading data.Also it can also be and judge the data to be upgraded Whether the default mark of carrying is judged as imperfect and invalid upgrading data when not carrying default mark;If carrying pre- bidding When knowledge, it is judged as complete and effective upgrading data.Also can also be in other embodiments of the present invention using other modes come Judge whether data to be upgraded are complete and valid data.
The first terminal judges that the data to be upgraded are after the data to be upgraded are complete and effective data No carrying difference mark, and if it exists, then integrate each difference upgrading data, determine integrate difference upgrading data it is correct after, update each A subregion.For example, updating rootfs subregion: ddif=/data/upgrade/rootfs.div of=/dev/ Mmcblk0p11dd is the standard commands of linux, function are as follows: specified file is copied in specified output file.Grammer Are as follows:
Dd [option]
If=input file (or device name)
Of=output file (or device name)
The difference updating operation of first terminal is completed through the above way.
There are whole packets to upgrade data in the data to be upgraded, then starts whole packet upgrading process, confirms each subregion upgrading After data are complete, correct, effective, each subregion is updated, whole packet updating operation is completed.
When the first terminal only includes difference upgrading data in the upgrading data, difference updating operation is completed;? When only including whole packet upgrading data, whole packet updating operation is completed.
The present embodiment by combining the upgrading of whole packet subregion and difference upgrading automatically, so that upgrading mode is no longer single One, updating operation effectively is completed to intelligent terminal, improves the efficiency of updating operation.
It is the functional block diagram of the 3rd embodiment of data update device of the present invention referring to Fig. 7, Fig. 7.The data Update device further includes the second judgment module 100 and the second upgraded module 200.
Second judgment module 100, for judging wait rise after receiving the data to be upgraded that first terminal is sent It is identified in grade data with the presence or absence of difference;
Second upgraded module 200, for there are the upgrading data for carrying difference mark in the data to be upgraded When, each difference upgrading data are integrated, when the differential data after the integration is valid data, according to the difference after the integration Decilitre grade data update each subregion to complete difference updating operation;It is also used to exist in the data to be upgraded and does not carry difference When the upgrading data that minute mark is known, when the upgrading data for not carrying difference mark are valid data, do not carried according to described The upgrading data of difference mark update each subregion to complete whole packet updating operation.
The second terminal based on the received complete in the process and above-mentioned first embodiment of updating operation by data to be upgraded Data to be upgraded generating process be inverse process.For the second terminal when receiving data to be upgraded, judgement is described wait rise Whether grade data are complete upgrading data and effective upgrading data, can be judged by the length of data to be upgraded, for example, When the length of data to be upgraded is matched with preset length, it is judged as complete and effective upgrading data;In the data to be upgraded When mismatching with preset length, it is judged as imperfect and invalid upgrading data.Also it can also be and judge the data to be upgraded Whether the default mark of carrying is judged as imperfect and invalid upgrading data when not carrying default mark;If carrying pre- bidding When knowledge, it is judged as complete and effective upgrading data.Also can also be in other embodiments of the present invention using other modes come Judge whether data to be upgraded are complete and valid data.
The second terminal judges that the data to be upgraded are after the data to be upgraded are complete and effective data No carrying difference mark, and if it exists, then integrate each difference upgrading data, determine integrate difference upgrading data it is correct after, update each A subregion.For example, updating rootfs subregion: ddif=/data/upgrade/rootfs.div of=/dev/ Mmcblk0p11dd is the standard commands of linux, function are as follows: specified file is copied in specified output file.Grammer Are as follows:
Dd [option]
If=input file (or device name)
Of=output file (or device name)
The difference updating operation of second terminal is completed through the above way.
There are whole packets to upgrade data in the data to be upgraded, then starts whole packet upgrading process, confirms each subregion upgrading After data are complete, correct, effective, each subregion is updated, whole packet updating operation is completed.
When the second terminal only includes difference upgrading data in the upgrading data, difference updating operation is completed;? When only including whole packet upgrading data, whole packet updating operation is completed.
The present embodiment by combining the upgrading of whole packet subregion and difference upgrading automatically, so that upgrading mode is no longer single One, updating operation effectively is completed to intelligent terminal, improves the efficiency of updating operation.
With reference to the functional block diagram for the 3rd embodiment that Fig. 8, Fig. 8 are present invention upgrading data set.The data Update device further include: second obtains module 300, the second read module 400, the second generation module 500 and the second sending and receiving module 600。
Described second obtains module 300, for obtaining upgrading configuration;
The second terminal starting is packaged script, and reading and being packaged configuration file is upgrading configuration, and the upgrading is matched It is as follows to set file content:
The upgrading configuration includes multiple sub- configuration files, it may for example comprise whole packet upgrading configuration and difference liter Grade configuration file;Or the upgrading configuration is also possible to only include a sub- configuration file, for example, only including whole Bao Sheng Grade configuration file or difference upgrading configuration, the second terminal judge in the packing path, that is, judge that the upgrading is matched It sets and whether carries difference mark in file.The difference mark is generated when making upgrading configuration, for example, it may be Fota.tgz, by fota.tgz to determine whether carrying difference mark, if judging to carry difference mark when there are fota.tgz Know, if it does not exist when fota.tgz, judgement does not carry difference mark.
Second read module 400, for there is the son configuration for carrying difference mark in the upgrading configuration When file, the data content of each subregion of sub- configuration file for carrying difference mark is read as the first data content;
When the second terminal carries difference mark in the upgrading configuration, the carrying difference mark is read The data content of each subregion is as the first data content, i.e., this partial content is the data content of difference upgrading as the first data Content, and judge whether first data content is empty.For example, the content of each subregion compression in upgrading configuration is read, Whether the content for judging compression is empty.
Second generation module 500, for being by first data content when first data content is empty Empty subregion is packed into difference upgrade package;
First data are that empty subregion is packed into difference when first data content is empty by the second terminal Divide in upgrade package;When first data content is not sky, it is not packed into described in difference upgrade package for empty subregion. The second terminal, there is no when the sub- configuration file for carrying difference mark, upgrades in the configuration file according to the whole packet Packet generates whole packet upgrading data as data to be upgraded.
Second read module 400 is also used to have the son for not carrying difference mark in the upgrading configuration When configuration file, the data content of each subregion of sub- configuration file for not carrying difference mark is read as in the second data Hold;
The second terminal also judges in the upgrading configuration with the presence or absence of the son configuration text for not carrying difference mark Part, when there is the sub- configuration file for not carrying difference mark in the upgrading configuration, reading is described not to carry difference mark The data content for each subregion of sub- configuration file known is as the second data content, the judgement son configuration for not carrying difference mark Whether file is empty;When the sub- configuration file for not carrying difference mark being not present in the upgrading configuration, according to packing Difference upgrade package generate difference upgrading data as data to be upgraded.
Second generation module 500 is also used to when second data content is not sky, will be in second data Hold and be not packed into whole packet upgrade package for empty subregion, is generated according to the difference upgrade package and the whole packet upgrade package to be upgraded Data;
The second sending and receiving module 600, for the data to be upgraded to be sent to each first terminal.
Second data content is not empty subregion when second data content is not sky by the first terminal It is packed into whole packet upgrade package, data to be upgraded is generated according to the difference upgrade package and the whole packet upgrade package, and will be described Data to be upgraded are sent to each terminal to be upgraded, so that each terminal to be upgraded completes upgrading behaviour according to the data to be upgraded Make;When second data content is empty, this subregion is skipped, is not packed into the subregion that second data content is sky whole In packet upgrade package.
Specifically, reference table 1 is to table 3, it is the format of data to be upgraded and the format of subregion upgrade package.
The present embodiment by combining the upgrading of whole packet subregion and difference upgrading automatically, so that upgrading mode is no longer single One, updating operation effectively is completed to intelligent terminal, improves the efficiency of updating operation.
The above is only a preferred embodiment of the present invention, is not intended to limit the scope of the invention, all to utilize this hair Equivalent structure or equivalent flow shift made by bright specification and accompanying drawing content is applied directly or indirectly in other relevant skills Art field, is included within the scope of the present invention.

Claims (8)

1. a kind of data updating method, which is characterized in that comprising steps of
First terminal obtains upgrading configuration;
When the first terminal has the sub- configuration file for carrying difference mark in the upgrading configuration, taken described in reading The data content of each subregion of sub- configuration file with difference mark is as the first data content;
First data content is that empty subregion is packed into difference when first data content is empty by the first terminal Divide in upgrade package;
When the first terminal has the sub- configuration file for not carrying difference mark in the upgrading configuration, described in reading The data content of each subregion of sub- configuration file of difference mark is not carried as the second data content;
Second data content is not that empty subregion is packaged when second data content is not sky by the first terminal To in whole packet upgrade package, data to be upgraded are generated according to the difference upgrade package and the whole packet upgrade package, and by described wait rise Grade data are sent to each terminal to be upgraded, so that each terminal to be upgraded completes updating operation according to the data to be upgraded.
2. data updating method as described in claim 1, which is characterized in that described according to the difference upgrade package and described whole Packet upgrade package generates data to be upgraded, and after the step of data to be upgraded are sent to each terminal to be upgraded, also wraps It includes:
The first terminal judges to identify in data to be upgraded with the presence or absence of difference after receiving data to be upgraded;
When the first terminal has the upgrading data for carrying difference mark in the data to be upgraded, each difference liter is integrated Grade data when the differential data after the integration is valid data, update each according to the difference upgrading data after the integration A subregion is to complete difference updating operation;
When the first terminal has the upgrading data for not carrying difference mark in the data to be upgraded, do not carried described When the upgrading data of difference mark are valid data, according to the upgrading data for not carrying difference mark update each subregion with Complete whole packet updating operation.
3. data updating method as claimed in claim 1 or 2, which is characterized in that the first terminal is in first data When content is empty, after the step that the subregion that first data content is sky is packed into difference upgrade package, further includes:
When the sub- configuration file for not carrying difference mark is not present in the first terminal in the upgrading configuration, according to institute It states difference upgrade package and generates difference upgrading data as data to be upgraded.
4. data updating method as claimed in claim 1 or 2, which is characterized in that the upgrading data creation method further include:
When the sub- configuration file for carrying difference mark is not present in the first terminal in the configuration file, according to the whole packet Upgrade package generates whole packet upgrading data as data to be upgraded.
5. a kind of data update device characterized by comprising
First obtains module, for obtaining upgrading configuration;
First read module is read when for there is the sub- configuration file for carrying difference mark in the upgrading configuration The data content of each subregion of sub- configuration file for carrying difference mark is as the first data content;
First generation module, for being that empty subregion is beaten by first data content when first data content is empty Packet is into difference upgrade package;
First read module is also used to have the sub- configuration file for not carrying difference mark in the upgrading configuration When, the data content of each subregion of sub- configuration file for not carrying difference mark is read as the second data content;
First generation module, be also used to be not by second data content when second data content is not sky Empty subregion is packed into whole packet upgrade package, generates data to be upgraded according to the difference upgrade package and the whole packet upgrade package;
First sending and receiving module, for the data to be upgraded to be sent to each terminal to be upgraded, for each terminal to be upgraded Updating operation is completed according to the data to be upgraded.
6. data update device as claimed in claim 5, which is characterized in that the upgrading data generating device further include:
First judgment module, for after receiving the data to be upgraded, judging in data to be upgraded with the presence or absence of difference mark Know;
First upgraded module is integrated each when for there are the upgrading data for carrying difference mark in the data to be upgraded Difference upgrades data, when the differential data after the integration is valid data, upgrades data according to the difference after the integration Each subregion is updated to complete difference updating operation;It is also used to have the liter for not carrying difference mark in the data to be upgraded When grade data, when the upgrading data for not carrying difference mark are valid data, do not carry what difference identified according to described Upgrade data and updates each subregion to complete whole packet updating operation.
7. such as data update device described in claim 5 or 6, which is characterized in that first generation module is also used in institute It states in upgrading configuration there is no when the sub- configuration file for not carrying difference mark, difference is generated according to the difference upgrade package Upgrade data as data to be upgraded.
8. such as data update device described in claim 5 or 6, which is characterized in that first generation module is also used in institute It states in configuration file there is no when the sub- configuration file for carrying difference mark, whole packet ascending series is generated according to the whole packet upgrade package According to as data to be upgraded.
CN201410843165.5A 2014-12-30 2014-12-30 Data upgrading method and device Active CN105808272B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410843165.5A CN105808272B (en) 2014-12-30 2014-12-30 Data upgrading method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410843165.5A CN105808272B (en) 2014-12-30 2014-12-30 Data upgrading method and device

Publications (2)

Publication Number Publication Date
CN105808272A CN105808272A (en) 2016-07-27
CN105808272B true CN105808272B (en) 2019-05-31

Family

ID=56419868

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410843165.5A Active CN105808272B (en) 2014-12-30 2014-12-30 Data upgrading method and device

Country Status (1)

Country Link
CN (1) CN105808272B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112073994A (en) * 2020-09-03 2020-12-11 百度在线网络技术(北京)有限公司 Method and device for over-the-air upgrading, electronic equipment and readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102065118A (en) * 2010-09-16 2011-05-18 深圳市九洲电器有限公司 Method for updating network equipment and device for implementing method
CN103513998A (en) * 2012-06-25 2014-01-15 中兴通讯股份有限公司 Method and device for generating upgrade package and method and terminal for upgrading dynamic documents in difference mode
CN104184814A (en) * 2014-08-25 2014-12-03 中山市永衡日用制品有限公司 Method and system for generating and compounding embedded firmware differential upgrading file
CN104216719A (en) * 2013-05-30 2014-12-17 深圳创维无线技术有限公司 Method and device for updating android system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102065118A (en) * 2010-09-16 2011-05-18 深圳市九洲电器有限公司 Method for updating network equipment and device for implementing method
CN103513998A (en) * 2012-06-25 2014-01-15 中兴通讯股份有限公司 Method and device for generating upgrade package and method and terminal for upgrading dynamic documents in difference mode
CN104216719A (en) * 2013-05-30 2014-12-17 深圳创维无线技术有限公司 Method and device for updating android system
CN104184814A (en) * 2014-08-25 2014-12-03 中山市永衡日用制品有限公司 Method and system for generating and compounding embedded firmware differential upgrading file

Also Published As

Publication number Publication date
CN105808272A (en) 2016-07-27

Similar Documents

Publication Publication Date Title
US11974204B2 (en) Method for sharing application between terminals, and terminal
CN104052818B (en) The version upgrading method and device of a kind of mobile terminal
EP2524307B1 (en) Operating system auto-update procedure
CN105786549B (en) Smart machine and its upgrade method
CN103942058B (en) A kind of EMBEDDED AVIONICS method for upgrading software and system
EP1897386B1 (en) Apparatus and methods for managing firmware verification on a wireless device
US8522206B2 (en) Selective delta validation of a shared artifact
CN102946600B (en) A kind of mobile terminal parameter firmware upgrade method and system
WO2014180425A1 (en) File system upgrade package production method, upgrade method, device and terminal
US20070061800A1 (en) System and method for updating software in a network device
CN104699511B (en) Plug-in unit upgrade method and device
EP2866142A1 (en) Upgrade package generation method and device, dynamic file differential upgrade method and terminal
WO2022095199A1 (en) Differential upgrade method for embedded device, and related components
CN106775723A (en) The method and Android device of the system firmware customization based on Android platform
CN106843957A (en) System firmware upgrade method and device
WO2017161947A1 (en) Multi-system ota upgrade method and multi-system device
US11977637B2 (en) Technique for authentication and prerequisite checks for software updates
CN103442026A (en) Application program processing method, device and system
CN107809324A (en) A kind of OBD equipment and its upgrade method
CN105808273B (en) Method for upgrading software and software updating apparatus
CN106126297A (en) Method for upgrading system based on Android operation system
CN105573785A (en) Differential package manufacturing method and device
WO2017071337A1 (en) Database table data management method, apparatus and system
CN106020882A (en) Application upgrading method, intelligent terminal and upgrading system
CN106210877A (en) The method for upgrading system of intelligent television and device

Legal Events

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