CN111443938B - System updating method and device, storage medium and mobile terminal - Google Patents

System updating method and device, storage medium and mobile terminal Download PDF

Info

Publication number
CN111443938B
CN111443938B CN202010388379.3A CN202010388379A CN111443938B CN 111443938 B CN111443938 B CN 111443938B CN 202010388379 A CN202010388379 A CN 202010388379A CN 111443938 B CN111443938 B CN 111443938B
Authority
CN
China
Prior art keywords
data
update
writing
storage area
preset storage
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
CN202010388379.3A
Other languages
Chinese (zh)
Other versions
CN111443938A (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.)
Huizhou TCL Mobile Communication Co Ltd
Original Assignee
Huizhou TCL Mobile Communication 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 Huizhou TCL Mobile Communication Co Ltd filed Critical Huizhou TCL Mobile Communication Co Ltd
Priority to CN202010388379.3A priority Critical patent/CN111443938B/en
Publication of CN111443938A publication Critical patent/CN111443938A/en
Application granted granted Critical
Publication of CN111443938B publication Critical patent/CN111443938B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application discloses a system updating method, a device, a storage medium and a mobile terminal, wherein the method comprises the following steps: when the system update is detected, writing specified data into a preset storage area for multiple times, and recording the first writing times of the specified data; reading each piece of written specified data, and determining the first reading times of the data which are successfully read; determining a read success rate of data based on the first read times and the first write times; acquiring second writing times matched with the reading success rate, and writing the pre-update data of the system to a preset storage area for multiple times according to the second writing times; when the completion of the system updating is detected, determining whether the current system is updated abnormally; if the system is updated abnormally, the pre-update data is read from the preset storage area, and the system is restored to the pre-update state according to the pre-update data. The abnormal operation of the mobile terminal and even the situation that the mobile terminal cannot be started up can be avoided when the mobile terminal is updated abnormally.

Description

System updating method and device, storage medium and mobile terminal
Technical Field
The present invention relates to the field of communications, and in particular, to a system updating method, device, storage medium, and mobile terminal.
Background
At present, mobile terminals such as mobile phones or tablet computers are gradually favored by users due to the characteristic of easy portability, and more electronic devices are provided with intelligent operating systems. The intelligent operating system brings better experience to the user in a self-upgrading and updating mode.
In the prior art, when the operating system is updated, the old system file needs to be covered by the new system file, and once the new system file has a problem, the abnormal operation of the mobile terminal and even the incapability of starting up can be caused after the operating system is updated.
Disclosure of Invention
The embodiment of the application provides a system updating method, which can avoid the situation that a mobile terminal works abnormally and even cannot be started up when updating abnormally.
The embodiment of the application provides a system updating method, which comprises the following steps:
when the system update is detected, writing specified data into a preset storage area for multiple times, and recording the first writing times of the specified data;
reading each piece of written specified data, and determining the first reading times of the data which are successfully read;
determining a read success rate of data based on the first read times and the first write times;
acquiring second writing times matched with the reading success rate, and writing the pre-update data of the system to a preset storage area for multiple times according to the second writing times;
When the completion of the system updating is detected, determining whether the current system is updated abnormally;
if the system is updated abnormally, the pre-update data is read from the preset storage area, and the system is restored to the pre-update state according to the pre-update data.
The embodiment of the application also provides a system updating device, which comprises:
a writing unit, configured to write specified data into a preset storage area for multiple times when a system update is detected, and record a first write-in number of times of the specified data;
a reading unit configured to read each of the written specified data and determine a first number of times the data was successfully read;
a first determination unit configured to determine a read success rate of data based on the first read number and the first write number;
the acquisition unit is used for acquiring a second writing frequency matched with the reading success rate and writing the pre-update data of the system into a preset storage area for multiple times according to the second writing frequency;
a second determining unit, configured to determine, when it is detected that the system update is completed, whether the current system is updated abnormally;
and the recovery unit is used for reading the pre-update data from the preset storage area if the system update is abnormal, and recovering the system to a pre-update state according to the pre-update data.
The embodiments also provide a storage medium in which a computer program is stored which, when run on a computer, causes the computer to perform the system update method as described above.
The embodiment of the application also provides a mobile terminal, which comprises a processor and a memory, wherein the memory stores a computer program, and the processor is used for executing the system updating method by calling the computer program stored in the memory.
The system updating method provided by the embodiment of the application comprises the following steps: when the system update is detected, writing specified data into a preset storage area for multiple times, and recording the first writing times of the specified data; reading each piece of written specified data, and determining the first reading times of the data which are successfully read; determining a read success rate of data based on the first read times and the first write times; acquiring second writing times matched with the reading success rate, and writing the pre-update data of the system to a preset storage area for multiple times according to the second writing times; when the completion of the system updating is detected, determining whether the current system is updated abnormally; if the system is updated abnormally, the pre-update data is read from the preset storage area, and the system is restored to the pre-update state according to the pre-update data. The abnormal operation of the mobile terminal and even the situation that the mobile terminal cannot be started up can be avoided when the mobile terminal is updated abnormally.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly introduced below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a first flowchart of a system update method according to an embodiment of the present application.
Fig. 2 is a second flowchart of a system update method according to an embodiment of the present application.
Fig. 3 is a schematic structural diagram of a system updating device according to an embodiment of the present application.
Fig. 4 is a specific structural diagram of a mobile terminal according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. It will be apparent that the described embodiments are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
Referring to fig. 1, fig. 1 is a first flowchart of a system updating method according to an embodiment of the present application. The system updating method comprises the following steps:
step 101, when system update is detected, writing specified data into a preset storage area for multiple times, and recording the first writing times of the specified data.
Specifically, when the user clicks a system update button on the mobile terminal or triggers a corresponding update physical key, the system is triggered to perform update operation. The mobile terminal may be a mobile phone, a tablet computer, a notebook computer, a personal digital assistant, or other devices, and various system programs, such as a system with entertainment function (e.g., a video system, a system update system, a game system, and reading software), and a system with service function (e.g., a map navigation system, a catering system, etc.), are stored in the mobile terminal.
When the update instruction is detected, the system detects whether a system file to be updated exists in the storage area. Therefore, when a system update is detected, writing the specified data into the preset storage area a plurality of times includes:
when receiving an update instruction for a specified system, detecting whether the data to be updated of the specified system is stored in a preset storage area;
If the fact that the preset storage area stores the data to be updated of the appointed system is detected, the appointed data are written into the preset storage area for many times.
The specific method for detecting whether the storage area stores the data to be updated may be searching whether the version identifier of the system file in the storage area is the same as the version identifier of the system before updating (i.e. the current system), and if not, determining that the storage area stores the data to be updated. Therefore, detecting whether the data to be updated of the specified system is stored in the preset storage area includes:
acquiring a current version identifier corresponding to the appointed system;
and detecting whether a target version identifier which is different from the current version identifier exists in the preset storage area.
If the fact that the data to be updated of the specified system is stored in the preset storage area is detected, writing the specified data into the preset storage area for multiple times comprises the following steps:
if the fact that the target version identifier which is different from the current version identifier exists in the preset storage area is detected, determining the data of the designated system corresponding to the target version identifier as data to be updated;
the specified data is written into the preset storage area a plurality of times.
In the prior art, when updating a system, a new system file is covered on an old system file, so that irreversible updating is performed, and when updating is abnormal, the old system file cannot be recovered, so that the old system is stored in a storage area of a mobile terminal before the system updating, and in order to ensure that the old system file can be read out, the success rate of reading the file from the storage area can be determined in advance, so that the number of times of writing the old system file into the storage area can be determined based on different reading success rates, and the old system file which is written for multiple times can be successfully read when being read.
The method for determining the reading success rate can be to write the appointed data into different positions of the storage area in advance, then sequentially read the data from the writing positions, and compare whether the read data and the appointed data have differences, so as to determine the reading success rate. Wherein the meaning of writing data to different locations of the memory area is: and detecting whether a bad block exists in the storage, if the bad block exists, namely, the storage area has continuous range damage, so that writing data to different positions can avoid the condition that appointed data is written into the continuous range damage, and further, the data cannot be read. The specified data may be written in a certain storage range, and thus, the specified data may be written to the preset storage area a plurality of times, including:
And writing the specified data into the preset storage area according to the first preset storage interval.
Step 102, each of the written specified data is read, and the first read times of the data which is successfully read are determined.
Specifically, since the determination of the read success rate needs to determine the number of times of writing the specified data and the number of times of reading the specified data successfully, after the specified number of times is written in step 101, the data needs to be read according to the first preset storage interval, and if the read data is the same as the specified data, the read success is indicated, and if the read data is different or not, the read is failed. Thus, reading data from the preset storage area according to the first preset storage interval to obtain first target data;
comparing the specified data with the first target data, and determining the same times of the first target data and the specified data as a first reading time.
Step 103, determining the success rate of reading the data based on the first reading times and the first writing times.
Specifically, the ratio obtained by dividing the first read number by the first write number may be determined as the read success rate.
Step 104, obtaining a second writing frequency matched with the reading success rate, and writing the pre-update data of the system into the preset storage area for multiple times according to the second writing frequency.
Specifically, the meaning of determining the success rate of reading by writing specified data is to simulate the probability that an old system file is written to the memory area and can be successfully read when updating an abnormality. The lower the read success rate, the more times should be written when storing the old system file. After the second writing times of writing the old system file are determined, writing the old system file into the storage area according to the second writing times.
Two preset write times can be determined by multiple experiments. When the reading success rate is smaller than the preset reading success rate, determining the preset writing times with more writing times as second writing times; and when the reading success rate is greater than the preset reading success rate, determining the preset writing times with smaller writing times as the second writing times. Thus, obtaining a second number of writes matching the read success rate includes:
if the reading success rate is smaller than the preset reading success rate, writing the pre-update data of the specified system program into a preset storage area according to a first preset writing frequency, and taking the first preset writing frequency as a second writing frequency;
if the reading success rate is greater than the preset reading success rate, writing the pre-update data of the specified system program into a preset storage area according to a second preset writing frequency, and taking the second preset writing frequency as a second writing frequency.
Step 105, when it is detected that the system is updated, it is determined whether the current system is updated abnormally.
Since it is determined in step 101 that the data to be updated of the system is stored in the storage area, the system can be updated according to the data to be updated, and when it is detected that the system is updated, whether the updated system is abnormal or not can be determined through some conventional detection, for example, whether the power-down condition of the updated mobile terminal is abnormal or not, whether the system is started or not, and the like.
When writing the pre-update data according to the second writing times, the pre-update data may also be written at intervals of a certain storage range, so that the pre-update data of the system is written to the preset storage area for multiple times according to the second writing times, including:
writing pre-update data into a preset storage area according to a second preset storage interval, and recording the pre-update data.
And 106, if the system is updated abnormally, reading the pre-update data from the preset storage area, and recovering the system to the pre-update state according to the pre-update data.
If the condition that the updated system has power failure abnormality and can not be started is detected, the updated abnormality is proved, and the system before updating needs to be recovered through the previously stored data (old system file) before updating. The pre-update data should be read from the preset storage area and the system restored to the pre-update state according to the pre-update data.
Since the pre-update data is written at the second preset storage interval in step 105, the pre-update data should be read at the second preset storage interval when the pre-update data is read, and whether the read data is identical to the recorded pre-update data should be compared. If the data are the same, the data which are compared with the data are determined to be the data before updating, and the system is restored according to the data before updating. Thus, reading the pre-update data from the preset storage area includes:
reading data from the preset storage area according to a second preset storage interval to obtain second target data;
comparing the second target data with the recorded data before update, determining the second reading times when the second target data is the same as the data before update, and taking the second target data which is the same as the recorded data before update as the data before update.
Specifically, when the nth time is read, the read data is compared with the data before updating, and when the written second writing time is n+1 times, it is indicated that the data before updating written for 1 time in the storage area is not read, and after the recovery is completed, the data before updating which is not read can be cleared. Therefore, after restoring the system to the pre-update state according to the pre-update data, it further comprises:
And if the second reading times are smaller than the second writing times, determining that the unread pre-update data remain in the preset storage area, and clearing the unread pre-update data remain in the preset storage area.
The system updating method provided by the embodiment of the application comprises the following steps: when the system update is detected, writing specified data into a preset storage area for multiple times, and recording the first writing times of the specified data; reading each piece of written specified data, and determining the first reading times of the data which are successfully read; determining a read success rate of data based on the first read times and the first write times; acquiring second writing times matched with the reading success rate, and writing the pre-update data of the system to a preset storage area for multiple times according to the second writing times; when the completion of the system updating is detected, determining whether the current system is updated abnormally; if the system is updated abnormally, the pre-update data is read from the preset storage area, and the system is restored to the pre-update state according to the pre-update data. The abnormal operation of the mobile terminal and even the situation that the mobile terminal cannot be started up can be avoided when the mobile terminal is updated abnormally.
In some embodiments, a system update method is provided as shown in fig. 2, the system update method comprising:
step 201, when receiving an update instruction for a specified system, acquiring a current version identifier corresponding to the specified system.
Specifically, when the user clicks a system update button on the mobile terminal or triggers a corresponding update physical key, the system is triggered to perform update operation. The mobile terminal may be a mobile phone, a tablet computer, a notebook computer, a personal digital assistant, or other devices, and various system programs, such as a system with entertainment function (e.g., a video system, a system update system, a game system, and reading software), and a system with service function (e.g., a map navigation system, a catering system, etc.), are stored in the mobile terminal.
When the update instruction is detected, the system detects whether a system file to be updated exists in the storage area. The specific way to detect whether the storage area stores the data to be updated may be to find whether the version identifier of the system file in the storage area is the same as the version identifier of the system before the update (i.e. the current system).
Step 202, detecting whether a target version identifier different from the current version identifier exists in a preset storage area.
Step 203, if it is detected that the preset storage area has a target version identifier different from the current version identifier, determining data of a specified system corresponding to the target version identifier as data to be updated, writing specified data into the preset storage area according to a first preset storage interval, and recording a first writing frequency of the specified data.
If the data to be updated are not the same, the data to be updated are stored in the storage area can be determined. In the prior art, when updating a system, a new system file is covered on an old system file, so that irreversible updating is performed, and when updating is abnormal, the old system file cannot be recovered, so that the old system is stored in a storage area of a mobile terminal before the system updating, and in order to ensure that the old system file can be read out, the success rate of reading the file from the storage area can be determined in advance, so that the number of times of writing the old system file into the storage area can be determined based on different reading success rates, and the old system file which is written for multiple times can be successfully read when being read.
The method for determining the reading success rate can be to write the appointed data into different positions of the storage area in advance, then sequentially read the data from the writing positions, and compare whether the read data and the appointed data have differences, so as to determine the reading success rate. Wherein the meaning of writing data to different locations of the memory area is: and detecting whether a bad block exists in the storage, if the bad block exists, namely, the storage area has continuous range damage, so that writing data to different positions can avoid the condition that appointed data is written into the continuous range damage, and further, the data cannot be read. The specified data may be written in a certain storage range.
And 204, reading data from the preset storage area according to a first preset storage interval to obtain first target data.
Specifically, since the determination of the read success rate needs to determine the number of times of writing the specified data and the number of times of reading the specified data successfully, after the specified number of times is written in step 203, the data needs to be read according to the first preset storage interval, and if the read data is the same as the specified data, the read success is indicated, and if the read data is different or not, the read is failed.
Step 205, comparing the specified data with the first target data, determining the same number of times as the specified data as the first read number, and recording the first write number of the specified data.
Step 206, determining the success rate of reading the data based on the first reading times and the first writing times.
Specifically, the ratio obtained by dividing the first read number by the first write number may be determined as the read success rate.
Step 207, if the read success rate is smaller than the preset read success rate, writing the pre-update data of the specified system program into the preset storage area according to the first preset write times, and taking the first preset write times as the second write times.
Specifically, the meaning of determining the success rate of reading by writing specified data is to simulate the probability that an old system file is written to the memory area and can be successfully read when updating an abnormality. The lower the read success rate, the more times should be written when storing the old system file. After the second writing times of writing the old system file are determined, writing the old system file into the storage area according to the second writing times.
Two preset write times can be determined by multiple experiments. When the reading success rate is smaller than the preset reading success rate, determining the preset writing times with more writing times as second writing times; and when the reading success rate is greater than the preset reading success rate, determining the preset writing times with smaller writing times as the second writing times. Thus, obtaining a second number of writes matching the read success rate includes:
if the reading success rate is smaller than the preset reading success rate, writing the pre-update data of the specified system program into a preset storage area according to a first preset writing frequency, and taking the first preset writing frequency as a second writing frequency;
if the reading success rate is greater than the preset reading success rate, writing the pre-update data of the specified system program into a preset storage area according to a second preset writing frequency, and taking the second preset writing frequency as a second writing frequency.
Step 208, if the read success rate is greater than the preset read success rate, writing the pre-update data of the specified system program into the preset storage area according to the second preset write times, and taking the second preset write times as the second write times.
Step 209, writing the pre-update data into the preset storage area according to the second preset storage interval, and recording the pre-update data.
When the pre-update data is written according to the second writing times, the pre-update data may be written at intervals of a certain storage range.
Step 210, updating the designated system according to the data to be updated.
Step 211, when it is detected that the system is updated, it is determined whether the current system is updated abnormally.
Because the data to be updated of the system is stored in the storage area, the system can be updated according to the data to be updated, and when the completion of the system updating is detected, whether the updated system is abnormal or not can be determined through some conventional detection, for example, whether the power-down condition of the updated mobile terminal is abnormal or not, whether the system updating is abnormal or not can be determined by starting up or not, and the like.
And 212, if the system is updated abnormally, reading the data from the preset storage area according to a second preset storage interval to obtain second target data.
If the condition that the updated system has power failure abnormality and can not be started is detected, the updated abnormality is proved, and the system before updating needs to be recovered through the previously stored data (old system file) before updating. The pre-update data should be read from the preset storage area and the system restored to the pre-update state according to the pre-update data.
Step 213, comparing the second target data with the recorded pre-update data, determining the second reading times when the second target data is the same as the pre-update data, taking the second target data which is the same as the recorded pre-update data as the pre-update data, and recovering the system to the pre-update state according to the pre-update data.
The data before update written according to the second preset storage interval is read, so that the data before update should be read according to the second preset storage interval, and whether the read data is identical to the recorded data before update is compared. If the data are the same, the data which are compared with the data are determined to be the data before updating, and the system is restored according to the data before updating.
Step 214, if the second read number is smaller than the second write number, determining that unread pre-update data remains in the preset storage area, and clearing the unread pre-update data remaining in the preset storage area.
Specifically, when the nth time is read, the read data is compared with the data before updating, and when the written second writing time is n+1 times, it is indicated that the data before updating written for 1 time in the storage area is not read, and after the recovery is completed, the data before updating which is not read can be cleared.
The system updating method provided by the embodiment of the application comprises the following steps: when the system update is detected, writing specified data into a preset storage area for multiple times, and recording the first writing times of the specified data; reading each piece of written specified data, and determining the first reading times of the data which are successfully read; determining a read success rate of data based on the first read times and the first write times; acquiring second writing times matched with the reading success rate, and writing the pre-update data of the system to a preset storage area for multiple times according to the second writing times; when the completion of the system updating is detected, determining whether the current system is updated abnormally; if the system is updated abnormally, the pre-update data is read from the preset storage area, and the system is restored to the pre-update state according to the pre-update data. The abnormal operation of the mobile terminal and even the situation that the mobile terminal cannot be started up can be avoided when the mobile terminal is updated abnormally.
Referring to fig. 3, fig. 3 is a schematic structural diagram of a system updating apparatus according to an embodiment of the present application. The system updating device comprises: a writing unit 31, a reading unit 32, a first determination unit 33, an acquisition unit 34, a second determination unit 35, and a recovery unit 36.
Wherein, the writing unit 31 is configured to write the specified data into the preset storage area for a plurality of times when the system update is detected, and record the first number of times of writing the specified data.
Specifically, when the user clicks a system update button on the mobile terminal or triggers a corresponding update physical key, the system is triggered to perform update operation. The mobile terminal may be a mobile phone, a tablet computer, a notebook computer, a personal digital assistant, or other devices, and various system programs, such as a system with entertainment function (e.g., a video system, a system update system, a game system, and reading software), and a system with service function (e.g., a map navigation system, a catering system, etc.), are stored in the mobile terminal.
When the update instruction is detected, the system detects whether a system file to be updated exists in the storage area.
The reading unit 32 reads each of the written specified data, and determines the first number of times the data is successfully read.
Specifically, since the determination of the success rate of reading needs to determine the number of times of writing the specified data and the number of times of reading the specified data successfully, after the specified number of times of writing, the data needs to be read according to the first preset storage interval, and if the read data is the same as the specified data, the success of reading is indicated, and if the read data is different or not, the reading is failed.
The first determining unit 33 is configured to determine a read success rate of the data based on the first read number and the first write number.
Specifically, the ratio obtained by dividing the first read number by the first write number may be determined as the read success rate.
The acquiring unit 34 is configured to acquire a second write number matching the read success rate, and write the pre-update data of the system to the preset storage area multiple times according to the second write number.
Specifically, the meaning of determining the success rate of reading by writing specified data is to simulate the probability that an old system file is written to the memory area and can be successfully read when updating an abnormality. The lower the read success rate, the more times should be written when storing the old system file. After the second writing times of writing the old system file are determined, writing the old system file into the storage area according to the second writing times.
The second determining unit 35 is configured to determine, when it is detected that the system update is completed, whether the current system is updated abnormally.
Because the data to be updated of the system is stored in the storage area, the system can be updated according to the data to be updated, and when the completion of the system updating is detected, whether the updated system is abnormal or not can be determined through some conventional detection, for example, whether the power-down condition of the updated mobile terminal is abnormal or not, whether the system updating is abnormal or not can be determined by starting up or not, and the like.
And the recovery unit 36 is configured to read the pre-update data from the preset storage area if the system update is abnormal, and recover the system to a pre-update state according to the pre-update data.
If the condition that the updated system has power failure abnormality and can not be started is detected, the updated abnormality is proved, and the system before updating needs to be recovered through the previously stored data (old system file) before updating. The pre-update data should be read from the preset storage area and the system restored to the pre-update state according to the pre-update data.
Based on the above method, the present invention also provides a storage medium having stored thereon a plurality of instructions, wherein the instructions are adapted to be loaded by a processor and to perform the system update method as described above.
Those of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be implemented by a program to instruct related hardware, the program may be stored in a computer readable storage medium, and the storage medium may include: read Only Memory (ROM), random access Memory (RAM, random Access Memory), magnetic or optical disk, and the like.
Fig. 4 shows a specific block diagram of a terminal according to an embodiment of the present invention, where the terminal may be used to implement the system updating method, the storage medium, and the terminal provided in the foregoing embodiments.
As shown in fig. 4, the mobile terminal 1200 may include an RF (Radio Frequency) circuit 110, a memory 120 including one or more computer-readable storage media (only one is shown), an input unit 130, a display unit 140, a sensor 150, an audio circuit 160, a transmission module 170, a processor 180 including one or more processing cores (only one is shown), and a power supply 190. Those skilled in the art will appreciate that the configuration of the mobile terminal 1200 shown in fig. 4 is not limiting of the mobile terminal 1200 and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components. Wherein:
RF circuitry 110 may include various existing circuit elements for performing these functions, such as an antenna, a radio frequency transceiver, a digital signal processor, an encryption/decryption chip, a Subscriber Identity Module (SIM) card, memory, and the like. The RF circuit 110 may communicate with various networks such as the internet, an intranet, a wireless network, or with a second device via a wireless network. The wireless network may include a cellular telephone network, a wireless local area network, or a metropolitan area network.
The memory 120 may be used to store software programs and modules, such as the system updating method, apparatus, storage medium and program instructions/modules corresponding to the mobile terminal in the above embodiments, and the processor 180 executes the software programs and modules stored in the memory 120, thereby performing various functional systems and data processing, that is, implementing the function of chip mutual identification. Memory 120 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or a second non-volatile solid-state memory. In some examples, memory 120 may be a storage medium as described above.
The input unit 130 may be used to receive input numeric or character information and to generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control. In particular, the input unit 130 may comprise a touch sensitive surface 131 and other input devices 132. The touch-sensitive surface 131, also referred to as a touch display screen or a touch pad, may collect touch operations thereon or thereabout by a user (e.g., operations of the user on the touch-sensitive surface 131 or thereabout by using any suitable object or accessory such as a finger, stylus, etc.), and actuate the corresponding connection means according to a predetermined program. Alternatively, the touch sensitive surface 131 may comprise two parts, a touch detection device and a touch controller.
The display unit 140 may be used to display information input by a user or information provided to the user and various graphical user interfaces of the mobile terminal 1200, which may be composed of graphics, text, icons, video, and any combination thereof. The display unit 140 may include a display panel 141, and further, the touch-sensitive surface 131 may cover the display panel 141. The display interface of the mobile terminal in the above embodiment may be represented by the display unit 140, that is, the updated display content of the display system may be displayed by the display unit 140.
The mobile terminal 1200 may also include at least one sensor 150, such as a light sensor, a motion sensor, and a second sensor. Specifically, the light sensor may include an ambient light sensor that may adjust the brightness of the display panel 141 according to the brightness of ambient light, and a proximity sensor that may turn off the display panel 141 and/or the backlight when the mobile terminal 1200 moves to the ear. As for the second sensor such as a gyroscope, barometer, hygrometer, thermometer, infrared sensor, etc. which may be further configured in the mobile terminal 1200, the description thereof will be omitted.
Audio circuitry 160, speaker 161, microphone 162 may provide an audio interface between a user and mobile terminal 1200. The audio circuit 160 may transmit the received electrical signal converted from audio data to the speaker 161, and the electrical signal is converted into a sound signal by the speaker 161 to be output; on the other hand, the microphone 162 converts the collected sound signal into an electrical signal, receives the electrical signal from the audio circuit 160, converts the electrical signal into audio data, outputs the audio data to the processor 180 for processing, transmits the audio data to, for example, another terminal via the RF circuit 110, or outputs the audio data to the memory 120 for further processing. Audio circuitry 160 may also include an ear bud jack to provide communication of a peripheral ear bud with mobile terminal 1200.
The mobile terminal 1200 may facilitate user receiving and sending e-mail, browsing web pages, accessing streaming media, etc., via the transmission module 170, which may provide wireless broadband internet access to the user.
The processor 180 is a control center of the mobile terminal 1200, connects various parts of the entire mobile phone using various interfaces and lines, and performs various functions of the mobile terminal 1200 and processes data by running or executing software programs and/or modules stored in the memory 120, and calling data stored in the memory 120, thereby performing overall monitoring of the mobile phone. Optionally, the processor 180 may include one or more processing cores; in some embodiments, the processor 180 may integrate a system processor that primarily processes operating systems, user interfaces, system programs, and the like, with a modem processor that primarily processes wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 180.
Specifically, the processor 180 includes: an arithmetic logic unit (Arithmetic Logic Unit, ALU), a system processor, a global positioning system (Global Positioning System, GPS) and a control and status Bus (Bus) (not shown).
The mobile terminal 1200 also includes a power supply 190 (e.g., a battery) that provides power to the various components, and in some embodiments, may be logically coupled to the processor 180 via a power management system to perform functions such as managing power, discharging, and power consumption via the power management system. The power supply 190 may also include one or more of any of a direct current or alternating current power supply, a re-power system, a power failure detection circuit, a power converter or inverter, a power status indicator, and the like.
Although not shown, the mobile terminal 1200 may further include a camera (e.g., front camera, rear camera), a bluetooth module, etc., which will not be described in detail herein.
In particular, in the present embodiment, the display unit 140 of the mobile terminal 1200 is a touch screen display, the mobile terminal 1200 further includes a memory 120, and one or more programs, wherein the one or more programs are stored in the memory 120 and configured to be executed by the one or more processors 180, the one or more programs comprising instructions for:
in a system update preview mode, determining a system update subject in a system update preview interface;
When a system update subject scaling adjustment operation of a user on the system update preview interface is received, determining a target system update subject to be adjusted and a target scaling of the target system update subject according to the scaling adjustment operation;
and gradually adjusting the display size of the target system updating body in the system updating preview interface according to the target scaling until the scaling of the target system updating body is adjusted to the target scaling.
In some embodiments, the processor 380 may further execute instructions to:
when the system update is detected, writing specified data into a preset storage area for multiple times, and recording the first writing times of the specified data;
reading each piece of written specified data, and determining the first reading times of the data which are successfully read;
determining a read success rate of data based on the first read times and the first write times;
acquiring second writing times matched with the reading success rate, and writing the pre-update data of the system to a preset storage area for multiple times according to the second writing times;
When the completion of the system updating is detected, determining whether the current system is updated abnormally;
if the system is updated abnormally, the pre-update data is read from the preset storage area, and the system is restored to the pre-update state according to the pre-update data.
In some embodiments, when a system update is detected, the processor 380 may also execute instructions to:
when receiving an update instruction for a specified system, detecting whether the data to be updated of the specified system is stored in a preset storage area;
if the fact that the preset storage area stores the data to be updated of the appointed system is detected, writing the appointed data into the preset storage area for multiple times;
before detecting that the system update is completed, the method further comprises:
and updating the appointed system according to the data to be updated.
In some embodiments, the processor 380 may also execute instructions for, in writing the specified data into the preset storage area a plurality of times:
writing specified data into a preset storage area according to a first preset storage interval;
the reading and writing each piece of appointed data, and determining the first reading times of the data which is successfully read, including:
Reading data from the preset storage area according to the first preset storage interval to obtain first target data;
comparing the specified data with the first target data, and determining the same times of the first target data and the specified data as a first reading time.
In some embodiments, when obtaining the second number of writes matching the read success rate, the processor 380 may further execute instructions to:
if the reading success rate is smaller than the preset reading success rate, writing the pre-update data of the specified system program into a preset storage area according to a first preset writing frequency, and taking the first preset writing frequency as a second writing frequency;
if the reading success rate is greater than the preset reading success rate, writing the pre-update data of the specified system program into a preset storage area according to a second preset writing frequency, and taking the second preset writing frequency as a second writing frequency.
In some embodiments, in detecting whether the predetermined storage area stores data to be updated of the specified system, the processor 380 may further execute instructions for:
acquiring a current version identifier corresponding to the appointed system;
Detecting whether a target version identifier different from the current version identifier exists in the preset storage area;
if the fact that the data to be updated of the specified system is stored in the preset storage area is detected, writing the specified data into the preset storage area for multiple times comprises the following steps:
if the fact that the target version identifier which is different from the current version identifier exists in the preset storage area is detected, determining the data of the designated system corresponding to the target version identifier as data to be updated;
the specified data is written into the preset storage area a plurality of times.
In some embodiments, the processor 380 may further execute instructions for, when writing the pre-update data of the system to the preset storage area a plurality of times according to the second number of writes:
writing pre-update data into a preset storage area according to a second preset storage interval, and recording the pre-update data;
the reading the pre-update data from the preset storage area includes:
reading data from the preset storage area according to a second preset storage interval to obtain second target data;
comparing the second target data with the recorded data before update, determining the second reading times when the second target data is the same as the data before update, and taking the second target data which is the same as the recorded data before update as the data before update.
In some embodiments, after restoring the system to the pre-update state according to the pre-update data, the processor 380 may also execute instructions to:
and if the second reading times are smaller than the second writing times, determining that the unread pre-update data remain in the preset storage area, and clearing the unread pre-update data remain in the preset storage area.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and for parts of one embodiment that are not described in detail, reference may be made to related descriptions of other embodiments.
The foregoing describes in detail a system updating method, device, storage medium and mobile terminal provided in the embodiments of the present application, and specific examples of the system herein are described to illustrate the principles and embodiments of the present application, where the description of the foregoing embodiments is only used to help understand the technical solution and core ideas of the present application; those of ordinary skill in the art will appreciate that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.

Claims (10)

1. A system updating method, comprising:
when the system update is detected, writing specified data into a preset storage area for multiple times, and recording the first writing times of the specified data;
reading each piece of written specified data, and determining the first reading times of the data which are successfully read;
determining a read success rate of data based on the first read times and the first write times;
acquiring second writing times matched with the reading success rate, and writing the pre-update data of the system to a preset storage area for multiple times according to the second writing times;
when the completion of the system updating is detected, determining whether the current system is updated abnormally;
if the system is updated abnormally, the pre-update data is read from the preset storage area, and the system is restored to the pre-update state according to the pre-update data.
2. The system updating method according to claim 1, wherein the writing of the specified data into the preset storage area a plurality of times when the system update is detected comprises:
when receiving an update instruction for a specified system, detecting whether the data to be updated of the specified system is stored in a preset storage area;
If the fact that the preset storage area stores the data to be updated of the appointed system is detected, writing the appointed data into the preset storage area for multiple times;
before detecting that the system update is completed, the method further comprises:
and updating the appointed system according to the data to be updated.
3. The system updating method according to claim 2, wherein the writing of the specified data into the preset storage area a plurality of times includes:
writing specified data into a preset storage area according to a first preset storage interval;
the reading and writing each piece of appointed data, and determining the first reading times of the data which is successfully read, including:
reading data from the preset storage area according to the first preset storage interval to obtain first target data;
comparing the specified data with the first target data, and determining the same times of the first target data and the specified data as a first reading time.
4. The system updating method according to claim 3, wherein the obtaining the second number of writes matching the read success rate includes:
if the reading success rate is smaller than the preset reading success rate, writing the pre-update data of the appointed system into a preset storage area according to a first preset writing frequency, and taking the first preset writing frequency as a second writing frequency;
If the reading success rate is greater than the preset reading success rate, writing the pre-update data of the appointed system into a preset storage area according to a second preset writing frequency, and taking the second preset writing frequency as a second writing frequency.
5. The system updating method according to claim 2, wherein the detecting whether the data to be updated of the specified system is stored in the preset storage area comprises:
acquiring a current version identifier corresponding to the appointed system;
detecting whether a target version identifier different from the current version identifier exists in the preset storage area;
if the fact that the data to be updated of the specified system is stored in the preset storage area is detected, writing the specified data into the preset storage area for multiple times comprises the following steps:
if the fact that the target version identifier which is different from the current version identifier exists in the preset storage area is detected, determining the data of the designated system corresponding to the target version identifier as data to be updated;
the specified data is written into the preset storage area a plurality of times.
6. The system updating method according to claim 1, wherein writing the pre-update data of the system to the preset storage area a plurality of times according to the second writing times includes:
Writing pre-update data into a preset storage area according to a second preset storage interval, and recording the pre-update data;
the reading the pre-update data from the preset storage area includes:
reading data from the preset storage area according to a second preset storage interval to obtain second target data;
comparing the second target data with the recorded data before update, determining the second reading times when the second target data is the same as the data before update, and taking the second target data which is the same as the recorded data before update as the data before update.
7. The system updating method according to claim 6, further comprising, after restoring the system to the pre-update state in accordance with the pre-update data:
and if the second reading times are smaller than the second writing times, determining that the unread pre-update data remain in the preset storage area, and clearing the unread pre-update data remain in the preset storage area.
8. A system updating apparatus, comprising:
a writing unit, configured to write specified data into a preset storage area for multiple times when a system update is detected, and record a first write-in number of times of the specified data;
A reading unit configured to read each of the written specified data and determine a first number of times the data was successfully read;
a first determination unit configured to determine a read success rate of data based on the first read number and the first write number;
the acquisition unit is used for acquiring a second writing frequency matched with the reading success rate and writing the pre-update data of the system into a preset storage area for multiple times according to the second writing frequency;
a second determining unit, configured to determine, when it is detected that the system update is completed, whether the current system is updated abnormally;
and the recovery unit is used for reading the pre-update data from the preset storage area if the system update is abnormal, and recovering the system to a pre-update state according to the pre-update data.
9. A computer readable storage medium, characterized in that the storage medium has stored therein a computer program which, when run on a computer, causes the computer to perform the system update method according to any one of claims 1 to 7.
10. A mobile terminal, characterized in that the mobile terminal comprises a processor and a memory, the memory storing a computer program, the processor being adapted to perform the system updating method according to any of claims 1 to 7 by calling the computer program stored in the memory.
CN202010388379.3A 2020-05-09 2020-05-09 System updating method and device, storage medium and mobile terminal Active CN111443938B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010388379.3A CN111443938B (en) 2020-05-09 2020-05-09 System updating method and device, storage medium and mobile terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010388379.3A CN111443938B (en) 2020-05-09 2020-05-09 System updating method and device, storage medium and mobile terminal

Publications (2)

Publication Number Publication Date
CN111443938A CN111443938A (en) 2020-07-24
CN111443938B true CN111443938B (en) 2023-05-23

Family

ID=71656426

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010388379.3A Active CN111443938B (en) 2020-05-09 2020-05-09 System updating method and device, storage medium and mobile terminal

Country Status (1)

Country Link
CN (1) CN111443938B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014147735A1 (en) * 2013-03-19 2014-09-25 株式会社日立製作所 Recording device and method for controlling recording device
CN104636574A (en) * 2013-11-08 2015-05-20 成都鼎桥通信技术有限公司 Terminal device upgrade method and terminal device
CN110502264A (en) * 2019-08-23 2019-11-26 深圳融安网络科技有限公司 Method for upgrading system, terminal and readable storage medium storing program for executing

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014147735A1 (en) * 2013-03-19 2014-09-25 株式会社日立製作所 Recording device and method for controlling recording device
CN104636574A (en) * 2013-11-08 2015-05-20 成都鼎桥通信技术有限公司 Terminal device upgrade method and terminal device
CN110502264A (en) * 2019-08-23 2019-11-26 深圳融安网络科技有限公司 Method for upgrading system, terminal and readable storage medium storing program for executing

Also Published As

Publication number Publication date
CN111443938A (en) 2020-07-24

Similar Documents

Publication Publication Date Title
JP6231220B2 (en) Side menu display method, apparatus and terminal
US9967100B2 (en) Method of controlling power supply for fingerprint sensor, fingerprint processing device, and electronic device performing the same
CN105511667A (en) Back touch control mobile terminal and method based on back pressure transducer
CN109040419B (en) Screen recording method and device, mobile terminal and storage medium
CN110837343B (en) Snapshot processing method and device and terminal
CN112035298A (en) Data backup method and device, electronic equipment and storage medium
CN110990679A (en) Information searching method and electronic equipment
CN112231144A (en) Data processing method and device and electronic equipment
KR20180010029A (en) Method and apparatus for operation of an electronic device
CN111562959A (en) Icon management method and electronic equipment
CN110765085A (en) Log information writing method, system, storage medium and mobile terminal
US11147038B2 (en) Notification message processing method and terminal
CN107832191B (en) Black screen detection method, mobile terminal and computer readable storage medium
KR102553573B1 (en) Electronic device and method for detecting touch input of the same
JP2018032425A (en) Side menu display method, device, and terminal
CN111797017A (en) Method and device for storing log, test equipment and storage medium
CN108989554B (en) Information processing method and terminal
CN111443938B (en) System updating method and device, storage medium and mobile terminal
CN110717133A (en) Page updating method and device, terminal equipment and storage medium
CN110908732B (en) Application task deleting method and electronic equipment
CN110958352B (en) Network signal display method, device, storage medium and mobile terminal
CN110716908A (en) Log information writing method, system, storage medium and mobile terminal
CN110795285A (en) Backup mark display method and electronic equipment
CN111601036B (en) Camera focusing method and device, storage medium and mobile terminal
CN111182153B (en) System language setting method and device, storage medium and mobile terminal

Legal Events

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