Mode switching method and electronic device
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HUAWEI TECH CO LTD
- Filing Date
- 2025-01-08
- Publication Date
- 2026-07-14
AI Technical Summary
When switching modes in existing terminal devices, due to the hardware computing power performance, the mode switching time is too long and the user experience is poor.
By storing the service data of the main processor to a specific area of the internal memory in power saving mode, and directly obtaining data from the area when switching back to the operating mode for initialization, the step of loading multi-layer hardware and software architecture data from the external memory is avoided.
Significantly reduces mode switching time, improves user experience, reduces power consumption, and improves functional availability.
Smart Images

Figure CN122396992A_ABST
Abstract
Description
Mode switching method and electronic device
[0001] This application claims priority to the Chinese patent application with application number 202410041952.1 filed with the State Intellectual Property Office of China on January 10, 2024, and priority to the Chinese patent application with the invention name “A mode switching method and electronic device”, all contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of computer technology, and in particular to a mode switching method and electronic device. Background Art
[0003] Currently, terminal devices have a variety of operating modes, including working mode and power-saving mode. However, due to the limitations of the hardware computing power of terminal devices and the continuous upgrade of terminal device systems and business expansion, the above two operating modes cannot provide users with the expected functional effects, resulting in low functional availability and poor user experience. Summary of the Invention
[0004] The present application discloses a mode switching method and an electronic device, which can enable the operating mode of the electronic device to provide the required functional effects, improve functional availability, and thus enhance user experience.
[0005] In a first aspect, an embodiment of the present application provides a mode switching method, which is applied to an electronic device, wherein the electronic device includes a main processor, a coprocessor and an internal memory, and the operating mode of the electronic device includes a power saving mode and a working mode. In the power saving mode, the coprocessor works and the main processor does not work, and in the working mode, the main processor and the coprocessor work. The method includes: receiving a first operation, the first operation being used to switch the operating mode of the electronic device from the power saving mode to the working mode; controlling the main processor to power on; and obtaining first data from the internal memory, the first data being the business data of the main processor stored when the operating mode of the electronic device is switched from the working mode to the power saving mode.
[0006] In the above method, when the electronic device is in power saving mode, it can receive a first operation. In response to the first operation, it controls the main processor to power on and obtains first data from the internal memory to switch the electronic device to working mode. The first data is the business data of the main processor stored when the electronic device switches from working mode to power saving mode. The first data includes business data of the system's multi-layer software and hardware architecture. When the electronic device switches from power saving mode to working mode, based on the content and storage location of the first data, the electronic device can directly complete the initialization of the main processor, thereby solving the problem of long operating mode switching time, reducing the user's waiting time and anxiety, and improving the user experience.
[0007] In a possible implementation, after obtaining the first data from the internal memory, the method further includes: executing a first initialization process on the main processor according to the first data.
[0008] In the above method, after the electronic device obtains the first data, it can execute the first initialization process of the main processor according to the first data. In this way, the first data can be used to directly complete the initialization of the main processor, and the electronic device does not need to obtain relevant data from the external memory and load the relevant data of each layer in the multi-layer software architecture in sequence. It can be understood that the electronic device uses the first data to complete the loading of the business data of the multi-layer software and hardware architecture "at one time", thereby greatly reducing the time for switching the operating mode, thereby reducing the user's waiting time and improving the user experience.
[0009] In one possible implementation, before receiving the first operation, the method further includes: receiving a second operation, the second operation being used to switch the operating mode of the electronic device from the working mode to the power saving mode; storing the first data to the internal memory; and controlling the main processor to power off.
[0010] In the above method, when the electronic device is in working mode, it can receive a second operation. In response to the second operation, the service data of the current main processor in the multi-layer hardware and software architecture (i.e., the first data) is stored in the internal memory, the main processor is controlled to be powered off, and the internal memory is kept powered on, so that the electronic device switches to power saving mode. When the electronic device subsequently switches back to working mode, the first data can be directly read from the internal memory to complete the initialization of the main processor, thereby reducing the time the user waits for the mode switch and improving the user experience.
[0011] In one possible implementation, storing the first data in the internal memory includes: obtaining the first data from a first area in the internal memory, where the first area is used by the main processor to store data; and storing the first data in a second area in the internal memory, where the second area is different from the first area.
[0012] In the above method, the first area corresponds to the area where the main processor stores data, and the second area is a partial area of the first area, that is, the first area includes the second area, and the main processor stores the first data in the first area in an orderly manner in the second area of the internal memory. It can be understood that in the working mode, the main processor stores the business data in the entire area of the internal memory. When it is determined that it is necessary to switch to the power saving mode, the business data can be stored in a partial area of the internal memory (that is, the above-mentioned second area), which saves storage space of the internal memory and reduces the self-refresh area range of the internal memory, thereby reducing the power consumption of the electronic device, and also facilitates the subsequent direct acquisition of the first data from the small-scale second area, avoiding the need to filter the first data from the large-scale first area, saving the time for obtaining the first data, reducing the time for mode switching, and improving the user experience.
[0013] In a possible implementation, the third area in the internal memory is used by the coprocessor to store data.
[0014] In the above method, the internal memory also includes a third area, which corresponds to the area where the coprocessor stores data. In working mode, both the main processor and the coprocessor can access the internal memory, for example, the main processor can access the first area of the internal memory, and the coprocessor can access the third area of the internal memory; in power saving mode, only the coprocessor accesses the internal memory. The main processor and the coprocessor can work independently, switching the working state of the processor (for example, working or not working) according to user demands, thereby realizing the switching of the operating mode of the electronic device.
[0015] In one possible implementation, after storing the first data in the internal memory, the method further includes: the main processor sending a first message to the coprocessor, the first message including storage location information of the first data, and the storage location information of the first data is used to determine the refresh area of the internal memory in the power saving mode.
[0016] In the above method, the electronic device can set the self-refresh area of the internal memory in the power saving mode according to the storage location information of the first data, so that the data in the self-refresh area of the internal memory is periodically refreshed, and other areas of the internal memory except the self-refresh area are not refreshed, thereby ensuring the integrity of the stored first data, and the local area refresh reduces the power consumption of the electronic device compared to the global area refresh.
[0017] In a possible implementation, the storage location information of the first data includes: location information of the second area, or location information of the first data stored in the second area.
[0018] In the above method, the second area in the internal memory can be an area with a fixed address or an area with a variable address, so the location information of the second area can be fixed address information or variable address information, and the location information of the first data stored in the second area can be the address information corresponding to a partial area in the second area, and the partial area is used to store the first data.
[0019] In a possible implementation, the first message includes size information of the first data.
[0020] In the above method, the size information of the first data may be determined according to the location information of the first data stored in the second area.
[0021] In one possible implementation, after controlling the main processor to power off, the method further includes: adjusting the operating frequency of the internal memory to a first frequency, the first frequency being less than a second frequency, and the second frequency being the operating frequency of the internal memory in the working mode.
[0022] In the above method, in the power saving mode, the electronic device can reduce the operating frequency of the internal memory to meet the frequency range required by the coprocessor to access the internal memory, thereby reducing the power consumption of the electronic device.
[0023] In a possible implementation, the method further includes: if the first data is not stored in the internal memory, executing a second initialization process, and the duration of the second initialization process is longer than the duration of the first initialization process.
[0024] In the above method, when the first data is not stored in the internal memory, the electronic device can execute a second initialization process. The second initialization process, for example, includes obtaining relevant data from the external memory, and loading the relevant data of each layer in sequence according to the system's multi-layer hardware and software architecture (for example, but not limited to the kernel layer, system library, application framework layer, application layer, etc.). When all loading is completed, the initialization of the main processor is completed. The duration of the first initialization process (usually less than 5 seconds) is less than the duration of the second initialization process (usually 70 seconds), thereby solving the problem of long operating mode switching time, reducing the user's waiting time and anxiety, and improving the user experience.
[0025] In a second aspect, the present application provides an electronic device comprising a transceiver, a processor and a memory, wherein the memory is used to store a computer program, and the processor calls the computer program to execute the mode switching method in any possible implementation of the first aspect.
[0026] In a third aspect, the present application provides an electronic device comprising one or more processors and one or more memories. The one or more memories are coupled to the one or more processors, and the one or more memories are used to store computer program code, wherein the computer program code comprises computer instructions. When the one or more processors execute the computer instructions, the electronic device performs the mode switching method in any possible implementation of the first aspect described above.
[0027] In a fourth aspect, the present application provides a computer storage medium storing a computer program. When the computer program is executed by a processor, the mode switching method in any possible implementation of any of the above aspects is implemented.
[0028] In a fifth aspect, the present application provides a computer program product, which, when running on an electronic device, enables the electronic device to execute the mode switching method in any possible implementation of the first aspect above.
[0029] In a sixth aspect, the present application provides an electronic device, the electronic device including a method or apparatus for executing any one of the implementations of the first aspect of the present application. The electronic device is, for example, a chip. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] The following is an introduction to the drawings used in this application.
[0031] Figures 1 and 2 are schematic diagrams of some user interfaces provided by this application;
[0032] FIG3 is a schematic diagram of the hardware structure of an electronic device 100 provided in this application;
[0033] FIG4 is a schematic diagram of the hardware structure of another electronic device 100 provided in this application;
[0034] FIG5 is a schematic diagram of a software architecture of an electronic device 100 provided in this application;
[0035] FIG6 is a flow chart of a mode switching method provided by the present application;
[0036] FIG7 is a flow chart of another mode switching method provided by the present application;
[0037] FIG8 is a schematic diagram of the regional distribution of two types of internal memories provided by this application;
[0038] FIG9 is a flow chart of another mode switching method provided in the present application. DETAILED DESCRIPTION
[0039] The technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying drawings. In the description of the embodiments of the present application, unless otherwise specified, " / " represents or, for example, A / B can represent A or B; "and / or" in the text is merely a description of the association relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" refers to two or more than two.
[0040] In the following, the terms "first" and "second" are used for descriptive purposes only and should not be understood to imply or suggest relative importance or implicitly indicate the number of the technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of this application, unless otherwise specified, "plurality" means two or more.
[0041] In an embodiment of the present application, the electronic device may include a main processor and a coprocessor, and the operation mode of the electronic device may include a working mode and a power saving mode. In the working mode, the electronic device can use all functions normally. In this working mode, the main processor and the coprocessor of the electronic device both work / run, and the coprocessor can optionally work in the background, and the power consumption of the electronic device is relatively high. In the power saving mode, the electronic device can only use some functions and turn off some unnecessary functions, such as turning off mobile networks, wireless local area networks (WLAN), and other functions. In this power saving mode, the coprocessor of the electronic device works / runs, while the application processor does not work / run, and the power consumption of the electronic device is low, and the battery life is improved.
[0042] In the embodiment of the present application, the initialization process can be an initialization process executed by the main processor after the electronic device controls the main processor to be powered on. The initialization process can include a first initialization process and a second initialization process. The first initialization process and the second initialization process are different. The specific description can be seen below.
[0043] At present, due to the limitations of the hardware computing power of electronic devices, and with the continuous upgrading of electronic device systems and the expansion of business, the load on electronic devices when switching operating modes also increases, resulting in a longer time for operating mode switching. For example, in order to improve the endurance of electronic devices, when electronic devices switch from working mode to power saving mode, some unnecessary functions will be turned off, and the main processor will be controlled to be powered off so that the main processor is in an inoperative / non-operating state, thereby reducing power consumption. Then, when the electronic device switches from power saving mode back to working mode, it is necessary to control the main processor to power on and execute a process for initializing the main processor (which may be referred to as a second initialization process). The second initialization process includes, for example, obtaining relevant data from an external memory and loading the relevant data of each layer in sequence according to the multi-layer hardware and software architecture of the system (for example, but not limited to, including the kernel layer, system library, application framework layer, application layer, etc.). When all loading is completed, the main processor is initialized. The execution time of the second initialization process is long (usually 70 seconds), resulting in a longer waiting time for the user, low functional availability of the mode switching, and thus affecting the user experience.
[0044] The following takes manually switching the operating mode of an electronic device as an example to introduce the application scenario involved in the embodiment of the present application and the user interface diagram in this scenario.
[0045] Scenario 1: The operation mode of the electronic device 100 is switched from the working mode to the power saving mode.
[0046] As shown in FIG1(A), the electronic device 100 may display a user interface 110, which is a dial when the electronic device 100 is in working mode. The user interface 110 may include components such as time, weather, and a player. At this time, both the main processor and the coprocessor of the electronic device 100 are working. In one embodiment, the electronic device 100 may display a quick settings interface in response to a user operation on the user interface 110 (for example, the user operation is a downward sliding operation from the top of the dial). For a specific example, see the user interface 120 shown in FIG1(B).
[0047] As shown in FIG1(B), the user interface 120 may include multiple functional controls, such as controls for functions such as editing, draining, ultra-long battery life, and flight mode. The characters "Ultra-Long Battery Life" are displayed under the control 121 for the ultra-long battery life function, which can be used to enable the ultra-long battery life function of the electronic device 100, that is, to enable / switch to the power saving mode of the electronic device 100. In one embodiment, the electronic device 100 may display the user interface 130 shown in FIG1(C) in response to a user operation on the control 121 (for example, the user operation is a touch operation), and the power saving mode indicated by the control 121 is selected to be enabled. At this time, the electronic device 100 may display the user interface 140 shown in FIG1(D).
[0048] As shown in FIG1(C) , the user interface 130 is similar to the user interface 120 shown in FIG1(B) , except that the control 121 in the user interface 130 is in a selected state, which may indicate a triggering of switching to the power saving mode.
[0049] As shown in (D) of FIG1 , the user interface 140 may include text content 141, a control 142, and a control 143. The text content 141 may include the characters "After turning on, the battery life can be improved, and some functions such as mobile networks and WLAN will be unavailable. Do you want to turn it on?", the control 142 may be used to cancel turning on the power saving mode of the electronic device 100, and the control 143 may be used to determine whether to turn on the power saving mode of the electronic device 100. In one embodiment, the electronic device 100 may display the user interface 150 shown in (E) of FIG1 in response to a user operation on the control 143 (for example, the user operation is a touch operation), and the electronic device 100 may control the main processor to power off so that the electronic device 100 switches to the power saving mode. At this time, the electronic device 100 may display the user interface 160 shown in (F) of FIG1 .
[0050] As shown in FIG1(E), the user interface 150 may be a loading interface, indicating that the electronic device 100 is currently switching to the power saving mode. As shown in FIG1(F), the user interface 160 may be a dial when the electronic device 100 is in the power saving mode.
[0051] Without limitation, in another embodiment, the electronic device 100 may cancel the power saving mode of the electronic device 100 in response to a user operation (for example, the user operation is a touch operation) on the control 142 in the user interface 140 shown in (D) of Figure 1 , and the electronic device 100 may display the user interface 120 shown in (B) of Figure 1 .
[0052] Scenario 2: After FIG. 1 (A) to FIG. 1 (F) shown in Scenario 1, the operation mode of the electronic device 100 may be switched from the power saving mode back to the working mode.
[0053] As shown in FIG2(A), the electronic device 100 may display a user interface 210, which is a watch face when the electronic device 100 is in power saving mode. At this time, the coprocessor of the electronic device 100 is working, but the main processor is not working. In one embodiment, the electronic device 100 may display a quick settings interface in response to a user operation on the user interface 210 (for example, the user operation is a downward sliding operation from the top of the watch face). For a specific example, see the user interface 220 shown in FIG2(B).
[0054] As shown in FIG2(B), the user interface 220 may include multiple functional controls, such as controls for functions such as full-featured mode, settings, lock screen, and drainage. The characters "full-featured mode" are displayed under the control 221 of the full-featured mode function, which can be used to turn on / switch to the full-featured mode, i.e., the working mode, of the electronic device 100. In one embodiment, the electronic device 100 may display the user interface 230 shown in FIG2(C) in response to a user operation on the control 221 (e.g., the user operation is a touch operation), and select to turn on the working mode indicated by the control 221. At this time, the electronic device 100 may display the user interface 240 shown in FIG2(D).
[0055] As shown in FIG2(C), the user interface 230 is similar to the user interface 220 shown in FIG2(B), except that the control 221 in the user interface 230 is in a selected state, which can represent a trigger to switch to the working mode.
[0056] As shown in (C) of FIG2 , the user interface 240 may include text content 241, a control 242, and a control 243. The text content 241 may include the characters "After turning it on, you can get a complete watch experience: including the use of mobile networks, WLAN and other functions. Do you want to turn it on?", the control 242 may be used to cancel the working mode of the electronic device 100, and the control 243 may be used to determine whether to turn on the working mode of the electronic device 100. In one embodiment, the electronic device 100 may display the user interface 250 shown in (E) of FIG2 in response to a user operation on the control 243 (for example, the user operation is a touch operation), the electronic device 100 may control the main processor to power on, and execute the above-mentioned second initialization process to switch the electronic device 100 to the working mode. At this time, the electronic device 100 may display the user interface 260 shown in (F) of FIG2 .
[0057] As shown in FIG2(E), user interface 250 may be a loading interface, indicating that electronic device 100 is currently switching to working mode. As shown in FIG2(F), user interface 260 may be a dial when electronic device 100 is in power saving mode. User interface 260 may include components such as time, weather, and player.
[0058] Without limitation to this, in another embodiment, the electronic device 100 may cancel the working mode of the electronic device 100 in response to a user operation (for example, the user operation is a touch operation) on the control 242 in the user interface 240 shown in (D) of Figure 2. At this time, the electronic device 100 may keep the main processor powered off and not execute the second initialization process. The electronic device 100 may display the user interface 220 shown in (B) of Figure 2.
[0059] Among them, in the above scenario 2, when the operating mode of the electronic device is switched from the power saving mode to the working mode, the electronic device 100 displays the loading interface (i.e., the user interface 250) for a long time. It can be understood that the electronic device 100 takes a long time to switch from the power saving mode to the working mode, and the user also needs to wait for a long time, resulting in a poor user experience.
[0060] The embodiment of the present application proposes a mode switching method, which is applied to an electronic device, which includes a main processor, a coprocessor and an internal memory. When the electronic device is in a power saving mode, the electronic device can receive a first operation, which can be used to switch the operating mode from the power saving mode to the working mode. The first operation is, for example, the user operation on the control 243 in the user interface 240 in the above scenario 2. In response to the first operation, the electronic device can control the main processor to power on and obtain first data from the internal memory. The electronic device can perform a first initialization process based on the first data (i.e., load the first data and initialize the main processor) to switch the electronic device to the working mode. The first data can be the business data of the main processor stored when the electronic device switches from the working mode to the power saving mode (including data such as running services and cache processes), and the first data can include business data of the system's multi-layer software and hardware architecture. When the electronic device switches from the power saving mode to the working mode, based on the content and storage location of the first data, the electronic device can directly complete the initialization of the main processor, without the need for the electronic device to obtain relevant data from the external memory and load the relevant data of each layer in the multi-layer hardware and software architecture in sequence. It can be understood that the electronic device uses the first data to complete the loading of the business data of the multi-layer hardware and software architecture "at one time", wherein the duration of the first initialization process (usually less than 5 seconds) is less than the duration of the second initialization process (usually 70 seconds), thereby solving the problem of long operating mode switching time, reducing the user's waiting time and anxiety, and improving the user experience.
[0061] Moreover, before this, when the electronic device is in working mode, the electronic device can receive a second operation, which is used to switch the operating mode from working mode to power saving mode. The second operation is, for example, the user operation of the control 143 in the user interface 140 in the above scenario 1. In response to the second operation, the electronic device can first store the business data of the current main processor in the multi-layer hardware and software architecture (including data such as running services and cache processes) to the internal memory, control the main processor to power off, and keep the internal memory from being powered off, so that the electronic device switches to power saving mode. In addition, in power saving mode, the electronic device can reduce the operating frequency of the internal memory to meet the frequency range required for the coprocessor to access the internal memory, and also reduce the power consumption of the electronic device. In addition, the electronic device can set a self-refresh area of the internal memory (such as a partial area of the internal memory) so that the data (such as business data) in the self-refresh area of the internal memory is periodically refreshed, and other areas of the internal memory except the self-refresh area are not refreshed, thereby ensuring the integrity of the business data of the stored main processor, and the local area refresh further reduces the power consumption of the electronic device compared to the global area refresh.
[0062] In the embodiments of the present application, the electronic device may be a mobile phone, a tablet computer, a handheld computer, a desktop computer, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a personal digital assistant (PDA), smart home devices such as smart TVs, wearable devices such as smart bracelets, smart watches, and smart glasses, extended reality (XR) devices such as augmented reality (AR), virtual reality (VR), and mixed reality (MR), in-vehicle devices or smart city devices, etc. The present application does not impose any special restrictions on the specific type of electronic device.
[0063] In the embodiments of the present application, wearable devices may also be referred to as wearable smart devices or smart wearable devices, etc., which are a general term for wearable devices that are intelligently designed and developed by applying wearable technology to everyday wear, such as glasses, gloves, watches, clothing and shoes. A wearable device is a portable device that is worn directly on the body or integrated into the user's clothes or accessories. Wearable devices are not only hardware devices, but also achieve powerful functions through software support, data interaction, and cloud interaction. Broadly speaking, wearable smart devices include those that are full-featured, large in size, and can achieve complete or partial functions without relying on smartphones, such as smart watches or smart glasses, as well as those that only focus on a certain type of application function and need to be used in conjunction with other devices such as smartphones, such as various smart bracelets, smart helmets, smart jewelry, etc. for vital sign monitoring.
[0064] Next, the structure of an exemplary electronic device provided by an embodiment of the present application is introduced.
[0065] FIG3 exemplarily shows a schematic diagram of the hardware structure of an electronic device 100 .
[0066] As shown in FIG3 , the electronic device 100 may include a coprocessor, a main processor, and an internal memory. The coprocessor may communicate with the main processor via wired (e.g., universal serial bus (USB), twisted pair, coaxial cable, and optical fiber, etc.) and / or wireless (e.g., wireless local area network (WLAN), Bluetooth, and cellular communication network, etc.). The main processor may communicate with the internal memory via wired and / or wireless means, and the coprocessor may communicate with the internal memory via wired and / or wireless means. It is understandable that the main processor and the coprocessor share an internal memory, and both the main processor and the coprocessor can access the internal memory. Among them:
[0067] The main processor may include, but is not limited to, an application processor (AP) and a central processing unit (CPU). The coprocessor may include, but is not limited to, a graphics processing unit (GPU), an image signal processor (ISP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU).
[0068] Internal memory can be used to store data for the main processor and coprocessors, such as business data for running services and cached processes. Internal memory can include, but is not limited to, high-speed random access memory, such as double data rate (DDR) synchronous dynamic random access memory.
[0069] The main processor has strong computing power and high power consumption. When the main processor accesses the internal memory, the operating frequency of the internal memory needs to be kept in a relatively high range, such as greater than or equal to 200 MHz (for example, 200 MHz, 400 MHz, 800 MHz, and 1200 MHz). The coprocessor has weak computing power and low power consumption. When the coprocessor accesses the internal memory, the operating frequency of the internal memory needs to be kept in a relatively low range, such as less than or equal to 192 MHz (for example, 32 MHz, 48 MHz, 96 MHz, and 192 MHz).
[0070] It is understood that when the electronic device 100 is in working mode, both the application processor and the coprocessor are operating (optionally, the coprocessor is operating in the background), and the frequency of the internal memory needs to be maintained in a relatively high frequency range to support the normal operation of the application processor. When the electronic device 100 is in power saving mode, the application processor is not operating and only the coprocessor is operating. At this time, the coprocessor can adjust the frequency of the internal memory to a lower frequency range to support the normal operation of the coprocessor, thereby reducing power consumption.
[0071] FIG4 exemplarily shows a schematic diagram of the hardware structure of another electronic device 100 .
[0072] As shown in Figure 4, the electronic device 100 may include a main processor 110, a coprocessor 111, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a sensor module 180, a button 190, a motor 191, a display screen 194, optionally a camera 193, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a proximity light sensor 180G, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, and optionally a fingerprint sensor 180H, etc.
[0073] It is understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or combine or separate certain components, or arrange the components differently. For example, the electronic device 100 may not include the camera 193, and the sensor module 180 may not include the fingerprint sensor 180H. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0074] The main processor 110 may include, but is not limited to, an application processor (AP) and a central processing unit (CPU). The coprocessor 111 may include, but is not limited to, a graphics processing unit (GPU), an image signal processor (ISP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.
[0075] The main processor 110 may also include a memory for storing instructions and data. In one embodiment, the memory in the main processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by the main processor 110. If the main processor 110 needs to use the instruction or data again, it can directly call it from the memory. This avoids repeated accesses, reduces the waiting time of the main processor 110, and thus improves system efficiency.
[0076] The charging management module 140 is configured to receive charging input from a charger. The charger can be either a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 can receive charging input from the wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 can receive wireless charging input via the wireless charging coil of the electronic device 100. While charging the battery 142, the charging management module 140 can also provide power to the electronic device via the power management module 141.
[0077] The power management module 141 is used to connect the battery 142, the charging management module 140 and the main processor 110. The charging management module 140 and the battery 142 can be connected to the coprocessor 111.
[0078] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0079] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In another embodiment, the antenna can be used in conjunction with a tuning switch.
[0080] The mobile communication module 150 can provide wireless communication solutions for the electronic device 100, including second generation (2G) mobile communication technology, third generation (3G) mobile communication technology, fourth generation (4G) mobile communication technology, fifth generation (5G) mobile communication technology, and sixth generation (6G) mobile communication technology. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, filter and amplify the received electromagnetic waves, and transmit them to the modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation through the antenna 1.
[0081] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signal is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.) or displays an image or video through the display screen 194. In one embodiment, the modem processor may be an independent device. In another embodiment, the modem processor may be independent of the coprocessor 111 and be set in the same device as the mobile communication module 150 or other functional modules.
[0082] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the coprocessor 111. The wireless communication module 160 can also receive the signal to be sent from the coprocessor 111, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0083] In one embodiment, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with a network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).
[0084] Electronic device 100 implements display functionality through a GPU, display screen 194, and an application processor. A GPU is a microprocessor for image processing that connects display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Coprocessor 111 may include one or more GPUs that execute program instructions to generate or modify display information.
[0085] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-oLed, or a quantum dot light-emitting diode (QLED). In one embodiment, electronic device 100 may include one or N display screens 194, where N is a positive integer greater than 1.
[0086] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the main processor 110 through the external memory interface 120 to implement data storage.
[0087] The internal memory 121 is connected to the main processor 110 and the coprocessor 111, and can be used to store computer executable program codes, and the executable program codes include instructions. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The main processor 110 and the coprocessor 111 execute various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121.
[0088] The electronic device 100 can implement audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, and the application processor.
[0089] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In one embodiment, the audio module 170 can be provided in the coprocessor 111, or some functional modules of the audio module 170 can be provided in the coprocessor 111.
[0090] The speaker 170A, also called a "horn", is used to convert audio electrical signals into sound signals.
[0091] The receiver 170B, also called a "handset", is used to convert audio electrical signals into sound signals.
[0092] Microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals.
[0093] The pressure sensor 180A is used to sense pressure signals and convert them into electrical signals. In one embodiment, the pressure sensor 180A can be set on the display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. A capacitive pressure sensor can be a device comprising at least two parallel plates with conductive material. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of the pressure based on the change in capacitance. When a touch operation is applied to the display screen 194, the electronic device 100 detects the intensity of the touch operation based on the pressure sensor 180A. The electronic device 100 can also calculate the position of the touch based on the detection signal of the pressure sensor 180A. In one embodiment, touch operations acting on the same touch position but with different touch operation intensities can correspond to different operation instructions.
[0094] The gyro sensor 180B may be used to determine the motion posture of the electronic device 100. In one embodiment, the angular velocity of the electronic device 100 around three axes (ie, x, y, and z axes) may be determined by the gyro sensor 180B.
[0095] The air pressure sensor 180C is used to measure air pressure. In one embodiment, the electronic device 100 calculates the altitude using the air pressure value measured by the air pressure sensor 180C to assist in positioning and navigation.
[0096] The magnetic sensor 180D includes a Hall sensor, and the electronic device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip leather case.
[0097] The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in various directions (generally three axes).
[0098] The proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device 100 emits infrared light outward through the light emitting diode. The electronic device 100 uses the photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100.
[0099] The ambient light sensor 180L is used to sense the brightness of the ambient light. The electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the sensed brightness of the ambient light.
[0100] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locks, fingerprint photography, fingerprint call answering, etc.
[0101] The temperature sensor 180J is used to detect temperature.
[0102] The touch sensor 180K is also called a "touch device". The touch sensor 180K can be set on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen". The touch sensor 180K is used to detect touch operations acting on or near it. In one embodiment, in working mode, the touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. In another embodiment, in power saving mode, the touch sensor can pass the detected touch operation to the coprocessor 111 to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be set on the surface of the electronic device 100, which is different from the position of the display screen 194.
[0103] The buttons 190 include a power button, a volume button, and the like. The buttons 190 may be mechanical buttons or touch buttons. The electronic device 100 may receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 100.
[0104] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts and touch vibration feedback. Motor 191 can also correspond to different vibration feedback effects for touch operations on different areas of the display 194. Different application scenarios (for example: time reminders, receiving messages, alarm clocks, etc.) can also correspond to different vibration feedback effects. Touch vibration feedback effects can also support customization.
[0105] The SIM card interface 195 is used to connect a SIM card.
[0106] The software system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a microservice architecture, or a cloud architecture. For example, the software system with a layered architecture can be an Android system, a Harmony operating system (OS), or other software systems. The embodiment of the present application takes the Android system with a layered architecture as an example to illustrate the software structure of the electronic device 100.
[0107] FIG5 exemplarily shows a schematic diagram of a software architecture of an electronic device 100 .
[0108] A layered architecture divides software into several layers, each with distinct roles and responsibilities. Layers communicate with each other through software interfaces. In one implementation, the Android system is divided into four layers: application layer (Application), application framework layer (Framework), system library (Native), and kernel layer (Kernel).
[0109] The application layer can include a series of application packages.
[0110] As shown in FIG5 , the application package may include applications such as camera, music, calendar, short message, navigation, and negative one screen.
[0111] The application framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The application framework layer includes some predefined functions.
[0112] As shown in FIG5 , the application framework layer may include a desktop manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like.
[0113] The desktop manager is used to manage desktop programs. It can obtain the display size, determine whether there is a status bar, lock the screen, take screenshots, etc.
[0114] Content providers are used to store and retrieve data and make it accessible to applications. The data may include video, images, audio, dialed and received calls, phone books, etc.
[0115] The view system includes visual controls, such as those for displaying text and images. The view system is used to build applications. A display interface can consist of one or more views. For example, a display interface containing a text notification icon might include a view for displaying text and a view for displaying images.
[0116] The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including answering, hanging up, etc.).
[0117] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0118] The notification manager enables applications to display notifications in the status bar. These messages can be displayed briefly and then disappear automatically, without requiring user interaction. For example, the notification manager is used to display message reminders. The notification manager can also display notifications in the form of dialog windows on the screen. Examples include text messages in the status bar, audible alerts, vibrations on electronic devices, and flashing indicator lights.
[0119] The system library can include multiple functional modules, such as media libraries, 3D graphics processing libraries (such as OpenGL ES), and 2D graphics engines (such as SGL).
[0120] The media library supports playback and recording of a variety of common audio and video formats, as well as static image files. The media library can support a variety of audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0121] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0122] A 2D graphics engine is a drawing engine for 2D drawings.
[0123] The kernel layer is the layer between hardware and software. The kernel layer includes at least display driver, camera driver, audio driver, and sensor driver.
[0124] The following describes the workflow of the software and hardware of the electronic device 100 in conjunction with the mode switching scenario.
[0125] When the electronic device 100 is in working mode, when the touch sensor 180K receives a touch operation, the corresponding hardware interrupt is sent to the kernel layer. The kernel layer processes the touch operation into a raw input event (including touch coordinates, timestamp of the touch operation, and other information). The raw input event is stored in the kernel layer. The application framework layer obtains the raw input event from the kernel layer and identifies the control corresponding to the input event. Taking the touch operation as a touch single-click operation, and the control corresponding to the single-click operation as an example, the application is set to call the interface of the application framework layer, and then control the display driver by calling the kernel layer, and display the loading interface for starting the power saving mode through the display screen 194. The loading interface is, for example, the user interface 150 shown in (E) of Figure 1.
[0126] Next, the mode switching method provided by the embodiment of the present application is introduced.
[0127] Please refer to Figure 6, which is a flow chart of a mode switching method provided in an embodiment of the present application. The method can be applied to the mode switching scenario shown in Figure 1. The method can be applied to the electronic device 100 shown in Figure 3. The method can be applied to the electronic device 100 shown in Figure 4. The method can be applied to the electronic device 100 shown in Figure 5. The method can include but is not limited to the following steps:
[0128] S101: The main processor obtains a first event.
[0129] In one embodiment, the current operating mode of the electronic device 100 is the working mode, and the main processor and coprocessor in the electronic device 100 are both working, and the coprocessor can optionally work in the background. In one embodiment, when the operating mode of the electronic device 100 is the working mode, the operating frequency of the internal memory is frequency 1, and frequency 1 is, for example, greater than or equal to 200 MHZ (e.g., 200 MHZ, 400 MHZ, 800 MHZ, 1200 MHZ). In some examples, when the operating mode of the electronic device 100 is the working mode, the user interface 110 shown in FIG. 1 (A) can be displayed.
[0130] In one embodiment, the electronic device 100 can receive a first user operation and obtain a first event based on the first user operation. The first user operation can be used to switch the operating mode from the working mode to the power saving mode. The first user operation is, for example, a touch operation on the control 143 in the user interface 140 in the scene 1 shown in Figure 1.
[0131] In one embodiment, the first event may be an event for switching the operating mode of the electronic device 100 from the working mode to the power saving mode. In some examples, the first event may be generated by user triggering. For example, the first event includes a first user operation. When the electronic device 100 is in the working mode, the touch sensor may receive the first user operation, and the corresponding hardware interrupt is sent to the kernel layer of the main processor. The main processor may process the first user operation into the first event. In other examples, the first event may be generated by the electronic device 100 itself. For example, the first event includes detecting the power level of the electronic device 100. When the electronic device 100 is in the working mode, the first event may be generated when the electronic device 100 detects that the current remaining power level is less than a first power threshold.
[0132] S102: The main processor executes a first process according to a first event.
[0133] In one embodiment, the first process may include closing services that are already open and / or cached. After the main processor receives the first event, it may determine that it is necessary to switch to a power saving mode. The main processor may close the currently running services / businesses and cached processes of the electronic device 100 to facilitate the subsequent power-off of the main processor.
[0134] S103: The main processor obtains first data according to the first event.
[0135] In one embodiment, the first data may be business data of the main processor, which business data may include, for example but not limited to, data such as services and cache processes currently running on the electronic device 100. The first data may include business data of the system's multi-layer hardware and software architecture.
[0136] In one embodiment, the internal memory can be divided into multiple areas, such as a first area and a third area. Different areas can be used for different types of processors to store data. The first area can be used for the main processor to store data (e.g., first data), and the third area can be used for the coprocessor to store data. That is, the first area can correspond to the area where the main processor stores data, and the third area can correspond to the area where the coprocessor stores data. In some examples, the regional distribution diagram of the internal memory can be seen in Figure 8 below, which is not described in detail for the time being.
[0137] In one embodiment, after obtaining the first event, the main processor may determine that it is necessary to switch to the power saving mode and obtain the first data from the first area in the internal memory.
[0138] The order of S102 and S103 is not limited.
[0139] S104: The main processor stores the first data in a regular manner in the second area of the internal memory.
[0140] In one embodiment, the second region may be a partial region of the first region, that is, the first region includes the second region.
[0141] In one embodiment, the second area may be an area with a fixed address in the first area. In some examples, assuming that the starting address corresponding to the first area is 1 and the end address corresponding to the first area is 100, that is, the address range corresponding to the first area is [1,100], and the second area is, for example, an area corresponding to the address range [1,10] in the first area. It can be understood that when the main processor determines that it needs to switch to power saving mode, the main processor can store the business data of the main processor in [1,10] each time.
[0142] In another embodiment, the second area may be an area with a variable address in the first area. In some examples, assuming that the address range corresponding to the first area is still [1,100], the second area is, for example, an area corresponding to the address range [a,b] in the first area, where a is less than b, a is greater than or equal to 1, b is less than or equal to 100, and b is not equal to 100 when a is equal to 1. It can be understood that when the main processor determines that it needs to switch to power saving mode at the first moment, the business data of the main processor can be stored in [a1,b1]. When the main processor determines again that it needs to switch to power saving mode at the second moment (the second moment is different from the first moment), the business data of the main processor can be stored in [a2,b2], where a1 is not equal to a2, and / or b1 is not equal to b2. The size descriptions of [a1,b1] and [a2,b2] can refer to the size description of [a,b].
[0143] In one embodiment, the main processor can regularly store the first data in the first area to the second area of the internal memory. It can be understood that in the working mode, the main processor stores the business data in the entire area of the internal memory. When the first event (for switching to the power saving mode) is obtained, the main processor can store the business data in a partial area of the internal memory (i.e., the second area).
[0144] In one embodiment, after the main processor stores the first data in the second area, it can determine the location information of the second area and the size information of the first data. The location information of the second area may include the starting address and ending address (i.e., the address range) corresponding to the second area. The size information of the first data may be determined based on the specific location of the first data stored in the second area. In some examples, assuming that the address range of the second area is [1, 10], the location information of the second area may include the address range [1, 10]. Assuming that the specific location of the first data stored in [1, 10] is [1, 2], the main processor can determine the size information of the first data based on [1, 2].
[0145] S105: The main processor sends a first message (including storage location information of the first data) to the coprocessor.
[0146] In one embodiment, the first message may include storage location information of the first data, and the storage location information of the first data may include location information of the second area, or specific location information of the first data stored in the second area, wherein the location information of the second area may be fixed address information or variable address information, and the specific location information of the first data stored in the second area may be address information corresponding to a partial area in the second area. For specific instructions, please refer to the instructions in S104 and will not be repeated here.
[0147] In one embodiment, after receiving the first message, the coprocessor can mark and store the first flag bit. The first flag bit can instruct the main processor to store the first data in the internal memory (for example, the storage location of the first data). When the coprocessor is subsequently triggered to switch back to the working mode, the coprocessor detects the first data and sends a third event to the main processor. For specific instructions, please refer to S202-S203 in Figure 7 below, which will not be described in detail for the time being.
[0148] S106: The main processor is powered off.
[0149] In one embodiment, the electronic device 100 can control the main processor, external devices and chip integrated system-on-chip (SOC) to power off, and keep the internal memory powered on, so that the electronic device 100 switches the operating mode from working mode to power saving mode.
[0150] S107: The coprocessor detects whether the main processor is powered off.
[0151] In one implementation, after receiving the first message, the coprocessor may detect whether the main processor is powered off.
[0152] The order of S106 and S107 is not limited.
[0153] S108: The coprocessor adjusts the operating frequency of the internal memory.
[0154] In one embodiment, S108 is an optional step.
[0155] In one embodiment, when the coprocessor detects that the main processor is powered off, it can be determined that the current operating mode of the electronic device 100 is a power saving mode, the main processor in the electronic device 100 is not working, and only the coprocessor is working. At this time, the electronic device 100 can display the user interface 160 shown in (F) of Figure 1.
[0156] In one embodiment, the coprocessor can adjust the operating frequency of the internal memory (e.g., the main frequency) to frequency 2, where frequency 2 is less than frequency 1, and frequency 2 is, for example, less than or equal to 192 MHZ (e.g., 32 MHZ, 48 MHZ, 96 MHZ, 192 MHZ). The adjusted frequency 2 can meet the frequency range required for the coprocessor to access the internal memory, and also reduces the power consumption of the electronic device 100.
[0157] S109: The coprocessor sets a self-refresh area of the internal memory according to the first message.
[0158] In one embodiment, S109 is an optional step.
[0159] In one embodiment, the self-refresh area may be a partial area in the internal memory, and the self-refresh area may be related to the second area. For example, the self-refresh area may be the second area or a partial area of the second area (eg, an area storing the first data).
[0160] In one embodiment, the coprocessor can set the self-refresh area of the internal memory in the power saving mode according to the received first message, so that the data in the self-refresh area of the internal memory (such as the above-mentioned first data) is periodically refreshed. In some examples, assuming that the storage location information of the first data includes the location information of the second area, and the address range of the second area is, for example, [1,10], the coprocessor can set the second area storing the first data as the self-refresh area, that is, the self-refresh area is [1,10], and the internal memory can periodically refresh (for example, refresh once every 10 seconds) the first data stored in [1,10], thereby ensuring the integrity of the business data (that is, the first data) of the stored main processor. In addition, other areas in the internal memory except the self-refresh area are not refreshed, that is, the local area of the internal memory is refreshed instead of the entire area, which further reduces the power consumption of the electronic device.
[0161] In one embodiment, the electronic device 100 may only execute S108, or only execute S109, or execute S108-S109. When the electronic device 100 only executes S108, the electronic device 100 may no longer set a self-refresh area for the internal memory. In this case, the internal memory may periodically refresh the entire area, increasing power consumption. When the electronic device 100 only executes S109, the electronic device 100 may no longer reduce the operating frequency of the internal memory, but instead maintain the operating frequency of the internal memory at frequency 1. Accordingly, the power consumption of the internal memory during partial self-refresh increases.
[0162] The present invention is not limited to the case where the main processor stores the first data in an orderly manner in the second area of the internal memory as shown in the example of FIG6 . In another embodiment, after the main processor obtains the first data, it can directly store the first data in the first area of the internal memory rather than in the second area of the first area. This method does not require the main processor to perform an orderly storage process, is suitable for main processors with average / poor computing performance, expands the application scenarios of mode switching, and improves user experience.
[0163] In the method shown in Figure 6, when the electronic device is in working mode, the electronic device can receive a first user operation, which is used to switch the operating mode from working mode to power saving mode. In response to the first user operation, the electronic device can first store the business data (i.e., first data) of the current main processor in the multi-layer hardware and software architecture to the internal memory, control the main processor to power off, and keep the internal memory from being powered off, so that the electronic device switches to power saving mode. In addition, in power saving mode, the electronic device can reduce the operating frequency of the internal memory to meet the frequency range required for the coprocessor to access the internal memory, and also reduce the power consumption of the electronic device. In addition, the electronic device can set a self-refresh area of the internal memory so that the first data in the self-refresh area of the internal memory is periodically refreshed, and other areas of the internal memory except the self-refresh area are not refreshed, thereby ensuring the integrity of the first data stored in the main processor, and the local area refresh further reduces the power consumption of the electronic device compared to the global area refresh.
[0164] Please refer to Figure 7, which is a flowchart of another mode switching method provided by an embodiment of the present application. This method can be applied to the mode switching scenario shown in Figure 2. This method can be applied to the electronic device 100 shown in Figure 3. This method can be applied to the electronic device 100 shown in Figure 4. This method can be applied to the electronic device 100 shown in Figure 5. This method can include but is not limited to the following steps:
[0165] S201: The coprocessor obtains a second event.
[0166] In one embodiment, before S201 , S101 - S109 of FIG. 6 may also be included.
[0167] In one embodiment, the electronic device 100 is currently operating in a power saving mode, and the main processor in the electronic device 100 is not operating, with only the coprocessor operating. In one embodiment, when the electronic device 100 is operating in the power saving mode, the operating frequency of the internal memory is frequency 2. In some examples, when the electronic device 100 is operating in the power saving mode, the user interface 210 shown in FIG. 2(A) may be displayed.
[0168] In one embodiment, the electronic device 100 can receive a second user operation and obtain a second event based on the second user operation. The second user operation can be used to switch the operating mode from the power saving mode to the working mode. The second user operation is, for example, a touch operation on the control 243 in the user interface 240 in the scene 2 shown in Figure 2.
[0169] In one embodiment, the second event may be an event for switching the operating mode of the electronic device 100 from the power saving mode to the working mode. In some examples, the second event may be generated by user triggering. For example, the second event includes a second user operation. When the electronic device 100 is in the power saving mode, the touch sensor may receive the second user operation, and the corresponding hardware terminal is sent to the kernel layer of the coprocessor. The coprocessor may process the second user operation into a second event. In other examples, the second event may be generated by the electronic device 100 itself. For example, the second event includes detecting the power level of the electronic device 100. When the electronic device 100 is in the power saving mode, the second event may be generated when the electronic device 100 detects that the current remaining power level is greater than the second power threshold. For another example, the second event includes detecting an incoming call reminder of the electronic device 100. When the electronic device 100 detects an incoming call reminder, the second event may be generated.
[0170] S202: The coprocessor detects first data.
[0171] In one embodiment, after the coprocessor obtains the second event, it can determine that it is currently necessary to switch to the working mode. The coprocessor determines that the first flag is currently stored and can detect the first data based on the storage location information of the first data. For example, based on the storage location of the first data, the first data corresponding to the storage location in the internal memory is detected. The description of the first flag can be found in S105 of Figure 6.
[0172] In one embodiment, after the coprocessor receives the second event, it can detect the first data after the latest / most recent internal memory self-refresh, for example, to detect the integrity of the first data. It is understandable that in power saving mode, the internal memory stores the service data of the main processor (i.e., the first data) and continuously self-refreshes. Therefore, obtaining the most recently refreshed service data in the internal memory to detect the integrity of the first data is more accurate and more consistent with actual conditions.
[0173] In some examples, if the first difference between the time when the internal memory was last self-refreshed and the time when the second event is currently obtained is less than or equal to a first threshold, the coprocessor can directly detect the first data based on the flag of the first data. If the above-mentioned first difference is greater than or equal to the second threshold, the coprocessor can self-refresh again and then detect the first data based on the flag of the first data. For example, assuming that the cycle of the internal memory self-refresh data is 10 seconds, the time between the time when the coprocessor obtains the second event and the time of the most recent self-refresh is 1 second (assuming it is less than the first threshold), it can be understood that the coprocessor obtains the second event 1 second after the internal memory self-refreshes the data, and therefore, the coprocessor can directly detect the current first data. For another example, assuming that the time between the time when the coprocessor obtains the second event and the time of the most recent self-refresh is 9 seconds (assuming it is greater than the second threshold), it can be understood that the coprocessor obtains the second event 9 seconds after the internal memory self-refreshes the data. At this time, the coprocessor can wait for 1 second to self-refresh again and detect the first data after the second self-refresh.
[0174] S203: The coprocessor sends a third event to the main processor.
[0175] In one embodiment, when the coprocessor detects that the first data is complete, the coprocessor may send a third event to the main processor. The third event may be used to power on the main processor, which may be understood as the coprocessor waking up the main processor.
[0176] S204: The main processor is powered on according to the third event.
[0177] In one embodiment, the main processor may be powered on after receiving the third event to execute the first initialization process (ie, execute S205-S206 below). The electronic device 100 may also control external devices and the SOC to be powered on, while the internal memory remains powered on.
[0178] In one embodiment, after the main processor is powered on, the internal memory may be initialized and the operating frequency of the internal memory may be adjusted to frequency 1. The adjusted frequency 1 may meet the frequency range required by the main processor to access the internal memory.
[0179] In one embodiment, after the internal memory is initialized, the self-refresh area of the internal memory becomes the entire area of the internal memory. It can be understood that at this time, the self-refresh area of the internal memory is changed from the entire area of the above-mentioned second area or a part of the second area to the entire area of the internal memory (including the first area and the third area).
[0180] S205: The main processor obtains first data from the second area in the internal memory according to the third event.
[0181] In one embodiment, after the main processor is powered on, the first data may be directly obtained from the second area in the internal memory according to the storage location of the first data.
[0182] S206: The main processor loads and initializes the system according to the first data.
[0183] In one embodiment, the main processor can directly resume loading of the service data of the multi-layer software and hardware architecture according to the first data, that is, directly complete the initialization of the main processor.
[0184] In one embodiment, after S206 , the operation mode of the electronic device 100 is switched to the working mode, and both the main processor and the coprocessor in the electronic device 100 are working. At this time, the electronic device 100 can display the user interface 260 shown in (F) of FIG. 2 .
[0185] Not limited to the embodiment shown in FIG7 , in another embodiment, in S202 , when the coprocessor detects that the first data is incomplete (e.g., does not include the first data), the coprocessor may send a fourth event to the main processor. Subsequently, the main processor may be powered on according to the fourth event and execute a second initialization process, which may include, for example, obtaining relevant data from an external memory and sequentially loading relevant data for each layer of the system's multi-layer hardware and software architecture (e.g., but not limited to, a kernel layer, a system library layer, an application framework layer, and an application layer). Initialization of the main processor is completed when all loading is complete.
[0186] Not limited to the example of FIG7 in which the coprocessor detects the first data, in another embodiment, S202 may not be included. Instead, the coprocessor sends a fifth event to the main processor based on the second event. The fifth event may indicate that the operating mode should be switched to the working mode. The main processor may then power on based on the fifth event and detect whether data is stored in the internal memory. If the first data is detected to be stored in the internal memory, the main processor may retrieve the first data and load and initialize the system based on the first data. If the internal memory is detected to be empty, the main processor may execute the second initialization process.
[0187] In the method shown in FIG7 , when the electronic device is in power saving mode, the electronic device may receive a second user operation, which may be used to switch the operating mode from power saving mode to working mode. In response to the second user operation, the electronic device may control the main processor to power on and obtain first data from the internal memory. The electronic device may perform a first initialization process based on the first data (i.e., load the first data and initialize the main processor) to switch the electronic device to working mode. The first data is the business data of the main processor stored when the electronic device switches from working mode to power saving mode (including data such as running services and cached processes), and the first data includes business data of the system's multi-layer software and hardware architecture. When the electronic device switches from the power saving mode to the working mode, based on the content and storage location of the first data, the electronic device can directly complete the initialization of the main processor, without the need for the electronic device to obtain relevant data from the external memory and load the relevant data of each layer in the multi-layer hardware and software architecture in sequence. It can be understood that the electronic device uses the first data to complete the loading of the business data of the multi-layer hardware and software architecture "at one time", wherein the duration of the first initialization process (usually less than 5 seconds) is less than the duration of the second initialization process (usually 70 seconds), thereby solving the problem of long operating mode switching time, reducing the user's waiting time and anxiety, and improving the user experience.
[0188] The specific implementation process of the electronic device 100 in the mode switching scenario is exemplified below with reference to the schematic diagram of regional distribution of two internal memories shown in FIG8 .
[0189] As shown in FIG8 (A) and FIG8 (B), the internal memory can be divided into multiple areas, and the multiple areas can include a first area and a third area, wherein the first area is an area for storing data for the main processor, and the third area is an area for storing data for the coprocessor. In the working mode, both the main processor and the coprocessor can access the internal memory. For example, the main processor can access the first area of the internal memory, and the coprocessor can access the third area of the internal memory. In the power saving mode, the main processor does not work and cannot access the internal memory, and the coprocessor can access the first and third areas of the internal memory.
[0190] In one embodiment, when the electronic device 100 determines that the operating mode needs to be switched from the working mode to the power saving mode, the business data of the main processor can be stored in a regular manner in the second area of the first area, and the second area is a partial area of the first area, as shown in (A) of Figure 8. Subsequently, the electronic device 100 can set the self-refresh area of the internal memory according to the second area, so that the self-refresh area in the internal memory periodically refreshes the data, and other areas except the self-refresh area are not refreshed. For example, the second area is directly set as the self-refresh area, and the areas except the second area in the third area and the first area are not refreshed, thereby reducing the power consumption of the electronic device. Then, when the electronic device 100 determines that the operating mode needs to be switched from the power saving mode back to the working mode, the first data can be directly obtained from the second area, avoiding filtering the first data from the first area, saving the time to obtain the first data, reducing the time the user waits for the mode switch, and improving the user experience.
[0191] In another embodiment, when the electronic device 100 determines that the operating mode needs to be switched from the working mode to the power saving mode, the business data of the main processor can be directly stored in the first area, as shown in (B) of Figure 8. This method does not require the main processor to perform a regular storage process, is suitable for main processors with average / poor computing performance, and expands the application scenarios of mode switching. Subsequently, the electronic device 100 can set the self-refresh area of the internal memory according to the first area, for example, directly setting the first area as the self-refresh area, and not refreshing the third area. Compared with setting the second area as the self-refresh area, this method has a larger range of the self-refresh area, so the power consumption will increase. Then, when the electronic device 100 determines that the operating mode needs to be switched from the power saving mode back to the working mode, it can obtain the first data from the first area again and initialize the main processor according to the first data.
[0192] Please refer to Figure 9, which is a flowchart of another mode switching method provided by an embodiment of the present application. The method can be applied to the mode switching scenarios shown in Figures 1 and 2. The method can be applied to the electronic device 100 shown in Figure 3. The method can be applied to the electronic device 100 shown in Figure 4. The method can be applied to the electronic device 100 shown in Figure 5. The method can include but is not limited to the following steps:
[0193] S301: The electronic device receives a first operation.
[0194] In one embodiment, the electronic device is currently operating in a power saving mode, and the main processor in the electronic device is not operating, with only the coprocessor operating. In one embodiment, when the electronic device is operating in the power saving mode, the operating frequency of the internal memory is a first frequency. The description of the first frequency can be found in the description of frequency 2 in S201 of FIG. 7 , and is not repeated here.
[0195] In one embodiment, the first operation can be used to switch the operating mode of the electronic device from the power saving mode to the working mode. The electronic device can receive the first operation and, in response to the first operation, determine that it is currently necessary to switch to the working mode. For specific instructions, please refer to the instructions for the electronic device 100 receiving the second user operation in S201 of Figure 7, which will not be repeated here.
[0196] In one embodiment, before S301, the electronic device can receive a second operation, store the first data in the internal memory, and control the main processor to power off, wherein the second operation can be used to switch the operating mode of the electronic device from the working mode to the power saving mode. For specific instructions, please refer to the description of S101-S106 in Figure 6, which will not be repeated here.
[0197] In one embodiment, the electronic device can obtain first data from a first area in the internal memory and store the first data in a second area in the internal memory. For specific instructions, please refer to the instructions in S104 of Figure 6. The first area is used for the main processor to store data. The second area is different from the first area. The second area can be a partial area in the first area. For the description of the first area, please refer to the description of the first area in S103 of Figure 6. For the description of the second area, please refer to the description of the second area in S104 of Figure 6. No further details will be given.
[0198] In one embodiment, the third area in the internal memory is used for the coprocessor to store data. For the description of the third area, please refer to the description of the third area in S103 of FIG6 , which will not be repeated here.
[0199] In one embodiment, after the electronic device stores the first data in the internal memory, the main processor can send a first message to the coprocessor. The first message may include storage location information of the first data. For details, please refer to the description of S105 in Figure 6. The storage location information of the first data can be used to determine the refresh area of the internal memory in the power saving mode. For details, please refer to the description of S109 in Figure 6, which will not be repeated here.
[0200] In one embodiment, the storage location information of the first data may include the location information of the second area, or the location information of the first data stored in the second area. The location information of the second area may be fixed address information or variable address information. The location information of the first data stored in the second area may be address information corresponding to a partial area in the second area. For specific instructions, please refer to the description of S104 in Figure 6 and will not be repeated here.
[0201] In one embodiment, the first message may include size information of the first data. The size information of the first data may be determined based on a specific location where the first data is stored in the second area. For details, please refer to S104 in FIG. 6 , which will not be repeated here.
[0202] In one embodiment, after the electronic device controls the main processor to power off, the operating frequency of the internal memory can be adjusted to a first frequency, where the first frequency is less than the second frequency. The second frequency is the operating frequency of the internal memory in the working mode. For the description of the second frequency, please refer to the description of frequency 1 in S101 of Figure 6. For the specific description, please refer to the description of S108 in Figure 6, which will not be repeated here.
[0203] S302: The electronic device controls the main processor to power on.
[0204] In one embodiment, when the electronic device receives the first operation, it can control the main processor, the external device, and the chip SOC to power on.
[0205] In one embodiment, after the main processor is powered on, the internal memory can be initialized and the operating frequency of the internal memory can be adjusted to a second frequency. The description of the second frequency can be found in the description of frequency 1 in S204 of FIG. 7 and will not be repeated here.
[0206] S303: The electronic device obtains first data from the internal memory.
[0207] In one embodiment, the first data is service data of the main processor stored when the operation mode of the electronic device is switched from the working mode to the power saving mode.
[0208] In one embodiment, the description of S303 can refer to the description of S205 in FIG. 7 , and will not be repeated here.
[0209] In one embodiment, after S303, the electronic device may execute a first initialization process on the main processor according to the first data. For detailed description, please refer to the description of S206 in FIG. 7 and will not be repeated here.
[0210] In one embodiment, if the first data is not stored in the internal memory, the electronic device can execute a second initialization process. The second initialization process, for example, includes obtaining relevant data from the external memory, and loading the relevant data and initializing the main processor in accordance with the system's multi-layer hardware and software architecture (for example, but not limited to, including the kernel layer, system library, application framework layer, application layer, etc.). The duration of the second initialization process is greater than the duration of the first initialization process.
[0211] The above embodiments are described by taking manual switching of the operating mode of the electronic device 100 as an example. In other embodiments, the electronic device 100 may automatically switch the operating mode.
[0212] The methods provided in the various embodiments of the present application may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, they 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 the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, a network device, a user device, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. 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 server or data center that includes one or more available media. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, or a magnetic tape), an optical medium (e.g., a digital video disc (DWD), or a semiconductor medium (e.g., a solid state drive (SSD)). As mentioned above, the above embodiments are only used to illustrate the technical solutions of the present application, and are not intended to limit the same. Although the present application has been described in detail with reference to the above embodiments, a person skilled in the art should understand that the technical solutions described in the above embodiments may be modified, or some of the technical features thereof may be replaced by equivalents. However, such modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A mode switching method, characterized in that, Applied to an electronic device, the electronic device includes a main processor, a coprocessor, and an internal memory. The operating modes of the electronic device include a power-saving mode and a working mode. In the power-saving mode, the coprocessor works and the main processor does not work. In the working mode, the main processor and the coprocessor work. The method includes: Receiving a first operation for switching the operating mode of the electronic device from the power-saving mode to the working mode; Controlling the main processor to power on; Obtaining first data from the internal memory, where the first data is the service data of the main processor stored when the operating mode of the electronic device is switched from the working mode to the power-saving mode.
2. The method according to claim 1, characterized in that, After obtaining the first data from the internal memory, the method further includes: Performing a first initialization process on the main processor according to the first data.
3. The method according to claim 1 or 2, characterized in that, Before receiving the first operation, the method further includes: Receiving a second operation for switching the operating mode of the electronic device from the working mode to the power-saving mode; Storing the first data in the internal memory; Controlling the main processor to power off.
4. The method according to claim 3, wherein The storing the first data in the internal memory includes: Obtaining the first data from a first area in the internal memory, where the first area is used for the main processor to store data; Storing the first data in a second area in the internal memory, where the second area is different from the first area.
5. The method according to any one of claims 1-4, characterized in that, A third area in the internal memory is used for the coprocessor to store data.
6. The method according to claim 3, wherein After storing the first data in the internal memory, the method further includes: The main processor sending a first message to the coprocessor, where the first message includes the storage location information of the first data, and the storage location information of the first data is used to determine the refresh area of the internal memory in the power-saving mode.
7. The method according to claim 6, wherein The storage location information of the first data includes: the location information of the second area, or the location information where the first data is stored in the second area.
8. The method according to claim 6 or 7, characterized in that, The first message includes the size information of the first data.
9. The method according to any one of claims 3-8, characterized in that, After controlling the main processor to power off, the method further includes: Adjusting the working frequency of the internal memory to a first frequency, where the first frequency is less than a second frequency, and the second frequency is the working frequency of the internal memory in the working mode.
10. The method according to any one of claims 2-9, characterized in that, The method further includes: If the first data is not stored in the internal memory, performing a second initialization process, and the duration of the second initialization process is greater than the duration of the first initialization process.
11. An electronic device, characterized in that, Including a transceiver, a processor, and a memory, where the memory is used to store a computer program, and the processor calls the computer program to execute the method according to any one of claims 1-10.
12. A computer storage medium, characterized in that, The computer storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1-10 is implemented.