CN116048628B - Equipment starting method and electronic equipment - Google Patents
Equipment starting method and electronic equipment Download PDFInfo
- Publication number
- CN116048628B CN116048628B CN202210862826.3A CN202210862826A CN116048628B CN 116048628 B CN116048628 B CN 116048628B CN 202210862826 A CN202210862826 A CN 202210862826A CN 116048628 B CN116048628 B CN 116048628B
- Authority
- CN
- China
- Prior art keywords
- electronic device
- partition
- program
- system program
- electronic equipment
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44521—Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/61—Installation
- G06F8/63—Image based installation; Cloning; Build to order
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/71—Version control; Configuration management
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/4401—Bootstrapping
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Stored Programmes (AREA)
Abstract
The application discloses a device starting method and electronic equipment, and relates to the field of terminals, wherein the method comprises the following steps: when the electronic device needs to update the new version of the system, the electronic device can download the system update file from the cloud server side and store the system update file into the partition B. At this time, the system program stored in the partition B is a new version of the system program. The electronic device may then load the boot image program in the B partition into RAM based on the coprocessor. When the electronic device needs to run the new version of the system, the electronic device can run the startup mirror program loaded into the RAM so as to restart the electronic device, so that the electronic device can run the new version of the system based on the system program in the partition B.
Description
Technical Field
The present application relates to the field of terminals, and in particular, to a device starting method and an electronic device.
Background
With the rapid development of information technology and the popularization of various electronic devices, users also use electronic devices to process various daily transactions and perform various entertainment activities more and more frequently. In order to adapt to more complex and diverse application scenarios, the system update period of the electronic device is gradually shortened, and users need to download and upgrade new versions of the system frequently. After the electronic device responds to the input of the user for the system version update, the electronic device can download the system new version file from the cloud server and install the system new version file. In the installation process of the new version file of the system, the electronic device needs to be restarted so that the electronic device can apply the downloaded new version file of the system to update the system. However, in the current installation process, the restarting time of the electronic device is longer, so that the time that the user cannot use the electronic device is longer, and meanwhile, the efficiency of installing a new version of the system of the electronic device is lower, so that the use experience of the user is greatly influenced.
Disclosure of Invention
The application provides a device starting method and electronic equipment, which realize that the electronic equipment does not need to load a new version of starting mirror program and directly operates the program in the process that the electronic equipment needs to be restarted to operate a new version system, so that the restarting time of the electronic equipment is shortened, and the time that a user cannot use the electronic equipment is shortened. Meanwhile, the efficiency of the new version of the electronic equipment installation system is improved, and the use experience of a user is improved.
In a first aspect, the present application provides a device boot method, where the method is applied to an electronic device, and a read-only memory ROM in the electronic device includes a first partition and a second partition, where the first partition and the second partition are used to store a system program, and the method includes: the electronic equipment loads a first system program in the first partition into an operating memory RAM, and operates the first system program; the electronic equipment acquires a system update file from a cloud server; the electronic equipment updates a first system program in the second partition into a second system program based on the system update file; when the size of the available space of the running memory is larger than or equal to a first threshold value and the coprocessor is in an idle state, the electronic equipment loads a starting mirror program of the second system program into the running memory by using the coprocessor; when the electronic equipment is restarted, a mark corresponding to the starting mirror program of the second system program exists in the running memory, and the electronic equipment runs the starting mirror program of the second system program from the running memory. Therefore, the restarting time of the electronic equipment is reduced, and the time that the user cannot use the electronic equipment is shortened. Meanwhile, the efficiency of the new version of the electronic equipment installation system is improved, and the use experience of a user is improved.
In one possible implementation, the method further includes: when the size of the available space of the running memory is smaller than a first threshold value, the electronic equipment acquires the size of the space of the running memory in a first period based on a specified time interval; and when the size of the available space of the running memory acquired by the electronic equipment in the first period is larger than or equal to a first threshold value, the electronic equipment judges whether the coprocessor is idle or not. Therefore, whether the size of the running memory space is larger than or equal to the first threshold value can be timely obtained and judged, and the coprocessor can timely load the starting mirror program of the second system program.
In one possible implementation, the method further includes: and when the coprocessor is not in an idle state and the CPU is in an idle state, the electronic equipment loads the starting mirror program of the second system program into the RAM by utilizing the CPU. In this way, the boot image program of the second system program can be loaded into the RAM in time when the coprocessor is not in an idle state.
In one possible implementation manner, when the coprocessor is not in an idle state and a Central Processing Unit (CPU) is in an idle state, the electronic device loads a boot mirror program of the second system program into the RAM by using the CPU, and specifically includes: the electronic equipment acquires the occupancy rate of the CPU; when the occupancy rate of the CPU is larger than a second threshold value, the electronic equipment determines that the CPU is in an idle state; and the electronic equipment loads a starting mirror image program of the second system program into the RAM by utilizing the CPU. In this way, the boot image program of the second system program can be loaded into the RAM in time when the coprocessor is not in an idle state.
In a possible implementation manner, the electronic device obtains a system update file from a cloud server, and specifically includes: the electronic equipment receives a system update notification sent by the cloud server; in response to a first input, the electronic device obtains a system update file from the cloud server.
In a possible implementation manner, when the electronic device is restarted, a flag corresponding to the start-up mirror program of the second system program exists in the running memory, and before the electronic device runs the start-up mirror program of the second system program in the running memory, the method further includes: the electronic equipment displays prompt information of system downloading completion; the system downloading completion prompt information is used for prompting a user, and the first system program in the second partition is updated to be the second system program; responsive to a second input, the electronic device ceasing to run the first system program in the RAM; the electronic device is restarted.
In one possible implementation, the method further includes: the electronic device copying the second system program in the second partition; the electronic device writes the copied second system program into the first partition, so that the first system program in the first partition is updated to the second system program.
In a second aspect, an embodiment of the present application provides an electronic device, including computer instructions, including: one or more processors, one or more memories, and a display screen. The one or more memories are coupled with one or more processors, the one or more memories being configured to store computer program code comprising computer instructions that, when executed by the one or more processors, cause the electronic device to perform the method of any of the possible implementations of the first aspect described above. Therefore, the restarting time of the electronic equipment is reduced, and the time that the user cannot use the electronic equipment is shortened. Meanwhile, the efficiency of the new version of the electronic equipment installation system is improved, and the use experience of a user is improved.
In a third aspect, embodiments of the present application provide a computer readable storage medium comprising computer instructions which, when run on an electronic device, cause the electronic device to perform the method of any one of the possible implementations of the first aspect. Therefore, the restarting time of the electronic equipment is reduced, and the time that the user cannot use the electronic equipment is shortened. Meanwhile, the efficiency of the new version of the electronic equipment installation system is improved, and the use experience of a user is improved.
In a fourth aspect, embodiments of the present application provide a chip or chip system comprising processing circuitry and interface circuitry, the interface circuitry for receiving code instructions and transmitting to the processing circuitry, the processing circuitry for executing the code instructions to perform the method of any one of the possible implementations of the first aspect. Therefore, the restarting time of the electronic equipment is reduced, and the time that the user cannot use the electronic equipment is shortened. Meanwhile, the efficiency of the new version of the electronic equipment installation system is improved, and the use experience of a user is improved.
In a fifth aspect, embodiments of the present application provide a computer program product which, when run on an electronic device, causes the electronic device to perform the method of any one of the possible implementations of the first aspect. Therefore, the restarting time of the electronic equipment is reduced, and the time that the user cannot use the electronic equipment is shortened. Meanwhile, the efficiency of the new version of the electronic equipment installation system is improved, and the use experience of a user is improved.
Drawings
FIG. 1A is a schematic diagram of a partition operating state of a system according to an embodiment of the present application;
FIG. 1B is a schematic diagram of another system partition operating state according to an embodiment of the present application;
FIG. 1C is a schematic diagram of another system partition operating state according to an embodiment of the present application;
fig. 2 is a schematic flow chart of a device starting method according to an embodiment of the present application;
FIGS. 3A-3C are a set of user interface diagrams provided in accordance with an embodiment of the present application;
fig. 3D is a schematic diagram of system area division in an electronic device according to an embodiment of the present application;
FIG. 3E is a schematic diagram illustrating system area division in another electronic device according to an embodiment of the present application;
FIGS. 3F-3I are a set of user interface diagrams provided in accordance with an embodiment of the present application;
fig. 4 is a schematic hardware structure of an electronic device 100 according to an embodiment of the present application;
fig. 5 is a schematic software module of an electronic device 100 according to an embodiment of the present application.
Detailed Description
The terminology used in the following embodiments of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the specification and the appended claims, the singular forms "a," "an," "the," and "the" are intended to include the plural forms as well, unless the context clearly indicates to the contrary. It should also be understood that the term "and/or" as used in this disclosure is meant to encompass any or all possible combinations of one or more of the listed items. In embodiments of the present application, the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as implying or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more such feature, and in the description of embodiments of the application, unless otherwise indicated, the meaning of "a plurality" is two or more.
In some embodiments, the electronic device may divide two storage areas of a specified size (e.g., 500MB, 900MB, etc.) from a magnetic disk (which may also be referred to as a read-only memory ROM) to hold the system program. One of the storage areas may be referred to as an a partition (also referred to as slot a) and the other storage area may be referred to as a B partition (also referred to as slot B). The names of the a partition and the B partition may be preset, and are not limited herein. The system program stored in partition a is identical to the system program stored in partition B. Wherein the system program may be for: managing files on an electronic device, obtaining status information (e.g., date, time, running memory space available, etc.) on the electronic device, conducting inter-device communications, etc. The electronic device may run an operating system on the electronic device based on a system program in the partition a or the partition B. Partitions that are running the system program may be referred to as active systems and partitions that are not running the system program may be referred to as backup systems.
The electronic device may set its corresponding attribute identification based on the current state of the a partition/B partition. Here byFor example, the category identified by the attribute and the corresponding state thereof may be shown in the following list 1:
TABLE 1
As can be seen from table 1, the attribute identification may include:
an active identifier indicating that the partition to which the identifier corresponds is preferably a device boot partition. That is, the electronic device may preferentially read and operate the partition corresponding to the identifier to perform the device starting operation, and operate the operating system on the electronic device based on the system program in the partition. Therefore, the electronic device can set an active flag for only one partition. For example, when the electronic device is running an operating system on the electronic device based on a system program in the a partition, the electronic device may set the acitve flag to the a partition, at which time the B partition cannot be set with the acitve flag. And when the electronic device sets an active identifier for a certain partition, the partition can not be set with an unbootable identifier. That is, the active identifier and the unbookable identifier cannot exist in one partition at the same time. For example, when the electronic device sets an active identifier for the a partition, the electronic device cannot set an unbootable identifier for the a partition, and the a partition cannot have both the active identifier and the unbootable identifier.
The bootable identifier indicates that a bootable system program exists in the partition corresponding to the identifier, indicates that the electronic equipment can perform equipment starting operation based on the partition corresponding to the identifier, and operates an operating system based on the system program in the partition.
And a success flag indicates that the system program in the corresponding partition of the flag can normally operate. When the electronic device successfully performs the device starting operation based on a certain partition and normally operates the operating system on the electronic device based on the system program in the partition, the electronic device can set a success ful identifier for the partition.
The unbootable identifier indicates that the corresponding partition is damaged, and the system program in the partition cannot run. When the electronic device sets an unbootable identifier for a certain partition, the partition cannot be set with an active identifier, a bootable identifier and a success identifier. That is, the unscable identifier cannot exist in one partition at the same time as the active identifier, the bootable identifier, and the successful identifier, and the active identifier, the bootable identifier, and the successful identifier may exist in one partition at the same time.
For example, when the electronic device performs a device start operation, the electronic device may detect whether the a partition and the B partition have bootable identities. If both the partition A and the partition B have bootable identifications, the electronic device can detect which partition has an active identification. When the electronic equipment detects that the A partition has the acitve identifier, the electronic equipment can perform equipment starting operation based on the A partition preferentially and operate an operating system based on a system program in the A partition. At this time, because the electronic device successfully starts the device based on the a partition, the electronic device may set the acitve identifier and the success identifier for the a partition again, which indicates that the electronic device may be preferentially based on the a partition when performing the device starting operation next time. If the electronic device cannot be started successfully based on the partition A, namely when the device fails to start, the electronic device can set an unbootable identifier for the partition A and an active identifier for the partition B, and the electronic device can perform device starting operation based on the partition B. When the electronic device successfully starts the device based on the partition B and operates the operating system based on the system program in the partition B, the electronic device can set the success identifier and the acitve identifier for the partition B again, and the electronic device is indicated to be based on the partition B preferentially when the electronic device starts the device next time.
In some application scenarios of the above embodiments, the electronic device may update the system version during use. As shown in fig. 1A, first, the electronic device may run an operating system based on a system program in an a partition, which is an active system. At this time, the system program in partition B is in an un-running state, and partition B is a backup system. In order to avoid the damage to the device caused by the failure of updating the system version, the electronic device needs to update the system version based on the partition B. Thus, if the system version update fails to cause the system program in the partition B to be inoperable, the electronic device can still work normally based on the system program in the partition a.
When the electronic equipment does not update the system version, the A partition can have an active identifier, a success identifier and a bootable identifier, and the B partition can have a bootable identifier and a success identifier; in the process of updating the system version of the electronic device, the A partition can have an active identifier, a success identifier and a bootable identifier, and the B partition can have an unbiotidable identifier. The electronic equipment can download a system new version program from the cloud server side to the partition B; when the electronic device has successfully downloaded and stored the system new version program from the cloud server side into the B partition, the a partition may have a bootable identifier and a success identifier, and the B partition may have a bootable identifier and an acitve identifier.
As shown in fig. 1B, when the electronic device needs to run a new version of the system, the electronic device may run the system program on the B partition based on the operation of the electronic device reboot (which may also be referred to as a reboot), and no longer run the system program on the a partition. In the process of restarting the electronic device, the electronic device can detect that the B partition has an acitve identifier, and the acitve identifier indicates that the electronic device can currently perform electronic device restarting operation based on the B partition. Then, the electronic device may load a boot image program of the B partition (for example, a bootloader program of the B partition, a second bootloader program of the B partition, a kernel program of the B partition, etc.) in a read-only memory (may also be referred to as a disk, random access memory, RAM) into a random access memory (may also be referred to as a running memory), and then load other system programs (for example, a program for guiding various system services to load, various service programs, etc.) into a RAM, and run, so that the electronic device may run a new version of the system based on the system programs in the B partition.
As shown in fig. 1C, when the electronic device successfully restarts the electronic device based on the partition B and runs a new version system based on the system program in the partition B, the electronic device may set an active identifier, a success identifier, and a bootable identifier for the partition B, and the partition a sets a success identifier and a success identifier.
As can be seen from the above description, when the electronic device performs the electronic device restarting operation based on the partition B, the electronic device takes a long time to load the system program of the partition B in the ROM into the RAM, so that the restarting period of the electronic device is long, and the time for which the user cannot use the electronic device is also long. Meanwhile, the restarting time of the electronic equipment is longer, so that the efficiency of installing the new version of the system of the electronic equipment is lower, and the use experience of a user is greatly influenced.
Accordingly, the present application provides a device start-up method.
The device starting method can be applied to electronic devices such as mobile phones and tablet computers. The electronic device 100 is subsequently used in a unified manner to represent the above-described electronic device. Not limited to a cell phone, tablet computer, electronic device 100 may also be a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a cellular telephone, a personal digital assistant (personal digital assistant, PDA), an augmented reality (augmented reality, AR) device, a Virtual Reality (VR) device, an artificial intelligence (artificial intelligence, AI) device, a wearable device, a vehicle-mounted device, a smart home device, and/or a smart city device, and the specific type of the terminal is not particularly limited by the embodiments of the present application.
It should be noted that, in the subsequent embodiment of the present application, the electronic device 100 is taken as a mobile phone, and an operating system on the electronic device 100 isSpecific implementations of the device start-up method are specifically illustrated as examples.
Specifically, the electronic device 100 may run the system of version 1 based on the current system program in the a partition, which is an active system. At this time, the system program in partition B is in an un-running state, and partition B is a backup system. In order that the running process of the system program in the partition a based on the electronic device 100 is not interrupted during the system version update process, and in order to avoid the damage to the device caused by the failure of the system version update, the electronic device 100 may perform the system version update based on the partition B.
When the electronic device 100 needs to update the system to version 2, the electronic device 100 may download a system update file corresponding to the system of version 2 from the cloud server side, and store the system update file in the partition B. At this time, the system program stored in the B partition is the version 2 system program. When the electronic device 100 detects that the system update file has been downloaded and stored to the B partition, the electronic device 100 may load the boot image program in the B partition into the RAM based on a coprocessor or a central processing unit (central processing unit, CPU). The above procedure does not affect the running of the system program in the partition a, that is, when the electronic device 100 downloads and stores the system update file from the cloud server side and loads the boot image program of the partition B, the electronic device 100 can run the system program in the partition a, and the two cannot collide. Then, when the electronic device 100 needs to run the version 2 system, the electronic device may switch from the a partition to the B partition to run the system program based on the electronic device restart operation. The electronic device 100 may run the aforementioned boot image program that has been loaded into RAM for a reboot of the electronic device so that the electronic device 100 may run a version 2 system based on the system program in partition B.
As can be seen from the above flow, since the electronic device 100 loads the boot image program in the B partition to the RAM while the system program in the a partition is running, during the restart of the electronic device 100, the electronic device 100 does not need to load the boot image program of the B partition, but directly runs the above program, which reduces the restart time of the electronic device 100 and shortens the time when the user cannot use the electronic device 100. Meanwhile, the efficiency of installing the new version of the system of the electronic equipment 100 is improved, and the use experience of a user is improved.
Next, specific steps of the device start-up method provided by the present application are described in connection with user interface examples and implementation procedures.
Referring to fig. 2, fig. 2 is a schematic flow chart illustrating a device start-up method according to an embodiment of the present application.
As shown in fig. 2, the specific flow of the device start-up method may include:
s201, the electronic device 100 runs a version 1 system based on the current system program in the A partition.
The electronic device 100 may store a system program by dividing a plurality of (e.g., 2, 3, etc.) storage areas of a predetermined size (e.g., 500MB, 900MB, etc.) from a magnetic disk (may also be referred to as a ROM). The plurality of storage areas may include an a partition (may also be referred to as a first partition) and a B partition (may also be referred to as a second partition). The system program stored in the partition a and the system program stored in the partition B may be the same, and both the system program of version 1 and the system program of version 1 may be referred to as a first system program. The description of the system program may refer to the foregoing description, and will not be repeated herein.
Specifically, the electronic device 100 may run the version 1 system based on the current system program in the a partition. The electronic device 100 may set an active identifier, a bootable identifier, and a success identifier for the a partition, and set a bootable identifier and a success identifier for the B partition.
S202, the electronic equipment 100 receives a system update notification sent by the cloud server.
In some examples, the cloud server may actively send a system update notification to the electronic device 100. The system update notification may be used to prompt the electronic device 100 that the system version is updated, for example, to prompt the electronic device 100 that the latest system version is updated to version 2.
In some examples, the electronic device 100 may actively send a system update detection request to the cloud server. The system update detection request may include a current system version number of the electronic device 100. After receiving the system version number, the cloud server may determine whether the system on the electronic device 100 is updated on the cloud server based on the system version number. If so, the cloud server may send a system update notification to the electronic device 100. For the description of the system update notification, reference may be made to the foregoing description, and details are not repeated here.
S203, the electronic device 100 may display the first interface. The first interface comprises a first window, and the first window can display system update prompt information and a first button based on system update notification.
For example, as shown in fig. 3A, when a user views video using the electronic device 100, the electronic device 100 may display the video interface 30 (i.e., the first interface). The video interface 301 may include, among other things, a video frame, a timeline bar, and a window 301 (i.e., a first window). The timeline indicates time play information of the video, e.g. "0:11/2:30", indicating that the video has been played for 11 seconds for 2 minutes and 30 seconds. The window 301 may display system update-prompting information and a download button 301A (i.e., the first button) based on the system update notification. The system update prompt information can be used for prompting the user that the system version is updated. The system update-prompting message may be a text message, such as "software update: 2.0.0211 (B00E 211R8P 4) can be used for your equipment. 284MB of traffic is required to download the update. In some examples, not limited to text information, the system update hint information may also be picture information, voice information, etc., as the application is not limited in this regard.
S204, in response to the input acting on the first button, the electronic device 100 receives the system update file from the cloud server side.
Illustratively, as shown in FIG. 3B, taking the video interface 30 shown in FIG. 3A as an example, the input acting on the first button is a touch operation acting on the download button 301A.
Specifically, the system update file may be used to: the version 1 system on the electronic device 100 is updated to the version 2 system. Wherein:
in some examples, the system update file may be a delta update file. Wherein the delta update file includes difference information between the version 2 system program and the version 1 system program. For example, if the system program of version 1 is S1, the system program of version 2 is S2, and the difference information between both S1 and S2 is S3, the incremental update file may include the difference information S3. In the embodiment of the present application, the system program S1 of version 1 is stored in the partition B as an example, so that the incremental system update file and the system program S1 can be combined to form the system program S2 of version 2, so that the system program in the partition B can be updated to the system program S2 of version 2.
In some examples, the system update file may be a full volume update file. Wherein the full update file may comprise a version 2 system program. For example, if the system program of version 2 is S2, the full update file includes the system program S2.
The input acting on the first button may be referred to as an input of the download system update file, and the input of the download system update file may be referred to as a first input. In response to the input of the download system update file, the electronic device 100 may acquire the system update file from the cloud server side. In some examples, the input of the download system update file may be other inputs such as gesture input or voice input, without limitation, that is not limited to the input acting on the first button.
S205, after the electronic device 100 detects that the system update file has been downloaded and stored in partition B, the electronic device 100 determines whether the size of the space available in the running memory (i.e. RAM) is greater than or equal to the specified threshold a.
In particular, inIn the system, the electronic device 100 may download and store the system update file into the B partition through a specified service, for example, an update_engine service, so that the B partition stores the system program of version 2, that is, the system program in the B partition is updated to the system program of version 2, and the system program of version 2 may also be referred to as a second system program. Then, the appointed service update_Engine can set an active identifier and a bootable identifier for the partition B, and set a bootable identifier and a success identifier for the partition A.
The electronic device 100 may monitor whether the system program in the B partition has been updated to the version 2 system program in real time through a specified field, for example, an onproperty field. When the electronic device 100 obtains that the value of the specified attribute, such as the bsystem.completed, has been set to the specified value (e.g., true) through the specified field onproperty, the electronic device 100 may determine that the system update file has been downloaded and stored to the B partition, and the system program in the B partition has been updated to the system program of version 2.
The electronic device 100 may then obtain the size of the available space of the running memory (i.e., RAM) and determine whether the size of the available space of the running memory is greater than or equal to a specified threshold a (which may also be referred to as a first threshold). The value of the specified threshold a may be 300 Megabytes (MB), 400MB, 500MB, or the like, which is not limited by the present application. The electronic device 100 may obtain the size of the space available for running memory through a specified function, such as activitymanaager.
It should be noted that, the foregoing specific service update_event, the specific field, the specific attribute bs, the completed and the specific function activitymanager, getmemorinfo () are examples in the embodiment of the present application, and in a specific implementation process, the foregoing specific service, the specific field, the specific attribute, the specific function, etc. may be different from the examples in the embodiment of the present application, that is, the examples in the embodiment of the present application do not limit the foregoing, and the electronic device 100 may determine that the system update file has been downloaded and stored in the partition B, obtain the size of the available space of the running memory, etc. in other manners.
S206, when the electronic device 100 determines that the size of the available space of the running memory is smaller than the specified threshold a, the electronic device 100 obtains the size of the available space of the running memory every specified period.
Specifically, when the electronic device 100 obtains the size of the available space of the running memory in each period, the electronic device 100 may determine whether the size of the available space of the running memory obtained in the period is greater than or equal to the specified threshold a. If yes, the electronic device 100 executes step S207; if not, the electronic device 100 continues to execute the step S206.
For example, the electronic device 100 obtains the value of the available space size of the running memory as M in the first period, and the electronic device 100 may determine whether M is greater than or equal to the specified threshold a. If yes, the electronic device 100 executes step S207; if not, the electronic device 100 continues to execute the step S206, obtains the available space size of the running memory in the second period, and determines the available space size. The specific period may be 10 seconds, 15 seconds, 20 seconds, or the like, which is not limited in the present application. Preferably, the specified period in the embodiment of the present application may be 10 seconds.
S207, when the electronic device 100 determines that the size of the available space of the running memory is greater than or equal to the specified threshold a, the electronic device 100 determines whether the coprocessor (e.g., GPU coprocessor) is in an idle state.
Preferably, the coprocessor in an embodiment of the application may be a graphics processor (graphics processing unit, GPU). In some examples, not limited to GPUs, coprocessors may also be math co-processors (math co-processors) or the like, as the application is not limited in this regard.
Specifically, taking the case that the coprocessor is a GPU coprocessor as an example, when the GPU coprocessor is based on a call request, so that the electronic device 100 can call the GPU coprocessor based on an interface provided by the GPU coprocessor, the electronic device 100 determines that the GPU is in an idle state, and the electronic device 100 can execute subsequent steps based on the GPU coprocessor. When the GPU coprocessor cannot provide the interface based on the call request, the electronic device 100 determines that the GPU coprocessor is not in the idle state, and the electronic device 100 performs step S209.
S208, when the electronic device 100 determines that the coprocessor is in an idle state, the electronic device 100 loads a boot image program in the partition B into the running memory RAM based on the coprocessor.
Preferably, the boot image program in the B partition may include, but is not limited to, the following image programs: bootloader programs for the B partition, secondootlloader programs for the B partition, kernel programs for the B partition, and related programs (e.g., ramdisk programs, devicetree programs), and so forth. The bootloader program and the second bootloader program may be used to initialize the hardware device during the startup process of the electronic device 100, so that the hardware device of the electronic device 100 may execute corresponding program instructions during the running process. The bootloader program and the second bootloader program may also set a start parameter for the kernel, and the bootloader program may guide the second bootloader program to load into the RAM. The ramdisk program may be used to load the hardware drivers into RAM. The devicetree program may be used for the electronic device 100 to obtain hardware device resources on the device. The kernel (i.e., kernel) program may be used for the electronic device 100 to drive the hardware device to perform corresponding operations based on the hardware driver, such as driving a microphone to collect audio signals, driving a camera to collect images, driving a sensor to collect physical data, and so on. At this time, since the B partition stores the version 2 system program, the boot image program of the B partition is the boot image program included in the version 2 system program, and may be referred to as a boot image program of the second system program. Thus, it will be appreciated that the system program includes a boot image program.
Specifically, each mirror program in the partition B may correspond to a preset logical address. For example:
the bootloader program may correspond to a first start logical address and a first end logical address;
the second start logical address and the second end logical address may correspond to the second condcootloader program;
the kernel program, the ramdisk program, and the devicetree program may correspond to a third start logical address and a third end logical address.
The logical addresses corresponding to the mirror programs may be included in the system update file or may be included in the program code of the partition B.
The specific implementation manner of the step can be as follows:
the electronic device 100 may obtain a physical address of the free area in RAM and map the physical address with a logical address. For example, if the first start physical address is mapped to the first start logical address, the first end physical address is the first start physical address+ (first end logical address-first start logical address), and the first start physical address and the first end physical address form the first storage area; the second initial physical address is mapped with the second initial logical address, and then the second termination physical address is a second initial physical address+ (second termination logical address-second initial logical address), and the second initial physical address and the second termination physical address form a second storage area; the third starting physical address is mapped with the third starting logic, and the third ending physical address is a third starting physical address+ (third ending logic address-third starting logic address), and the third starting physical address and the third ending physical address form a third storage area.
Then, the electronic device 100 may load the bootloader program of the B partition in the ROM to the first storage area in the RAM, the second bootloader program of the B partition in the ROM to the second storage area in the RAM, and the kernel program, ramdisk program, and devicetree program of the B partition in the ROM to the third storage area in the RAM based on the mapping between the physical address and the logical address. The electronic device 100 may decompress the kernel program when loading the kernel program into the third memory area in the RAM. The initial physical address of the decompressed kernel program in the RAM is: the original kernel program's starting physical address in RAM + offset. The size of the offset is the size of the original kernel program.
S209, when the electronic device 100 determines that the coprocessor is not in the idle state, the electronic device 100 determines whether the CPU is in the idle state.
Specifically, the electronic device 100 may obtain the CPU occupancy rate, and determine whether the CPU is idle based on the CPU occupancy rate.
When the electronic device 100 determines that the CPU occupancy rate is greater than the specified threshold B (may also be referred to as a second threshold), the electronic device 100 determines that the CPU is not in an idle state, and the electronic device 100 may execute the foregoing step S206, and acquire the size of the available space of the running memory at intervals of a specified period; when the electronic device 100 determines that the CPU occupancy rate is less than or equal to the specified threshold B, the electronic device 100 determines that the CPU is in an idle state, and the electronic device 100 may perform subsequent steps based on the CPU.
Wherein the specified threshold B may be 20%, 25% or 30%, as the present application is not limited in this regard. The electronic device 100 may obtain the CPU occupancy rate based on a specified file, e.g., a/proc file. It should be noted that, the embodiment of the present application does not limit the manner in which the electronic device 100 obtains the CPU occupancy rate.
S210, when the electronic device 100 determines that the CPU is in an idle state, the electronic device 100 loads a boot mirror program in the partition B into the running memory RAM based on the CPU.
For the boot image procedure in the B partition and the related description, reference may be made to the description in S208, which is not repeated here. The specific implementation manner of this step may also refer to the description in S208, and will not be described herein.
S211, the electronic device 100 displays a second window, wherein the second window comprises system downloading completion prompt information and a second button.
For example, as shown in fig. 3C, the electronic device 100 may display a window 302 (i.e., a second window) in the video interface 30 (i.e., the first interface). For the description of the video interface 30, reference may be made to the description in fig. 3A, and the description is omitted here. At this time, the time playing information of the video in the video interface 30 may be different from that of fig. 3A, and may be displayed as "1:20/2:30", for example, indicating that the video has been played for 1 minute and 20 seconds for 2 minutes and 30 seconds. That is, the running process of the system program in the a partition is not interrupted when the electronic device 100 performs the related operations of the foregoing steps, and the use process of the user based on the electronic device 100 is not affected.
Window 302 may include a system download complete reminder, a "now install" button 302A (i.e., a second button), and a "install later" button 302B. The system downloading completion prompt information can be used for prompting the user that the system updating file is downloaded and stored in the partition B. The system download completion prompt may be a text message, such as "software update: 2.0.0211 (B00E 211R8P 4) downloaded to your device, is it now installed? ".
In some examples, the system download completion prompt may be, but not limited to, a text message, a picture message, a voice message, etc., which is not limiting in this regard.
In some examples, not limited to the first interface, the electronic device 100 may also display the second window in other interfaces, that is, the embodiment of the present application does not limit the interface displaying the second window.
S212, in response to the input acted on the second button, the electronic device 100 restarts based on the boot image program of the partition B in the RAM, and the system of the version 1 on the electronic device 100 is updated to the version 2.
Illustratively, taking the interface shown in FIG. 3C as an example, the input acting on the second button is a touch operation acting on the "now installed" button 302A.
It should be noted that, in this step, the restart process is a hot start, and the electronic device 100 does not interrupt the power supply path of the internal power supply to each hardware device, and each hardware device is in an energized state. Therefore, when the electronic device 100 executes the reboot process, the RAM is not powered off and the data in the RAM is not emptied, and the RAM may still retain the boot image program of the partition B loaded in the RAM in the previous step.
Specifically, in response to an input acting on the second button, the electronic device 100 may terminate the version 1 system program (e.g., version 1 boot image program, a program that directs various types of system services to be loaded, etc.) currently running in the RAM based on the intent. The electronic device 100 may then restart.
In the process of restarting the electronic apparatus 100, first, the electronic apparatus 100 may determine that the active flag has been set to the B partition. Then, the electronic device 100 may acquire the physical address of the first storage area, the physical address of the second storage area, and the physical address of the third storage area in the RAM. If the first 8 bytes in the first storage area have a first mark, the bootloader program of the partition B is loaded to the first storage area in the RAM; if the first 8 bytes in the second storage area have a second flag, the second db ootloader program of the B partition is loaded into the second storage area in the RA M; if the first 8 bytes in the third storage area have a third flag indicating that the ke-kernel program of the B partition has been loaded into the third storage area in RAM, the electronic device 100 may run the boot image program of the B partition in RAM. Next, the electronic device 100 loads other system programs in the B partition (e.g., programs that guide various types of system services to be loaded, various types of service programs, etc.) into the RAM and runs based on the above-described boot image program. After the electronic device 100 stably runs the version 2 system program, the electronic device 100 may erase the version 1 system program in the RAM. The first flag, the second flag, and the third flag may be referred to as a flag corresponding to a boot image program of the second system program. If the first mark, the second mark and the third mark exist in the RAM, the starting mirror program of the second system program is not required to be loaded into the RAM, the starting mirror program is directly operated from the RAM, and if the first mark, the second mark and the third mark do not exist in the RAM, the second system program is loaded into the RAM, and the second system program is operated from the RAM. It should be noted that, if the electronic device 100 is restarted, the electronic device is hot, the data in the RAM is not erased, the RAM has the first flag, the second flag and the third flag, the electronic device 100 does not need to load the second system program in the partition B into the RAM, and the boot image program of the second system program is directly run from the RAM; if the electronic device 100 is cold-started when it is restarted, the active flag is set to the B partition, and at this time, the data in the RAM is erased, the first flag, the second flag, and the third flag are not present in the RAM, the electronic device 100 loads the second system program in the B partition into the RAM, and then runs the second system program from the RAM.
If the electronic device 100 can successfully run the version 2 system based on the B partition, at this time, the identifier of the B partition may be set to an active identifier, a bootable identifier, and a success identifier, so that the electronic device 100 may subsequently start and run the system program in the B partition based on the B partition. Then in this scenario, partition B is the acitve system and partition a is the backup system. When the electronic device 100 subsequently needs to perform a system update based on the version 2 system, that is, update the version 2 system to a new version (e.g., version 3) system, the electronic device 100 may perform a system update based on the a partition.
After the electronic device 100 successfully runs the version 2 system based on the partition B, the electronic device 100 may copy the version 2 system program in the partition B, and write the copied version 2 system program into the partition a, and cover the version 1 system program in the partition a, so that the system program in the partition a and the system program in the partition B remain consistent and are both the version 2 system program, so as to improve the efficiency of subsequent system update of the electronic device 100 based on the version 2 system program. It is understood that, without being limited to the above manner, the electronic device 100 may also update the system program of version 1 to the system program of version 2 in the a partition based on other methods.
The input acting on the second button may also be referred to as a system installation input (may also be referred to as a second input). In response to the system installation input, the electronic device 100 may perform step S212. In some examples, the system installation input may be other inputs such as a gesture input or a voice input, without limitation to the input acting on the second button, that is, the present application is not limited in this regard.
In different examples, the ROM has different area division manners, so the storage manners of the system program may also be different, and the following fig. 3D-3E are exemplary and are described below:
in some examples, as shown in fig. 3D, the plurality of partitions in the ROM may include: an a partition, a B partition, and a user data (userdata) area, and so forth. The user data area may include, among other things, user-saved pictures, documents, application information, etc., personal data of the user. Both the a partition and the B partition include complete system programs. For example, the a partition may include: bootloader for the A partition, second bootloader for the A partition, kernel for the A partition, and related programs (e.g., ramdisk program, devicetree program), system area for the A partition, vendor area for the A partition, product area for the A partition, original designer (original design manufacture, ODM) area for the A partition, and so forth. The region type and the program type included in the B partition may be the same as those of the a partition, and are not described herein. Wherein the system region may include Executable programs, libraries, system services, etc. of the system, vendor area, product area, ODM area may include equipment vendor proprietary capabilitiesExecuting programs, libraries, system services.
The electronic device 100 may download and save the system update file to the B partition so that the system program in the B partition is updated to the version 2 system program, which is a complete system program. Then, the electronic device 100 may load the boot image program in the partition B into the running memory RAM, and then, the electronic device 100 may restart the system of version 1 on the electronic device 100 to version 2 based on the boot image program in the RAM and the system program in the partition B. The specific implementation process may refer to the foregoing steps, and will not be described herein.
In some examples, as shown in fig. 3E, the plurality of partitions in the ROM may include: a base (common) region, an a partition, a B partition, a super region, a user data region, and the like. The data information of the base area is data information which does not participate in system updating. The a partition and the B partition include only: bootloader program, second bootloader program, kernel program, and related programs, which are boot image programs in the foregoing. The super region includes, but is not limited to, the following multiple sub-regions: a system sub-region, a vendor sub-region, a product sub-region, an ODM sub-region, and the like. For the description of each region, reference may be made to the foregoing description, and the description is omitted here. The super area is a dynamic partition, that is, the super area divides the storage space of each sub-area according to the size of the data information in the plurality of sub-areas, and can change the size of the storage space of each sub-area based on the size change of the data information in each sub-area.
The system update file acquired by the electronic device 100 from the cloud server may include: and the version 2 system is used for starting a mirror program and updating files in the super area. Wherein, the super area update file is: the difference information between the super zone data of the version 1 system and the super zone data of the version 2 system.
When the electronic device 100 downloads and saves the system update file to partition B, it may specifically include: and downloading and storing the boot image program corresponding to the version 2 system to the partition B, so that the boot image program stored in the partition B is updated to the boot image program corresponding to the version 2 system. And storing the super area update file into the user data area. In this way, the process of running the version 1 system based on the super region and the A partition may not be interrupted by the electronic device 100.
Before the electronic device reboots, the electronic device 100 may load the boot image program in partition B into the running memory RAM. Then, during the electronic device restart process, the electronic device 100 may run the boot image program in the RAM. Then, the electronic device 100 may generate the super area data corresponding to the version 2 system based on the data of the super area and the super area update file in the user data area. The electronic device 100 may load the super region data corresponding to the version 2 system into the RAM and operate the super region data, and update the version 1 system on the electronic device 100 to the version 2. For specific implementation, reference may be made to the foregoing steps, which are not described herein.
After the electronic device 100 successfully runs the version 2 system, the electronic device 100 may write the super region data corresponding to the version 2 system in the RAM back into the super region of the ROM, and update the boot image program in the partition a to the boot image program corresponding to the version 2 system, so that the program in the partition a is consistent with the program in the partition B, and the efficiency of subsequent system update based on the version 2 system is improved.
In some examples, after the electronic device 100 downloads and stores the system update file to partition B, the electronic device 100 may also set a timer for a specified duration (e.g., 2 hours, 3 hours, etc.). When the electronic apparatus 100 receives the system installation input within a specified period after setting the timer, the electronic apparatus 100 may perform step S212 in response to the input. When the electronic device 100 does not receive the system installation input within the specified time after the timer is set, the electronic device 100 may erase the boot image program in the RAM, and subsequently, the electronic device 100 loads the boot image program of the partition B from the ROM into the RAM and operates in the electronic device restarting process. In this way, the RAM space utilization can be improved.
For example, taking the user interface shown in fig. 3A to 3C as an example, when the electronic device 100 receives a touch operation acting on the download button 301A, the electronic device 100 may download and store a system update file to the B partition from the cloud server side in response to the touch operation. The electronic device 100 may then set a timer having a duration of 2 hours. The electronic device 100 may display a window 302, and for the description of the window 302, reference may be made to the foregoing description, which is not repeated here. The electronic device 100 may receive a touch operation on the "mount later" button 302B, in response to which the electronic device 100 no longer displays the window 302. If the electronic apparatus 100 receives the system installation input within 2 hours after the timer is set, the electronic apparatus 100 may perform step S212 in response to the input. If the electronic device 100 does not receive the system installation input within the specified time after the timer is set, the electronic device 100 may erase the boot image program of the partition B in the RAM, and in the subsequent electronic device 100, reload the boot image program of the partition B from the ROM into the RAM and run the same in the restart process. In this example, an example of a relevant user interface for system installation input may be as shown in FIGS. 3F-3I below:
As shown in fig. 3F, the electronic device 100 may display a desktop 31. The desktop 31 may display one or more application icons. The one or more application icons may include, among other things, a weather application icon, a stock application icon, a calculator application icon, a settings application icon 311, a mail application icon, a theme application icon, a calendar application icon, a video application icon, and the like. Optionally, desktop 31 may also display a status bar. The status bar may include, among other things, one or more signal strength indicators of a mobile communication signal (which may also be referred to as a cellular signal), a signal strength indicator of a wireless fidelity (wireless fidelity, wi-Fi) signal, a battery status indicator, a time indicator, and so forth.
The electronic device 100 may receive a touch operation (e.g., click) on the setting application icon 311, and in response to the touch operation, the electronic device 100 may display a setting interface.
As shown in fig. 3G, the electronic device 100 may display the setup interface 32. The settings interface 32 may display a number of settings options including system and update options 321, etc.
The electronic device 100 may receive a touch operation (e.g., a click) on the system and update options 321, in response to which the electronic device 100 may display a system and update interface.
As shown in fig. 3H, the electronic device 100 may display a system and update interface 33. The system and update interface 33 may include a software update option 331 or the like.
The electronic device 100 may receive a touch operation (e.g., a click) on the software update option 331, in response to which the electronic device 100 may display a software update interface.
As shown in fig. 3I, the electronic device 100 may display the software update interface 34. The software update interface 34 may include an immediate install button 341 and an install prompt, which may be, for example, "loved user, the update incorporates a security patch, which enhances the security of the handset, please install as soon as possible.
The electronic device 100 may receive a touch operation (e.g., click) on the immediate install button 341. If the electronic device 100 receives the touch operation within 2 hours after the timer is set, the electronic device 100 may perform step S212 in response to the touch operation. The touch operation is a system installation input.
It should be noted that, in this example, the specific implementation of the electronic device 100 may refer to the description in the flowchart shown in fig. 2, which is not repeated here.
In some examples, the foregoing step S205 may be performed in the following step S205A: when the electronic device 100 detects that the system update file has been downloaded and stored to partition B, the electronic device 100 may obtain the size of the available space of the running memory and a ratio of the size of the available space of the running memory to the total size of the running memory (may also be referred to as a ratio of the available space of the running memory). Then, the electronic device 100 may determine whether the size of the running memory available space is greater than or equal to a specified threshold a, and whether the ratio of the running memory available space is greater than or equal to a specified threshold C. The value of the specified threshold a may be 30%, 35% or 40% as described above, which is not limited in the present application. Other descriptions and implementations may refer to S205 described above, and are not described herein. The electronic device 100 may obtain the size of the running memory total space and the size of the running memory available space through the specified function activitymanager.
In this example, the foregoing step S206 may be performed as follows step S206A: when the electronic device 100 determines that the size of the running memory available space is smaller than the specified threshold a or the ratio of the running memory available space is smaller than the specified threshold C, the electronic device 100 acquires the size of the running memory available space and the ratio of the running memory available space every specified period. When the electronic device 100 obtains the size of the available space of the running memory and the ratio of the available space of the running memory in each period, the electronic device 100 may determine whether the size of the available space of the running memory obtained in the period is greater than or equal to a specified threshold a, and whether the ratio of the available space of the running memory is greater than or equal to a specified threshold C. If the size of the available space of the running memory acquired in the period is smaller than the specified threshold a or the ratio of the available space of the running memory is smaller than the specified threshold C, the electronic device 100 continues to execute step S206A; if the size of the available space of the running memory acquired in the period is greater than or equal to the specified threshold a, and the ratio of the available space of the running memory is greater than or equal to the specified threshold C, the electronic device 100 executes step S207A. Other descriptions and implementations may refer to S206 described above, and are not repeated here.
In this example, the foregoing step S207 may be performed as follows step S207A: when the electronic device 100 determines that the size of the running memory available space is greater than or equal to the specified threshold a and the ratio of the running memory available space is greater than or equal to the specified threshold C, the electronic device 100 determines whether the coprocessor (e.g., GPU coprocessor) is idle. Other descriptions and specific implementations can refer to S207 described above, and are not repeated here.
In this way, the electronic device 100 determines the size of the available space of the running memory and the ratio of the available space of the running memory at the same time, so that the electronic device 100 can avoid jamming when executing the subsequent steps, and the efficiency of loading the program into the RAM by the electronic device 100 is improved.
In some examples, when the electronic device 100 determines that the size of the available space of the running memory is greater than or equal to the specified threshold a, the electronic device 100 may determine whether the CPU is in an idle state, and if so, the electronic device 100 loads the boot image program in the partition B into the running memory RAM based on the CPU, and performs the subsequent steps. That is, in this example, the electronic device 100 does not need to determine the state of the coprocessor nor need to load the boot image program in partition B into the running memory RAM based on the coprocessor.
In some examples, this step of electronic device 100 is optional in response to a system installation input. That is, after the electronic device 100 loads the boot image program of the B partition into the RAM, the electronic device 100 may directly restart the electronic device based on the boot image program in the RAM and the system program in the B partition, and update the system on the electronic device 100 from the version 1 to the version 2. In this process, the electronic device 100 need not receive and respond to system installation inputs.
Next, a hardware structure of the electronic device 100 provided in the embodiment of the present application is described.
Referring to fig. 4, fig. 4 schematically illustrates a hardware structure of an electronic device 100.
As shown in fig. 4, the electronic device 100 may include a processor 401, a memory 402, a wireless communication module 403, a display 404, a camera 405, an audio module 406, and a microphone 407.
It should be understood that the illustrated structure of the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the application, electronic device 100 may also include more or fewer components than shown, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The processor 401 may include one or more processor units, for example, the processor 401 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and/or a neural network processor (neural-network processing unit, NPU), etc. Wherein the different processing units may be separate devices or may be integrated in one or more processors. The controller can generate operation control signals according to the instruction operation codes and the time sequence signals to finish the control of instruction fetching and instruction execution.
In the embodiment of the present application, the GPU may be used to load the boot image program of the B partition in the ROM into the RAM, and the specific implementation manner may refer to the flow shown in fig. 2 and will not be described herein.
A memory may also be provided in the processor 401 for storing instructions and data. In some embodiments, the memory in the processor 401 is a cache memory. The memory may hold instructions or data that has just been used or recycled by the processor 401. If the processor 401 needs to reuse the instruction or data, it can be called directly from the memory. Repeated accesses are avoided and the latency of the processor 401 is reduced, thus improving the efficiency of the system.
In some embodiments, the processor 401 may include one or more interfaces. The interfaces may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous receiver transmitter (universal asynchronous receiver/transmitter, UART) interface, a mobile industry processor interface (mobile industry processor interface, MIPI), a general-purpose input/output (GPIO) interface, a subscriber identity module (subscriber identity module, SIM) interface, and/or a USB interface, among others.
A memory 402 is coupled to the processor 401 for storing various software programs and/or sets of instructions. In particular implementations, memory 402 may include volatile memory (RAM), such as Random Access Memory (RAM); non-volatile memory (non-volatile memory) such as ROM, flash memory (flash memory), hard Disk Drive (HDD) or solid state Disk (Solid State Drives, SSD) may also be included; memory 402 may also include a combination of the above types of memory. The memory 402 may also store some program code such that the processor 401 invokes the program code stored in the memory 402 to implement a method of implementing an embodiment of the present application in the electronic device 100. The memory 402 may store an operating system, such as an embedded operating system, for example uCOS, vxWorks, RTLinux.
In the embodiment of the present application, the ROM may include an a partition and a B partition, and the RAM may be used to store a boot image program of the B partition loaded by the processor 401, and the specific implementation may refer to the flow shown in fig. 2 and will not be described herein.
The wireless communication module 403 may provide solutions for wireless communication including wireless local area network (wireless local area networks, WLAN) (e.g., wireless fidelity (wireless fidelity, wi-Fi) network), bluetooth (BT), global navigation satellite system (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field wireless communication technology (near field communication, NFC), infrared technology (IR), etc., applied to the electronic device 100. The wireless communication module 403 may be one or more devices integrating at least one communication processing module. The wireless communication module 403 receives electromagnetic waves via an antenna, modulates the electromagnetic wave signals, filters the electromagnetic wave signals, and transmits the processed signals to the processor 401. The wireless communication module 403 may also receive a signal to be transmitted from the processor 401, frequency modulate and amplify the signal, and convert the signal to electromagnetic waves through an antenna to radiate. In some embodiments, the electronic device 100 may also probe or scan for devices in the vicinity of the electronic device 100 by transmitting signals through a bluetooth module (not shown in fig. 4), a WLAN module (not shown in fig. 4) in the wireless communication module 403, and establish a wireless communication connection with the nearby devices to transmit data. The bluetooth module may provide a solution including one or more bluetooth communications of classical bluetooth (BR/EDR) or bluetooth low energy (bluetooth low energy, BLE), and the WLAN module may provide a solution including one or more WLAN communications of Wi-Fi direct, wi-Fi LAN, or Wi-Fi softAP, among others.
The display 404 may be used to display images, video, etc. The display 404 may include a display panel. The display panel may employ a liquid crystal display (liquid crystal display, LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED) or an active-matrix organic light-emitting diode (matrix organic light emitting diode), a flexible light-emitting diode (flex), a mini, a Micro led, a Micro-OLED, a quantum dot light-emitting diode (quantum dot light emitting diodes, QLED), or the like. In some embodiments, electronic device 100 may include 1 or N displays 404, N being a positive integer greater than 1.
The camera 405 may be used to capture still images or video. The object generates an optical image through the lens and projects the optical image onto the photosensitive element. The photosensitive element may be a charge coupled device (charge coupled device, CCD) or a Complementary Metal Oxide Semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, which is then transferred to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV, or the like format. In some examples, electronic device 100 may include 1 or N cameras 405, N being a positive integer greater than 1.
The audio module 406 may be used to convert digital audio information to an analog audio signal output, and may also be used to convert an analog audio input to a digital audio signal. The audio module 406 may also be used to encode and decode audio signals. In some embodiments, the audio module 406 may also be provided in the processor 401, or part of the functional modules of the audio module 406 may be provided in the processor 401.
The microphone 407, which may also be referred to as a "microphone" or "microphone", may be used to collect a sound signal in the environment surrounding the electronic device, then convert the sound signal into an electrical signal, and then subject the electrical signal to a series of processes, such as analog-to-digital conversion, to obtain an audio signal in a digital form that may be processed by the processor 401 of the electronic device. When making a call or transmitting voice information, the user can sound near the microphone 407 through the mouth, inputting a sound signal to the microphone 407. The electronic device 100 may be provided with at least one microphone 407. In other embodiments, the electronic device 100 may be provided with two microphones 407, and may implement a noise reduction function in addition to collecting sound signals. In other embodiments, the electronic device 100 may also be provided with three, four or more microphones 407 to enable collection of sound signals, noise reduction, identification of sound sources, directional recording functions, etc.
The electronic device 100 may also include a sensor module (not shown in fig. 4) and/or a touch sensor (not shown in fig. 4). Touch sensors may also be referred to as "touch devices". The touch sensor may be disposed on the display screen 404, and the touch sensor and the display screen 404 form a touch screen, which is also referred to as a "touch screen". The touch sensor may be used to detect touch operations acting on or near it. Optionally, the sensor module may further include a gyro sensor (not shown in fig. 4), an acceleration sensor (not shown in fig. 4), and the like. Where the gyroscopic sensor may be used to determine a motion pose of the electronic device 100, in some embodiments, the electronic device 100 may determine an angular velocity of the electronic device 100 about three axes (i.e., x, y, and z axes) via the gyroscopic sensor. The acceleration sensor may be used to detect the acceleration of the electronic device 100 in various directions (typically x, y, and z axes), and may also detect the magnitude and direction of gravity when the electronic device 100 is stationary.
It should be noted that, the electronic device 100 shown in fig. 4 is only for exemplarily explaining the hardware structure of the electronic device provided by the present application, and does not limit the present application in particular.
Next, a software module of the electronic device 100 provided in the embodiment of the present application is described.
Referring to fig. 5, fig. 5 schematically illustrates software modules of an electronic device 100.
As shown in fig. 5, software modules in the electronic device 100 may include: a storage module 501, a system update module 502, and a loading module 503. Wherein:
the memory module 501 may be used to store a partition a system program and a partition B system program, which may include the boot image program described above. The memory module 501 may also store program codes to implement the method of the embodiment of the present application in an electronic device. Specific implementation may refer to the steps shown in the flowchart of fig. 2, and will not be described herein.
The system update module 502 may be configured to obtain a system update file from the cloud server side, and update a system program in the B partition to a system program of version 2 based on the system update file. The system update module 502 may also restart the electronic device 100 based on the boot image program of the B partition in RAM and the system program of version 2 in the B partition, such that the version 1 system on the electronic device 100 is updated to the version 2 system. Specific implementation may refer to the steps shown in the flowchart of fig. 2, and will not be described herein.
The loading module 503 may be configured to load the boot image program of the B partition in the ROM into the RAM, so that the system updating module 502 may cause the boot image program of the B partition on the RAM to run during the reboot of the electronic device 100. The loading module 503 may also load and run other system programs on the partition B except the boot image program into the RAM during the rebooting of the electronic device 100, so as to execute the rebooting operation of the electronic device 100. The specific implementation may refer to the steps shown in the flowchart of fig. 2, which are not described herein.
As used in the above embodiments, the term "when …" may be interpreted to mean "if …" or "after …" or "in response to determination …" or "in response to detection …" depending on the context. Similarly, the phrase "at the time of determination …" or "if detected (a stated condition or event)" may be interpreted to mean "if determined …" or "in response to determination …" or "at the time of detection (a stated condition or event)" or "in response to detection (a stated condition or event)" depending on the context.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, produces a flow or function in accordance with embodiments of the present application, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another, for example, by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means from one website, computer, cloud server, or data center. The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a cloud server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk), etc.
Those of ordinary skill in the art will appreciate that implementing all or part of the above-described method embodiments may be accomplished by a computer program to instruct related hardware, the program may be stored in a computer readable storage medium, and the program may include the above-described method embodiments when executed. And the aforementioned storage medium includes: ROM or random access memory RAM, magnetic or optical disk, etc.
Claims (10)
1. A device boot method applied to an electronic device, a read-only memory ROM in the electronic device including a first partition and a second partition, the first partition and the second partition being for storing a system program, the method comprising:
the electronic equipment loads a first system program in the first partition into an operating memory RAM, and operates the first system program;
the electronic equipment acquires a system update file from a cloud server; the electronic equipment updates a first system program in the second partition into a second system program based on the system update file;
when the size of the available space of the running memory is larger than or equal to a first threshold value and the coprocessor is in an idle state, the electronic equipment loads a starting mirror program of the second system program into the running memory by using the coprocessor;
When the electronic equipment is restarted, a mark corresponding to the starting mirror program of the second system program exists in the running memory, and the electronic equipment runs the starting mirror program of the second system program from the running memory.
2. The method according to claim 1, wherein the method further comprises:
when the size of the available space of the running memory is smaller than a first threshold value, the electronic equipment acquires the size of the space of the running memory in a first period based on a specified time interval;
and when the size of the available space of the running memory acquired by the electronic equipment in the first period is larger than or equal to a first threshold value, the electronic equipment judges whether the coprocessor is idle or not.
3. The method according to claim 1, wherein the method further comprises:
and when the coprocessor is not in an idle state and the CPU is in an idle state, the electronic equipment loads the starting mirror program of the second system program into the RAM by utilizing the CPU.
4. A method according to claim 3, wherein when the coprocessor is not in an idle state and a central processing unit CPU is in an idle state, the electronic device uses the CPU to load a boot image program of the second system program into RAM, specifically comprising:
The electronic equipment acquires the occupancy rate of the CPU;
when the occupancy rate of the CPU is larger than a second threshold value, the electronic equipment determines that the CPU is in an idle state;
and the electronic equipment loads a starting mirror image program of the second system program into the RAM by utilizing the CPU.
5. The method of claim 1, wherein the electronic device obtains a system update file from a cloud server, specifically comprising:
the electronic equipment receives a system update notification sent by the cloud server;
in response to a first input, the electronic device obtains the system update file from the cloud server.
6. The method according to claim 1, wherein when the electronic device is restarted, a flag corresponding to a boot image program of the second system program exists in the running memory, and before the electronic device runs the boot image program of the second system program from the running memory, the method further includes:
the electronic equipment displays prompt information of system downloading completion; the system downloading completion prompt information is used for prompting a user, and the first system program in the second partition is updated to be the second system program;
Responsive to a second input, the electronic device ceasing to run the first system program in the RAM;
the electronic device is restarted.
7. The method according to claim 1, wherein the method further comprises:
the electronic device copying the second system program in the second partition;
the electronic device writes the copied second system program into the first partition, so that the first system program in the first partition is updated to the second system program.
8. An electronic device, comprising: one or more processors, one or more memories, and a display screen; the one or more memories are coupled with one or more processors, the one or more memories being configured to store computer program code, the computer program code comprising computer instructions that, when executed by the one or more processors, cause the electronic device to perform the method of any of claims 1-7.
9. A computer readable storage medium comprising computer instructions which, when run on an electronic device, cause the electronic device to perform the method of any of claims 1-7.
10. A chip or chip system comprising processing circuitry and interface circuitry, the interface circuitry to receive code instructions and to transmit to the processing circuitry, the processing circuitry to execute the code instructions to perform the method of any of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210862826.3A CN116048628B (en) | 2022-07-21 | 2022-07-21 | Equipment starting method and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210862826.3A CN116048628B (en) | 2022-07-21 | 2022-07-21 | Equipment starting method and electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN116048628A CN116048628A (en) | 2023-05-02 |
CN116048628B true CN116048628B (en) | 2023-09-29 |
Family
ID=86124494
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210862826.3A Active CN116048628B (en) | 2022-07-21 | 2022-07-21 | Equipment starting method and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116048628B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117311840A (en) * | 2023-05-10 | 2023-12-29 | 荣耀终端有限公司 | Application starting method, electronic device and storage medium |
CN117234544B (en) * | 2023-11-14 | 2024-01-26 | 海马云(天津)信息技术有限公司 | Method and device for recovering system of server equipment |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1825283A (en) * | 2006-03-31 | 2006-08-30 | 浙江大学 | Method for implementing hardware image starting optimizing of embedded operating system |
CN101042651A (en) * | 2006-03-22 | 2007-09-26 | 华为技术有限公司 | Software updating method and system thereof |
CN102693139A (en) * | 2011-03-25 | 2012-09-26 | 比亚迪股份有限公司 | Method and system for wirelessly upgrading mobile phone software |
CN110825563A (en) * | 2019-10-22 | 2020-02-21 | RealMe重庆移动通信有限公司 | System recovery method and device and electronic equipment |
CN113821263A (en) * | 2021-06-15 | 2021-12-21 | 荣耀终端有限公司 | Management method, device, storage medium and computer program product of operating system |
-
2022
- 2022-07-21 CN CN202210862826.3A patent/CN116048628B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101042651A (en) * | 2006-03-22 | 2007-09-26 | 华为技术有限公司 | Software updating method and system thereof |
CN1825283A (en) * | 2006-03-31 | 2006-08-30 | 浙江大学 | Method for implementing hardware image starting optimizing of embedded operating system |
CN102693139A (en) * | 2011-03-25 | 2012-09-26 | 比亚迪股份有限公司 | Method and system for wirelessly upgrading mobile phone software |
CN110825563A (en) * | 2019-10-22 | 2020-02-21 | RealMe重庆移动通信有限公司 | System recovery method and device and electronic equipment |
CN113821263A (en) * | 2021-06-15 | 2021-12-21 | 荣耀终端有限公司 | Management method, device, storage medium and computer program product of operating system |
Also Published As
Publication number | Publication date |
---|---|
CN116048628A (en) | 2023-05-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN116048628B (en) | Equipment starting method and electronic equipment | |
CN112055424B (en) | Electronic device and method for switching electronic device | |
CN106445063B (en) | Method for managing application and electronic equipment thereof | |
US20220100490A1 (en) | Firmware updating method, and electronic apparatus and storage media for same | |
EP3772681A1 (en) | Electronic device and method for sharing data thereof | |
US11157264B2 (en) | Electronic device and method for controlling update of electronic device | |
KR20210037320A (en) | Method and electronic device for executing application | |
CN115328563B (en) | System starting method and electronic equipment | |
US20200201518A1 (en) | Method for starting application and electronic device for implementing same | |
US11740681B2 (en) | Electronic device and application managing method thereof | |
US20230367572A1 (en) | Patch Package Installation Method and Apparatus | |
US20240111595A1 (en) | Application deployment method, distributed operating system, electronic device, and storage medium | |
CN114096946A (en) | Method and apparatus for managing applications | |
US20210026807A1 (en) | Method for managing data associated with application and electronic device therefor | |
CN111726848B (en) | Equipment binding method, target starting device, fixed terminal and storage medium | |
US11455139B2 (en) | Electronic device and method for independently controlling a plurality of displays | |
CN115033193B (en) | Screen turning processing method and device, medium and electronic equipment | |
CN111596936A (en) | Application program updating method and device | |
CN116719556B (en) | System upgrading method and electronic equipment | |
CN116700738B (en) | Application management method, electronic equipment and system | |
CN117009023B (en) | Method for displaying notification information and related device | |
CN116661812B (en) | Equipment upgrading method, electronic equipment and system | |
WO2023202406A1 (en) | Display method and electronic device | |
CN116700660B (en) | Audio playing method and electronic equipment | |
WO2024083114A1 (en) | Software distribution method, electronic device, and system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |