CN113495744A - Version upgrading method and related device - Google Patents

Version upgrading method and related device Download PDF

Info

Publication number
CN113495744A
CN113495744A CN202010198332.0A CN202010198332A CN113495744A CN 113495744 A CN113495744 A CN 113495744A CN 202010198332 A CN202010198332 A CN 202010198332A CN 113495744 A CN113495744 A CN 113495744A
Authority
CN
China
Prior art keywords
space
data
user data
capacity
system software
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
CN202010198332.0A
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 CN202010198332.0A priority Critical patent/CN113495744A/en
Priority to PCT/CN2021/081796 priority patent/WO2021185352A1/en
Publication of CN113495744A publication Critical patent/CN113495744A/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/654Updates using techniques specially adapted for alterable solid state memories, e.g. for EEPROM or flash memories

Abstract

Disclosed is a version upgrade method, including: receiving update information, wherein the update information comprises the capacity of the software space of the new version system; the user data space comprises a first user data space and a second user data space, the second user data space in the physical space is adjacent to the system software space, the first user data space comprises a metadata storage area and a data area, and a first data block of the second user data space is the next data block of a last data block of the first user data space; when the system software space of the new version is larger than the current system software space and the data free space of the user data space is larger than the capacity difference before and after the system software space is upgraded, the operating system is upgraded to the new version; the upgraded system software space comprises a first space of a header of the original second user data space, the capacity of the first space is a first difference value, and the upgraded second user data space is the residual space of the original second user data space except the first space. Thus, the time required for version upgrade can be reduced.

Description

Version upgrading method and related device
Technical Field
The present application relates to the field of electronic technologies, and in particular, to a version upgrade method and a related apparatus.
Background
The storage space of the mobile phone comprises a system software space and a user data space, wherein the user data space is used for storing user data such as videos, music, cache files and the like, and the system software space is used for storing installation data of an operating system of the mobile phone. Further, the metadata storage area of the user data space header is used to store information such as file number, location, creation/modification time, etc. in the user data, and the block addresses of all data blocks of the user data area of the user data space are offset addresses from the start address of the metadata storage area. When the version of the operating system of the mobile phone is upgraded, the size of the storage space occupied by the new version is usually enlarged or reduced compared with the current installation version of the mobile phone. When the mobile phone is in the first edition, a certain free space is usually reserved in the system software space to deal with the scene of the subsequent edition increase, and when the size of the new edition increase exceeds the reserved space, namely the storage space occupied by the new edition is larger than the current system software space, the problem that the upgrade cannot be performed is caused.
At present, in order to solve the above problems, the following solutions are proposed. When the version is upgraded, if the storage space occupied by the new version is larger than the current system software space, the user data space can be reduced, so that part of the user data space is released to the system software space. However, in the above scheme, reducing the user data space requires moving the metadata storage area, i.e., changing the start address of the metadata storage area, and thus the above scheme requires modifying the block addresses of all the data blocks of the user data area, resulting in a very slow version upgrade of the above scheme.
In summary, the current version upgrading techniques are time consuming.
Disclosure of Invention
The embodiment of the application provides a version upgrading method and a related device, which can effectively shorten the version upgrading time.
In a first aspect, the present application provides a version upgrade method, including: the electronic equipment receives update information, wherein the update information comprises the capacity of system software space of the new version of the operating system; the storage space of the electronic equipment comprises a system software space and a user data space, the user data space comprises a first user data space and a second user data space, the second user data space in the physical space is adjacent to the system software space, the first user data space comprises a metadata storage area and a data area, metadata in the metadata storage area is used for managing data in the first user data space and the second user data space, the second user data space comprises a first space, the starting address of the first space is the same as the starting address of the second user data space, and the first data block of the second user data space is the next data block of the last data block of the first user data space; when the capacity of the system software space of the new version is larger than the current capacity of the system software space and the free space of the data area of the user data space is larger than a first difference value, the electronic equipment upgrades the operating system to the new version; the upgraded system software space comprises a first space, the first difference is equal to the subtraction of the current capacity of the system software space from the capacity of the system software space of the new version, the capacity of the first space is equal to the first difference, the first data block of the upgraded second space is the next data block of the last data block of the first user data space, and the second space is the residual space except the first space in the second user data space before upgrading.
In this embodiment, the user data space includes a first user data space and a second user data space, the first user data space includes a metadata storage area, a block address of a data block in the user data space is an offset address relative to a start address of the metadata storage area, and a first data block of the second user data space at a logical address is a next data block of a last data block of the first user data space. In the version upgrading process of the electronic device, if the system software space is insufficient, a part of the second user data space can be divided into the system software space. Since the start address of the metadata storage area is not changed during the version upgrade process, the block address of the data block in the first user data space does not need to be changed. By implementing the embodiment of the application, the time length of version upgrading can be effectively shortened.
In one implementation manner, the system software space includes a third space, a last data block of the third space is a last data block of the system software space, and after receiving the update information, the electronic device further includes: when the capacity of the system software space of the new version is smaller than the current capacity of the system software space, the electronic equipment upgrades the operating system to the new version; the upgraded second user data space includes a third space, the capacity of the third space is equal to the current capacity of the system software space minus the capacity of the system software space of the new version, and the first data block of the upgraded third space is the next data block of the last data block of the first user data space.
In the embodiment of the application, in the version upgrading process of the electronic device, if the system software space has redundant free space, the free space of the system software space can be divided into the second user data space. Since the start address of the metadata storage area is not changed during the version upgrade process, the block address of the data block in the first user data space does not need to be changed. By implementing the embodiment of the application, the time length of version upgrading can be effectively shortened, and the user experience is improved.
In one implementation, the data area of the first user data space includes a fourth space, the fourth space does not occupy a physical space, a last data block of the fourth space is a last data block of the first user data space, the metadata storage area includes a first parameter, the first parameter is used for representing a capacity of the fourth space, and the capacity of the fourth space is smaller than a current capacity of the system software space.
In one implementation manner, before the electronic device upgrades the operating system to the new version, the method further includes: the electronic equipment increases a fourth space and a system software space; the increased system software space comprises a first space, the increased capacity of a fourth space is equal to the capacity of the first space, a fifth space is the increased fourth space, and the last data block of the first user data space is the last data block of the fifth space after the fourth space is increased.
In the embodiment of the application, in the version upgrading process of the electronic device, if the system software space is insufficient, the first space of the second user data space can be divided into the system software space, and meanwhile, the fourth space in the first user data space is increased. The fourth space does not occupy real physical space and can be understood as virtual space. Since the increased capacity of the fourth space is equal to the capacity of the first space, offset addresses of data blocks of a second space other than the first space in the second user data space with respect to the metadata storage area do not change, and thus, there is no need to modify the block addresses of the second space. It will be appreciated that moving the metadata storage area and modifying the block address of the data blocks of the user data space risks losing all or part of the user data. By implementing the embodiment of the application, the time length for version upgrading can be further shortened, the risk of data loss is reduced, and the user experience is improved.
In one implementation, after receiving the update information, the electronic device further includes: the electronic equipment reduces the fourth space and the system software space; the reduced system software space does not include a third space, the reduced capacity of the fourth space is equal to the capacity of the third space, the sixth space is the reduced fourth space, and the last data block of the first user data space after the fourth space is reduced is the last data block of the sixth space.
In the embodiment of the application, in the version upgrading process of the electronic device, if the system software space has redundant free space, the free space of the system software space can be divided into the second user data space, and meanwhile, the fourth space in the first user data space is reduced. Since the reduced capacity of the fourth space is equal to the capacity of the free space, the offset address of the data block in the original second user data space relative to the metadata storage area does not change, and therefore, the block address of the data block in the original second user data space does not need to be modified. By implementing the embodiment of the application, the time length for version upgrading can be further shortened, the risk of data loss is reduced, and the user experience is improved.
In one implementation, the electronic device increases the fourth space, and includes: the electronic device modifies the first parameter to the capacity of the fifth space.
In the embodiment of the application, the capacity of the fourth space can be increased by modifying the first parameter, and the increased capacity of the fourth space is equal to the capacity of the first space, so that the block address of the data block in the second space is ensured not to be changed.
In one implementation, the electronic device shrinking the fourth space includes: the electronic device modifies the first parameter to the capacity of the sixth space.
In the embodiment of the application, the capacity of the fourth space can be reduced by modifying the first parameter, and the reduced capacity of the fourth space is equal to the capacity of the third space, so that the block address of the data block in the original second user data space is ensured not to be changed.
In one implementation, the metadata storage area includes a data item S1To SrS above1To SrS in (1)1To SyValidity of data blocks for identifying data areas, S1To SrS in (1)x+1To SyFor identifying the validity, S, of data blocks of a fourth space1To SrS in (1)y+1To SrValidity of data block for identifying second user data space, S1To SrS in (1)y+1To SzIdentifying a validity of a data block of a first space; wherein S isiEqual to 1 characterizes SiThe identified data block is an invalid block, SiEqual to 0 characterizes SiThe characterized data block is an effective block, i is a positive integer greater than zero and less than or equal to r, and S isx+1To SyAll equal to 1, x, y, z and r are positive integers, x is greater than 1, y is greater than x, z is greater than y, and r is greater than z.
In one implementation, after the electronic device increases the fourth space, the method further includes: the electronic device determines Sy+1To SzAre all 1, S abovey+1To SzAnd the data processing device is used for representing the effectiveness of the newly added data block of the fourth space.
In the embodiment of the application, before the electronic equipment upgrades the operating system to the new version, the data item Sy+1To SzFor identifying the validity of the data block of the first space. Before the electronic equipment upgrades the operating system to the new version, the electronic equipment upgrades the operating system to the new versionAnd ensuring that the block address of the data block in the new second user data space is unchanged, and increasing the capacity of the fourth space by the electronic equipment. To guarantee the data item Sy+1To SzCorresponding relation with logical data block, the electronic device stores the data item Sy+1To SzAll are modified to be 1, and the newly added data blocks used for identifying the fourth space are all invalid data blocks.
In one implementation, the third space includes a data blocks, and after the electronic device reduces the fourth space, the method further includes: the electronic device determines Sy-a+1To SyAre all 0, S abovey-a+1To SyFor characterizing the validity of the data blocks of the third space.
In the embodiment of the application, before the electronic equipment upgrades the operating system to the new version, the data item Sy-a+1To SyThe data blocks used for identifying the fourth space are all invalid data blocks. And the electronic equipment upgrades the operating system to a new version, and reduces the capacity of a fourth space in order to ensure that the block address of the data block in the original second user data space is unchanged after the system software space is reduced. To guarantee the data item Sy-a+1To SyCorresponding relation with logical data block, the electronic device stores the data item Sy+1To SzAre all modified to be 0, and the data blocks used for identifying the third space are all valid data blocks.
In an implementation manner, the update information further includes a start address of the second user data space of the new version and a capacity of the second user data space of the new version, the storage space of the electronic device further includes a partition table, and the partition table includes a first address parameter and a first capacity parameter, and a second capacity parameter, where the first address parameter is used to represent the start address of the second user data space, and the first capacity parameter and the second capacity parameter are respectively used to represent capacities of the system software space and the second user data space.
In an implementation manner, before the electronic device upgrades the operating system to the new version, the electronic device further modifies the first capacity parameter to the first capacity, modifies the second capacity parameter to the capacity of the second user data space of the new version, modifies the first address parameter to the start address of the second user data space of the new version, and modifies the start address of the second user data space of the new version to be the same as the start address of the second space.
In one implementation manner, after receiving the update information, the electronic device further includes: the electronic equipment modifies the first capacity parameter into a first capacity, the second capacity parameter into the capacity of the second user data space of the new version, the first address parameter is modified into the starting address of the second user data space of the new version, and the starting address of the second user data space of the new version is the same as the starting address of the third space.
In a second aspect, an embodiment of the present application provides an electronic device, including: one or more processors, memory, touch screen, one or more keys; a memory, a touch screen, the one or more keys coupled to the one or more processors, the memory for storing computer program code, the computer program code comprising computer instructions, the one or more processors executing the computer instructions to perform:
receiving update information, the update information including a capacity of system software space for a new version of the operating system; the storage space of the electronic equipment comprises a system software space and a user data space, the user data space comprises a first user data space and a second user data space, the second user data space in the physical space is adjacent to the system software space, the first user data space comprises a metadata storage area and a data area, metadata in the metadata storage area is used for managing data in the first user data space and the second user data space, the second user data space comprises a first space, the starting address of the first space is the same as the starting address of the second user data space, and the first data block of the second user data space is the next data block of the last data block of the first user data space; when the capacity of the system software space of the new version is larger than the current capacity of the system software space and the free space of the data area of the user data space is larger than a first difference value, the operating system is upgraded to the new version; the upgraded system software space comprises a first space, the first difference is equal to the subtraction of the current capacity of the system software space from the capacity of the system software space of the new version, the capacity of the first space is equal to the first difference, the first data block of the upgraded second space is the next data block of the last data block of the first user data space, and the second space is the residual space except the first space in the second user data space before upgrading.
In one implementation, the system software space includes a third space, a last data block of the third space is a last data block of the system software space, and after receiving the update information, the processor is further configured to: when the capacity of the system software space of the new version is smaller than the current capacity of the system software space, the operating system is upgraded to the new version; the upgraded second user data space includes a third space, the capacity of the third space is equal to the current capacity of the system software space minus the capacity of the system software space of the new version, and the first data block of the upgraded third space is the next data block of the last data block of the first user data space.
In one implementation, the data area of the first user data space includes a fourth space, the fourth space does not occupy a physical space, a last data block of the fourth space is a last data block of the first user data space, the metadata storage area includes a first parameter, the first parameter is used for representing a capacity of the fourth space, and the capacity of the fourth space is smaller than a current capacity of the system software space.
In one implementation, before the upgrading of the operating system to the new version, the processor is further configured to: increasing the fourth space and the system software space; the increased system software space comprises a first space, the increased capacity of a fourth space is equal to the capacity of the first space, a fifth space is the increased fourth space, and the last data block of the first user data space is the last data block of the fifth space after the fourth space is increased.
In one implementation, after receiving the update information, the processor is further configured to: reducing the fourth space and the system software space; the reduced system software space does not include a third space, the reduced capacity of the fourth space is equal to the capacity of the third space, the sixth space is the reduced fourth space, and the last data block of the first user data space after the fourth space is reduced is the last data block of the sixth space.
In one implementation, the increasing the fourth space includes: the first parameter is modified to the capacity of the fifth space.
In one implementation, the narrowing the fourth space includes: the first parameter is modified to the capacity of the sixth space.
In one implementation, the metadata storage area includes a data item S1To SrS above1To SrS in (1)1To SyValidity of data blocks for identifying data areas, S1To SrS in (1)x+1To SyFor identifying the validity, S, of data blocks of a fourth space1To SrS in (1)y+1To SrValidity of data block for identifying second user data space, S1To SrS in (1)y+1To SzIdentifying a validity of a data block of a first space; wherein S isiEqual to 1 characterizes SiThe identified data block is an invalid block, SiEqual to 0 characterizes SiThe characterized data block is an effective block, i is a positive integer greater than zero and less than or equal to r, and S isx+1To SyAll equal to 1, x, y, z and r are positive integers, x is greater than 1, y is greater than x, z is greater than y, and r is greater than z.
In one implementation, after increasing the fourth space, the processor is further configured to: determining the above Sy+1To SzAre all 1, S abovey+1To SzAnd the data processing device is used for representing the effectiveness of the newly added data block of the fourth space.
In one implementation, the third space includes a data blocks, and after the fourth space is narrowed, the processor is further configured to: determining the above Sy-a+1To SyAre all 0, S abovey-a+1To SyFor characterizing the validity of the data blocks of the third space.
In an implementation manner, the update information further includes a start address of the second user data space of the new version and a capacity of the second user data space of the new version, the storage space of the electronic device further includes a partition table, and the partition table includes a first address parameter and a first capacity parameter, and a second capacity parameter, where the first address parameter is used to represent the start address of the second user data space, and the first capacity parameter and the second capacity parameter are respectively used to represent capacities of the system software space and the second user data space.
In one implementation, before the upgrading of the operating system to the new version, the processor is further configured to: and modifying the first capacity parameter into a first capacity, modifying the second capacity parameter into the capacity of the second user data space of the new version, modifying the first address parameter into the initial address of the second user data space of the new version, wherein the initial address of the second user data space of the new version is the same as the initial address of the second space.
In one implementation, after receiving the update information, the processor is further configured to: and modifying the first capacity parameter into a first capacity, modifying the second capacity parameter into the capacity of the second user data space of the new version, modifying the first address parameter into the initial address of the second user data space of the new version, wherein the initial address of the second user data space of the new version is the same as the initial address of the third space.
In a third aspect, an embodiment of the present application provides a computer storage medium, which includes computer instructions, and when the computer instructions are run on an electronic device, the electronic device is caused to execute a version upgrade method provided in any implementation manner of the first aspect of the embodiment of the present application.
In a fourth aspect, an embodiment of the present application provides a computer program product, which when running on an electronic device, causes the electronic device to execute the version upgrade method provided in any implementation manner of the first aspect of the embodiment of the present application.
It is to be understood that the electronic device provided by the second aspect, the computer storage medium provided by the third aspect, and the computer program product provided by the fourth aspect are all configured to execute the version upgrade method provided by the second aspect, and therefore, the beneficial effects achieved by the electronic device can refer to the beneficial effects in the version upgrade method provided by the first aspect, and are not described herein again.
Drawings
Fig. 1 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure;
fig. 2 is a schematic structural diagram of another electronic device provided in an embodiment of the present application;
3-5 are exemplary graphical user interfaces provided by embodiments of the present application;
fig. 6 is a schematic structural diagram of a storage space according to an embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of a user data space according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of another user data space provided in the embodiment of the present application;
fig. 9 is a schematic structural diagram of a storage space in a version upgrade process according to an embodiment of the present application;
fig. 10 is a schematic structural diagram of a storage space in another version upgrade process according to an embodiment of the present application;
fig. 11 is a schematic structural diagram of another storage space provided in an embodiment of the present application;
fig. 12 is a schematic structural diagram of another user data space provided in the embodiment of the present application;
fig. 13 is a schematic structural diagram of a storage space in another version upgrading process according to an embodiment of the present application;
fig. 14 is a schematic structural diagram of a storage space in another version upgrading process according to an embodiment of the present application;
fig. 15 is a schematic flowchart of a version upgrading method according to an embodiment of the present application;
16-17 are exemplary graphical user interfaces for version upgrades provided by embodiments of the present application;
fig. 18 is a schematic structural diagram of a storage space in another version upgrading process according to an embodiment of the present application;
FIG. 19 is an exemplary graphical user interface for version upgrading as provided by embodiments of the present application;
fig. 20 is a schematic structural diagram of a storage space in another version upgrade process according to an embodiment of the present application;
fig. 21 is a schematic structural diagram of another storage space provided in an embodiment of the present application;
fig. 22 is a schematic flowchart of another version upgrading method according to an embodiment of the present application;
fig. 23 is a schematic structural diagram of a storage space in another version upgrading process according to an embodiment of the present application;
fig. 24 is a schematic structural diagram of a storage space in another version upgrade process according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described in detail and clearly with reference to the accompanying drawings. In the description of the embodiments herein, "/" means "or" unless otherwise specified, for example, a/B may mean a or B; "and/or" in the text is only an association relationship describing an associated object, and means that three relationships may exist, for example, a and/or B may mean: three cases of a alone, a and B both, and B alone exist, and in addition, "a plurality" means two or more than two in the description of the embodiments of the present application.
In the following, the terms "first", "second" are used for descriptive purposes only and are not to be understood as implying or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature, and in the description of embodiments of the application, unless stated otherwise, "plurality" means two or more.
Next, the electronic apparatus related to the embodiment of the present application will be first described. The type of the electronic device is not particularly limited, and the electronic device 100 may be a portable electronic device such as a mobile phone, a tablet computer, a Personal Digital Assistant (PDA), a wearable device, and a laptop computer (laptop). Exemplary embodiments of portable electronic devices include, but are not limited to, portable electronic devices that carry an iOS, android, microsoft, or other operating system. The portable electronic device may also be other portable electronic devices such as laptop computers (laptop) with touch sensitive surfaces (e.g., touch panels), etc. It should also be understood that in some other embodiments of the present application, the electronic device may not be a portable electronic device, but may be a desktop computer with a touch-sensitive surface (e.g., a touch panel), a smart television, or the like.
Referring to fig. 1, fig. 1 shows a schematic structural diagram of an exemplary electronic device 100 provided in an embodiment of the present application.
The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a Universal Serial Bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a key 190, a motor 191, an indicator 192, a camera 193, a display screen 194, a Subscriber Identification Module (SIM) card interface 195, and the like. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and the like.
It is to be understood that the illustrated structure of the embodiment of the present application does not specifically limit the electronic device 100. In other embodiments of the present application, electronic device 100 may include more or fewer components than shown, or some components may be combined, some components may be split, or a different arrangement of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
Processor 110 may include one or more processing units, such as: the processor 110 may include an Application Processor (AP), a modem processor, a Graphics Processing Unit (GPU), an Image Signal Processor (ISP), a controller, a memory, a video codec, a Digital Signal Processor (DSP), a baseband processor, and/or a neural-Network Processing Unit (NPU), etc. The different processing units may be separate devices or may be integrated into one or more processors.
The controller may be, among other things, a neural center and a command center of the electronic device 100. The controller can generate an operation control signal according to the instruction operation code and the timing signal to complete the control of instruction fetching and instruction execution.
The NPU may perform artificial intelligence operations using Convolutional Neural Networks (CNN) processing. For example, a CNN model is used for carrying out a large amount of information identification and information screening, and training and identification of scene intelligence can be achieved.
A memory may also be provided in processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that have just been used or recycled by the processor 110. If the processor 110 needs to reuse the instruction or data, it can be called directly from the memory. Avoiding repeated accesses reduces the latency of the processor 110, thereby increasing the efficiency of the system.
In some embodiments, processor 110 may include one or more interfaces. The interface may include an integrated circuit (I2C) interface, an integrated circuit built-in audio (I2S) interface, a Pulse Code Modulation (PCM) interface, a universal asynchronous receiver/transmitter (UART) interface, a Mobile Industry Processor Interface (MIPI), a general-purpose input/output (GPIO) interface, a Subscriber Identity Module (SIM) interface, and/or a Universal Serial Bus (USB) interface, etc.
The I2C interface is a bi-directional synchronous serial bus that includes a serial data line (SDA) and a Serial Clock Line (SCL). In some embodiments, processor 110 may include multiple sets of I2C buses. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C bus interfaces, respectively. For example: the processor 110 may be coupled to the touch sensor 180K via an I2C interface, such that the processor 110 and the touch sensor 180K communicate via an I2C bus interface to implement the touch functionality of the electronic device 100.
The I2S interface may be used for audio communication. In some embodiments, processor 110 may include multiple sets of I2S buses. The processor 110 may be coupled to the audio module 170 via an I2S bus to enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 may communicate audio signals to the wireless communication module 160 via the I2S interface, enabling answering of calls via a bluetooth headset.
The PCM interface may also be used for audio communication, sampling, quantizing and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 may be coupled by a PCM bus interface. In some embodiments, the audio module 170 may also transmit audio signals to the wireless communication module 160 through the PCM interface, so as to implement a function of answering a call through a bluetooth headset. Both the I2S interface and the PCM interface may be used for audio communication.
The UART interface is a universal serial data bus used for asynchronous communications. The bus may be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, a UART interface is generally used to connect the processor 110 with the wireless communication module 160. For example: the processor 110 communicates with a bluetooth module in the wireless communication module 160 through a UART interface to implement a bluetooth function. In some embodiments, the audio module 170 may transmit the audio signal to the wireless communication module 160 through a UART interface, so as to realize the function of playing music through a bluetooth headset.
MIPI interfaces may be used to connect processor 110 with peripheral devices such as display screen 194, camera 193, and the like. The MIPI interface includes a Camera Serial Interface (CSI), a Display Serial Interface (DSI), and the like. In some embodiments, processor 110 and camera 193 communicate through a CSI interface to implement the capture functionality of electronic device 100. The processor 110 and the display screen 194 communicate through the DSI interface to implement the display function of the electronic device 100.
The GPIO interface may be configured by software. The GPIO interface may be configured as a control signal and may also be configured as a data signal. In some embodiments, a GPIO interface may be used to connect the processor 110 with the camera 193, the display 194, the wireless communication module 160, the audio module 170, the sensor module 180, and the like. The GPIO interface may also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, and the like.
The USB interface 130 is an interface conforming to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, or the like. The USB interface 130 may be used to connect a charger to charge the electronic device 100, and may also be used to transmit data between the electronic device 100 and a peripheral device. And the earphone can also be used for connecting an earphone and playing audio through the earphone. The interface may also be used to connect other electronic devices, such as AR devices and the like.
It should be understood that the interface connection relationship between the modules illustrated in the embodiments of the present application is only an illustration, and does not limit the structure of the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection manners or a combination of multiple interface connection manners in the above embodiments.
The charging management module 140 is configured to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive a wireless charging input through a wireless charging coil of the electronic device 100. The charging management module 140 may also supply power to the electronic device through the power management module 141 while charging the battery 142.
The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and/or the charge management module 140 and provides power to the processor 110, the internal memory 121, the external memory, the display 194, the camera 193, the wireless communication module 160, and the like. The power management module 141 may also be used to monitor parameters such as battery capacity, battery cycle count, battery state of health (leakage, impedance), etc. In some other embodiments, the power management module 141 may also be disposed in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 may be disposed in the same device.
The wireless communication function of the electronic device 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, a modem processor, a baseband processor, and the like.
The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in the electronic device 100 may be used to cover a single or multiple communication bands. Different antennas can also be multiplexed to improve the utilization of the antennas. For example: the antenna 1 may be multiplexed as a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
The mobile communication module 150 may provide a solution including 2G/3G/4G/5G wireless communication applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a Low Noise Amplifier (LNA), and the like. The mobile communication module 150 may receive the electromagnetic wave from the antenna 1, filter, amplify, etc. the received electromagnetic wave, and transmit the electromagnetic wave to the modem processor for demodulation. The mobile communication module 150 may also amplify the signal modulated by the modem processor, and convert the signal into electromagnetic wave through the antenna 1 to radiate the electromagnetic wave. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the same device as at least some of the modules of the processor 110.
The modem processor may include a modulator and a demodulator. The modulator is used for modulating a low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used for demodulating the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then passes the demodulated low frequency baseband signal to a baseband processor for processing. The low frequency baseband signal is processed by the baseband processor and then transferred to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.) or displays an image or video through the display screen 194. In some embodiments, the modem processor may be a stand-alone device. In other embodiments, the modem processor may be provided in the same device as the mobile communication module 150 or other functional modules, independent of the processor 110.
The wireless communication module 160 may provide a solution for wireless communication applied to the electronic device 100, including Wireless Local Area Networks (WLANs) (e.g., wireless fidelity (Wi-Fi) networks), bluetooth (bluetooth, BT), Global Navigation Satellite System (GNSS), Frequency Modulation (FM), Near Field Communication (NFC), Infrared (IR), and the like. The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, performs frequency modulation and filtering processing on electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 may also receive a signal to be transmitted from the processor 110, perform frequency modulation and amplification on the signal, and convert the signal into electromagnetic waves through the antenna 2 to radiate the electromagnetic waves.
In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150 and antenna 2 is coupled to wireless communication module 160 so that electronic device 100 can communicate with networks and other devices through wireless communication techniques. The wireless communication technology may include global system for mobile communications (GSM), General Packet Radio Service (GPRS), code division multiple access (code division multiple access, CDMA), Wideband Code Division Multiple Access (WCDMA), time-division code division multiple access (time-division code division multiple access, TD-SCDMA), Long Term Evolution (LTE), LTE, BT, GNSS, WLAN, NFC, FM, and/or IR technologies, etc. The GNSS may include a Global Positioning System (GPS), a global navigation satellite system (GLONASS), a beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS), and/or a Satellite Based Augmentation System (SBAS).
The electronic device 100 implements display functions via the GPU, the display screen 194, and the application processor. The GPU is a microprocessor for image processing, and is connected to the display screen 194 and an application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or alter display information.
The display screen 194 is used to display images, video, and the like. The display screen 194 includes a display panel. The display panel may adopt a Liquid Crystal Display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (active-matrix organic light-emitting diode, AMOLED), a flexible light-emitting diode (FLED), a miniature, a Micro-oeld, a quantum dot light-emitting diode (QLED), and the like. In some embodiments, the electronic device 100 may include 1 or N display screens 194, with N being a positive integer greater than 1.
In some embodiments of the present application, the interface content currently output by the system is displayed in the display screen 194. For example, the interface content is an interface provided by an instant messaging application.
The electronic device 100 may implement a shooting function through the ISP, the camera 193, the video codec, the GPU, the display 194, the application processor, and the like.
The ISP is used to process the data fed back by the camera 193. For example, when a photo is taken, the shutter is opened, light is transmitted to the camera photosensitive element through the lens, the optical signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converting into an image visible to naked eyes. The ISP can also carry out algorithm optimization on the noise, brightness and skin color of the image. The ISP can also optimize parameters such as exposure, color temperature and the like of a shooting scene. In some embodiments, the ISP may be provided in camera 193.
The camera 193 is used to capture still images or video. The object generates an optical image through the lens and projects the optical image to the photosensitive element. The photosensitive element may be a Charge Coupled Device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The light sensing element converts the optical signal into an electrical signal, which is then passed to the ISP where it is converted into a digital image signal. And the ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into image signal in standard RGB, YUV and other formats. In some embodiments, the electronic device 100 may include 1 or N cameras 193, N being a positive integer greater than 1.
The digital signal processor is used for processing digital signals, and can process digital image signals and other digital signals. For example, when the electronic device 100 selects a frequency bin, the digital signal processor is used to perform fourier transform or the like on the frequency bin energy.
Video codecs are used to compress or decompress digital video. The electronic device 100 may support one or more video codecs. In this way, the electronic device 100 may play or record video in a variety of encoding formats, such as: moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, and the like.
The NPU is a neural-network (NN) computing processor that processes input information quickly by using a biological neural network structure, for example, by using a transfer mode between neurons of a human brain, and can also learn by itself continuously. Applications such as intelligent recognition of the electronic device 100 can be realized through the NPU, for example: image recognition, face recognition, speech recognition, text understanding, and the like.
The external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to extend the memory capability of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music, video, etc. are saved in an external memory card.
The internal memory 121 may be used to store computer-executable program code, which includes instructions. The processor 110 executes various functional applications of the electronic device 100 and data processing by executing instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. The storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required by at least one function, and the like. The storage data area may store data (such as audio data, phone book, etc.) created during use of the electronic device 100, and the like. In addition, the internal memory 121 may include a high-speed random access memory, and may further include a nonvolatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (UFS), and the like.
The electronic device 100 may implement audio functions via the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone interface 170D, and the application processor. Such as music playing, recording, etc.
The audio module 170 is used to convert digital audio information into an analog audio signal output and also to convert an analog audio input into a digital audio signal. The audio module 170 may also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be disposed in the processor 110, or some functional modules of the audio module 170 may be disposed in the processor 110.
The speaker 170A, also called a "horn", is used to convert the audio electrical signal into an acoustic signal. The electronic apparatus 100 can listen to music through the speaker 170A or listen to a handsfree call.
The receiver 170B, also called "earpiece", is used to convert the electrical audio signal into an acoustic signal. When the electronic apparatus 100 receives a call or voice information, it can receive voice by placing the receiver 170B close to the ear of the person.
The microphone 170C, also referred to as a "microphone," is used to convert sound signals into electrical signals. When making a call or transmitting voice information, the user can input a voice signal to the microphone 170C by speaking the user's mouth near the microphone 170C. The electronic device 100 may be provided with at least one microphone 170C. In other embodiments, the electronic device 100 may be provided with two microphones 170C to achieve a noise reduction function in addition to collecting sound signals. In other embodiments, the electronic device 100 may further include three, four or more microphones 170C to collect sound signals, reduce noise, identify sound sources, perform directional recording, and so on.
The headphone interface 170D is used to connect a wired headphone. The headset interface 170D may be the USB interface 130, or may be a 3.5mm open mobile electronic device platform (OMTP) standard interface, a cellular telecommunications industry association (cellular telecommunications industry association of the USA, CTIA) standard interface.
The pressure sensor 180A is used for sensing a pressure signal, and converting the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A may be disposed on the display screen 194. In some alternative embodiments of the present application, the pressure sensor 180A may be configured to capture a pressure value generated when a user's finger portion contacts the display screen and transmit the pressure value to the processor, so that the processor identifies which finger portion the user entered the user action.
The pressure sensor 180A can be of a wide variety, such as a resistive pressure sensor, an inductive pressure sensor, a capacitive pressure sensor, and the like. The capacitive pressure sensor may be a sensor comprising at least two parallel plates having an electrically conductive material. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the strength of the pressure from the change in capacitance. When a touch operation is applied to the display screen 194, the electronic apparatus 100 detects the intensity of the touch operation according to the pressure sensor 180A. The electronic apparatus 100 may also calculate the touched position from the detection signal of the pressure sensor 180A. In some embodiments, the touch operations that are applied to the same touch position but different touch operation intensities may correspond to different operation instructions. For example: and when the touch operation with the touch operation intensity smaller than the first pressure threshold value acts on the short message application icon, executing an instruction for viewing the short message. And when the touch operation with the touch operation intensity larger than or equal to the first pressure threshold value acts on the short message application icon, executing an instruction of newly building the short message. In some alternative embodiments of the present application, the pressure sensor 180A may transmit the detected capacitance value to the processor, so that the processor recognizes through which finger portion (knuckle or pad, etc.) the user inputs the user operation. In some alternative embodiments of the present application, the pressure sensor 180A may also calculate the number of touch points from the detected signals and transmit the calculated value to the processor, so that the processor recognizes the user operation by the single-finger or multi-finger input.
The gyro sensor 180B may be used to determine the motion attitude of the electronic device 100. In some embodiments, the angular velocity of electronic device 100 about three axes (i.e., the x, y, and z axes) may be determined by gyroscope sensor 180B. The gyro sensor 180B may be used for photographing anti-shake. For example, when the shutter is pressed, the gyro sensor 180B detects a shake angle of the electronic device 100, calculates a distance to be compensated for by the lens module according to the shake angle, and allows the lens to counteract the shake of the electronic device 100 through a reverse movement, thereby achieving anti-shake. The gyroscope sensor 180B may also be used for navigation, somatosensory gaming scenes.
The air pressure sensor 180C is used to measure air pressure. In some embodiments, electronic device 100 calculates altitude, aiding in positioning and navigation, from barometric pressure values measured by barometric pressure sensor 180C.
The magnetic sensor 180D includes a hall sensor. The electronic device 100 may detect the opening and closing of the flip holster using the magnetic sensor 180D. In some embodiments, when the electronic device 100 is a flip phone, the electronic device 100 may detect the opening and closing of the flip according to the magnetic sensor 180D. And then according to the opening and closing state of the leather sheath or the opening and closing state of the flip cover, the automatic unlocking of the flip cover is set.
The acceleration sensor 180E may detect the magnitude of acceleration of the electronic device 100 in various directions (typically three axes). The magnitude and direction of gravity can be detected when the electronic device 100 is stationary. The method can also be used for recognizing the posture of the electronic equipment, and is applied to horizontal and vertical screen switching, pedometers and other applications. In some alternative embodiments of the present application, the acceleration sensor 180E may be used to capture acceleration values generated when a user's finger portion contacts the display screen and transmit the acceleration values to the processor, so that the processor identifies which finger portion the user entered the user operation.
A distance sensor 180F for measuring a distance. The electronic device 100 may measure the distance by infrared or laser. In some embodiments, taking a picture of a scene, electronic device 100 may utilize range sensor 180F to range for fast focus.
The proximity light sensor 180G may include, for example, a Light Emitting Diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device 100 emits infrared light to the outside through the light emitting diode. The electronic device 100 detects infrared reflected light from nearby objects using a photodiode. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 may determine that there are no objects near the electronic device 100. The electronic device 100 can utilize the proximity light sensor 180G to detect that the user holds the electronic device 100 close to the ear for talking, so as to automatically turn off the display screen to achieve the purpose of saving power. The proximity light sensor 180G may also be used in a holster mode, a pocket mode automatically unlocks and locks the screen.
The ambient light sensor 180L is used to sense the ambient light level. Electronic device 100 may adaptively adjust the brightness of display screen 194 based on the perceived ambient light level. The ambient light sensor 180L may also be used to automatically adjust the white balance when taking a picture. The ambient light sensor 180L may also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in a pocket to prevent accidental touches.
The fingerprint sensor 180H is used to collect a fingerprint. The electronic device 100 can utilize the collected fingerprint characteristics to unlock the fingerprint, access the application lock, photograph the fingerprint, answer an incoming call with the fingerprint, and so on.
The temperature sensor 180J is used to detect temperature. In some embodiments, electronic device 100 implements a temperature processing strategy using the temperature detected by temperature sensor 180J. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the electronic device 100 performs a reduction in performance of a processor located near the temperature sensor 180J, so as to reduce power consumption and implement thermal protection. In other embodiments, the electronic device 100 heats the battery 142 when the temperature is below another threshold to avoid the low temperature causing the electronic device 100 to shut down abnormally. In other embodiments, when the temperature is lower than a further threshold, the electronic device 100 performs boosting on the output voltage of the battery 142 to avoid abnormal shutdown due to low temperature.
The touch sensor 180K is also referred to as a "touch panel". The touch sensor 180K may be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, which is also called a "touch screen". The touch sensor 180K is used to detect a touch operation applied thereto or thereabout, which is an operation of a user's hand, elbow, stylus, or the like contacting the display screen 194. The touch sensor can communicate the detected touch operation to the application processor to determine the touch event type. Visual output associated with the touch operation may be provided through the display screen 194. In other embodiments, the touch sensor 180K may be disposed on a surface of the electronic device 100, different from the position of the display screen 194.
The bone conduction sensor 180M may acquire a vibration signal. In some embodiments, the bone conduction sensor 180M may acquire a vibration signal of the human vocal part vibrating the bone mass. The bone conduction sensor 180M may also contact the human pulse to receive the blood pressure pulsation signal. In some embodiments, the bone conduction sensor 180M may also be disposed in a headset, integrated into a bone conduction headset. The audio module 170 may analyze a voice signal based on the vibration signal of the bone mass vibrated by the sound part acquired by the bone conduction sensor 180M, so as to implement a voice function. The application processor can analyze heart rate information based on the blood pressure beating signal acquired by the bone conduction sensor 180M, so as to realize the heart rate detection function.
The keys 190 include a power-on key, a volume key, and the like. The keys 190 may be mechanical keys. Or may be touch keys. The electronic apparatus 100 may receive a key input, and generate a key signal input related to user setting and function control of the electronic apparatus 100.
The motor 191 may generate a vibration cue. The motor 191 may be used for incoming call vibration cues, as well as for touch vibration feedback. For example, touch operations applied to different applications (e.g., photographing, audio playing, etc.) may correspond to different vibration feedback effects. The motor 191 may also respond to different vibration feedback effects for touch operations applied to different areas of the display screen 194. Different application scenes (such as time reminding, receiving information, alarm clock, game and the like) can also correspond to different vibration feedback effects. The touch vibration feedback effect may also support customization.
Indicator 192 may be an indicator light that may be used to indicate a state of charge, a change in charge, or a message, missed call, notification, etc.
The SIM card interface 195 is used to connect a SIM card. The SIM card can be brought into and out of contact with the electronic apparatus 100 by being inserted into the SIM card interface 195 or being pulled out of the SIM card interface 195. The electronic device 100 may support 1 or N SIM card interfaces, N being a positive integer greater than 1. The SIM card interface 195 may support a Nano SIM card, a Micro SIM card, a SIM card, etc. The same SIM card interface 195 can be inserted with multiple cards at the same time. The types of the plurality of cards may be the same or different. The SIM card interface 195 may also be compatible with different types of SIM cards. The SIM card interface 195 may also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as communication and data communication. In some embodiments, the electronic device 100 employs esims, namely: an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
The software system of the electronic device 100 may employ a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes an Android system with a layered architecture as an example, and exemplarily illustrates a software structure of the electronic device 100.
Fig. 2 is a block diagram of a software structure of the electronic device 100 according to the embodiment of the present application.
The layered architecture divides the software into several layers, each layer having a clear role and division of labor. The layers communicate with each other through a software interface. In some embodiments, the Android system is divided into four layers, an application layer, an application framework layer, an Android runtime (Android runtime) and system library, and a kernel layer from top to bottom.
The application layer may include a series of application packages.
As shown in fig. 2, the application package may include applications such as camera, gallery, calendar, phone call, map, navigation, WLAN, bluetooth, music, video, short message, etc.
In this application, the application layer may further add a floating window starting component (floating launcher) for serving as a default display application in the above mentioned floating window, and providing the user with an entry for entering another application.
The application framework layer provides an Application Programming Interface (API) and a programming framework for the application program of the application layer. The application framework layer includes a number of predefined functions.
As shown in fig. 2, the application framework layer may include a window manager (window manager), a content provider, a view system, a phone manager, a resource manager, a notification manager, an activity manager (activity manager), and the like.
The window manager is used for managing window programs. The window manager can obtain the size of the display screen, judge whether a status bar exists, lock the display screen, intercept the display screen and the like. In the application, the floating window can be expanded based on the Android native PhoneWindow and is specially used for displaying the mentioned floating window so as to be different from a common window, and the window has the attribute of being displayed on the topmost layer of the series of windows in a floating manner. In some alternative embodiments, the window size may be given a suitable value according to the size of the actual screen, according to an optimal display algorithm. In some possible embodiments, the aspect ratio of the window may default to the screen aspect ratio of a conventional mainstream handset. Meanwhile, in order to facilitate the user to close the exit and hide the floating window, a close key and a minimize key can be additionally drawn at the upper right corner.
The content provider is used to store and retrieve data and make it accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
The view system includes visual controls such as controls to display text, controls to display pictures, and the like. The view system may be used to build applications. The display interface may be composed of one or more views. For example, the display interface including the short message notification icon may include a view for displaying text and a view for displaying pictures. In the application, the button views for closing, minimizing and other operations on the floating window can be correspondingly added and bound to the floating window in the window manager.
The phone manager is used to provide communication functions of the electronic device 100. Such as management of call status (including on, off, etc.).
The resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, and the like.
The notification manager allows applications to display notification information in the status bar 207, can be used to convey notification-type messages, can disappear automatically after a short dwell, and does not require user interaction. Such as a notification manager used to inform download completion, message alerts, etc. The notification manager may also be a notification that appears in the form of a chart or scroll bar text at the top status bar of the system, such as a notification of a background running application, or a notification that appears in the form of a dialog window on the display. For example, prompting text information in the status bar, sounding a prompt tone, vibrating the electronic device, flashing an indicator light, etc.
The activity manager is used for managing the active services running in the system, and comprises processes (processes), applications, services (services), task information and the like. In the application, an Activity task stack specially used for managing the application Activity displayed in the floating window can be newly added in the Activity manager module, so that the application Activity and task in the floating window cannot conflict with the application displayed in the full screen in the screen.
In the application, a motion detector (motion detector) may be additionally arranged in the application framework layer, and is used for performing logic judgment on the acquired input event and identifying the type of the input event. For example, it is determined that the input event is a knuckle touch event or a pad touch event, based on information such as touch coordinates and a time stamp of a touch operation included in the input event. Meanwhile, the motion detection assembly can also record the track of the input event, judge the gesture rule of the input event and respond to different operations according to different gestures.
The Android Runtime comprises a core library and a virtual machine. The Android runtime is responsible for scheduling and managing an Android system.
The core library comprises two parts: one part is a function which needs to be called by java language, and the other part is a core library of android.
The application layer and the application framework layer run in a virtual machine. And executing java files of the application program layer and the application program framework layer into a binary file by the virtual machine. The virtual machine is used for performing the functions of object life cycle management, stack management, thread management, safety and exception management, garbage collection and the like.
The system library may include a plurality of functional modules. For example: input manager, input dispatcher, surface manager, Media Libraries, three-dimensional graphics processing Libraries (e.g., OpenGL ES), 2D graphics engine (e.g., SGL), and the like.
And the input manager is responsible for acquiring event data from the input driver at the bottom layer, analyzing and packaging the event data and then transmitting the event data to the input scheduling manager.
The input scheduling manager is used for storing window information, and after receiving an input event from the input manager, the input scheduling manager searches a proper window in the stored window and distributes the event to the window.
The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications.
The media library supports a variety of commonly used audio, video format playback and recording, and still image files, among others. The media library may support a variety of audio-video encoding formats, such as MPEG4, h.264, MP3, AAC, AMR, JPG, PNG, and the like.
The three-dimensional graphic processing library is used for realizing three-dimensional graphic drawing, image rendering, synthesis, layer processing and the like.
The 2D graphics engine is a drawing engine for 2D drawing.
The kernel layer is a layer between hardware and software. The inner core layer at least comprises a display driver, a camera driver, an audio driver and a sensor driver.
The following describes exemplary workflow of the software and hardware of the electronic device 100 in connection with capturing a photo scene.
When the touch sensor 180K receives a touch operation, a corresponding hardware interrupt is issued to the kernel layer. The kernel layer processes the touch operation into an original input event (including touch coordinates, a time stamp of the touch operation, and other information). The raw input events are stored at the kernel layer. And the application program framework layer acquires the original input event from the kernel layer and identifies the control corresponding to the input event. Taking the touch operation as a touch click operation, and taking a control corresponding to the click operation as a control of a camera application icon as an example, the camera application calls an interface of an application framework layer, starts the camera application, further starts a camera drive by calling a kernel layer, and captures a still image or a video through the camera 193.
An exemplary graphical user interface for version upgrades of some operating systems provided by embodiments of the present application is described below.
Fig. 3 illustrates an exemplary user interface 10 on the electronic device 100 for exposing applications installed by the electronic device 100.
The user interface 10 may include: status bar 201, calendar indicator 202, weather indicator 203, tray 204 with common application icons, navigation bar 205, and other application icons. Wherein:
the status bar 201 may include: one or more signal strength indicators 201A for mobile communication signals (which may also be referred to as cellular signals), an operator name (e.g., "china mobile") 201B, one or more signal strength indicators 201C for wireless fidelity (Wi-Fi) signals, a battery status indicator 201D, and a time indicator 201E.
Calendar indicator 202 may be used to indicate the current time, such as the date, day of the week, time division information, and the like.
The weather indicator 203 may be used to indicate a weather type, such as cloudy sunny, light rain, etc., and may also be used to indicate information such as temperature, etc.
The tray 204 with the common application icons may show: phone icon 204A, contact icon 204B, short message icon 204C, camera icon 204D.
The navigation bar 205 may include: a system navigation key such as a back key 205A, a home screen key 205B, a multitasking key 205C, etc. When it is detected that the user clicks the return key 205A, the electronic apparatus 100 may display a page previous to the current page. When the user is detected to click the home screen key 205B, the electronic device 100 may display a home interface. When the user's click on the multi-task key 205C is detected, the electronic device 100 may display the task that was recently opened by the user. The names of the navigation keys can be other keys, and the application does not limit the names. Not limited to virtual keys, each navigation key in the navigation bar 205 may also be implemented as a physical key.
Other application icons may be, for example: an icon 206 for mutual communication, an icon 207 for gallery, an icon 208 for music, an icon 209 for application, an icon 210 for mailbox, an icon 211 for cloud sharing, an icon 212 for memo, and an icon 213 for setting. The user interface 10 may also include a page indicator 214. Other application icons may be distributed across multiple pages, and page indicator 216 may be used to indicate which page the user is currently browsing for applications in. The user may slide the area of the other application icons from side to browse the application icons in the other pages.
In some embodiments, the user interface 10 exemplarily illustrated in FIG. 3 may be a Home screen (Home Screen). It is understood that fig. 3 is only an exemplary illustration of the user interface on the electronic device 100, and should not be construed as a limitation on the embodiments of the present application.
Illustratively, as shown in fig. 4, a user may click an icon set on the user interface 10, the electronic device 100 detects the user operation, and in response to the user operation, the electronic device 100 displays the set user interface 11.
The user interface 11 may include: status bar 301, navigation bar 302, application title bar 303, search box 304, "login-in-place account" entry 305, "wireless and network" entry 306, "device connection" entry 307, "application and notification" entry 308, "battery" entry 309, "display" entry 310, "sound" entry 311, "store" entry 312, "security and privacy" entry 313, "user and account" entry 314, "system update" entry 315. Wherein:
the application title bar 303 may be used to indicate that the current page is used to present a settings interface of the electronic device 100. The presentation of the application title bar 303 may be in the form of text information "settings", icons or other forms.
The search box 304 may be used to search for settings that match a character entered by the user based on the character.
The "login Huawei Account" entry 305 may receive a user operation (e.g., a touch operation), and in response to detecting the user operation, the electronic device 100 may display a user interface of the login Huawei Account.
Any of "wireless and network" entry 306, "device connection" entry 307, "application and notification" entry 308, "battery" entry 309, "display" entry 310, "sound" entry 311, "context intelligence" entry 312, "security and privacy" entry 313, and "user and account" entry 314 may receive a user operation (e.g., a touch operation), and in response to detecting the user operation, electronic device 100 may display a setting interface for the entry, which may include one or more setting items.
The "system update" entry 315 may receive a user operation (e.g., a touch operation), and in response to the detected user operation, the electronic apparatus 100 may display a setting interface of the system update.
Illustratively, as shown in FIG. 5, the user may click on a "system update" entry 315, and in response to detecting the user operation described above, the electronic device 100 displays the set user interface 12.
The user interface 12 may include: status bar 401, application title bar 402, check update control 403, "new version" entry 405, "current version" entry 405. Wherein:
the check update control 403 may receive a user operation (e.g., a touch operation), and in response to detecting the user operation, if the version of the current operating system is not the new version, the electronic device 100 may update the current version to the new version.
The "new version" entry 404 may receive a user operation (e.g., a touch operation), and in response to detecting the user operation, the electronic device 100 may display detailed information of the new version, e.g., a version number, which optimizes those functions, and so on.
The "current version" entry 405 may receive a user operation (e.g., a touch operation), and in response to the detected user operation, the electronic device 100 may display detailed information of the current version.
Often, after a period of use, the operating system develops its own vulnerabilities and flaws. These bugs and bugs do not meet the evolving user needs, and therefore, there is a need to repair and correct bugs and bugs of the software itself on a regular or irregular basis. This results in a new version of the operating system to meet the new requirements. Version up (version up) of the operating system means to perfect bugs of the operating system or add new application functions to the operating system, so that the operating system is more perfect and better used.
Notably, the success of a version upgrade is not supported by hardware, e.g., the hardware has enough memory to accommodate the new version of the operating system.
The layout of the storage space of the electronic device is described below. The storage space of the electronic device mainly comprises a system software space and a user data space.
As shown in fig. 6, in the embodiment of the present application, a partition table is further included before the system software space. The partition table is used for storing some partition parameters of the storage space, including starting addresses of the system software space and the user data space, and sizes of the system software space and the user data space. The system software space is used for storing relevant data of an operating system installed on the electronic equipment. The user data space is used to store data of the user, e.g., files of applications, videos, caches, etc. For example, the size of the system software space and the user data space are 6GB and 128GB, respectively.
It is understood that the storage space of the electronic device may be divided into a plurality of areas, and the partition table is used for recording the starting position of each area and the space size of each area in the plurality of areas.
In the embodiment of the present application, a new open source flash file system (F2 FS) is adopted in the user data space. Fig. 7 is a schematic structural diagram of F2FS according to an embodiment of the present disclosure. F2FS Segments the entire volume into a large number of Segments (Segments), each segment consisting of 512 contiguous Blocks (Blocks), each block being fixed to 4KB in size and each segment being fixed to 2MB in size. Each Segment contains a Segment Summary Block (Segment Summary Block) metadata structure that describes the owner of each Block in the Segment, i.e., the file to which the Block belongs and the offset of the Block within the file to which it belongs. One segment digest block can completely store 512 Blocks of digest information.
The user data space mainly includes a metadata storage area and a data area. Wherein the data area is used for storing file and directory structures and their index data. The metadata storage area is used to store information data that manages data of the data area, such as a file unique number, a location, creation/modification time, and the like. These data may be referred to as Metadata (Metadata). The metadata storage area comprises the following five parts: superblock (SB), Checkpoint (CP), Segment Information Table (SIT), Node Address Table (NAT), and Segment Summary Area (SSA).
The SB describes how large the file system, Block and Segment are, the Root Number (i.e. the Node Number of the Root directory file, fixed value is 3), and how much space is allocated to the SB, CP, SIT, NAT, SSA, etc.
The CP contains writable information for storing the total amount of free space, the total amount of user data already stored, the address of the Segment to which data is to be written next, and other alterable information.
SIT is mainly used to track whether the data blocks of the data area are valid (including the number of valid blocks in each Segment and the validity of the data blocks). SIT Blcok of every 4k size represents 55 2M Segment regions valid. If it is determined that there is no valid data in a Segment based on the information in the SIT, the Segment can be recovered, or Cleaning (clearing) can be performed when there is little valid data in the Segment.
It can be understood that if a data block already stores valid user data, or the data block is a damaged data block, the data block is an invalid block and cannot be written with new data; if a data block does not store user data and is not corrupted, the data block is a valid block and new data can be written.
Illustratively, as shown in fig. 8, if the data region includes n data blocks D1To DnThen the SIT includes the data item S1To Sn. Wherein the data item S is as shown in FIG. 8iAnd i is a positive integer which is greater than zero and less than or equal to n, and is used for identifying the validity of the data block Di. If data item S is in SITiIf the number is equal to 1, the data block Di is an invalid block; if data item S is in SITiEqual to 0, this indicates the data block DiIs a valid block.
For convenience of information management, when a file is stored in the user data space, not only the content of the file but also the attribute of the file, for example, information such as the size of the file, the creation time, and the block address of the data block stored in the content of the file, are stored. The block address of a data block refers to an offset address of the data block relative to a start address of the metadata storage area. Therefore, there are two types of data blocks in the data area for storing the file, one for storing the attributes of the file and one for storing the contents of the file.
The NAT records a block address table of data blocks (hereinafter, simply referred to as node blocks for convenience of description) corresponding to all nodes in the data area. Each file stored in the data area has a unique Node number (Node number) and a Node block, and the Node block is used for storing the attribute of the file. Each entry in the NAT is called a natural entry, and each natural entry includes a node number and a block address of a node block of a file corresponding to the node number. The block address tables of all node blocks are mapped by the NAT, which means that the location of each node is translated by the NAT table. Every 4K NAT Blcok can record the address block information of 455 nodes. It is understood that the block address of the node block is an offset address from the start address of the metadata storage area.
The SSA contains all data stored in the data area and owner information of node blocks, and records offsets of respective blocks in the managed segment with respect to the node blocks of the file to which they belong.
It should be noted that a data block size is 4KB, i.e. the length of the data block can be expressed as 0x 1000. If the block number of a data block relative to the start block of the metadata storage area is 0x00009100, the block address of the data block is 0x 009100000. In this embodiment of the present application, for convenience of description, the block address of the data block may refer to an offset block number relative to the starting block of the metadata storage area, or may be an offset address relative to the starting address of the metadata storage area, and is not specifically limited herein.
When the version of the operating system of the electronic device is upgraded, the size of the storage space occupied by the new version is usually enlarged or reduced compared with the current installation version of the mobile phone. As shown in fig. 6, when the electronic device is in the first version, a certain free space is usually reserved in the system software space to deal with the scenario that the subsequent version is increased, and when the size of the new version is increased to exceed the reserved space, that is, the storage space occupied by the new version is larger than the system software space, the problem that the electronic device cannot be upgraded is caused. At present, in order to solve the above problems, the following solutions are provided: when the version is upgraded, if the storage space occupied by the new version is larger than the system software space, the user data space can be reduced, so that part of the user data space is released to the system software space, as shown in fig. 9. In addition, if the storage space occupied by the new version is smaller than the system software space, the system software space may also be reduced, thereby releasing part of the system software space to the user data space, as shown in fig. 10.
As can be seen from fig. 9 and 10, since the metadata storage area is located at the head of the user data space, the metadata storage area needs to be moved regardless of whether the user data space is enlarged or reduced. Since the block addresses of the data blocks in the data area are offset addresses relative to the start address of the metadata storage area, it is necessary to traverse and modify the block addresses of all the data blocks recorded in the NAT. This solution has two drawbacks as follows.
Defect one: currently, the user data space is large (e.g., 128GB, 256GB), containing a lot of data. This is time consuming because shrinking or expanding the user data space requires modifying the block addresses of all data blocks of the data area recorded in the NAT. For example, a version upgrade may take up to several hours.
And defect two: if a key abnormal bad block exists in the user data space, the risk of losing all or part of the user data can exist by moving the metadata and modifying the block addresses of all the data blocks.
In order to solve the foregoing drawbacks, an embodiment of the present application provides a version upgrade method. First, a structure of a storage space applied by the version upgrading method provided in the embodiment of the present application is described.
As shown in fig. 11, in the embodiment of the present application, the user data space is divided into two areas, i.e., a user data space 1 and a user data space 2. The physical location of the user data space 2 is between the system software space and the user data space 1, i.e. the user data space 2 is adjacent to the system software space. The logical position is that the user data space 2 is located after the user data space 1, i.e. the first data block of the user data space 2 is the next data block of the last data block of the user data space 1. In the embodiment of the application, the user data space 1 and the user data space 2 are uniformly managed by one file system, and the upper layer application only sees one file system, namely, only one user data space exists for the upper layer application. The user data space 1 includes a metadata storage area and a data area, and the metadata storage area at the head of the user data space 1 collectively manages user data in the user data space 1 and the user data space 2.
In the embodiment of the present application, the user data space 1 may also be referred to as a first user data space, and the user data space 2 may also be referred to as a second user data space, which is not specifically limited herein.
Illustratively, the structure of the user data space is shown in FIG. 12. As can be seen from FIG. 12, if the user data space 1 contains data blocks D1To DxThen SIT includes AND data block D1To DxRespectively corresponding data items S1 to SxWhere data item Si may be used to identify whether data block Di is valid, i is a positive integer greater than zero and less than or equal to x. If the user data space 2 contains data blocks Dx+1To DnThen SIT includes AND data block Dx+1To DnRespectively corresponding data items Sx+1To Sn. As can be seen from fig. 12, the logical position of the user data space 2 is located after the user data space 1, and the block address of the last data block of the user data space 1 is consecutive to the block address of the first data block of the user data space 2. For example, if the block address of the last data block of user data space 1 is 1000 blocks, the block address of the first data block of user data space 2 is 1001 blocks.
For the user data space shown in fig. 11, the parameters stored in the partition table stored before the system software space include the starting addresses of the system software space, the user data space 1 and the user data space 2, and the capacities of the system software space, the user data space 1 and the user data space 2.
In the version upgrading method provided in the embodiment of the present application, based on the user data space structure shown in fig. 12, when performing version upgrading, if the storage space occupied by the new version is larger than the system software space, the user data space 2 may be reduced to the second space, and the first space at the head of the user data space 2 is released to the system software space, as shown in fig. 13. If the storage space occupied by the new version is smaller than the system software space, the system software space may also be reduced, and the third space at the tail of the system software space is released to the user data space 2, as shown in fig. 14.
As can be seen from fig. 13 and 14, in the version upgrading method provided in the embodiment of the present application, when the user data space needs to be expanded or reduced, only the user data space 2 needs to be expanded or reduced. And the position and the size of the user data space 1 are kept unchanged, the metadata storage area does not need to be moved, and the offset address of the data block in the user data space 1 does not need to be modified. Therefore, the method can reduce the time length of version upgrading and reduce the risk of data loss.
Based on the user data space structure shown in fig. 12, fig. 15 is a schematic flowchart of a version update method provided in an embodiment of the present application. As shown in fig. 15, the version updating method provided in the embodiment of the present application includes, but is not limited to, steps S201 to S205. Possible implementations of embodiments of the method are described further below.
S201, the electronic equipment receives an updating instruction, wherein the updating instruction is used for indicating that the current version of the operating system is updated to a new version.
In some embodiments of the present application, before the electronic device receives an update instruction of a user, new version update information sent by the server is received, and the new version update information may include a capacity of system software space of the new version.
In some embodiments of the present application, the new version of update information may include the capacity of the new version of system software space, the capacity of the new version of user data space 1, the capacity of the new version of user data space 2, the start address of the new version of system software space, the start address of the new version of user data space 1, and the start address of the new version of user data space 2.
In some embodiments of the present application, the version number of the new version may be included in the update information of the new version.
It is to be appreciated that the update information of a new version can refer to an installation package of a new version of the operating system. The installation package may include all files that are installed by the new version. The installation package may also include all patch packages installed by the new version, i.e., part of the files installed by the new version, relative to the current version.
Illustratively, as shown in fig. 16, the user clicks the update control 403, and in response to detecting the user operation, the electronic device changes the content of the title bar to "system update", and executes step S202.
In some embodiments of the present application, the user triggers the update instruction by clicking on the update control.
The update instruction is not limited to be triggered by clicking the update control 403 with a finger of a user, and may also be triggered by other user operations. And is not particularly limited herein.
For example, the user may trigger the update instruction by a gesture.
Specifically, the first user operation may also be a specific gesture performed by the user within the capture range of the camera, for example, the gesture is "V-shaped by hand of the user". The electronic device 100 may collect a gesture input by a user through the camera, compare the collected gesture with a pre-stored gesture, and execute step S202 if the collected gesture is consistent with the pre-stored gesture.
As another example, the user may trigger the update instruction by voice.
Specifically, the electronic device 100 may collect the voice input by the user through the microphone, and if the specific content of the voice is "please upgrade the operating system", compare the collected specific content of the voice "please upgrade the operating system" with the pre-stored voice keyword "upgrade the operating system", and if the keywords are consistent and the matching degree of the voice features exceeds a certain threshold, execute step S202.
In some embodiments of the present application, the user may preset the automatic upgrade of the version of the operating system, that is, after the electronic device receives the update information of the new version sent by the server, the electronic device executes step S202.
S202, the electronic equipment judges whether the capacity of the system software space of the new version is larger than the current capacity of the system software space.
It can be understood that when the electronic device downloads the update information of the new version, the capacity of the system software space of the new version can be known.
In the embodiment of the present application, "the capacity of the space" refers to the size of the space occupied by the space.
S203, when the capacity of the system software space of the new version is larger than the current capacity of the system software space, the electronic equipment judges whether the total amount of the free space of the data area of the user data space is larger than a first difference value, wherein the first difference value is the difference value between the capacity of the system software space of the new version and the current capacity of the system software space; if yes, executing step S204; and if the number of the data blocks is smaller than or equal to the preset value, generating first prompt information, wherein the first prompt information is used for reminding a user that the storage space is insufficient and the system fails to update.
It is understood that if the electronic device determines that the capacity of the system software space of the new version is greater than the current capacity of the system software space, the electronic device may release a portion of the space of the user data space header (i.e., the first space) to the system software space. The electronic device needs to move the valid data in the first space to the remaining data area of the user data space except the first space before the release. The remaining data regions of the user data space include data regions of the user data space 2 other than the first space and data regions of the user data space 1. Therefore, after the electronic device determines that the capacity of the system software space of the new version is greater than the current capacity of the system software space, it is further determined whether the total amount of free space of the data area except the user data space is greater than or equal to the first difference value, that is, whether the data area of the user data space has enough space to be released to the system software space, so that the electronic device performs system update.
In some embodiments of the present application, the electronic device determines a first space to be released to the software local space according to the first difference, and the capacity of the first space is equal to the first difference.
In some embodiments of the present application, the electronic device may obtain the total amount of free space of the data area of the user data space according to the total amount of free space recorded in the CP.
In some embodiments of the present application, the first prompt message may be presented in the form of text, image, animation, voice, or the like.
For example, as shown in fig. 17, when the total amount of free space in the remaining data area is greater than the total amount of space required by the valid data in the first space, the electronic device displays a prompt window 406, and a control 407 and first prompt information may be included in the prompt window 406. The first prompt message is presented in text form, and the content of the first prompt message may include "insufficient storage space, failed system update! ".
Control 407 can receive a user operation (e.g., a touch operation), in response to which window 406 can be closed by electronic device 100.
It can be understood that after the user knows that the system update failure is that the storage space is insufficient, the storage space can be cleared, so as to perform the system update again.
That is, when the capacity of the system software space of the new version is greater than the current capacity of the system software space, and the total amount of free space in the data area of the user data space is greater than the first difference, the electronic device executes step S204.
S204, the electronic device moves the valid user data in the first space at the head of the user data space 2 to a remaining data area, where the capacity of the first space is equal to the first difference, and the remaining data area is a remaining data area of the user data space except the first space.
In some embodiments of the present application, the electronic device moving valid user data in the first space into the remaining data area includes: the electronic equipment determines a first data block according to the information in the SIT, wherein the first data block is a first free data block in the residual data area; the electronic equipment writes the data of the second data block of the first space into the first data block; the electronic device modifies a block address of a data block storing the first data from a block address of the second data block to a block address of the first data block.
It can be understood that the electronic device writes the data of the second data block to the first data block, that is, the electronic device determines the physical address of the first data block according to the block address of the first data block, and writes the data of the second data block to the storage location corresponding to the physical address.
The method for moving the valid user data in the first space to the remaining data area is not limited to the above-mentioned implementation, and other moving methods are also possible, which are not specifically limited herein.
The second data block may be a node block storing file attributes, or may be a data block storing file contents.
In some embodiments of the application, if the second data block is a node block storing file attributes, the modifying, by the electronic device, the block address of the data block storing the first data from the block address of the second data block to the block address of the first data block includes: the electronic equipment inquires a first file number of a file to which the first data in the second data block belongs in the SSA according to the block address of the second data block; the method comprises the steps that electronic equipment inquires a first table entry recorded with a first file number in an NAT, and the first table entry records the block address of a node block of a file to which first data belongs; the electronic equipment determines the second data block to be the node block as the block address of the node block is the same as the block address of the second data block; and the electronic equipment modifies the block address of the node block in the first table entry into the block address of the first data block.
In some embodiments of the application, if the second data block may be a data block storing file content, the modifying, by the electronic device, a block address of the data block storing the first data from a block address of the second data block to a block address of the first data block includes: the electronic equipment inquires a first file number of a file to which the first data in the second data block belongs in the SSA according to the block address of the second data block; the electronic equipment inquires a first entry recorded with a first file number in an NAT, wherein the first entry records the block address of a node block of a file to which first data belongs, the block address of the node block is different from the block address of a second data block, the first data is file content, and the block address of a data block for storing the first data is recorded in the node block; and the electronic equipment modifies the block address of the data block storing the first data in the node block into the block address of the first data block.
S205, the electronic equipment releases the first space to the system software space.
In some embodiments of the present application, the above electronic device releasing the first space to the system software space includes: the electronic equipment modifies a first capacity parameter in the partition table into the capacity of a system software space of a new version, modifies a second capacity parameter into the capacity of a user data space 2 of the new version, and modifies a first address parameter into an initial address of the user data space 2 of the new version in the user data space 2; the starting address of the new version of the user data space 2 is equal to the starting address of the second space, the capacity of the new version of the system software space is equal to the sum of the capacity of the original software version and the capacity of the first space, and the capacity of the new version of the user data space 2 is equal to the capacity of the second space. The second space is the remaining space of the user data space 2 excluding the first space. The first capacity parameter in the partition table is used to indicate the capacity of the system software space, the second capacity parameter is used to indicate the capacity of the user data space 2, and the second address parameter is used to indicate the starting address of the user data space 2.
It will be appreciated that the starting location and the space capacity of each partition may be altered by modifying the partition parameters in the partition table.
S206, the electronic device modifies the block address of the data block in a second space, wherein the second space is the residual space except the first space in the user data space 2.
In some embodiments of the present application, as shown in FIG. 18, user data space 2 comprises a first space and a second space, the first space comprising user data blocks Dx+1To DyThe second space comprises user data blocks Dy+1To DnData item S in SITx+1To SyFor signIdentification data block Dx+1To DyThe effectiveness of (c). If the space required by the software version upgrade is larger than the current system software space, the electronic device may release the first space of the user data space 2 to the system software space during the version upgrade process. After releasing the first space to the system software space, the electronic device needs to modify the block address of the data block in the second space recorded in the NAT, and in addition, the data item Sx+1To SyIs no longer used to indicate data block D in the first spacex+1To DyThe effectiveness of (c). Wherein the data item Sx+1Application to indication Dy+1Validity of, data item Sx+2Application to indication Dy+2And so on. Therefore, the electronic device also needs to modify the data items of the corresponding SIT according to the validity of the data blocks of the second space.
It should be noted that, after the electronic device modifies the block address of the data block in the second space, as shown in fig. 18, the data item Sx+1To SnThe first n-y data items in are used to identify the validity of the data block of the second space, data item Sx+1To SnThe last y-x data items in (1) are in an idle state and no longer indicate the validity of the data block, and the electronic device can delete the last y-x data items.
It can be understood that the block addresses of the data blocks in the user data space are all offset addresses relative to the start address of the metadata storage area, and after the first space is released to the system software space, the data blocks in the first space do not belong to the user data space 2 any more. The first data block in the second space becomes the first data block of the user data space 2 and the first data block in the second space at the logical address becomes the next data block of the last data block of the user data space 1. Therefore, after the first space is released to the system software space, the block address of the data block in the second space recorded in the NAT needs to be modified.
It can be understood that, if the first data block in the second space stores data, the physical storage location of the data is not changed, and the block address of the first data block is modified, which may satisfy the mapping relationship between the logical location and the physical location of the data block after the first space is released.
In some embodiments of the present application, the modifying block addresses of the data blocks in the second space recorded in the NAT includes: the electronic equipment inquires a second file number of a file to which second data in a third data block of a second space belongs in the SSA; the electronic equipment inquires a second table entry recorded with a second file number in the NAT, and the second table entry records the block address of the node block of the file to which the third data block belongs; if the block address of the node block is the same as that of the third data block, determining that the third data block is the node block, and shifting the block address of the node block in the second table item forward by F blocks by the electronic equipment; and if the block address of the node block is different from the block address of the third data block, recording the block address of the data block for storing the second data in the node block, inquiring the node block by the electronic equipment according to the block address of the node block, and offsetting the block address of the data block for storing the second data in the node block by F blocks forwards. For example, if the original block address of the third data block is 1000 blocks offset from the start block of the metadata storage area, the block address of the third data block is modified to be 1000-F blocks.
It is to be appreciated that the electronic device modifies the block address of the data block in the second space recorded in the NAT, i.e., the traversal modifies the block address of the data block containing valid data in the second space.
S207, the electronic equipment upgrades the current version of the operating system to a new version, and the upgraded system software space comprises a first space.
Illustratively, as shown in fig. 19, the user clicks the update control 403, and in response to detecting the user operation, the electronic device changes the content of the title bar to "system update", and performs version upgrade. And after the version upgrade is successful, displaying a window 408, wherein the window 408 includes second prompt information, and the content of the second prompt information may include "system update successful". The version upgrading method provided by the embodiment of the application greatly reduces the version upgrading time. The version-up process shown in fig. 19 may only take as little as tens of seconds.
In some embodiments of the present application, after step S202, the version updating method provided in the embodiments of the present application may further include steps S208 to S210.
And S208, when the capacity of the system software space of the new version is smaller than the current capacity of the system software space, the electronic equipment upgrades the current version of the operating system to the new version.
S209, the electronic equipment releases the third space at the tail part of the system software space to the user data space 2.
In this embodiment of the present application, the upgraded user data space 2 includes a third space, the capacity of the third space is equal to the capacity of the original system software space minus the capacity of the system software space of the new version, and the first data block of the upgraded third space is the next data block of the last data block of the user data space 2.
In some embodiments of the present application, the electronic device releasing a third space at the end of the system software space to the user data space, including: the electronic equipment modifies the first capacity parameter in the partition table into the capacity of a system software space of a new version, modifies the second capacity parameter into the capacity of a user data space 2 of the new version, modifies the second address parameter into the initial address of the user data space 2 of the new version, the initial address of the user data space 2 of the new version is equal to the initial address of a third space, and the capacity of the user data space 2 of the new version is equal to the capacity of the original user data space 2 plus the capacity of the third space.
It should be noted that, since the installation data of the software version is written in the system software space sequentially from front to back, the third space does not store valid software version installation data. Therefore, the electronic equipment can directly release the third space at the tail part of the system software space to the user data space without cleaning the data in the third space.
In the embodiment of the application, when the capacity of the system software space of the new version is smaller than the current capacity of the system software space, the electronic equipment can immediately release the free space in the free system software space to the user data space after the version is upgraded; the electronic device may also release the free space of the free system software space to the user data space only when the electronic device can upgrade the version and the available space of the user data space is insufficient. The embodiment of the present application is not particularly limited to this.
S210, the electronic device modifies the block addresses of the data blocks in the first space and the second space.
In some embodiments of the present application, as shown in FIG. 20, user data space 2 comprises user data blocks Dx+1To Dy. If the space required by the software version upgrade is smaller than the current system software space, the third space in the system software space can be released to the user data space 2 after the version upgrade. If the third space includes the data block DgTo Dg+ a, the new user data space 2 will include Dx+1To DyAnd DgTo Dg+aAnd the electronic needs to modify the block address of the data block in the original user data space 2 recorded in the NAT, and the original user data space 2 includes a first space and a second space.
It can be understood that after the electronic device releases the third space in the system software space to the user data space 2, the first block of the third space becomes the first block of the expanded user data space 2, and the first data in the third space at the logical address becomes the next data block of the last data block of the user data space 1. In order to satisfy the continuity of the block numbers in the block address table, the offset addresses of the data blocks in the original user data space 2 need to be added with the total amount of the data blocks in the third space, so that the block addresses of the data blocks in the first space and the second space recorded in the NAT need to be modified. For example, as shown in fig. 20, the third space includes a data blocks, and if the original block address of the first data block in the first space of the user data space 2 is 1000 blocks offset from the start block of the metadata storage area, the block address of the first data block in the first space is modified to be 1000+ a blocks.
In some embodiments of the present application, the block address of the data block in the first space and the block address of the data block in the second space recorded in the NAT may refer to the block address of the data block in the second space recorded in the NAT in the foregoing embodiments, and details are not described here again.
In some embodiments of the present application, as shown in FIG. 20, user data space 2 comprises a first space and a second space, the first space comprising user data blocks Dx+1To DyThe second space comprises user data blocks Dy+1To DnData item S in SITx+1To SyFor identifying data blocks Dx+1To DyThe effectiveness of (c). After the electronic device has released the third space to the user data space 2, the electronic device needs to modify the block addresses of the data blocks in the first space and the second space, and furthermore, the data item Sx+1To Sx+aIs no longer used to indicate data block Dx+1To Dx+aValidity of, data item Sx+1To Sx+aData block D to be used for indicating the third spacegTo Dg+aThe effectiveness of (c). In addition, the data item Sx+a+1Will be used to indicate data block Dx+1Validity of, data item Sx+a+2Will be used to indicate data block Dx+2And so on. Therefore, the electronic device also needs to modify the data items of the corresponding SIT according to the validity of the data blocks of the first space and the second space.
It will be appreciated that the data item SnWill be used to indicate data block Dn-aThe data item S also needs to be added after the data item Sn in the SITn+1To Sn+aData item Sn+1To Sn+aFor indicating data block Dn-a+1To DnThe effectiveness of (c).
The version upgrading method shown in fig. 13 does not need to move the metadata storage area, does not need to modify the offset address of the data block in the user data space 1, and can reduce the time length of version upgrading and reduce the risk of data loss. But the above method requires modification of the block addresses of the data blocks in the original user data space 2. This is due to the fact that at logical locations, user data space 2 and user data space 1 are logically contiguous.
Therefore, the time consumption of the version upgrading method shown in fig. 13 still needs to be further optimized, and there is still a risk of user data loss during the version upgrading process. In order to further reduce the time length of version upgrading and avoid the risk of data loss, the embodiment of the application also provides a version upgrading method.
First, another structure of a user data space to which the method is applied will be described. In the embodiment of the application, a virtual invalid data area is added in a user data space, and the virtual invalid data area is a virtual logic space and does not occupy an actual physical space. The virtual invalid data area contains virtual data blocks, and the virtual invalid data area is behind the user data space 1 and in front of the user data space 2 at the logical address. For example, as shown in FIG. 21, user data space 1 contains user data blocks D1To DxData block D1To DxThe corresponding block addresses are respectively d1To dx(ii) a The dummy invalid data area includes dummy data blocks Dx+1To DyData block Dx+1To DyThe corresponding block addresses are respectively dx+1To dy(ii) a User data space 2 contains user data blocks Dy+1To DrData block Dy+1To DrThe corresponding block addresses are respectively dy+1To dr. In addition, as shown in FIG. 21, the SIT also includes a dummy data block Dx+1To DyCorresponding data item Sx+1To SyData item Sx+1To SyAre identified as invalid.
In the embodiment of the present application, the start address and the virtual space capacity of the virtual invalid data area may be recorded in the SB or CP. Accordingly, the size of the virtual invalid data area can be changed by modifying the space capacity of the virtual invalid data area recorded in the SB or CP.
It should be noted that, since all the data blocks in the virtual invalid data area are identified as invalid data blocks, the virtual invalid data area does not perform write operation. In addition, since the virtual invalid data area is a virtual logical space and does not occupy an actual physical space, the virtual invalid data area cannot store data, and the virtual invalid data area cannot perform a read operation. Therefore, the used space for the user data returned to the upper layer needs to be reduced by the space size of the virtual invalid data area. In the embodiment of the present application, the initial size of the virtual invalid data area is generally smaller than or equal to the initial size of the system software space.
It is understood that the virtual invalid data area is a concept introduced for easy understanding, and does not exist in an actual physical space.
Based on the user data space structure shown in fig. 21, fig. 22 is a schematic flowchart of another version updating method provided in the embodiment of the present application. As shown in fig. 22, the version updating method provided in the embodiment of the present application includes, but is not limited to, steps S301 to S307. Possible implementations of embodiments of the method are described further below.
S301, the electronic equipment receives an updating instruction, wherein the updating instruction is used for indicating that the current version of the operating system is updated to a new version.
S302, the electronic equipment judges whether the capacity of the system software space of the new version is larger than the current capacity of the system software space.
S303, when the capacity of the system software space of the new version is larger than the current capacity of the system software space, the electronic equipment judges whether the total amount of the free space of the data area of the user data space is larger than a first difference value, wherein the first difference value is the difference value between the capacity of the system software space of the new version and the current capacity of the system software space; if yes, executing step S204; and if the number of the data blocks is smaller than or equal to the preset value, generating first prompt information, wherein the first prompt information is used for reminding a user that the storage space is insufficient and the system fails to update.
S304, the electronic equipment moves the valid user data in the first space at the head of the user data space 2 to a residual data area of the user data space except the first space, wherein the capacity of the first space is equal to the first difference.
S305, the electronic equipment releases the first space to the system software space.
S306, increasing the virtual invalid data area, and setting the data item used for identifying the validity of the first space data block as an invalid identifier, wherein the increased capacity of the virtual invalid data area is equal to the capacity of the first space.
In some embodiments of the present application, as shown in FIG. 23, user data space 2 comprisesA first space and a second space, the first space comprising user data blocks Dy+1To DzThe second space comprises user data blocks Dz+1To DrData item S in SITy+1To SzFor identifying data blocks Dy+1To DzThe effectiveness of (c). If the space required by the software version upgrade is larger than the current system software space, the electronic device may release the first space of the user data space 2 to the system software space during the version upgrade process. After the first space is released to the system software space, the electronic equipment increases the space capacity of the virtual invalid data area, the increased space capacity of the virtual invalid data area is equal to the capacity of the first space, and the data block D in the first spacey+1To DzCorresponding SIT data item Sy+1To SzAre all set to 1. Data item Sx+1To SyNo longer for indicating the validity of a data block in the first space, data item Sy+1To SzMay be used to indicate the validity of the new data block in the virtual invalid data area.
It can be understood that the block addresses of the data blocks in the user data space are all offset addresses relative to the start address of the metadata storage area, and after the first space is released to the system software space, the data blocks in the first space do not belong to the user data space 2 any more. The first data block in the second space becomes the first data block of the user data space 2 and the first data block in the second space at the logical address becomes the next data block of the last data block of the virtual invalid data area. In order not to change the offset address of the data blocks of the second space with respect to the start address of the metadata storage area, the electronic device increases the space capacity of the virtual invalid data area, the increased space capacity of the virtual invalid data area being equal to the capacity of the first space, i.e., the total amount of added virtual data blocks in the virtual invalid data area is equal to the total amount of data blocks of the first space. Therefore, the block address of the data block in the second space can be guaranteed not to change, and the block address of the data block in the second space does not need to be modified after the electronic equipment releases the first space to the system software space.
That is, the electronic device does not increase the virtual invalid data areaStator Sy+1To SzAre all 1, Sy+1To SzMay be used to characterize the validity of the newly added data block of the virtual invalid data area.
S307, the electronic equipment upgrades the current version of the operating system into a new version, and the upgraded system software space comprises a first space.
In the embodiment of the present application, the virtual invalid data area may also be understood as a part of the user data space 1, and the last data block of the virtual invalid data area is the last data block of the user data space 1, and the capacity of the user data space 1 is smaller than the current capacity of the system software space.
In the embodiment of the present application, the virtual invalid data area may also be referred to as a fourth space at the tail of the user data space 1.
In some embodiments of the present application, before the electronic device updates the current version of the operating system to the new version, the electronic device increases the virtual invalid data area and the system software space, where the increased system software space includes a first space, and the increased capacity of the virtual invalid data area is equal to a first difference; the fifth space is the increased virtual invalid data area, and the last data block of the user data space 1 after the virtual invalid data area is increased is the last data block of the fifth space.
In some embodiments of the present application, the virtual invalid data area is increased, that is, the space capacity of the virtual invalid data area recorded in the metadata storage area is modified to the capacity of the fifth space.
In this embodiment of the application, the specific implementation manners of steps S301 to S305 may refer to the optional embodiments of steps S201 to S205, which are not described herein again.
In some embodiments of the present application, after step S302, the version updating method provided in the embodiments of the present application may further include step S308 to step S309.
And S308, when the capacity of the system software space of the new version is smaller than the current capacity of the system software space, the electronic equipment updates the current version of the operating system to the new version.
S309, the electronic device releases the third space at the tail of the software version to the user data space 2, and reduces the virtual invalid data area, wherein the reduced capacity of the virtual invalid data area is equal to the capacity of the third space.
As shown in fig. 24, if the third space includes data block DgTo Dg+1The electronic device stores the data item S corresponding to the virtual data block in SITx+1To SyThe latter item of (i.e. S)y-a+1To Sy) Data item is set as valid identification, data item Sy-a+1To SyWill be used to identify data block DgTo Dg+1The effectiveness of (c).
In some embodiments of the present application, as shown in FIG. 24, user data space 2 comprises user data blocks Dy+1To Dr. If the space required by the software version upgrade is smaller than the current system software space, the third space in the system software space can be released to the user data space 2 after the version upgrade. If the third space includes the data block DgTo Dg+aThen the new user data space 2 will include Dy+1To DrAnd DgTo Dg+a. After the third space in the system software space is released to the user data space 2, the electronic equipment reduces the space capacity of the virtual invalid data area, the reduced space capacity of the virtual invalid data area is equal to the capacity of the third space, and SIT data items S corresponding to the last a data blocks in the virtual invalid data areay-a+1To SyAre all set to 0. The data item S corresponding to the last a data blocksy-a+1To SyNo longer used to indicate the validity of a data block in the virtual invalid data area, data item Sy-a+1To SyWill be used to indicate the validity of the data block of the third space.
It can be understood that, after the electronic device releases the third space in the system software space to the user data space 2, the first block of the third space becomes the first block of the expanded user data space 2, and the first data in the third space at the logical address becomes the next data block of the last data block of the virtual invalid data area. In order not to change the offset address of the data blocks of the original user data space 2 with respect to the start address of the metadata storage area, the electronic device reduces the spatial size of the virtual invalid data area, which is equal to the size of the third space, i.e. the total amount of virtual data blocks reduced in the virtual invalid data area is equal to the total amount of data blocks in the third space. Therefore, the block address of the data block in the original user data space 2 can be ensured not to change, and the block address of the data block in the original user data space 2 does not need to be modified after the electronic device releases the third space to the user data space 2. The original user data space 2 refers to the original user data space 2 before release.
That is, after the electronic device reduces the virtual invalid data area, S is determinedy-a+1To SyAre all 1, Sy-a+1To SyMay be used to characterize the validity of the data blocks of the third space.
In the embodiment of the present application, the virtual invalid data area may also be understood as a part of the user data space 1, and the last data block of the virtual invalid data area is the last data block of the user data space 1, and the capacity of the user data space 1 is smaller than the current capacity of the system software space.
In some embodiments of the present application, after the electronic device receives the update information, the electronic device reduces the virtual invalid data area and the system software space, the reduced system software space does not include the third space, and the reduced capacity of the virtual invalid data area is equal to the capacity of the third space; and the sixth space is a reduced virtual invalid data area, and the last data block of the first user data space after the virtual invalid data area is reduced is the last data block of the sixth space.
In some embodiments of the present application, the space capacity of the virtual invalid data area recorded in the reduced virtual invalid data area, that is, the modified metadata storage area, is the capacity of the sixth space.
In summary, by implementing the embodiment of the present application, it is not necessary to move the metadata storage area, and it is also not necessary to modify the offset addresses of the data blocks in the user data space 1 and the user data space 2, so that the time length for version upgrade and the risk of data loss are greatly reduced, and the user experience is effectively improved.
Through the above description of the embodiments, it is clear to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional modules is merely used as an example, and in practical applications, the above function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device may be divided into different functional modules to complete all or part of the above described functions. For the specific working processes of the system, the apparatus and the unit described above, reference may be made to the corresponding processes in the foregoing method embodiments, and details are not described here again.
Each functional unit in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application may be essentially implemented or make a contribution to the prior art, or all or part of the technical solutions may be implemented in the form of a software product stored in a storage medium and including several instructions for causing a computer device (which may be a personal computer, a server, or a network device) or a processor to execute all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: flash memory, removable hard drive, read only memory, random access memory, magnetic or optical disk, and the like.
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 (22)

1. A version upgrade method, comprising:
the electronic device receiving update information, the update information including a capacity of system software space of a new version of the operating system; the storage space of the electronic device comprises the system software space and a user data space, the user data space comprises a first user data space and a second user data space, the second user data space is adjacent to the system software space in a physical space, the first user data space comprises a metadata storage area and a data area, metadata in the metadata storage area is used for managing data in the first user data space and the second user data space, the second user data space comprises a first space, a starting address of the first space is the same as a starting address of the second user data space, and a first data block of the second user data space is a next data block of a last data block of the first user data space;
when the capacity of the system software space of the new version is larger than the current capacity of the system software space and the free space of the data area of the user data space is larger than a first difference value, the electronic equipment upgrades the operating system to the new version; the upgraded system software space includes the first space, the first difference is equal to a difference between the capacity of the system software space of the new version and the current capacity of the system software space, the capacity of the first space is equal to the first difference, a first data block of the upgraded second space is a next data block of a last data block of the first user data space, and the second space is a remaining space of the second user data space before the upgrade, except for the first space.
2. The method of claim 1, wherein the system software space comprises a third space, a last data block of the third space is a last data block of the system software space, and after the electronic device receives the update information, the method further comprises:
when the capacity of the system software space of the new version is smaller than the current capacity of the system software space, the electronic equipment upgrades the operating system to the new version; the upgraded second user data space includes the third space, the capacity of the third space is equal to the current capacity of the system software space minus the capacity of the system software space of the new version, and the first data block of the upgraded third space is the next data block of the last data block of the first user data space.
3. The method of claim 1 or 2, wherein the data area of the first user data space comprises a fourth space, the fourth space does not occupy physical space, the last data block of the fourth space is the last data block of the first user data space, the metadata storage area comprises a first parameter, the first parameter is used for characterizing the capacity of the fourth space, and the capacity of the fourth space is smaller than the current capacity of the system software space.
4. The method of claim 1, wherein before the electronic device upgrades the operating system to the new version, further comprising:
the electronic device increasing the fourth space and the system software space; the increased system software space includes the first space, the increased capacity of the fourth space is equal to the capacity of the first space, the fifth space is the increased fourth space, and the last data block of the first user data space is the last data block of the fifth space after the fourth space is increased.
5. The method of claim 2, wherein after the electronic device receives the update information, further comprising:
the electronic device shrinks the fourth space and the system software space; the reduced system software space does not include the third space, the reduced capacity of the fourth space is equal to the capacity of the third space, the sixth space is the reduced fourth space, and the last data block of the first user data space after the fourth space is reduced is the last data block of the sixth space.
6. The method of claim 4, wherein the electronic device enlarging the fourth space comprises:
the electronic device modifies the first parameter to be the capacity of the fifth space.
7. The method of claim 5, wherein the electronic device shrinking the fourth space comprises:
the electronic device modifies the first parameter to be the capacity of the sixth space.
8. The method of claim 3, wherein the metadata storage area comprises data item S1To SrSaid S1To SrS in (1)1To SyValidity of data blocks for identifying said data area, said S1S to Srx+1To SyFor identifying the validity of the data block of the fourth space, S1To SrS in (1)y+1To SrFor identifying the validity of the data blocks of the second user data space, S1To SrS in (1)y+1To SzMeans for identifying a validity of a data block of the first space; wherein S isiEqual to 1 characterizes said SiThe identified data block is an invalid block, SiEqual to 0 characterizes said SiThe characterized data block is an effective block, i is a positive integer which is greater than zero and less than or equal to r, and Sx+1To SyAll equal to 1, x, y, z and r are positive integers, x is greater than 1, y is greater than x, z is greater than y, and r is greater than z.
9. The method of claim 4, wherein after the electronic device increases the fourth space, further comprising:
the electronic device determines the Sy+1To SzAre all 1, Sy+1To SzAnd the method is used for representing the effectiveness of the newly added data block of the fourth space.
10. The method of claim 5, wherein the third space comprises a data blocks, and wherein the electronic device further comprises, after narrowing the fourth space:
the electronic device determines the Sy-a+1To SyAre all 0, Sy-a+1To SyFor characterizing the validity of the data blocks of the third space.
11. An electronic device, comprising: one or more processors, memory, touch screen, one or more keys;
the memory, the touchscreen, the one or more keys, and the one or more processors are coupled, the memory for storing computer program code, the computer program code comprising computer instructions, the one or more processors executing the computer instructions to perform:
receiving update information, the update information including a capacity of system software space for a new version of an operating system; the storage space comprises the system software space and a user data space, the user data space comprises a first user data space and a second user data space, the second user data space is adjacent to the system software space in a physical space, the first user data space comprises a metadata storage area and a data area, metadata in the metadata storage area is used for managing data in the first user data space and the second user data space, the second user data space comprises a first space, a starting address of the first space is the same as a starting address of the second user data space, and a first data block of the second user data space is a next data block of a last data block of the first user data space;
when the capacity of the system software space of the new version is larger than the current capacity of the system software space and the free space of the data area of the user data space is larger than a first difference value, upgrading the operating system to the new version; the upgraded system software space includes the first space, the first difference is equal to a difference between the capacity of the system software space of the new version and the current capacity of the system software space, the capacity of the first space is equal to the first difference, a first data block of the upgraded second space is a next data block of a last data block of the first user data space, and the second space is a remaining space of the second user data space before the upgrade, except for the first space.
12. The electronic device of claim 11, wherein the system software space comprises a third space, wherein a last data block of the third space is a last data block of the system software space, and wherein the processor is further configured to:
when the capacity of the system software space of the new version is smaller than the current capacity of the system software space, upgrading the operating system to the new version; the upgraded second user data space includes the third space, the capacity of the third space is equal to the current capacity of the system software space minus the capacity of the system software space of the new version, and the first data block of the upgraded third space is the next data block of the last data block of the first user data space.
13. The electronic device of claim 11 or 12, wherein the data area of the first user data space comprises a fourth space, the fourth space does not occupy physical space, a last data block of the fourth space is a last data block of the first user data space, and the metadata storage area comprises a first parameter, the first parameter is used for characterizing a capacity of the fourth space, and the capacity of the fourth space is smaller than a current capacity of the system software space.
14. The electronic device of claim 11, wherein before the upgrade of the operating system to the new version, the processor is further configured to:
increasing the fourth space and the system software space; the increased system software space includes the first space, the increased capacity of the fourth space is equal to the capacity of the first space, the fifth space is the increased fourth space, and the last data block of the first user data space is the last data block of the fifth space after the fourth space is increased.
15. The electronic device of claim 12, wherein after receiving the update information, the processor is further configured to:
narrowing the fourth space and the system software space; the reduced system software space does not include the third space, the reduced capacity of the fourth space is equal to the capacity of the third space, the sixth space is the reduced fourth space, and the last data block of the first user data space after the fourth space is reduced is the last data block of the sixth space.
16. The electronic device of claim 14, wherein the increasing the capacity of the fourth space comprises:
modifying the first parameter to a capacity of the fifth space.
17. The electronic device of claim 15, wherein said narrowing the fourth space comprises:
modifying the first parameter to a capacity of the sixth space.
18. The electronic device of claim 13, wherein the metadata storage area comprises data item S1To SrSaid S1To SrS in (1)1To SyValidity of data blocks for identifying said data area, said S1S to Srx+1To SyFor identifying the validity of the data block of the fourth space, S1To SrS in (1)y+1To SrFor identifying the validity of the data blocks of the second user data space, S1To SrS in (1)y+1To SzMeans for identifying a validity of a data block of the first space; wherein S isiEqual to 1 characterizes said SiThe identified data block is an invalid block, SiEqual to 0 characterizes said SiThe characterized data block is an effective block, i is a positive integer which is greater than zero and less than or equal to r, and Sx+1To SyAll equal to 1, x, y, z and r are positive integers, x is greater than 1, y is greater than x, z is greater than y, and r is greater than z.
19. The electronic device of claim 14, wherein after the increasing the fourth space, the processor is further configured to:
determining the Sy+1To SzAre all 1, Sy+1To SzAnd the method is used for representing the effectiveness of the newly added data block of the fourth space.
20. The electronic device of claim 15, wherein the third space comprises a data blocks, and wherein after shrinking the fourth space, the processor is further configured to:
determining the Sy-a+1To SyAre all 0, Sy-a+1To SyFor characterizing the validity of the data blocks of the third space.
21. A computer storage medium comprising computer instructions that, when executed on an electronic device, cause the electronic device to perform the method of any of claims 1-10.
22. A computer program product, characterized in that it causes a computer to carry out the method according to any one of claims 1 to 10 when said computer program product is run on the computer.
CN202010198332.0A 2020-03-19 2020-03-19 Version upgrading method and related device Pending CN113495744A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202010198332.0A CN113495744A (en) 2020-03-19 2020-03-19 Version upgrading method and related device
PCT/CN2021/081796 WO2021185352A1 (en) 2020-03-19 2021-03-19 Version upgrade method and related apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010198332.0A CN113495744A (en) 2020-03-19 2020-03-19 Version upgrading method and related device

Publications (1)

Publication Number Publication Date
CN113495744A true CN113495744A (en) 2021-10-12

Family

ID=77770498

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010198332.0A Pending CN113495744A (en) 2020-03-19 2020-03-19 Version upgrading method and related device

Country Status (2)

Country Link
CN (1) CN113495744A (en)
WO (1) WO2021185352A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114185587A (en) * 2021-12-13 2022-03-15 平安壹账通云科技(深圳)有限公司 Microcode upgrading method, device, equipment and storage medium

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114217838B (en) * 2022-02-22 2022-05-13 深圳市微克科技有限公司 Intelligent wearable dial plate updating method and system
CN117177246B (en) * 2023-10-25 2024-04-12 荣耀终端有限公司 Method for locking electronic equipment, electronic equipment and server

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2008095577A1 (en) * 2007-02-09 2008-08-14 Telefonaktiebolaget L M Ericsson (Publ) Generating delta updates for a processing device
CN109710286A (en) * 2018-11-30 2019-05-03 歌尔科技有限公司 Method for upgrading system, device, equipment and storage medium
CN110134416A (en) * 2019-04-12 2019-08-16 平安普惠企业管理有限公司 Oftware updating method, device and computer readable storage medium
CN110321148A (en) * 2019-07-12 2019-10-11 Oppo广东移动通信有限公司 Method for upgrading system and relevant apparatus
CN110781030A (en) * 2019-09-09 2020-02-11 晶晨半导体(深圳)有限公司 Backup method for user data in android system upgrading process

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101295268B (en) * 2007-04-27 2011-03-02 国际商业机器公司 Partition memory dumping method and device facing software system
CN106383666B (en) * 2016-09-07 2020-05-01 东信和平科技股份有限公司 Data storage method and device
CN109656603A (en) * 2019-01-15 2019-04-19 Oppo广东移动通信有限公司 Method for upgrading system, device, storage medium and electronic equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2008095577A1 (en) * 2007-02-09 2008-08-14 Telefonaktiebolaget L M Ericsson (Publ) Generating delta updates for a processing device
CN109710286A (en) * 2018-11-30 2019-05-03 歌尔科技有限公司 Method for upgrading system, device, equipment and storage medium
CN110134416A (en) * 2019-04-12 2019-08-16 平安普惠企业管理有限公司 Oftware updating method, device and computer readable storage medium
CN110321148A (en) * 2019-07-12 2019-10-11 Oppo广东移动通信有限公司 Method for upgrading system and relevant apparatus
CN110781030A (en) * 2019-09-09 2020-02-11 晶晨半导体(深圳)有限公司 Backup method for user data in android system upgrading process

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114185587A (en) * 2021-12-13 2022-03-15 平安壹账通云科技(深圳)有限公司 Microcode upgrading method, device, equipment and storage medium
CN114185587B (en) * 2021-12-13 2023-08-25 平安壹账通云科技(深圳)有限公司 Microcode upgrading method, device, equipment and storage medium

Also Published As

Publication number Publication date
WO2021185352A1 (en) 2021-09-23

Similar Documents

Publication Publication Date Title
CN112783564B (en) Method for accelerating starting of application program and electronic equipment
CN109766036B (en) Message processing method and electronic equipment
CN109559270B (en) Image processing method and electronic equipment
CN114443277A (en) Memory management method and device, electronic equipment and computer readable storage medium
WO2021185352A1 (en) Version upgrade method and related apparatus
CN111543042A (en) Notification message processing method and electronic equipment
CN113704205B (en) Log storage method, chip, electronic device and readable storage medium
CN112130714B (en) Keyword search method capable of learning and electronic equipment
CN113961157B (en) Display interaction system, display method and equipment
CN113132526B (en) Page drawing method and related device
WO2021159746A1 (en) File sharing method and system, and related device
CN113805797B (en) Processing method of network resource, electronic equipment and computer readable storage medium
CN114116191A (en) Memory cold page processing method and electronic equipment
US20240095000A1 (en) Plug-In Installation Method, Apparatus, and Storage Medium
CN114461588A (en) Method for adjusting pre-reading window and electronic equipment
CN115757193A (en) Memory management method and electronic equipment
CN112637477A (en) Image processing method and electronic equipment
WO2021104117A1 (en) Method for constructing application program resource packet, construction apparatus, and terminal device
CN114489469B (en) Data reading method, electronic equipment and storage medium
CN112783418B (en) Method for storing application program data and mobile terminal
CN113467821A (en) Application program repairing method, device, equipment and readable storage medium
CN113721836A (en) Data deduplication method and device
CN117009023B (en) Method for displaying notification information and related device
WO2024046010A1 (en) Interface display method, and device and system
CN116795476B (en) Wallpaper deleting method and electronic equipment

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