CN114968297A - OTA (over the air) upgrading method, electronic equipment and chip system - Google Patents

OTA (over the air) upgrading method, electronic equipment and chip system Download PDF

Info

Publication number
CN114968297A
CN114968297A CN202110223712.XA CN202110223712A CN114968297A CN 114968297 A CN114968297 A CN 114968297A CN 202110223712 A CN202110223712 A CN 202110223712A CN 114968297 A CN114968297 A CN 114968297A
Authority
CN
China
Prior art keywords
space
storage space
rom
partition
user
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
CN202110223712.XA
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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN202110223712.XA priority Critical patent/CN114968297A/en
Publication of CN114968297A publication Critical patent/CN114968297A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/66Updates of program code stored in read-only memory [ROM]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Abstract

The application is applicable to the technical field of terminals and provides an OTA upgrading method, electronic equipment and a chip system. The OTA upgrading method comprises the following steps: when detecting that OTA upgrading needs to be carried out on an operating system of the electronic equipment, acquiring a target ROM space required by a new version operating system; if the target ROM space is larger than a first ROM space of the electronic equipment, applying for a first storage space from a user space of the electronic equipment, wherein the first storage space is an area which does not store user data in the user space; merging the first ROM space and the first storage space to serve as a second ROM space of the electronic equipment; and performing OTA upgrade on the operating system of the electronic equipment based on the second storage space. The method can improve the utilization rate of the internal storage space of the electronic equipment, can ensure that the user data is not lost, and does not need to adjust the whole user space.

Description

OTA (over the air) upgrading method, electronic equipment and chip system
Technical Field
The application relates to the technical field of terminals, in particular to an OTA upgrading method, electronic equipment and a chip system.
Background
The internal Memory space of the electronic device includes a ROM space (Read only Memory) and a user space. The user space refers to a storage area for storing user data, and the ROM space refers to a storage area for storing firmware code (also referred to as an operating system) of the electronic device. The ROM space of an electronic device is determined by the size occupied by the operating system. When the ROM space required by the new version of the operating system is enlarged relative to the ROM space required by the old version of the operating system, it may result in that the OTA (Over-the-air technology, Over-the-air on-line upgrade technology or Over-the-air download technology) upgrade of the operating system of the electronic device cannot be completed.
In order to ensure that the operating system of the electronic equipment can still be upgraded OTA after the ROM space required by the new version operating system is expanded, when the size of the partition of the electronic equipment is set, a redundant space which cannot be used by a user is reserved in each partition. For part of electronic devices, the redundant space of each partition can even reach about 5g (gigabyte). Such a large redundant space may result in an inefficient use of the storage space of the electronic device.
Disclosure of Invention
The application provides an OTA upgrading method, electronic equipment and a chip system, which can improve the utilization rate of an internal storage space of the electronic equipment, can ensure that user data cannot be lost, and does not need to adjust the whole user space.
In order to achieve the purpose, the technical scheme is as follows:
in a first aspect, an OTA upgrading method is provided, including: when detecting that OTA upgrading needs to be carried out on an operating system of the electronic equipment, acquiring a target ROM space required by a new version operating system; if the target ROM space is larger than a first ROM space of the electronic equipment, applying for a first storage space from a user space of the electronic equipment, wherein the first storage space is an area which does not store user data in the user space, and the first ROM space is a ROM space which is used for storing an operating system in an internal storage space of the electronic equipment before OTA upgrade is carried out on the operating system of the electronic equipment; merging the first ROM space and the first storage space as a second ROM space of the electronic device; and performing OTA upgrade on the operating system of the electronic equipment based on the second ROM space.
According to the embodiment of the application, when OTA upgrading needs to be carried out on the operating system of the electronic equipment, the ROM space needed by the new version operating system is determined. And if the ROM space required by the new version of operating system is larger than the first ROM space of the electronic equipment, applying for the first storage space from the user space of the electronic equipment. The first ROM space and the first memory space are then merged as a second ROM space for the electronic device. And when the operation information of the electronic equipment needs to be upgraded by OTA, using the second ROM space to upgrade by OTA.
The OTA upgrading method can improve the utilization rate of the internal storage space of the electronic equipment and can ensure that user data cannot be lost, which is equivalent to the related technology I and the related technology II. Compared with the third related art, the first storage space is an area in the user space where the user data is not stored, and the whole user space does not need to be adjusted, so that the situation that the time required by the adjustment process of the user space is long and the user cannot use the electronic device for a long time does not occur.
In combination with the first aspect, in some embodiments, the method further includes: and determining the first storage space according to the difference value of the target ROM space and the first ROM space.
After obtaining the target ROM space required by the new version of the operating system, the target ROM space required by the new version of the operating system may be compared with the first ROM space. If the target ROM space required by the new version of the operating system is larger than the first ROM space of the electronic device, the first ROM space cannot store the new version of the operating system. That is, OTA upgrade of the operating system of the electronic device is not possible based on the first ROM space.
At this time, the first storage space may be applied from the user space of the electronic device, and information of the first storage space may be recorded. The first storage space is an area which does not store user data in the user space, and the size of the first storage space is determined according to a difference value between a target ROM space and the first ROM space, wherein the target ROM space is required by a new version of the operating system. For example, if the target ROM space required by the new version of the operating system is a and the first ROM space is b, the first storage space should be greater than or equal to the difference a-b between the target ROM space and the first ROM space.
With reference to the first aspect, in some embodiments, after applying for the first storage space from the user space of the electronic device, the method further includes: and storing the information of the first storage space, wherein the information of the first storage space comprises the position and the size of the first storage space.
For example, the start position and size of the first storage space may be saved to a preset position. The position of the first storage space is the absolute position of the first storage space in the user space, so that the position and the size of the first storage space can still be found after the user file system is damaged.
With reference to the first aspect, in some embodiments, the method further includes moving the first storage space to a front-most end of the partition of the user space; and modifying the initial position of the partition of the user space, and moving the first storage space out of the partition of the user space.
For example, the first storage space is moved to the foremost end of the partition of the user space, and then the start address of the partition of the user space may be modified, and the first storage space is moved out of the partition of the user space, so as to obtain a new partition of the user space. For example, after the first storage space is moved to the front end of the partition of the user space, the starting position of the first storage space is x 1 (is the starting position of the partition of the user space) and the ending position is x 2 Then, the first storage space is moved out of the partition of the user space, and the starting position of the partition of the new user space is obtained as x 2 The next position of (a).
Wherein the first storage space may be moved to a frontmost end of the partition of the user space after an OTA upgrade of an operating system of the electronic device based on the second ROM space. Or, after applying for a first storage space from a user space of the electronic device, move the first storage space to a forefront of a partition of the user space, which is not limited in this embodiment of the present application.
In this embodiment, the first storage space is moved to the forefront of the partition of the user space. And then, modifying the initial position of the partition of the user space, and moving the first storage space out of the partition of the user space. Since the first storage space is moved out of the partition of the user space, the data of the new version of the operating system is not deleted if the data in the user space needs to be cleaned up.
Optionally, before moving the first storage space to the foremost end of the partition of the user space, the method may further include: and backing up the data in the first storage space, so that the data loss of the first storage space in the moving process can be prevented. If the data in the first storage space is lost in the moving process, the backed-up data can be copied to the moved first storage space.
In one scenario, after detecting a preset operation, the first storage space may be moved to the forefront of the partition of the user space, the start position of the partition of the user space is modified, and the first storage space is moved out of the partition of the user space.
Illustratively, the preset operation may be an operation of deleting data in the user space. For example, the preset operation may be an operation of restoring factory settings of the electronic device.
By way of example, the first storage space may be an area having a preset identifier in the user space partition. The electronic device may detect whether the partition of the user space includes an area with a preset identifier, so as to determine whether the first storage space exists in the partition of the user space of the electronic device.
It can be understood that restoring factory settings to the electronic device deletes data in the partition of the user space. Because the first storage space is still located in the user space, if factory settings are restored to the electronic device at this time, data in the first storage space is deleted. And the first storage space stores part of data of the new version operating system, so that factory reset cannot be directly executed on the electronic device, and the data in the first storage space needs to be prevented from being deleted. Based on the above, the first storage space can be moved to the foremost end of the partition of the user space, and the start address of the partition of the user space is correspondingly modified, so that the new partition of the user space does not contain the first storage space.
For example, after detecting a preset operation, determining whether the first storage space is located at the forefront of the partition of the user space according to the starting position of the first storage space; and if the first storage space is not positioned at the foremost end of the partition of the user space, moving the first storage space to the foremost end of the partition of the user space.
For example, the electronic device may detect whether there is an area with a preset identification in a partition of the user space. If the area with the preset identification exists in the partition of the user space, determining whether the initial position of the area with the preset identification is located at the forefront of the partition of the user space. And if the initial position of the area with the preset identification is not positioned at the foremost end of the partition of the user space, moving the area with the preset identification to the foremost end of the partition of the user space.
With reference to the first aspect, in some embodiments, the storing the location information of the first ROM space and the location information of the first storage space in the location information partition of the electronic device, and merging the first ROM space and the first storage space as the second ROM space of the electronic device may include: acquiring the position information of the first ROM space and the position information of the first storage space from the position information partition; and logically combining the first ROM space and the first storage space by a Device Mapper technology based on the position information of the first ROM space and the position information of the first storage space to obtain the second ROM space.
In other embodiments, merging the first ROM space and the first storage space as the second ROM space of the electronic device may include: and logically combining the first ROM space and the first storage space through other technologies except for a Device Mapper technology to obtain the second ROM space.
In some embodiments, the method further comprises: after the first storage space is moved out of the user space partition, merging the first storage space into a first ROM space by a Device Mapper technology based on the position information of the first storage space and the position information of the first ROM space to form a second ROM space; and writing the position information of the second ROM space into the position information partition, and replacing the position information of the first ROM space.
For example, after the first storage space is moved out of the user space partition, the first storage space may be merged into the System partition by the Device Mapper technique based on the location information of the first storage space and the location information of the first ROM space, forming a new System partition; and then writing the position information of the new System partition into the position information partition, replacing the old position information of the System partition, and taking the new System partition as the System partition when the OTA is updated next time.
In a second aspect, an OTA upgrading apparatus is provided, which includes an obtaining unit, an applying unit, a merging unit, and an upgrading unit. The obtaining unit is used for obtaining a target ROM space required by a new version operating system when detecting that OTA upgrading needs to be carried out on the operating system of the electronic equipment. The application space is used for applying for the first storage space from the user space of the electronic equipment when the target ROM space is larger than the first ROM space of the electronic equipment. The first storage space is an area where user data is not stored in the user space, and the first ROM space is a ROM space used for storing an operating system in an internal storage space of the electronic device before OTA upgrade is performed on the operating system of the electronic device. The merging unit is used for merging the first ROM space and the first storage space as a second ROM space of the electronic device. The upgrading unit is used for performing OTA upgrading on the operating system of the electronic equipment based on the second ROM space.
According to the embodiment of the application, when OTA upgrading needs to be carried out on the operating system of the electronic equipment, the ROM space needed by the new version operating system is determined. And if the ROM space required by the new version of operating system is larger than the first ROM space of the electronic equipment, applying for the first storage space from the user space of the electronic equipment. The first ROM space and the first memory space are then merged as a second ROM space of the electronic device. And when the operation information of the electronic equipment needs to be upgraded by OTA, using the second ROM space to upgrade by OTA.
Therefore, the OT upgrade apparatus can improve the utilization rate of the internal storage space of the electronic device, and can ensure that the user data is not lost, which is equivalent to the first related art and the second related art. In other words, the first storage space is an area of the user space where the user data is not stored, and the whole user space does not need to be adjusted, so that the situation that the user cannot use the electronic device for a long time due to long time required for the adjustment process of the user space does not occur.
In a third aspect, an embodiment of the present application provides an electronic device, including: one or more processors, memory, and a display screen; the memory, the display screen, and the one or more processors, the memory to store computer program code, the computer program code comprising computer instructions; the computer instructions, when executed by the one or more processors, cause the electronic device to perform the method of any of the first aspects.
In a fourth aspect, an embodiment of the present application provides a chip system, where the chip system includes a processor, the processor is coupled with a memory, and the processor executes a computer program stored in the memory to implement the method according to any one of the first aspect. The chip system can be a single chip or a chip module consisting of a plurality of chips.
In a fifth aspect, an embodiment of the present application provides a chip system, where the chip system includes a memory and a processor, and the processor executes a computer program stored in the memory to implement the method according to any one of the first aspect. The chip system can be a single chip or a chip module consisting of a plurality of chips.
In a sixth aspect, embodiments of the present application provide a computer program product, which, when run on an electronic device, causes the electronic device to perform the method of any one of the above first aspects.
In a seventh aspect, this application provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the computer program implements the method according to any one of the first aspect.
It is to be understood that the OTA upgrading apparatus according to the second aspect, the electronic device according to the third aspect, the chip systems according to the fourth aspect and the fifth aspect, the computer program product according to the sixth aspect, and the computer readable storage medium according to the seventh aspect are all configured to perform the method according to the first aspect. Therefore, the beneficial effects achieved by the method can refer to the beneficial effects in the corresponding method, and are not described herein again.
Drawings
FIG. 1 is a schematic diagram illustrating a partition table of an electronic device according to a first related art;
fig. 2 is a schematic flowchart of an OTA upgrading method according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of a partition table before OTA upgrade according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a partition table after OTA upgrade provided in an embodiment of the present application;
fig. 5 is a schematic flowchart of an OTA upgrading method according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a partition table after an electronic device is restored to factory settings according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a partition table after System partitions and a first storage space are merged according to an embodiment of the present application;
fig. 8 is a block diagram of an OTA upgrading apparatus provided in an embodiment of the present application;
fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It should also be understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when", "upon" or "in response to" determining "or" in response to detecting ". Similarly, the phrase "if it is determined" or "if a [ described condition or event ] is detected" may be interpreted contextually to mean "upon determining" or "in response to determining" or "upon detecting [ described condition or event ]" or "in response to detecting [ described condition or event ]".
Furthermore, in the description of the present application and the appended claims, the terms "first," "second," "third," and the like are used for distinguishing between descriptions and not necessarily for describing or implying relative importance.
Reference throughout this specification to "one embodiment" or "some embodiments," or the like, means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," or the like, in various places throughout this specification are not necessarily all referring to the same embodiment, but rather "one or more but not all embodiments" unless specifically stated otherwise. The terms "comprising," "including," "having," and variations thereof mean "including, but not limited to," unless expressly specified otherwise.
In addition, the references to "a plurality" in the embodiments of the present application should be interpreted as two or more.
The steps involved in the OTA upgrading method provided in the embodiments of the present application are only examples, and not all the steps are necessarily executed steps, or the content in each information or message is not necessary, and may be increased or decreased as required during the use process.
The same steps or messages with the same functions in the embodiments of the present application may be referred to with each other between different embodiments.
The service scenario described in the embodiment of the present application is for more clearly illustrating the technical solution of the embodiment of the present application, and does not form a limitation on the technical solution provided in the embodiment of the present application, and as a person having ordinary skill in the art knows that along with the evolution of a network architecture and the appearance of a new service scenario, the technical solution provided in the embodiment of the present application is also applicable to similar technical problems.
In the related art one, an OTA upgrading method is provided. In order to ensure that the operating System of the electronic equipment can be still subjected to OTA upgrade after the ROM space required by the operating System of the new version is enlarged relative to the ROM space occupied by the operating System of the old version, a redundant space which cannot be used by a user can be set for a System partition when the System partition of the electronic equipment is set. Since the System partition is provided with the redundant space, in the first related art, OTA upgrade can be performed on the operating System of the electronic device when the ROM space required by the new version of the operating System becomes large.
Illustratively, fig. 1 shows a partition table diagram in the related art. Referring to fig. 1, the partition table of the electronic device may include a plurality of partitions such as an Xloader partition, a System partition, a Vendor partition, and a Data partition. The System partition comprises a System partition redundant space, and a memory space in the System partition except the System partition redundant space is a System actual mirror space. When the ROM space required by the new version of the operating System is enlarged, the electronic equipment can store the new version of the operating System through the System actual mirror image space and the System partition redundant space together, so that OTA upgrading of the operating System of the electronic equipment is realized.
However, since the System partition redundancy space can only be used when the ROM space required by the operating System of a new version becomes large, and the operating System is not always upgraded, the utilization rate of the System partition redundancy space is low. For part of the electronic devices, the System partition redundant space is large, so that the internal storage space of the electronic devices is not fully utilized.
Related art two provides an OTA upgrading method. In this embodiment, a redundant space is not provided in the System partition of the electronic device. When OAT upgrading needs to be carried out on an operating system of the electronic equipment, the ROM space needed by a new version of the operating system is determined. If the ROM space required by the operating system of the new version is larger than the ROM space occupied by the operating system of the old version, the upgrade package can be temporarily stored in the external storage device of the electronic device. And then, modifying the partition table of the electronic equipment, so that the adjusted ROM space can meet the OTA upgrade of the operating system of the new version. And after the partition table of the electronic equipment is modified, storing the upgrade package temporarily stored in the external storage equipment of the electronic equipment into the adjusted ROM space.
According to the OTA upgrading method, the partition table of the electronic equipment is modified, so that the adjusted ROM space can meet OTA upgrading of a new version of operating system. However, when the partition table of the electronic device is modified, a part of the user space is covered, so that a part of the user data is lost.
Related art three provides an OTA upgrading method. In this embodiment, a redundant space is not provided in the System partition of the electronic device. When OAT upgrading needs to be carried out on the operating system of the electronic equipment, the ROM space needed by the operating system of a new version is determined. If the ROM space required by the new version of the operating system is larger than the ROM space occupied by the old version of the operating system, the user space (Data partition in fig. 1) of the electronic device may be first reduced. Correspondingly, the reduced user space is divided into the ROM space, so that the new ROM space is enlarged, and OTA upgrading of a new version of the operating system can be met.
According to the OTA upgrading method, the ROM space is expanded by reducing the whole user space, so that OTA upgrading of a new version of operating system is met. Moreover, the user space is reduced, so that the user data in the user space can be completely stored, and the user data cannot be lost. Wherein the time required for the adjustment process for the entire user space is determined by the condition of the user data in the user space. If the amount of data in the user space is large, the time required for the adjustment process of the user space is long, for example, may reach approximately one hour. And the user cannot use the electronic equipment in the adjustment process of the whole user space. Therefore, in the third related art, although the utilization rate of the internal storage space of the electronic device can be improved and the user data can be ensured not to be lost, the time required by the adjustment process of the user space is long, the efficiency is low, and the user experience can be seriously influenced.
Based on the above problem, an embodiment of the present application provides an OTA upgrading method, which determines a ROM space required by a new version operating system when an operating system of an electronic device needs to be upgraded by an OTA. And if the ROM space required by the new version of operating system is larger than the first ROM space of the electronic equipment, applying for a first storage space from the user space of the electronic equipment, wherein the first storage space does not store user data. The first ROM space is a storage space used for storing the operating system in an internal storage space of the electronic device before OTA upgrade is performed on the operating system. The first ROM space and the first memory space are then merged as a second ROM space for the electronic device. And when the operation information of the electronic equipment needs to be upgraded by OTA, using the second ROM space to upgrade by OTA.
Because the first storage space is still located in the user space, if the user performs factory reset operation on the electronic device, the data in the first storage space is deleted, and a part of data of the operating system is stored in the first storage space. Thus, the first storage space may be moved to the very front of the user space partition. Then, the partition of the first ROM space and the partition of the first memory space are merged into a partition of the second ROM space. Therefore, when the user performs formatting or factory setting restoration operations on the electronic device, the data in the first storage space is not deleted because the first storage space does not belong to the user space.
For example, the electronic device in the embodiment of the present application may be an electronic device such as a mobile phone, a tablet computer, a wearable device, an in-vehicle device, an Augmented Reality (AR)/Virtual Reality (VR) device, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a Personal Digital Assistant (PDA), and the like, and the specific type of the electronic device is not limited in this embodiment of the present application.
Fig. 2 shows a flowchart of an OTA upgrading method provided in an embodiment of the present application. Referring to fig. 2, the OTA upgrading method includes the following steps:
step 101, obtaining a target ROM space required by a new version of an operating system.
In some embodiments, a user may apply a touch operation in a display interface of an electronic device, and the electronic device determines that OTA upgrade is required to an operating system in response to the touch operation, and obtains a target ROM space required by a new version of the operating system.
For example, after the electronic device obtains the version information of the operating system, the electronic device compares the version information with the current version information of the electronic device to determine whether the operating system needs to be updated through OTA. If the OTA upgrading of the operating system is needed, the electronic equipment can generate an operating system updating control and an operating system non-updating control. The user can apply touch operation to the operating system updating control in the display interface of the electronic device. And the electronic equipment responds to the touch operation and acquires a target ROM space required by a new version of operating system.
For example, the electronic device may determine, according to the obtained version information of the operating system, a target ROM space required by a new version of the operating system. For example, the version information may include the size of the ROM space required by the new version of the operating system.
Step 102, if the target ROM space required by the new version operating system is larger than the first ROM space of the electronic device, applying for a first storage space from the user space of the electronic device, and recording information of the first storage space.
The first ROM space is a storage space used for storing the operating system in an internal storage space of the electronic device before OTA upgrade is performed on the operating system. As shown in fig. 3, the System partition is the first ROM space. Among them, the System partition in fig. 3 has no System partition redundant space compared to the System partition in fig. 1. That is, the System partition in fig. 3 corresponds to the System real mirror space in fig. 1.
After obtaining the target ROM space required by the new version of the operating system, the target ROM space required by the new version of the operating system may be compared to the first ROM space. If the target ROM space required by the new version of the operating system is larger than the first ROM space of the electronic device, the first ROM space cannot store the new version of the operating system. That is, OTA upgrade of the operating system of the electronic device is not possible based on the first ROM space.
At this time, the first storage space may be applied from the user space of the electronic device, and information of the first storage space may be recorded. The first storage space is an area of the user space where user data is not stored (as shown in fig. 4), and the size of the first storage space is determined according to a difference between a target ROM space required by the new version operating system and the first ROM space. For example, if the size of the target ROM space required by the new version of the operating system is a and the size of the first ROM space is b, the first storage space should be greater than or equal to the difference a-b between the target ROM space and the first ROM space.
In some embodiments, the information of the first storage space may include a location and a size of the first storage space. For example, the location and size of the first storage space may be saved into a location information partition, as shown in FIG. 4. In addition, the location information partition may also store therein location information of the first ROM space (i.e., the System partition) and location information of the user space (i.e., the Data partition). In the embodiment of the application, the position of the first storage space is an absolute position of the first storage space in the user space, so that the starting position and the size of the first storage space cannot be found after the file system of the user is damaged.
Step 103, merging the first ROM space and the first storage space as a second ROM space of the electronic device.
In some embodiments, the first ROM space and the first storage space may be logically combined by a Device Mapper technique to obtain a second ROM space of the electronic Device.
For example, as shown in fig. 4, the location information of the first storage space and the location information of the first ROM space may be obtained from the location information partition, and then the System partition and the first storage space are logically merged by the Device Mapper technology based on the location information of the first storage space and the location information of the first ROM space, so as to obtain a new System partition for performing OTA upgrade on the operating System of the electronic Device.
For example, if the first ROM space is b and the first memory space is greater than or equal to a-b, then the resulting second ROM space is greater than or equal to a. Because the ROM space required by the new version of the operating system is a, the second ROM space can meet the requirement of OTA upgrading of the new version of the operating system.
And 104, performing OTA upgrade on the operating system of the electronic equipment by using the second ROM space.
And the new version operating system can be installed in the second ROM space, so that OTA upgrade of the operating system of the electronic equipment is realized. For example, after the operating system upgrade is completed, the electronic device may be rebooted. And after the electronic equipment is restarted, continuing to use the second ROM space to perform OTA upgrade on the operating system of the electronic equipment. For example, after the electronic device is restarted, the first ROM space and the first memory space may be spliced to obtain a second ROM space according to the location and the size of the first memory space, and the second RPM space is used for performing OTA upgrade on an operating system of the electronic device subsequently.
According to the OTA upgrading method, when the OTA upgrading is needed to be carried out on the operating system of the electronic equipment, the ROM space needed by the new version operating system is determined. And if the ROM space required by the new version of operating system is larger than the first ROM space of the electronic equipment, applying for the first storage space from the user space of the electronic equipment. The first ROM space and the first memory space are then merged as a second ROM space for the electronic device. And when the OTA upgrading is needed to be carried out on the operating system of the electronic equipment, the OTA upgrading is carried out by using the second ROM space.
The OTA upgrading method can improve the utilization rate of the internal storage space of the electronic equipment and can ensure that user data cannot be lost, which is equivalent to the related technology I and the related technology II. Compared with the third related art, the first storage space is an area in the user space where the user data is not stored, and the whole user space does not need to be adjusted, so that the situation that the time required by the adjustment process of the user space is long and the user cannot use the electronic device for a long time does not occur.
Fig. 5 shows a flowchart of an OTA upgrading method provided in an embodiment of the present application. Referring to fig. 5, based on the OTA upgrading method shown in fig. 3, the OTA upgrading method may further include the following steps:
step 201, detecting whether the first storage space is located at the forefront of the user space partition.
For example, when the preset operation is detected, whether a first storage space exists in the user space partition of the electronic device may be detected, and if the first storage space exists, step 201 may be performed. The preset operation may be an operation of restoring factory settings of the electronic device.
By way of example, the first storage space may be an area having a preset identifier in the user space partition. The electronic device may detect whether the user space partition includes an area with a preset identifier, so as to determine whether the first storage space exists in the user space partition of the electronic device.
For example, the electronic device may detect whether there is an area with a preset identification in a partition of the user space. If the area with the preset identification exists in the partition of the user space, determining whether the initial position of the area with the preset identification is located at the forefront of the partition of the user space. And if the initial position of the area with the preset identification is not positioned at the foremost end of the partition of the user space, moving the area with the preset identification to the foremost end of the partition of the user space.
It can be understood that, when factory settings are restored to the electronic device, data in the user space partition is deleted. Because the first storage space is still located in the user space, if factory settings are restored to the electronic device at this time, the data in the first storage space is deleted. And the first storage space stores part of data of the new version operating system, so that factory reset cannot be directly executed on the electronic device, and the data in the first storage space needs to be prevented from being deleted. Based on the above, the first storage space can be moved to the forefront of the user space partition, and the initial address of the user space partition is correspondingly modified, so that the new user space partition does not contain the first storage space.
Step 202, the first storage space is moved to the forefront of the user space partition.
In one scenario, after detecting that a touch operation for restoring factory settings is performed on an electronic device, the electronic device detects whether a first storage space is located at the forefront of a user space partition. And if the first storage space is not positioned at the forefront end of the user space partition, moving the first storage space to the forefront end of the user space partition. If the first storage space is located at the forefront of the user space partition, step 203 is executed.
As shown in fig. 4, since the first storage space is not located at the forefront of the Data partition, the electronic device needs to move the first storage space to the forefront of the Data partition, so as to obtain the partition table shown in fig. 6.
In addition, before the first storage space is moved to the foremost end of the user space partition, the data in the first storage space can be backed up, so that the data in the first storage space can be prevented from being lost in the moving process. If the data in the first storage space is lost in the moving process, the backed-up data can be copied to the moved first storage space.
In the process of moving the first storage space, the whole first storage space can be moved to the foremost end of the user space partition at one time according to the starting position and the size of the first storage space.
Step 203, modify the starting position of the user space partition, and move the first storage space out of the user space partition.
The first storage space is moved to the forefront of the Data partition, and then the start address of the Data partition may be modified, and the first storage space is moved out of the Data partition to obtain a new Data partition, as shown in fig. 7. For example, after the first storage space is moved to the forefront of the Data partition, the initial position of the first storage space is x 1 (as the starting position of the Data partition), and the ending position is x 2 Then, the first storage space is moved out of the Data subarea to obtain the initial position of a new Data subarea as x 2 The next position of (a).
After step 203 is executed, the new location information of the user space is written into the location information partition, and the old location information of the user space in the location information partition is replaced.
Since the first storage space is not included in the new Data partition, the Data of the new version of the operating system is not included in the new Data partition. At this time, the factory setting restoration operation is performed on the electronic device, and the data of the new version operating system is not deleted.
For example, after the first storage space is moved out of the user space partition, a new System partition may be formed by adding the first storage space to the System partition through a Device Mapper technique based on the location information of the first storage space and the location information of the first ROM space, as shown in fig. 7. The new System partition in fig. 7 is obtained by merging the System partition and the first memory space in fig. 6, and the new Data partition in fig. 7 is obtained by removing the first memory space from the Data partition in fig. 6. The position information of the new System partition can be written into the position information partition, the old position information of the System partition is replaced, and the new System partition is used as the System partition when the OTA is updated next time.
According to the OTA upgrading method, before factory settings of the electronic equipment are restored, the first storage space is moved to the foremost end of the user space partition, the initial position of the user space partition is modified, and the first storage space and the first ROM space are combined into the second ROM space, so that factory settings of the electronic equipment can be restored, OTA upgrading of an operating system of the electronic equipment cannot be affected, and reliability of OTA upgrading is improved.
Corresponding to the OTA upgrading method of the above embodiment, fig. 8 shows a block diagram of the OTA upgrading apparatus 300 provided in the embodiment of the present application, and for convenience of illustration, only the relevant parts of the embodiment of the present application are shown.
Referring to fig. 8, the OTA upgrading apparatus 300 in the embodiment of the present application may include an obtaining unit 301, an applying unit 302, a merging unit 303, and an upgrading unit 304.
The obtaining unit 301 is configured to obtain a target ROM space required by a new version operating system when it is detected that OTA upgrade needs to be performed on an operating system of the electronic device. The application space 302 is used to apply for a first storage space from a user space of the electronic device when the target ROM space is larger than the first ROM space of the electronic device. The first storage space is an area where user data is not stored in the user space, and the first ROM space is a ROM space used for storing an operating system in an internal storage space of the electronic device before OTA upgrade is performed on the operating system of the electronic device. The merging unit 303 is configured to merge the first ROM space and the first storage space as a second ROM space of the electronic device. The upgrade unit 304 is configured to perform OTA upgrade on the operating system of the electronic device based on the second ROM space.
The OTA upgrading device can improve the utilization rate of the internal storage space of the electronic equipment and can ensure that user data cannot be lost, which is equivalent to the related technology I and the related technology II. Compared with the third related art, the first storage space is an area where user data is not stored in the user space, and the whole user space does not need to be adjusted, so that the situation that the user cannot use the electronic device for a long time due to long time required in the adjustment process of the user space does not occur.
The embodiment of the application further provides an electronic device, which is capable of logically combining a plurality of storage spaces. For example, the electronic device may be an electronic device having a linux kernel. The linux kernel can logically merge two or more memory spaces by Device Mapper technology or other logic merging technology. For another example, the electronic device may be an electronic device having a core other than the linux core. Similarly, the other kernel can logically merge two or more memory spaces by Device Mapper technique or other logical merging technique. For another example, the electronic device may be an electronic device without a kernel, the electronic device automatically performs offset on data in a driver to implement logical merging on multiple storage spaces, and an application in the electronic device does not perceive the spliced devices.
Referring to fig. 9, the electronic device 500 may include: at least one processor 510, a memory 520, and a computer program stored in the memory 520 and executable on the at least one processor 510, the processor 510 when executing the computer program implementing the steps of any of the various method embodiments described above, such as the steps 101 to 104 in the embodiment shown in fig. 2. Alternatively, the processor 510, when executing the computer program, implements the functions of the modules/units in the above-described device embodiments, such as the functions of the modules 301 to 304 shown in fig. 8.
Illustratively, a computer program may be partitioned into one or more modules/units, which are stored in memory 520 and executed by processor 510 to accomplish the present application. One or more modules/units may be a series of computer program segments capable of performing certain functions, the program segments being used to describe the execution of the computer program in the electronic device 500.
Those skilled in the art will appreciate that fig. 8 is merely an example of an electronic device and is not limiting and may include more or fewer components than shown, or combine certain components, or different components, such as input output devices, network access devices, buses, etc.
The Processor 510 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 520 may be an internal storage unit of the electronic device, or may be an external storage device of the electronic device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like. The memory 520 is used to store computer programs and other programs and data required by the electronic device. The memory 520 may also be used to temporarily store data that has been output or is to be output.
The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended ISA (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, the buses in the figures of the present application are not limited to only one bus or one type of bus.
Optionally, an embodiment of the present application further provides an electronic device, including: one or more processors, memory, and a display screen. The memory, the display screen, and the one or more processors are coupled, the memory for storing computer program code, the computer program code including computer instructions. The computer instructions, when executed by the one or more processors, cause the electronic device to perform one or more steps of any of the methods described above.
Optionally, the present application further provides a computer-readable storage medium, which stores instructions that, when executed on a computer or a processor, cause the computer or the processor to execute one or more steps of any one of the methods described above.
Optionally, the present application further provides a computer program product containing instructions, which when run on a computer or a processor, causes the computer or the processor to perform one or more steps of any of the methods described above.
Optionally, an embodiment of the present application further provides a chip system, where the chip system may include a memory and a processor, and the processor executes a computer program stored in the memory to implement one or more steps of any of the methods described above. The chip system can be a single chip or a chip module consisting of a plurality of chips.
Optionally, an embodiment of the present application further provides a chip system, where the chip system may include a processor, the processor is coupled with a memory, and the processor executes a computer program stored in the memory to implement one or more steps of any of the above methods. The chip system can be a single chip or a chip module consisting of a plurality of chips.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, it may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. The procedures or functions according to the embodiments of the present application are all or partially generated when the computer program instructions are loaded and executed on a computer. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored on or transmitted over a computer-readable storage medium. The computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (e.g., coaxial cable, fiber optics, digital subscriber line) or wirelessly (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a Solid State Disk (SSD)), among others.
One of ordinary skill in the art will appreciate that all or part of the processes in the methods of the above embodiments may be implemented by hardware related to instructions of a computer program, which may be stored in a computer-readable storage medium, and when executed, may include the processes of the above method embodiments. And the aforementioned storage medium includes: various media capable of storing program codes, such as ROM or RAM, magnetic or optical disks, etc.
Finally, it should be noted that: the above description is only an embodiment of the present application, but the scope of the present application is not limited thereto, and any changes or substitutions within the technical scope of the present disclosure should be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (11)

1. An OTA upgrade method, comprising:
when detecting that OTA upgrading needs to be carried out on an operating system of the electronic equipment, acquiring a target ROM space required by a new version operating system;
if the target ROM space is larger than a first ROM space of the electronic equipment, applying for a first storage space from a user space of the electronic equipment, wherein the first storage space is an area which does not store user data in the user space, and the first ROM space is a ROM space which is used for storing an operating system in an internal storage space of the electronic equipment before OTA upgrade is carried out on the operating system of the electronic equipment;
merging the first ROM space and the first storage space as a second ROM space of the electronic device;
and performing OTA upgrade on the operating system of the electronic equipment based on the second ROM space.
2. The method of claim 1, further comprising:
and determining the first storage space according to the difference value of the target ROM space and the first ROM space.
3. The method of claim 1, wherein after applying for the first storage space from a user space of the electronic device, the method further comprises:
and storing the information of the first storage space, wherein the information of the first storage space comprises a starting position and a size of the first storage space.
4. The method according to any one of claims 1 to 3, further comprising:
moving the first storage space to a front-most end of a partition of the user space;
and modifying the initial position of the partition of the user space, and moving the first storage space out of the partition of the user space.
5. The method of claim 4, wherein moving the first storage space to a front-most end of the partition of the user space comprises:
after the preset operation is detected, determining whether the first storage space is positioned at the foremost end of the partition of the user space according to the initial position of the first storage space;
and if the first storage space is not positioned at the foremost end of the partition of the user space, moving the first storage space to the foremost end of the partition of the user space.
6. The method of claim 5, wherein prior to moving the first storage space to a front-most end of the partition of the user space, the method further comprises:
and backing up the data in the first storage space.
7. The method according to any one of claims 4 to 6, wherein the location information of the first ROM space and the location information of the first storage space are both stored in a location information partition of the electronic device; after moving the first storage space out of the partition of the user space, the method further comprises:
merging the first storage space into a first ROM space by a Device Mapper technology based on the position information of the first storage space and the position information of the first ROM space to form a second ROM space;
and writing the position information of the second ROM space into the position information partition, and replacing the position information of the first ROM space.
8. The method according to claim 5, wherein the preset operation is an operation of factory-reset of the electronic device.
9. The method according to any one of claims 1 to 8, wherein the storing of the location information of the first ROM space and the location information of the first storage space in the location information partition of the electronic device, and the merging of the first ROM space and the first storage space as the second ROM space of the electronic device comprises:
acquiring the position information of the first ROM space and the position information of the first storage space from the position information partition;
and logically combining the first ROM space and the first storage space by a Device Mapper technology based on the position information of the first ROM space and the position information of the first storage space to obtain the second ROM space.
10. An electronic device, comprising: one or more processors, memory, and a display screen;
the memory, the display screen, and the one or more processors, the memory to store computer program code, the computer program code comprising computer instructions;
the computer instructions, when executed by the one or more processors, cause the electronic device to perform the method of any of claims 1-9.
11. A chip system, characterized in that the chip system comprises a processor coupled with a memory, the processor executing a computer program stored in the memory to implement the method according to any of claims 1 to 9.
CN202110223712.XA 2021-02-26 2021-02-26 OTA (over the air) upgrading method, electronic equipment and chip system Pending CN114968297A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110223712.XA CN114968297A (en) 2021-02-26 2021-02-26 OTA (over the air) upgrading method, electronic equipment and chip system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110223712.XA CN114968297A (en) 2021-02-26 2021-02-26 OTA (over the air) upgrading method, electronic equipment and chip system

Publications (1)

Publication Number Publication Date
CN114968297A true CN114968297A (en) 2022-08-30

Family

ID=82973484

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110223712.XA Pending CN114968297A (en) 2021-02-26 2021-02-26 OTA (over the air) upgrading method, electronic equipment and chip system

Country Status (1)

Country Link
CN (1) CN114968297A (en)

Similar Documents

Publication Publication Date Title
US9239725B2 (en) System and method for installing an OS via a network card supporting PXE
US20110213954A1 (en) Method and apparatus for generating minimum boot image
US20130138934A1 (en) Loading configuration information
CN110825419B (en) Firmware refreshing method and device, electronic equipment and storage medium
US10496608B2 (en) Synchronizing changes in a file system which are initiated by a storage device and a host device
CN111258666A (en) Reading method and device of computer file, computer system and storage medium
CN113626256A (en) Virtual machine disk data backup method, device, terminal and storage medium
CN114579055B (en) Disk storage method, device, equipment and medium
CN110515671B (en) Initialization method, initialization device, terminal device and readable storage medium
CN115202686A (en) Virtualization system upgrading method and device, electronic equipment and storage medium
CN110019063B (en) Method for computing node data disaster recovery playback, terminal device and storage medium
CN114443081A (en) Terminal upgrading method and terminal
CN109582332B (en) System upgrading method and device for Internet camera
CN114780019A (en) Electronic device management method and device, electronic device and storage medium
US8886597B2 (en) Synchronizing changes in a file system which are initiated by a storage device and a host device
CN106933604B (en) System upgrading method and device
WO2020107469A1 (en) Application processing method and apparatus and storage medium
CN110941516A (en) Operating system restoration method, device, equipment and storage medium
CN114968297A (en) OTA (over the air) upgrading method, electronic equipment and chip system
CN105511904A (en) Method and apparatus for automatically updating shortcut window
CN113849494A (en) Data updating method and device
KR101143909B1 (en) Dual backup system based on cloud computing
CN115658152A (en) Firmware upgrading method, firmware, electronic device and computer readable storage medium
CN114995852A (en) Equipment upgrading method, equipment and computer readable storage medium
CN113778485A (en) System operation method and device of electronic chip, electronic chip and storage medium

Legal Events

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