CN109656603A - Method for upgrading system, device, storage medium and electronic equipment - Google Patents

Method for upgrading system, device, storage medium and electronic equipment Download PDF

Info

Publication number
CN109656603A
CN109656603A CN201910046642.8A CN201910046642A CN109656603A CN 109656603 A CN109656603 A CN 109656603A CN 201910046642 A CN201910046642 A CN 201910046642A CN 109656603 A CN109656603 A CN 109656603A
Authority
CN
China
Prior art keywords
system upgrade
spatial cache
electronic equipment
capacity
packet
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910046642.8A
Other languages
Chinese (zh)
Inventor
李杨
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201910046642.8A priority Critical patent/CN109656603A/en
Publication of CN109656603A publication Critical patent/CN109656603A/en
Pending legal-status Critical Current

Links

Classifications

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

Abstract

The embodiment of the present application discloses a kind of method for upgrading system, device, storage medium and electronic equipment, wherein, electronic equipment can obtain the system upgrade packet of corresponding electronic equipment first, and determine the target capacity for needing to occupy spatial cache when carrying out system upgrade according to system upgrade packet.Then it determines the Backup Data for system upgrade cached in spatial cache, and is unused by the occupancy capacity marking of Backup Data.Not used residual capacity in spatial cache is determined again, and judges whether the residual capacity of spatial cache reaches target capacity, if the residual capacity of spatial cache reaches target capacity, system upgrade is carried out according to system upgrade packet.Thereby, it is possible to avoid upgrading failure caused by the off-capacity of electronic equipment therefore spatial cache, the success rate that system upgrade is carried out to electronic equipment can be improved.

Description

Method for upgrading system, device, storage medium and electronic equipment
Technical field
This application involves field of computer technology, and in particular to a kind of method for upgrading system, device, storage medium and electronics Equipment.
Background technique
Currently, in order to enable electronic equipment is capable of providing more functions and improves the safety etc. of electronic equipment, phase Pass technology provides the system upgrade scheme that system upgrade is carried out to electronic equipment.It is risen in the related technology to electronic equipment It when grade, needs to use the spatial cache of electronic equipment, is lost however, the off-capacity of spatial cache will lead to electronic equipment upgrading It loses.
Summary of the invention
The embodiment of the present application provides a kind of method for upgrading system, device, storage medium and electronic equipment, can be improved pair The success rate of electronic equipment progress system upgrade.
In a first aspect, the embodiment of the present application provides a kind of method for upgrading system, it is applied to electronic equipment, the system liter Grade method include:
The system upgrade packet of the corresponding electronic equipment is obtained, and determines and system upgrade is carried out according to the system upgrade packet When need to occupy the target capacity of spatial cache;
Determine the Backup Data for system upgrade cached in the spatial cache, and by the occupancy of the Backup Data Capacity marking is unused;
It determines not used residual capacity in the spatial cache, and judges whether the residual capacity of the spatial cache reaches To the target capacity;
If the residual capacity of the spatial cache reaches the target capacity, system is carried out according to the system upgrade packet Upgrading.
Second aspect, the embodiment of the present application provide a kind of system upgrade device, are applied to electronic equipment, the system liter Stage arrangement includes:
Module is obtained, for obtaining the system upgrade packet of the corresponding electronic equipment, and is determined according to the system upgrade Packet carries out the target capacity for needing to occupy spatial cache when system upgrade;
Determining module, for determining the Backup Data for system upgrade cached in the spatial cache, and will be described The occupancy capacity marking of Backup Data is unused;
Judgment module for determining not used residual capacity in the spatial cache, and judges the spatial cache Whether residual capacity reaches the target capacity;
Upgraded module, for when the residual capacity of the spatial cache reaches the target capacity, according to the system Upgrade package carries out system upgrade.
The third aspect, the embodiment of the present application provide a kind of storage medium, are stored thereon with computer program, when the meter When calculation machine program is run on computers, so that the computer is executed as in method for upgrading system provided by the embodiments of the present application The step of.
Fourth aspect, the embodiment of the present application provide a kind of electronic equipment, including processor and memory, the memory It is stored with computer program, the processor is provided by calling the computer program for executing the embodiment of the present application such as Method for upgrading system in step.
In the embodiment of the present application, electronic equipment can obtain the system upgrade packet of corresponding electronic equipment first, and determine root Need to occupy the target capacity of spatial cache when carrying out system upgrade according to system upgrade packet.Then it is cached in determining spatial cache It is unused for the Backup Data of system upgrade, and by the occupancy capacity marking of Backup Data.It determines in spatial cache again not The residual capacity used, and judge whether the residual capacity of spatial cache reaches target capacity, if the residual capacity of spatial cache Reach target capacity, then system upgrade is carried out according to system upgrade packet.Thereby, it is possible to avoid electronic equipment therefore spatial cache Upgrade failure caused by off-capacity, can be improved the success rate for carrying out system upgrade to electronic equipment.
Detailed description of the invention
In order to more clearly explain the technical solutions in the embodiments of the present application, make required in being described below to embodiment Attached drawing is briefly described, it should be apparent that, the drawings in the following description are only some examples of the present application, for For those skilled in the art, without creative efforts, it can also be obtained according to these attached drawings other attached Figure.
Fig. 1 is a flow diagram of method for upgrading system provided by the embodiments of the present application.
Fig. 2 is the exemplary diagram of the configuration interface for the system upgrade time interval that electronic equipment provides in the embodiment of the present application.
Fig. 3 is another flow diagram of method for upgrading system provided by the embodiments of the present application.
Fig. 4 is a structural schematic diagram of system upgrade device provided by the embodiments of the present application.
Fig. 5 is a structural schematic diagram of electronic equipment provided by the embodiments of the present application.
Fig. 6 is another structural schematic diagram of electronic equipment provided by the embodiments of the present application.
Specific embodiment
Schema is please referred to, wherein identical component symbol represents identical component, the principle of the application is to implement one It is illustrated in computing environment appropriate.The following description be based on illustrated by the application specific embodiment, should not be by It is considered as limitation the application other specific embodiments not detailed herein.
The embodiment of the present application provides a kind of method for upgrading system first, which is applied to electronic equipment.Its In, the executing subject of the method for upgrading system can be system upgrade device provided by the embodiments of the present application, or be integrated with this The electronic equipment of system upgrade device, the system upgrade device can realize by the way of hardware or software, electronic equipment Can be smart phone, tablet computer, palm PC, laptop or desktop computer etc. has configured with processor The equipment of processing capacity.
Fig. 1 is please referred to, Fig. 1 is the flow diagram of method for upgrading system provided by the embodiments of the present application.As shown in Figure 1, The process of method for upgrading system provided by the embodiments of the present application can be such that
In 101, the system upgrade packet of corresponding electronic equipment is obtained, and determines and system upgrade is carried out according to system upgrade packet When need to occupy the target capacity of spatial cache.
It should be noted that spatial cache is commonly used in the data that the most frequentation of caching electronic equipment is asked, for example, online play Song files, the picture of online browse etc..And during carrying out system upgrade to electronic equipment, spatial cache is also used to Cache the file etc. parsed from system upgrade packet.
In the embodiment of the present application, electronic equipment obtains the system of corresponding electronic equipment when triggering system upgrade first Upgrade package that is to say electronic equipment by the system upgrade packet of current system edition upgrading to recent systems version.For example, electronics is set It is standby can be in the system upgrade operation for receiving user's input, triggering carries out system upgrade, can also be reach it is preset When the system upgrade period, automatic trigger carries out system upgrade, can also be other way triggering etc..
Which kind of do not done in addition, mode to get corresponding system upgrade packet using for electronic equipment in the embodiment of the present application Concrete restriction can be pre-configured with according to actual needs by those of ordinary skill in the art.For example, can be direct by electronic equipment It is obtained from the external memory of attachment, such as searches and obtain from the TF card or USB flash disk that electronic equipment is inserted into.
Electronic equipment reboots into Recovery mode after getting corresponding system upgrade packet, wherein Recovery mode is similar to Windows PE can be to the number of system space after electronic equipment enters Recovery mode According to modifying, such as carry out system upgrade and factory reset operation.
Under Recovery mode, electronic equipment, which is further determined that, carries out system upgrade according to the system upgrade packet got When need to occupy the target capacity of spatial cache.
In 102, the Backup Data for system upgrade cached in spatial cache is determined, and by the occupancy of Backup Data Capacity marking is unused.
It should be noted that some intermediate files when carrying out system upgrade, can be backuped to spatial cache by electronic equipment, To realize power loss recovery, for example, electronic equipment can be by intermediate file with saved.file and stash data under Android system Form backups to spatial cache.However, these Backup Datas can be covered constantly by new Backup Data, in other words, this A little Backup Datas can be recycled the occupancy capacity of spatial cache.Therefore, in the embodiment of the present application, electronics is set It is standby to further determine that the Backup Data for system upgrade cached in spatial cache, and by the occupancy capacity marking of Backup Data Be it is unused, that is to say and regard the occupancy capacity of Backup Data as in escalation process available capacity.
In 103, not used residual capacity in spatial cache is determined, and judge whether the residual capacity of spatial cache reaches To target capacity.
Based on above description, one of ordinary skill in the art will appreciate that due to the occupancy capacity quilt of Backup Data Labeled as being not used, not used residual capacity (that is to say available capacity in escalation process) in spatial cache is determined at this time, The occupancy capacity of Backup Data will be counted in residual capacity, and popular says, i.e., the remaining of spatial cache determining at this time is held Amount includes the occupancy capacity of capacity and Backup Data that upgrading is not occupied by any file data, such as, it is assumed that in spatial cache The capacity not occupied by any file data is 400M, if the occupancy capacity of Backup Data is 200M in cushion space, will be standby The occupancy capacity marking of part data is not used residual capacity=400+200=600 in determining spatial cache after being not used (M)。
In the embodiment of the present application, electronic equipment further judges spatial cache after determining the residual capacity of spatial cache Residual capacity whether reach target capacity, to determine whether the residual capacity of spatial cache is sufficiently used for according to judging result Complete the system upgrade to electronic equipment.Wherein, if the residual capacity of spatial cache reaches target capacity, electronic equipment determines The residual capacity of spatial cache is sufficiently used for completing the system upgrade to electronic equipment.
In 104, if the residual capacity of spatial cache reaches target capacity, system liter is carried out according to system upgrade packet Grade.
As described above, one of ordinary skill in the art will appreciate that if the residual capacity of spatial cache reaches The residual capacity for determining spatial cache is sufficiently used for completing the system upgrade to electronic equipment by target capacity, electronic equipment, this When, electronic equipment carries out system upgrade according to the system upgrade packet got.Wherein, for electronic equipment how according to system liter Grade packet carries out system upgrade, can refer to the relevant technologies and accordingly implements, the embodiment of the present application is without limitation.
From the foregoing, it will be observed that electronic equipment can obtain the system upgrade packet of corresponding electronic equipment first in the embodiment of the present application, And determine the target capacity for needing to occupy spatial cache when carrying out system upgrade according to system upgrade packet.Then spatial cache is determined The Backup Data for system upgrade of middle caching, and be unused by the occupancy capacity marking of Backup Data.Caching is determined again Not used residual capacity in space, and judge whether the residual capacity of spatial cache reaches target capacity, if spatial cache Residual capacity reaches target capacity, then carries out system upgrade according to system upgrade packet.Thereby, it is possible to avoid electronic equipment therefore slow Upgrading fails caused by depositing the off-capacity in space, can be improved the success rate that system upgrade is carried out to electronic equipment.
In one embodiment, it " determines not used residual capacity in spatial cache, and judges the residual capacity of spatial cache Whether target capacity is reached " after, further includes:
(1) if the residual capacity miss the mark capacity of spatial cache, according to preset Prune Policies to spatial cache into Row data scrubbing;
(2) if the residual capacity of spatial cache reaches target capacity after carrying out data scrubbing, according to system upgrade packet into Row system upgrade.
In the embodiment of the present application, the not used residual capacity in determining spatial cache, and judge the residue of spatial cache After whether capacity reaches target capacity, if the residual capacity that the judging result that electronic equipment obtains is spatial cache is not up to mesh Capacity is marked, the residual capacity for determining spatial cache is not enough to complete the system upgrade to electronic equipment by electronic equipment.At this point, electric Sub- equipment will carry out data scrubbing to spatial cache according to default Prune Policies.Wherein, the embodiment of the present application is to default cleaning plan Setting slightly is not particularly limited, and can be pre-configured with according to actual needs by those of ordinary skill in the art, for example, default cleaning Strategy can not be configured to that the primary cleaning mechanism of electronic equipment is called to carry out data scrubbing to spatial cache, that is to say and clean up The data cached of use state is not under spatial cache root, wherein be not at use state it is data cached i.e. not by Any process uses data cached, and Backup Data is upgraded process use, will not be cleaned.
Complete to the data scrubbing of spatial cache after, electronic equipment judge again spatial cache residual capacity whether Reach target capacity, if the residual capacity for carrying out cushion space after data scrubbing reaches target capacity, electronic equipment is according to being Upgrade package of uniting carries out system upgrade.It should be noted that the residual capacity of spatial cache still includes accounting for for Backup Data at this time Use capacity.
" carrying out data scrubbing to spatial cache according to default Prune Policies " in one embodiment includes:
In addition to default white list and the data cached of use state is not in cleaning spatial cache.
The embodiment of the present application provides a kind of optionally default Prune Policies, wherein the default Prune Policies are configured as clearly In addition to default white list and the data cached of use state is not in reason spatial cache.In the embodiment of the present application, electronics Equipment will remove default white list for according to the aforementioned default Prune Policies of configuration in the root of spatial cache and second-level directory Except and be not at the data cached deletion of use state.
It should be noted that the data in default white list can be cooperateed with by the manufacturer of user and electronic equipment and be determined, speech is changed It, include in default white list data cached and electronic equipment the manufacturer not being cleaned that specifies of user it is specified not by That clears up is data cached.
In one embodiment, " in addition to default white list and the caching number of use state is not in cleaning spatial cache According to " after, further includes:
If the residual capacity of spatial cache is still not up to target capacity, clear up in spatial cache in addition to default white list It is data cached.
It should be noted that deleting data cached in spatial cache, the use of electronic equipment will not influence, The data cached of these deletions can automatically generate again in the use process of electronic equipment.Therefore, in order to ensure electronic equipment System upgrade can be successfully completed, electronic equipment in addition to default white list and is not at using shape in cleaning spatial cache State it is data cached after, if the residual capacity of spatial cache is still not up to target capacity, clear up in spatial cache except default Data cached except white list, i.e., in the root of deletion spatial cache and second-level directory in addition to default white list institute Have data cached.
It should be noted that in order to avoid generating Backup Data again in the embodiment of the present application, in cleaning spatial cache Before data cached in addition to default white list, Backup Data is added in default white list, simultaneously to avoid Backup Data It deletes.
In one embodiment, after " data cached in addition to default white list in cleaning spatial cache ", further includes:
If the residual capacity of spatial cache is still not up to target capacity, dilatation processing is carried out to spatial cache, so that slow The residual capacity for depositing space reaches target capacity.
Wherein, the partition size that dilatation processing increases spatial cache is carried out to spatial cache.It should be noted that due to Total memory space of electronic equipment be it is certain, while increasing spatial cache partition size, corresponding to reduce user data empty Between partition size, popular says, i.e., moves the portion capacity of user data space to spatial cache, for example, electronic equipment exists In right spatial cache in addition to default white list it is all it is data cached after, it is found that the residual capacity of spatial cache is also poor 100M reaches target capacity, at this point, electronic equipment reduces the capacity of user data space 100M, and the capacity of this 100M is increased To spatial cache, so that the residual capacity of spatial cache reaches target capacity.
In one embodiment, before " carrying out system upgrade according to system upgrade packet ", further includes:
Safety check is carried out to system upgrade packet, if verification passes through, according to system upgrade packet to electronic equipment system System upgrading.
In the embodiment of the present application, electronic equipment is before carrying out system upgrade according to system upgrade packet, to the system of acquisition Upgrade package carries out safety check, and carries out system upgrade to electronic equipment according to the system upgrade packet when verification passes through, with true Data in insurance system upgrade package are not tampered with, and guarantee the safety of system upgrade.
Wherein, electronic equipment, can be first from the default of system upgrade packet when carrying out safety check to system upgrade packet The first check information that position (for example, packet header) extraction system upgrade package carries, then the second verification of computing system upgrade package The second check information being calculated is compared information with the first check information extracted, if the two compares consistent, electricity Sub- equipment decision-making system upgrade package passes through safety check.
Illustratively, on the one hand, the generation end of system upgrade packet is after compiling obtains system upgrade packet, using presetting message Digest algorithm (including but not limited to MD5 algorithm, SHA1 algorithm etc.) is calculated according to the data in system upgrade packet, obtains One check information, and will be in the packet header of the first check information writing system upgrade package.On the other hand, electronic equipment is to system liter When grade packet is verified, the first check information is extracted from the packet header of system upgrade packet, and be used in the life of system upgrade packet At holding identical presetting message summary info to be calculated according to the data in system upgrade packet, the second check information is obtained, so The second check information being calculated is compared with the first check information extracted afterwards, if the two compares unanimously, is illustrated System upgrade packet is not tampered in by " the generation end of system upgrade packet " transmission process to electronic equipment, therefore electronic equipment Decision-making system upgrade package passes through safety check.
In one embodiment, " the system upgrade packet for obtaining corresponding electronic equipment ", comprising:
The system upgrade packet of corresponding electronic equipment is obtained from upgrade server;
Alternatively, obtaining the system upgrade packet of corresponding electronic equipment from other electronic equipments.
As an alternative embodiment, when obtaining the system upgrade packet of corresponding electronic equipment, electronic equipment can be with The system upgrade packet of corresponding electronic equipment is obtained from upgrade server.
Wherein, on the one hand, electronic equipment sends data packet acquisition request to upgrade server, and data packet acquisition request carries There is the version number of the current system version of electronic equipment, and receives the system liter of the aforementioned version number of correspondence of upgrade server return Grade packet.On the other hand, upgrade server obtains after receiving the data packet acquisition request from electronic equipment according to data packet The version number for taking request to carry finds the system upgrade by electronic equipment by current system edition upgrading to recent systems version Packet, and the system upgrade packet is back to electronic equipment.
As another optional embodiment, when obtaining the system upgrade packet of corresponding electronic equipment, electronic equipment may be used also To obtain the system upgrade packet of corresponding electronic equipment from other electronic equipments.
Wherein, on the one hand, electronic equipment sends data packet acquisition request to wireless communication (for example, Wi-Fi, bluetooth etc.) model Interior other electronic equipments are enclosed, data packet acquisition request carries the version number of the current system version of electronic equipment, and receives The system upgrade packet for the aforementioned version number of correspondence that other electronic equipments return.On the other hand, other electronic equipments are receiving From after the data packet acquisition request of electronic equipment, found according to the version number that data packet acquisition request carries by electronic equipment By the system upgrade packet of current system edition upgrading to recent systems version, if finding, the system upgrade packet that will find It is back to electronic equipment.Thus, it is possible to enable what electronic equipment do not consumed mobile network's flow to get system upgrade packet.
In one embodiment, before " carrying out system upgrade according to system upgrade packet ", further includes:
Whether judgement currently reaches preset system upgrade time interval, if reaching, according to system upgrade packet system System upgrading.
In the embodiment of the present application, also configure when restricted electronic equipment is carrying out system upgrade in electronic equipment in advance System upgrade time interval, wherein the embodiment of the present application for system upgrade time interval concrete configuration with no restrictions, can be by User configures according to actual needs, for example, referring to figure 2., electronic equipment is provided with the configuration of system upgrade time interval Interface, in the configuration interface, electronic equipment can receive the initial time for being able to carry out system upgrade and the end of user's input The only moment, so that system upgrade time interval is obtained according to the initial time of user's input and end time, as shown in Fig. 2, with The initial time of family input is the 22:30 on " same day ", and end time is the 06:00 of " next day ", and electronic equipment will obtain system liter Grade time interval is same day 22:30 to next day 06:00.
In the embodiment of the present application, system upgrade is carried out in system upgrade time interval by limiting electronic equipment, it can Avoid system upgrade influence caused by user's use.
It is another flow diagram of method for upgrading system provided by the embodiments of the present application incorporated by reference to reference Fig. 3, Fig. 3, The process of the method for upgrading system may include:
In 201, electronic equipment obtains the system upgrade packet of corresponding electronic equipment, and determines and carried out according to system upgrade packet Need to occupy the target capacity of spatial cache when system upgrade.
It should be noted that spatial cache is commonly used in the data that the most frequentation of caching electronic equipment is asked, for example, online play Song files, the picture of online browse etc..And during carrying out system upgrade to electronic equipment, spatial cache is also used to Cache the file etc. parsed from system upgrade packet.
In the embodiment of the present application, electronic equipment obtains the system of corresponding electronic equipment when triggering system upgrade first Upgrade package that is to say electronic equipment by the system upgrade packet of current system edition upgrading to recent systems version.For example, electronics is set It is standby can be in the system upgrade operation for receiving user's input, triggering carries out system upgrade, can also be reach it is preset When the system upgrade period, automatic trigger carries out system upgrade, can also be other way triggering etc..
Which kind of do not done in addition, mode to get corresponding system upgrade packet using for electronic equipment in the embodiment of the present application Concrete restriction can be pre-configured with according to actual needs by those of ordinary skill in the art.For example, can be direct by electronic equipment It is obtained from the external memory of attachment, such as searches and obtain from the TF card or USB flash disk that electronic equipment is inserted into.
Electronic equipment reboots into Recovery mode after getting corresponding system upgrade packet, wherein Recovery mode is similar to Windows PE can be to the number of system space after electronic equipment enters Recovery mode According to modifying, such as carry out system upgrade and factory reset operation.
Under Recovery mode, electronic equipment, which is further determined that, carries out system upgrade according to the system upgrade packet got When need to occupy the target capacity of spatial cache.
In 202, electronic equipment determines the Backup Data for system upgrade cached in spatial cache, and will back up number According to occupancy capacity marking be unused.
It should be noted that some intermediate files when carrying out system upgrade, can be backuped to spatial cache by electronic equipment, To realize power loss recovery, for example, electronic equipment can be by intermediate file with saved.file and stash data under Android system Form backups to spatial cache.However, these Backup Datas can be covered constantly by new Backup Data, in other words, this A little Backup Datas can be recycled the occupancy capacity of spatial cache.Therefore, in the embodiment of the present application, electronics is set It is standby to further determine that the Backup Data for system upgrade cached in spatial cache, and by the occupancy capacity marking of Backup Data Be it is unused, that is to say and regard the occupancy capacity of Backup Data as in escalation process available capacity.
In 203, electronic equipment determines not used residual capacity in spatial cache, and judges that the remaining of spatial cache is held Whether amount reaches target capacity, is to be transferred to 204, is otherwise transferred to 205.
Based on above description, one of ordinary skill in the art will appreciate that due to the occupancy capacity quilt of Backup Data Labeled as being not used, not used residual capacity (that is to say available capacity in escalation process) in spatial cache is determined at this time, The occupancy capacity of Backup Data will be counted in residual capacity, and popular says, i.e., the remaining of spatial cache determining at this time is held Amount includes the occupancy capacity of capacity and Backup Data that upgrading is not occupied by any file data, such as, it is assumed that in spatial cache The capacity not occupied by any file data is 400M, if the occupancy capacity of Backup Data is 200M in cushion space, will be standby The occupancy capacity marking of part data is not used residual capacity=400+200=600 in determining spatial cache after being not used (M)。
In the embodiment of the present application, electronic equipment further judges spatial cache after determining the residual capacity of spatial cache Residual capacity whether reach target capacity, to determine whether the residual capacity of spatial cache is sufficiently used for according to judging result Complete the system upgrade to electronic equipment.Wherein, if the residual capacity of spatial cache reaches target capacity, electronic equipment determines The residual capacity of spatial cache is sufficiently used for completing the system upgrade to electronic equipment.
In 204, electronic equipment carries out system upgrade according to system upgrade packet.
As described above, one of ordinary skill in the art will appreciate that if the residual capacity of spatial cache reaches The residual capacity for determining spatial cache is sufficiently used for completing the system upgrade to electronic equipment by target capacity, electronic equipment, this When, electronic equipment carries out system upgrade according to the system upgrade packet got.Wherein, for electronic equipment how according to system liter Grade packet carries out system upgrade, can refer to the relevant technologies and accordingly implements, the embodiment of the present application is without limitation.
In addition to default white list and the caching of use state is not in 205, in electronic equipment cleaning spatial cache Data, and judge whether the residual capacity of spatial cache reaches target capacity, it is to be transferred to 204, is otherwise transferred to 206.
In the embodiment of the present application, the not used residual capacity in determining spatial cache, and judge the residue of spatial cache After whether capacity reaches target capacity, if the residual capacity that the judging result that electronic equipment obtains is spatial cache is not up to mesh Capacity is marked, the residual capacity for determining spatial cache is not enough to complete the system upgrade to electronic equipment by electronic equipment.At this point, electric Sub- equipment will carry out data scrubbing to spatial cache according to default Prune Policies.Wherein, default Prune Policies are configured as clearing up In addition to default white list and the data cached of use state is not in spatial cache.In the embodiment of the present application, electronics is set It is standby will according to the aforementioned default Prune Policies of configuration, will in the root of spatial cache and second-level directory except default white list it Outside and it is not at the data cached deletion of use state.It should be noted that the data in default white list can be by user and electricity The manufacturer of sub- equipment, which cooperates with, to be determined, in other words, in default white list includes that not being cleaned of specifying of user is data cached, and What the manufacturer of electronic equipment specified is not cleaned data cached.
Cleaning spatial cache in addition to default white list and be not at use state it is data cached after, electronics Equipment judges whether the residual capacity of spatial cache reaches target capacity again, if the residual capacity of cushion space reaches mesh at this time Capacity is marked, then is transferred to 204, system upgrade is carried out according to system upgrade packet, is otherwise transferred to 206, is continued to slow in spatial cache Deposit data is cleared up.It should be noted that the residual capacity of spatial cache still includes the occupancy capacity of Backup Data at this time.
In 206, data cached in addition to default white list in electronic equipment cleaning spatial cache, and judge that caching is empty Between residual capacity whether reach target capacity, be to be transferred to 204, be otherwise transferred to 207.
It should be noted that deleting data cached in spatial cache, the use of electronic equipment will not influence, The data cached of these deletions can automatically generate again in the use process of electronic equipment.Therefore, in order to ensure electronic equipment System upgrade can be successfully completed, electronic equipment in addition to default white list and is not at using shape in cleaning spatial cache State it is data cached after, if the residual capacity of spatial cache is still not up to target capacity, clear up in spatial cache except default Data cached except white list, i.e., in the root of deletion spatial cache and second-level directory in addition to default white list institute Have data cached.
It should be noted that in order to avoid generating Backup Data again in the embodiment of the present application, in cleaning spatial cache Before data cached in addition to default white list, Backup Data is added in default white list, simultaneously to avoid Backup Data It deletes.
After clearing up data cached in addition to default white list, electronic equipment judges that the remaining of spatial cache is held again Whether amount reaches target capacity, if the residual capacity of cushion space reaches target capacity at this time, 204 is transferred to, according to system liter Grade packet carries out system upgrade, is otherwise transferred to 207.It should be noted that the residual capacity of spatial cache still includes backup at this time The occupancy capacity of data.
In 207, electronic equipment carries out dilatation processing to spatial cache, so that the residual capacity of spatial cache reaches target Capacity, and it is transferred to 204.
Wherein, the partition size that dilatation processing increases spatial cache is carried out to spatial cache.It should be noted that due to Total memory space of electronic equipment be it is certain, while increasing spatial cache partition size, corresponding to reduce user data empty Between partition size, popular says, i.e., moves the portion capacity of user data space to spatial cache, for example, electronic equipment exists In right spatial cache in addition to default white list it is all it is data cached after, it is found that the residual capacity of spatial cache is also poor 100M reaches target capacity, at this point, electronic equipment reduces the capacity of user data space 100M, and the capacity of this 100M is increased To spatial cache, so that the residual capacity of spatial cache reaches target capacity.
The embodiment of the present application also provides a kind of system upgrade device.Referring to figure 4., Fig. 4 is provided by the embodiments of the present application The structural schematic diagram of system upgrade device.Wherein the system upgrade device is applied to electronic equipment, which includes Module 501, determining module 502, judgment module 503 and upgraded module 504 are obtained, as follows:
Module 501 is obtained, for obtaining the system upgrade packet of corresponding electronic equipment, and determines and is carried out according to system upgrade packet Need to occupy the target capacity of spatial cache when system upgrade;
Determining module 502 for determining the Backup Data for system upgrade cached in spatial cache, and will back up number According to occupancy capacity marking be unused;
Judgment module 503 for determining not used residual capacity in spatial cache, and judges that the remaining of spatial cache is held Whether amount reaches target capacity;
Upgraded module 504 carries out system according to system upgrade packet if the residual capacity of spatial cache reaches target capacity Upgrading.
In one embodiment, upgraded module 504 determines not used residual capacity in spatial cache in judgment module 503, And after judging whether the residual capacity of spatial cache reaches target capacity, it is also used to:
If the residual capacity miss the mark capacity of spatial cache, spatial cache is counted according to Prune Policies are preset According to cleaning;
If the residual capacity for carrying out spatial cache after data scrubbing reaches target capacity, according to system upgrade packet system System upgrading grade.
In one embodiment, when according to Prune Policies are preset to spatial cache progress data scrubbing, upgraded module 504 can To be used for:
In addition to default white list and the data cached of use state is not in cleaning spatial cache.
In one embodiment, in addition to default white list and the caching of use state is not in cleaning spatial cache After data, upgraded module 504 is also used to:
If the residual capacity of spatial cache is still not up to target capacity, clear up in spatial cache in addition to default white list It is data cached.
In one embodiment, in cleaning spatial cache after data cached in addition to default white list, upgraded module 504 are also used to:
If the residual capacity of spatial cache is still not up to target capacity, dilatation processing is carried out to spatial cache, so that slow The residual capacity for depositing space reaches target capacity, and carries out system upgrade according to system upgrade packet.
In one embodiment, before carrying out system upgrade according to system upgrade packet, upgraded module 504 is also used to:
Safety check is carried out to system upgrade packet, if verification passes through, according to system upgrade packet to electronic equipment system System upgrading.
In one embodiment, when obtaining the system upgrade packet of corresponding electronic equipment, obtaining module 501 can be used for:
The system upgrade packet of corresponding electronic equipment is obtained from upgrade server;
Alternatively, obtaining the system upgrade packet of corresponding electronic equipment from other electronic equipments.
In one embodiment, before carrying out system upgrade according to system upgrade packet, upgraded module 504 is also used to:
Whether judgement currently reaches preset system upgrade time interval, if reaching, according to system upgrade packet system System upgrading.
It should be noted that the system upgrade side in system upgrade device provided by the embodiments of the present application and foregoing embodiments It is owned by France in same design, on system upgrade device can in operating system upgrade method embodiment provide either method, Specific implementation process is detailed in method for upgrading system embodiment, and details are not described herein again.
The embodiment of the present application provides a kind of computer-readable storage medium, is stored thereon with computer program, when it is deposited When the computer program of storage executes on computers, so that computer executes such as method for upgrading system provided by the embodiments of the present application In step.Wherein, storage medium can be magnetic disk, CD, read-only memory (Read Only Memory, ROM) or with Machine memory access (Random Access Memory, RAM) etc..
The embodiment of the present application also provides a kind of electronic equipment, and referring to figure 5., electronic equipment includes processor 701 and storage Device 702.Wherein, processor 701 and memory 702 are electrically connected.
Processor 701 is the control centre of electronic equipment, utilizes each of various interfaces and the entire electronic equipment of connection A part by the computer program of operation or load store in memory 702, and is called and is stored in memory 702 Data, execute the various functions of electronic equipment and handle data.
Memory 702 can be used for storing software program and module, and processor 701 is stored in memory 702 by operation Computer program and module, thereby executing various function application and data processing.Memory 702 can mainly include storage Program area and storage data area, wherein storing program area can computer program needed for storage program area, at least one function (such as sound-playing function, image player function etc.) etc.;Storage data area can be stored to be created according to using for electronic equipment Data etc..In addition, memory 702 may include high-speed random access memory, it can also include nonvolatile memory, example Such as at least one disk memory, flush memory device or other volatile solid-state parts.Correspondingly, memory 702 may be used also To include Memory Controller, to provide access of the processor 701 to memory 702.
In the embodiment of the present application, processor 701 in electronic equipment can according to following step, by one or one with On computer program process it is corresponding instruction be loaded into memory 702, and by processor 701 operation be stored in memory Computer program in 702, thus realize various functions, it is as follows:
The system upgrade packet of corresponding electronic equipment is obtained, and determines and needs to account for when carrying out system upgrade according to system upgrade packet With the target capacity of spatial cache;
Determine the Backup Data for system upgrade cached in spatial cache, and by the occupancy capacity marking of Backup Data It is unused;
It determines not used residual capacity in spatial cache, and judges whether the residual capacity of spatial cache reaches target appearance Amount;
If the residual capacity of spatial cache reaches target capacity, system upgrade is carried out according to system upgrade packet.
Fig. 6 is please referred to, Fig. 6 is another structural schematic diagram of electronic equipment provided by the embodiments of the present application, with electricity shown in Fig. 5 The difference of sub- equipment is that electronic equipment further includes the components such as input unit 703 and output unit 704.
Wherein, input unit 703 can be used for receiving the number of input, character information or user's characteristic information (for example refer to Line), and to generate related with user setting and function control keyboard, mouse, operating stick, optics or trackball signal defeated Enter.
Output unit 704 can be used for showing information input by user or the information for being supplied to user, such as screen.
In the embodiment of the present application, processor 701 in electronic equipment can according to following step, by one or one with On computer program process it is corresponding instruction be loaded into memory 702, and by processor 701 operation be stored in memory Computer program in 702, thus realize various functions, it is as follows:
The system upgrade packet of corresponding electronic equipment is obtained, and determines and needs to account for when carrying out system upgrade according to system upgrade packet With the target capacity of spatial cache;
Determine the Backup Data for system upgrade cached in spatial cache, and by the occupancy capacity marking of Backup Data It is unused;
It determines not used residual capacity in spatial cache, and judges whether the residual capacity of spatial cache reaches target appearance Amount;
If the residual capacity of spatial cache reaches target capacity, system upgrade is carried out according to system upgrade packet.
In one embodiment, the not used residual capacity in determining spatial cache, and judge that the remaining of spatial cache is held After whether amount reaches target capacity, processor 701 can be executed:
If the residual capacity miss the mark capacity of spatial cache, spatial cache is counted according to Prune Policies are preset According to cleaning;
If the residual capacity for carrying out spatial cache after data scrubbing reaches target capacity, according to system upgrade packet system System upgrading grade.
In one embodiment, when according to presetting Prune Policies and carrying out data scrubbing to spatial cache, processor 701 can be with It executes:
In addition to default white list and the data cached of use state is not in cleaning spatial cache.
In one embodiment, in addition to default white list and the caching of use state is not in cleaning spatial cache After data, processor 701 be can also be performed:
If the residual capacity of spatial cache is still not up to target capacity, clear up in spatial cache in addition to default white list It is data cached.
In one embodiment, after data cached in addition to default white list in cleaning spatial cache, processor 701 can execute:
If the residual capacity of spatial cache is still not up to target capacity, dilatation processing is carried out to spatial cache, so that slow The residual capacity for depositing space reaches target capacity, and carries out system upgrade according to system upgrade packet.
In one embodiment, before carrying out system upgrade according to system upgrade packet, processor 701 can be executed:
Safety check is carried out to system upgrade packet, if verification passes through, according to system upgrade packet to electronic equipment system System upgrading.
In one embodiment, when obtaining the system upgrade packet of corresponding electronic equipment, processor 701 can be executed:
The system upgrade packet of corresponding electronic equipment is obtained from upgrade server;
Alternatively, obtaining the system upgrade packet of corresponding electronic equipment from other electronic equipments.
In one embodiment, before carrying out system upgrade according to system upgrade packet, processor 701 can be executed:
Whether judgement currently reaches preset system upgrade time interval, if reaching, according to system upgrade packet system System upgrading.
It should be noted that the method for upgrading system category in electronic equipment provided by the embodiments of the present application and foregoing embodiments It, on an electronic device can be with either offer method in operating system upgrade method embodiment, specific implementation in same design Process is detailed in feature extracting method embodiment, and details are not described herein again.
It should be noted that for the method for upgrading system of the embodiment of the present application, this field common test personnel can be with Understand all or part of the process for realizing the method for upgrading system of the embodiment of the present application, is that can be controlled by computer program Relevant hardware is completed, and the computer program can be stored in a computer-readable storage medium, be such as stored in electronics It in the memory of equipment, and is executed by least one processor in the electronic equipment, in the process of implementation may include such as system The process of the embodiment of upgrade method.Wherein, the storage medium can be magnetic disk, CD, read-only memory, arbitrary access note Recall body etc..
For the system upgrade device of the embodiment of the present application, each functional module be can integrate in a processing chip In, it is also possible to modules and physically exists alone, can also be integrated in two or more modules in a module.It is above-mentioned Integrated module both can take the form of hardware realization, can also be realized in the form of software function module.It is described integrated If module realized in the form of software function module and when sold or used as an independent product, also can store one In a computer-readable storage medium, the storage medium is for example read-only memory, disk or CD etc..
Above to a kind of method for upgrading system, device, storage medium and electronic equipment provided by the embodiment of the present application into It has gone and has been discussed in detail, specific examples are used herein to illustrate the principle and implementation manner of the present application, the above implementation The explanation of example is merely used to help understand the present processes and its core concept;Meanwhile for those skilled in the art, according to According to the thought of the application, there will be changes in the specific implementation manner and application range, in conclusion the content of the present specification It should not be construed as the limitation to the application.

Claims (10)

1. a kind of method for upgrading system, it is applied to electronic equipment, which is characterized in that the method for upgrading system includes:
The system upgrade packet of the corresponding electronic equipment is obtained, and is determined according to need when system upgrade packet progress system upgrade Occupy the target capacity of spatial cache;
Determine the Backup Data for system upgrade cached in the spatial cache, and by the occupancy capacity of the Backup Data Labeled as unused;
It determines not used residual capacity in the spatial cache, and judges whether the residual capacity of the spatial cache reaches institute State target capacity;
If the residual capacity of the spatial cache reaches the target capacity, system liter is carried out according to the system upgrade packet Grade.
2. system according to claim 1 upgrade method, which is characterized in that be not used in the determination spatial cache Residual capacity, and after judging whether the residual capacity of the spatial cache reaches the target capacity, further includes:
It is empty to the caching according to Prune Policies are preset if the residual capacity of the spatial cache is not up to the target capacity Between carry out data scrubbing;
If the residual capacity for carrying out the spatial cache after data scrubbing reaches the target capacity, according to the system upgrade Packet carries out system upgrade.
3. method for upgrading system according to claim 2, which is characterized in that the basis presets Prune Policies to described slow It deposits space and carries out data scrubbing, comprising:
It clears up in the spatial cache in addition to default white list and is not at the data cached of use state.
4. method for upgrading system according to claim 3, which is characterized in that cached in the cleaning spatial cache In addition to default white list and be not at use state it is data cached after, further includes:
If the residual capacity of the spatial cache is still not up to the target capacity, clear up white except presetting in the spatial cache It is data cached except list.
5. method for upgrading system according to claim 1-4, which is characterized in that described according to the system upgrade Packet carries out before system upgrade, further includes:
Safety check is carried out to the system upgrade packet, if verification passes through, the electronics is set according to the system upgrade packet It is standby to carry out system upgrade.
6. method for upgrading system according to claim 1-4, which is characterized in that the corresponding electronics of the acquisition The system upgrade packet of equipment, comprising:
The system upgrade packet of the corresponding electronic equipment is obtained from upgrade server;
Alternatively, obtaining the system upgrade packet of the corresponding electronic equipment from other electronic equipments.
7. method for upgrading system according to claim 1-4, which is characterized in that described according to the system Upgrade package carries out before system upgrade, further includes:
Whether judgement currently reaches preset system upgrade time interval, if reaching, according to system upgrade packet system System upgrading.
8. a kind of system upgrade device, it is applied to electronic equipment, which is characterized in that the system upgrade device includes:
Obtain module, for obtaining the system upgrade packet of the corresponding electronic equipment, and determine according to the system upgrade packet into Need to occupy the target capacity of spatial cache when row system upgrade;
Determining module, for determining the Backup Data for system upgrade cached in the spatial cache, and by the backup The occupancy capacity marking of data is unused;
Judgment module for determining not used residual capacity in the spatial cache, and judges the residue of the spatial cache Whether capacity reaches the target capacity;
Upgraded module, for when the residual capacity of the spatial cache reaches the target capacity, according to the system upgrade Packet carries out system upgrade.
9. a kind of storage medium, is stored thereon with computer program, which is characterized in that when the computer program on computers When operation, so that the computer executes the step in method for upgrading system as described in any one of claim 1 to 7.
10. a kind of electronic equipment, including processor and storage, the memory storage have computer program, which is characterized in that institute Processor is stated by calling the computer program, for executing method for upgrading system as described in any one of claim 1 to 7 In step.
CN201910046642.8A 2019-01-15 2019-01-15 Method for upgrading system, device, storage medium and electronic equipment Pending CN109656603A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910046642.8A CN109656603A (en) 2019-01-15 2019-01-15 Method for upgrading system, device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910046642.8A CN109656603A (en) 2019-01-15 2019-01-15 Method for upgrading system, device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN109656603A true CN109656603A (en) 2019-04-19

Family

ID=66119952

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910046642.8A Pending CN109656603A (en) 2019-01-15 2019-01-15 Method for upgrading system, device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN109656603A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110134652A (en) * 2019-05-10 2019-08-16 Oppo广东移动通信有限公司 Recovery method, device, electronic equipment and the storage medium of cache file
CN110321148A (en) * 2019-07-12 2019-10-11 Oppo广东移动通信有限公司 Method for upgrading system and relevant apparatus
WO2021185352A1 (en) * 2020-03-19 2021-09-23 华为技术有限公司 Version upgrade method and related apparatus

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105574163A (en) * 2015-12-16 2016-05-11 北京金山安全软件有限公司 File processing method and device and electronic equipment
CN105740017A (en) * 2016-01-29 2016-07-06 贵阳海信电子有限公司 Cloud television system upgrading method and device
CN105867962A (en) * 2015-12-07 2016-08-17 乐视移动智能信息技术(北京)有限公司 System upgrading method and device
US20170091030A1 (en) * 2015-09-24 2017-03-30 International Business Machines Corporation Performance optimized storage vaults in a dispersed storage network
CN107357617A (en) * 2017-06-30 2017-11-17 广东欧珀移动通信有限公司 Using update method, device, storage medium and electronic equipment
CN107643898A (en) * 2016-07-21 2018-01-30 中兴通讯股份有限公司 Terminal staging method and device
CN108366366A (en) * 2017-12-29 2018-08-03 海尔优家智能科技(北京)有限公司 A kind of upgrade method of equipment, device, storage medium and smart machine

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170091030A1 (en) * 2015-09-24 2017-03-30 International Business Machines Corporation Performance optimized storage vaults in a dispersed storage network
CN105867962A (en) * 2015-12-07 2016-08-17 乐视移动智能信息技术(北京)有限公司 System upgrading method and device
CN105574163A (en) * 2015-12-16 2016-05-11 北京金山安全软件有限公司 File processing method and device and electronic equipment
CN105740017A (en) * 2016-01-29 2016-07-06 贵阳海信电子有限公司 Cloud television system upgrading method and device
CN107643898A (en) * 2016-07-21 2018-01-30 中兴通讯股份有限公司 Terminal staging method and device
CN107357617A (en) * 2017-06-30 2017-11-17 广东欧珀移动通信有限公司 Using update method, device, storage medium and electronic equipment
CN108366366A (en) * 2017-12-29 2018-08-03 海尔优家智能科技(北京)有限公司 A kind of upgrade method of equipment, device, storage medium and smart machine

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110134652A (en) * 2019-05-10 2019-08-16 Oppo广东移动通信有限公司 Recovery method, device, electronic equipment and the storage medium of cache file
CN110321148A (en) * 2019-07-12 2019-10-11 Oppo广东移动通信有限公司 Method for upgrading system and relevant apparatus
CN110321148B (en) * 2019-07-12 2023-04-25 Oppo广东移动通信有限公司 System upgrading method and related device
WO2021185352A1 (en) * 2020-03-19 2021-09-23 华为技术有限公司 Version upgrade method and related apparatus

Similar Documents

Publication Publication Date Title
CN109656603A (en) Method for upgrading system, device, storage medium and electronic equipment
CN102426594B (en) Method and system for operating database
CN102216899B (en) Managing cache data and metadata
CN100458699C (en) Method and system for updating fastener
CN103412822B (en) Operation Nonvolatile memory and the method and relevant apparatus of data manipulation
CN103309709B (en) A kind of firmware upgrade method, device and communication equipment
CN107608705A (en) A kind of wireless WIFI video equipments and its firmware upgrade method
CN102802083A (en) Set top box updating method based on Android system and set top box
CN101060402B (en) Hash-map-based multipoint buffer memory device
CN109656597A (en) Firmware upgrade method, device and computer readable storage medium
CN102984357B (en) Contact person information managing method and managing device
CN101196823B (en) Method, system and equipment for on-line software upgrade in open application structure
CN105741106A (en) Selection method and device of NFC (Near Field Communication) payment way
CN109582496A (en) Creation method, device and the computer readable storage medium of consistency snapshot group
CN110209654A (en) A kind of text file data storage method, system and electronic equipment and storage medium
CN107066343A (en) The restorative procedure of partition table, device and mobile terminal in mobile terminal
CN104881312A (en) FPGA (Field Programmable Gate Array) logic code iterable upgrading method and circuit
CN102122248A (en) Method for managing wire clip software of communication equipment
CN109213510A (en) A kind of application program updating method and storage medium for embedded device
CN108196972A (en) A kind of restorative procedure of application software, device, terminal and storage medium
CN106249925A (en) The startup method and device of application program
CN106293621B (en) A kind of firmware upgrade method and device
CN104484211B (en) The method and device of shared image file
CN104808953B (en) Control the method, device and mobile terminal of data storage
CN106161082A (en) The method to set up of server UUID, system and baseboard management controller

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