Power display method and device, storage medium and terminal equipment

CN115220983BActive Publication Date: 2026-10-27GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110400110.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-04-14
Publication Date
2026-10-27
Estimated Expiration
2041-04-14

AI Technical Summary

Technical Problem

在设备使用过程中,在两个系统上进行切换时,由于两个系统不同的电量计算方法和初始条件,在两个系统间切换时可能造成设备界面显示的电池电量发生跳变或急剧变化的情况

Benefits of technology

在本申请实施例中,终端包括第一操作系统和第二操作系统,且所述终端设备运行所述第一操作系统的功耗小于所述终端设备运行所述第二操作系统的功耗,在所述第一操作系统切换至所述第二操作系统时,获取所述第一操作系统切换前的第一电量信息,所述第二操作系统基于所述第一电量信息确定第一初始电量信息,并在所述第二操作系统中显示所述第一初始电量信息。在进行操作系统切换时,切换后的操作系统基于切换前的操作系统所显示的电量信息来确定本系统的初始电量显示,避免电量显示出现跳变,保证了在所述第二操作系统切换所述第一操作系统时电量显示的平滑过渡。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115220983B_ABST
    Figure CN115220983B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a power display method and device, a storage medium and a terminal device. The terminal device comprises a first operating system and a second operating system. The power consumption of the terminal device running the first operating system is less than the power consumption of the terminal device running the second operating system. The method comprises: when the first operating system switches to the second operating system, obtaining first power information before the switching of the first operating system; the second operating system determines first initial power information based on the first power information; and the first initial power information is displayed in the second operating system. According to the embodiments of the present application, the power display can be smoothly transitioned without jumping when the system switches.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, storage medium and terminal device for displaying battery level. Background Technology

[0002] With the continuous development of smart terminal devices, dual-system (or multi-system) terminals are gradually becoming more common. A dual-system terminal refers to a terminal device that includes two different processor chips, each running an operating system. Each operating system has an independent power calculation function, but the accuracy of these calculations differs. During device use, switching between the two systems may cause jumps or drastic changes in the battery level displayed on the device interface due to the different power calculation methods and initial conditions of the two systems. Summary of the Invention

[0003] This application provides a power display method, apparatus, storage medium, and terminal device, which can achieve a smooth transition in power display during system switching. The technical solution is as follows: In a first aspect, embodiments of this application provide a power display method applied to a terminal device, the terminal device including a first operating system and a second operating system, wherein the power consumption of the terminal device running the first operating system is less than the power consumption of the terminal device running the second operating system, the method comprising: When the first operating system switches to the second operating system, the first battery information before the switch is obtained; The second operating system determines the first initial power information based on the first power information and displays the first initial power information in the second operating system.

[0004] Secondly, embodiments of this application provide a power display device, the power display device comprising: The first operating system is used to obtain the first battery information before the switch when the first operating system is switched to the second operating system; The first operating system is further configured to allow the second operating system to determine first initial power information based on the first power information, and to display the first initial power information in the second operating system.

[0005] Thirdly, embodiments of this application provide a storage medium storing a plurality of instructions adapted for loading by a processor and executing the above-described method steps.

[0006] Fourthly, embodiments of this application provide a terminal device, which may include: a processor and a memory; wherein the memory stores a computer program, the computer program being adapted to be loaded by the processor and to execute the above-described method steps.

[0007] The beneficial effects of the technical solutions provided in some embodiments of this application include at least the following: In this embodiment, the terminal includes a first operating system and a second operating system. The power consumption of the terminal device running the first operating system is less than the power consumption of the terminal device running the second operating system. When switching from the first operating system to the second operating system, first battery information before the switch is obtained. The second operating system determines first initial battery information based on the first battery information and displays the first initial battery information in the second operating system. During operating system switching, the switched operating system determines the initial battery display of its system based on the battery information displayed by the previous operating system, avoiding jumps in battery display and ensuring a smooth transition in battery display when switching from the second operating system to the first operating system. Attached Figure Description

[0008] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0009] Figure 1 This application provides a product architecture diagram for a power display method. Figure 2 This application provides a flowchart illustrating a method for displaying battery level. Figure 3 This application provides a flowchart illustrating a method for displaying battery level. Figure 4 This application provides an example diagram illustrating a scenario where the difference in battery information exceeds a threshold. Figure 5 This application provides an example diagram illustrating a scenario where the difference in battery information is less than a threshold. Figure 6 A timing flowchart of a power display method is provided for an embodiment of this application; Figure 7 A timing flowchart of a power display method is provided for an embodiment of this application; Figure 8This application provides a schematic diagram of the structure of a power display device according to an embodiment of the present application; Figure 9 This application provides a schematic diagram of the structure of a terminal device. Figure 10 This application provides a schematic diagram of the structure of an operating system and user space. Figure 11 This application provides an architecture diagram of an Android system operating system. Figure 12 An architecture diagram of an iOS operating system is provided for embodiments of this application. Detailed Implementation

[0010] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0011] In the description of this application, it should be understood that the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance. In the description of this application, it should be noted that, unless otherwise expressly specified and limited, "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or devices. Those skilled in the art can understand the specific meaning of the above terms in this application based on the specific circumstances. Furthermore, in the description of this application, unless otherwise stated, "multiple" means two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist; for example, A and / or B can represent: A alone, A and B simultaneously, and B alone. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship.

[0012] With the development of science and technology, the variety of terminal devices is becoming increasingly diverse. To meet diverse functional needs, some terminal devices often employ two operating systems running in tandem. One operating system, A, relies on a feature-rich, high-powered processor, while the other, B, often relies on a simpler, lower-powered processor. However, the lower-powered processor generally consumes very little power, enabling it to complete simple tasks while significantly ensuring the terminal device's battery life. In existing technologies, when switching from operating system A to operating system B, because operating system B has limited functionality, it may not display battery information or may only display a schematic without showing specific battery level information, resulting in a poor user experience. When switching from operating system B to operating system A, since operating system B does not display specific battery information, operating system A needs to recalculate the battery level information. This recalculation process takes time and consumes significant power, easily leading to fluctuating battery levels and further degrading the user experience.

[0013] According to some embodiments, please refer to Figure 1 The diagram below illustrates a system structure for a battery level display method as provided in this application. Figure 1 As shown, the power display method provided in this application embodiment can be applied to devices with, for example, power display... Figure 1 The terminal devices in the system structure shown include, but are not limited to, mobile phones, handheld devices, in-vehicle devices, personal computers, laptops, smart wearable devices, and other terminal devices with multiple operating systems.

[0014] like Figure 1 The system architecture shown includes a first operating system, a second operating system, and a battery layer. The first operating system includes a driver layer, a framework layer, and an application layer. The second operating system has the same structure as the first operating system, also including a driver layer, a framework layer, and an application layer. The two operating systems communicate with each other through a dual-core communication module (DCC).

[0015] The battery layer refers to the terminal device battery. The terminal device battery can store electrical energy, provide power to the terminal device, and ensure the normal operation of the terminal device. In the embodiments of this application, the terminal device battery provides energy for the stable operation of the first operating system and the second operating system, respectively, and the terminal device battery is connected to the driver layer of the two operating systems.

[0016] The driving layer may include a battery driver and a DCC (Digital Control Center). The battery driver can manage the charging and discharging of the battery and calculate its power level. Both the driving layers of the first operating system and the second operating system can obtain the battery power information and display it in the application layer of their respective systems. The DCC is mainly responsible for data interaction between the two operating systems. The battery power information obtained by the driving layer can also be exchanged and transmitted between the two systems through the DCC. For example, when the terminal device switches from the second operating system to the first operating system, the second operating system synchronizes the currently obtained battery power information to the DCC of the first operating system through the DCC of the second operating system. The DCC of the first operating system then sends the obtained battery power information as initial power information to the battery driver of the first operating system.

[0017] In both operating systems, the driver layer sends battery power information to the application layer through the framework layer and displays it. The framework layer is responsible for the logic of information transmission between the driver layer and the application layer, and the application layer is responsible for displaying the power information on the display interface.

[0018] based on Figure 1 The system structure shown below will be combined with... Figures 2-7 The battery level display method provided in the embodiments of this application will be described in detail.

[0019] Please see Figure 2 This is a flowchart illustrating a battery level display method provided in this application. The embodiments of this application are described using the example of switching from a first operating system to a second operating system. Figure 2 As shown, the power display method may include the following steps S101 to S102.

[0020] S101, when the first operating system switches to the second operating system, the first battery information before the switching of the first operating system is obtained; It is understandable that switching from the first operating system to the second operating system can be a process of switching from the second operating system to the first operating system and then switching back from the first operating system to the second operating system.

[0021] Specifically, the second operating system refers to an operating system running on a feature-rich and powerful processor. The power calculation accuracy of the second operating system is higher than that of the first operating system. When the second operating system is completely shut down, the terminal device runs only on the first operating system. When the terminal device switches from the first operating system to the second operating system, the second operating system obtains the initial power information from before the switch.

[0022] The first power information may be obtained by the second operating system sending a power information acquisition request before the first operating system switches. Upon receiving the power information acquisition request, the first operating system sends the first power information to the second operating system through the dual-core communication module DCC. The second operating system receives the second power information and returns a receipt confirmation message through the dual-core communication module DCC.

[0023] S102, the second operating system determines the first initial power information based on the first power information, and displays the first initial power information in the second operating system.

[0024] The first initial battery information refers to the battery information initially displayed in the second operating system when switching from the first operating system to the second operating system.

[0025] In this embodiment, when switching from the first operating system to the second operating system, first battery information before the switch is obtained. Then, the second operating system determines first initial battery information based on the first battery information and displays the first initial battery information in the second operating system. During operating system switching, the switched operating system determines the initial battery display of its system based on the battery information displayed by the previous operating system, avoiding jumps in battery display and ensuring a smooth transition of battery display when switching from the second operating system to the first operating system.

[0026] Please see Figure 3 This is a flowchart illustrating a battery level display method provided in this application. The embodiments of this application are described using the example of switching from a first operating system to a second operating system. Figure 3 As shown, the power display method may include the following steps S201 to S204.

[0027] S201, when the first operating system is switched to the second operating system, the first power information before the switch of the first operating system is obtained; Please refer to the description of step S101 in another embodiment for step S201, which will not be repeated here.

[0028] S202, the second operating system obtains the second power information when the second operating system is turned off; Specifically, when the first operating system switches to the second operating system, the second operating system obtains the second power information when the second operating system is turned off.

[0029] The second battery information refers to the battery level calculated before the second operating system shuts down when the terminal device switches from the second operating system to the first operating system. There are two scenarios: first, the terminal device switches from the second operating system to the first operating system and the second operating system shuts down; second, the terminal device switches from the second operating system to the first operating system, the second operating system continues to run in the background for a period of time, and then shuts down. The shutdown of the second operating system can be understood as the second operating system neither running in the foreground nor in the background.

[0030] S203, the second operating system obtains the power information difference between the first power information and the second power information; Specifically, the second operating system calculates the power information difference between the first power information and the second power information based on the first power information and the second power information.

[0031] The difference in battery power information can be the absolute value of the difference between the first battery power information and the second battery power information.

[0032] Obviously, the first power information is the power information before switching to the first operating system, and the second power information is the power information before shutting down the second operating system. The power information difference reflects the power consumed by the terminal device when it is only running the first operating system. A small power information difference indicates that there is no significant power consumption or replenishment when the terminal device is only running the first operating system; a large power information difference indicates that the power information changes significantly when the terminal device is only running the first operating system, which could be due to the terminal device running the first operating system for a longer period or charging behavior while running the first operating system.

[0033] S204, the second operating system determines first initial power information from the first power information and the second power information based on the power information difference, and displays the first initial power information in the second operating system.

[0034] The first initial battery information refers to the battery information initially displayed by the second operating system when switching from the first operating system to the second operating system.

[0035] Specifically, a threshold is set, and the second operating system determines the first initial power information based on the power information difference and the threshold from the first power information and the second power information.

[0036] When the difference in the power information is greater than the threshold, the first power information is determined as the first initial power information, and the first initial power information is displayed on the display interface based on the second operating system.

[0037] It is understood that after the second operating system is shut down, the terminal device runs on the first operating system. Battery power information is calculated based on the first operating system. When the terminal device runs on the first operating system for an extended period or undergoes charging during operation, significant changes in battery power information will occur; this change is the power information difference. If the power information difference exceeds a threshold, the first power information is determined as the initial power information. The power information displayed when the terminal device is running on the first operating system before the system switch is the first power information. Similarly, after the system switch, the first power information is used as the power information displayed when the terminal device is running on the second operating system.

[0038] Please see also Figure 4 This is an example diagram illustrating a scenario where the difference in battery information exceeds a threshold, as provided in this application embodiment.

[0039] like Figure 4 As shown, when the terminal device switches from the first operating system to the second operating system, the second battery information before the second operating system is turned off is 50%, and the first battery information before the first operating system is switched is 43%. The preset threshold is 5%. Then the battery information difference is equal to the absolute value of the difference between the second battery information and the first battery information. The battery information difference is 7%. The battery information difference is greater than the threshold. Then the first battery information is displayed as the first initial battery information on the display interface.

[0040] Optionally, when the difference in power information is greater than a threshold, the second operating system calculates the current power information and determines the current power information as the first initial power information.

[0041] It's easy to understand that when the second operating system is completely shut down, the terminal device runs on the first operating system. The power calculation method used by the first operating system may be somewhat coarse, resulting in inaccurate power information. Therefore, when switching from the first operating system to the second operating system, the first power information obtained by the second operating system may be inaccurate. In this case, if the difference in power information exceeds the threshold, the terminal device's current power information is recalculated based on the second operating system, and this current power information is determined as the first initial power information. Since the difference between the current power information and the first power information is small, the current power information is more accurate than the second power information.

[0042] The recalculation of the terminal device's current battery information based on the second operating system means that the second operating system first initializes the battery driver, and then uses the power calculation algorithm of the second operating system to calculate the remaining battery power information of the terminal device when switching from the first operating system to the second operating system, and determines the remaining battery power information as the current battery power information.

[0043] When the difference in the power information is less than or equal to the threshold, the second power information is determined as the initial power information, and the first initial power information is displayed on the display interface based on the second operating system.

[0044] It is easy to understand that after the second operating system is shut down, the terminal device runs on the first operating system and calculates battery power information based on the first operating system. On the one hand, since the power consumption of the terminal device is extremely low when running the first operating system, if the terminal device runs on the first operating system for a short period of time, the battery power information will not change significantly. On the other hand, when the terminal device calculates battery power information based on the first operating system, there is a certain error due to the coarse calculation algorithm. Therefore, when the difference in battery power information is less than or equal to the threshold, the second battery power information saved before the second operating system was shut down can be used as the first initial battery power information.

[0045] Please see also Figure 5 This is an example diagram illustrating a scenario where the difference in battery information is less than a threshold, as provided in this application embodiment.

[0046] like Figure 5 As shown, when the terminal device switches from the first operating system to the second operating system, the second battery information before the second operating system is turned off is 50%, and the first battery information before the first operating system is switched is 48%. The preset threshold is 5%. Then the difference in battery information is equal to the absolute value of the difference between the first battery information and the second battery information. The difference in battery information is 2%. If the difference in battery information is less than the threshold, then the second battery information is displayed as the first initial battery information on the display interface.

[0047] In this embodiment, when switching from the first operating system to the second operating system, the system obtains second battery information when the second operating system is shut down and first battery information before the switch. Then, it obtains a battery information difference based on the first and second battery information, sets a threshold, and determines first initial battery information based on this difference. This first initial battery information is then displayed on the display interface. By determining the final battery information displayed after the switch based on the battery information corresponding to the two operating systems and their difference, instead of directly calculating and displaying the battery information from the operating system before or after the switch, jumps in battery display are avoided, ensuring a smooth transition when switching from the first to the second operating system. Optionally, when the battery information difference is greater than the threshold, the current battery information of the terminal device can be recalculated based on the second operating system, and this current battery information can be determined as the first initial battery information, thereby ensuring the accuracy of the battery display. Please see Figure 6 This application provides a timing flowchart for a battery level display method. The embodiments of this application are described using the example of switching from a second operating system to a first operating system. Figure 6 As shown, the power display method may include the following steps S301 to S305.

[0048] S301, when the second operating system switches to the first operating system, obtain the third battery information before the switch to the second operating system; The third battery information is the battery information displayed on the interface before the switch from the second operating system to the first operating system.

[0049] It is understandable that switching from the second operating system to the first operating system can be a process where the terminal device is running on the second operating system by default when it is turned on, and then switches from the second operating system to the first operating system after powering on, or it can be a process where the device switches from the first operating system to the second operating system, and then switches back from the second operating system to the first operating system.

[0050] S302, the second operating system sends the third battery information to the first operating system; Specifically, the second operating system calculates battery power more accurately, while the first operating system calculates it more coarsely. When switching from the second operating system to the first operating system, the second operating system sends the third battery power information to the first operating system through the dual-core communication module DCC, so that the first operating system receives more accurate battery power information.

[0051] S303, the first operating system uses the third power information as the second initial power information and displays the second initial power information in the first operating system; The second initial battery information refers to the battery information initially displayed when switching to the first operating system.

[0052] Specifically, the first operating system receives the third battery information, which is calculated by the second operating system and has high accuracy. The first operating system displays the third battery information as the second initial battery information on the display interface.

[0053] It's easy to understand that when the terminal device is running the second operating system, the battery power information is calculated based on the second operating system, resulting in a more accurate calculation. In contrast, the first operating system's power metering method is coarser and less accurate. Therefore, when switching from the second operating system to the first operating system, the first operating system uses the third battery power information from before the switch as the second initial battery power information for this system.

[0054] S304, After the second operating system switches to the first operating system and the second operating system is turned off, the fifth power information is obtained; The fifth power information refers to the battery power information calculated based on the first operating system.

[0055] Specifically, after switching from the second operating system to the first operating system and shutting down the second operating system, the terminal device runs only on the first operating system; the second operating system neither runs in the foreground nor in the background. At this time, the battery level information is continuously calculated and updated based on the first operating system to obtain the fifth battery level information.

[0056] S305, the first operating system uses the fifth power information as the current power information and displays the current power information in the first operating system.

[0057] In this embodiment, when switching from the second operating system to the first operating system, a third battery level information prior to the switch is obtained. This third battery level information is then used as the second initial battery level information for switching to the first operating system, and displayed on the display interface. The switched operating system directly uses the battery level information displayed by the previous operating system and displays it on its own system, thus achieving a smooth transition in battery level display when switching from the second operating system to the first operating system. Furthermore, after switching from the second operating system to the first operating system and after the second operating system is shut down, the first operating system continuously calculates and updates the battery level information to obtain a fifth battery level information, which is then displayed on the first operating system's display interface. This avoids the situation where the battery level information cannot be displayed when the second operating system is shut down, ensuring the display of battery level information.

[0058] Please see Figure 7 This application provides a timing flowchart for a battery level display method. The embodiments of this application describe the complete process from power-on and residing in the first operating system to switching from the first operating system to the second operating system. Figure 7 As shown, the power display method may include the following steps S401 to S409.

[0059] S401, when a power-on command is detected, the sixth power information is obtained, the sixth power information is used as the third initial power information, and the third initial power information is displayed in the second operating system; The sixth power information refers to the battery power information calculated by the second operating system when the terminal device is first turned on.

[0060] The third initial power information refers to the power information displayed on the display interface when the terminal device is first turned on.

[0061] Specifically, the terminal device is powered on and runs on the second operating system. Based on the second operating system, the current battery power information is calculated to obtain the sixth power information, and the sixth power information is displayed on the display interface as the third initial power information.

[0062] S402, when the second operating system switches to the first operating system, obtain the third battery information before the switch to the second operating system; Please refer to the description of step S301 in another embodiment for step S402, which will not be repeated here.

[0063] S403, the second operating system sends the third battery information to the first operating system; Please refer to the description of step S302 in another embodiment for step S403, which will not be repeated here.

[0064] S404, the first operating system uses the third power information as the second initial power information and displays the second initial power information in the first operating system; Please refer to the description of step S303 in another embodiment for step S404, which will not be repeated here.

[0065] S405, after the second operating system switches to the first operating system, it continuously acquires the fourth power information before the second operating system is shut down, the fourth power information being the power information of the second operating system running in the background; The fourth battery information refers to the battery power information calculated by the second operating system when it is running in the background after the second operating system switches to the first operating system.

[0066] Specifically, after the second operating system switches to the first operating system, the second operating system runs in the background. At this time, the second operating system continuously calculates the battery power information to obtain the fourth power information.

[0067] S406, the second operating system sends the fourth power information to the first operating system; Specifically, the second operating system continuously sends the fourth power information to the first operating system through the dual-core communication module DCC.

[0068] In one feasible implementation, the terminal device runs on the first operating system, while the second operating system runs in the background. The second operating system continuously calculates and acquires the fourth battery information, and when the fourth battery information changes, it sends the fourth battery information to the first operating system through the dual-core communication module DCC. For example, the second operating system runs in the background and continuously calculates and acquires the fourth battery information. At a certain moment, the fourth battery information is 49%. At the next moment, the fourth battery information decreases from 49% to 48%. At this time, the second operating system sends the fourth battery information to the first operating system.

[0069] S407, the first operating system uses the fourth power information as the current power information and displays the current power information in the first operating system; Furthermore, if the second operating system is not completely shut down, i.e., the second operating system is running in the background and the first operating system is running in the foreground, then if the terminal device switches back to the second operating system from the first operating system, the second operating system directly uses the fourth battery information as the first initial battery information when switching back to the second operating system, and displays the first initial battery information in the second operating system.

[0070] S408, after the second operating system switches to the first operating system and the second operating system is turned off, the fifth power information is obtained; The fifth power information refers to the battery power information calculated based on the first operating system.

[0071] Specifically, after switching from the second operating system to the first operating system and completely shutting down the second operating system, the terminal device runs only on the first operating system, with the second operating system neither running in the foreground nor in the background. At this time, the battery level information is continuously calculated and updated based on the first operating system to obtain the fifth battery level information.

[0072] S409, the first operating system uses the fifth power information as the current power information and displays the current power information in the first operating system.

[0073] In this embodiment, when switching from the second operating system to the first operating system, a third battery level information prior to the switch is obtained. This third battery level information is then used as the second initial battery level information for the system switch to the first operating system, and displayed on the display interface. The switched operating system directly uses the battery level information displayed by the previous operating system and displays it on its own system, achieving a smooth transition in battery level display when switching from the second operating system to the first operating system. Furthermore, when switching from the second operating system to the first operating system and the second operating system is running in the background, the current battery level information is continuously calculated based on the second operation to obtain a fourth battery level information. The first operating system displays this fourth battery level information as the current battery level information on the display interface. When the second operating system is running in the background, the fourth battery level information calculated by the second operating system is used for display, resulting in more accurate battery level display. Even further, when switching from the second operating system to the first operating system and the second operating system is closed, the first operating system continuously calculates and updates the battery level information to obtain a fifth battery level information, which is then displayed on the first operating system's display interface. This avoids the situation where the battery level information cannot be displayed when the second operating system is closed, ensuring the display of battery level information.

[0074] The following will combine Figure 8 This application provides a detailed description of the power display device provided in its embodiments. It should be noted that... Figure 8 The power display device in the middle is used to perform the present application. Figures 1-7 The methods shown in the embodiments are for illustrative purposes only, illustrating the parts relevant to the embodiments of this application. For specific technical details not disclosed, please refer to this application. Figures 1-7 The example shown.

[0075] Please see Figure 8 This application provides a schematic diagram of a power display device 1. The power display device 1 can be implemented as all or part of a terminal device through software, hardware, or a combination of both. According to some embodiments, the power display device 1 includes a first operating system 11 and a second operating system 12. The power consumption of the terminal device running on the first operating system 11 is less than the power consumption of the terminal device running on the second operating system 12. Specifically: The second operating system 12 is used to obtain the first power information before the switching of the first operating system when the first operating system is switched to the second operating system; The second operating system 12 is further configured to determine first initial power information based on the first power information, and display the first initial power information in the second operating system.

[0076] Optionally, the second operating system 12 is also used to obtain second power information when the second operating system is turned off; The second operating system 12 is also used to obtain the power information difference between the first power information and the second power information; The second operating system 12 is further configured to determine first initial power information from the first power information and the second power information based on the power information difference.

[0077] Optionally, the second operating system 12 is further configured to determine the second power information as the first initial power information when the power information difference is less than or equal to a threshold. The second operating system 12 is further configured to determine the first power information as the first initial power information when the power information difference is greater than a threshold. Optionally, the second operating system 12 is further configured to calculate the current power information and determine the current power information as the first initial power information when the power information difference is greater than a threshold.

[0078] The second operating system 12 is also used to obtain third power information before the switch to the first operating system when the second operating system switches to the first operating system; The second operating system 12 is also used to send the third power information to the first operating system; The first operating system 11 is used to use the third power information as the second initial power information and to display the second initial power information in the first operating system.

[0079] Optionally, the second operating system 12 is further configured to continuously acquire fourth power information before the second operating system is shut down after the second operating system switches to the first operating system, wherein the fourth power information is the power information of the second operating system when it is running in the background; The second operating system 12 is also used to send the fourth power information to the first operating system; The first operating system 11 is further configured to use the fourth power information as the current power information and display the current power information in the first operating system.

[0080] Optionally, the first operating system 11 is further configured to obtain the fifth power information after the second operating system switches to the first operating system and the second operating system is turned off; The first operating system 11 is further configured to use the fifth power information as the current power information and display the current power information in the first operating system.

[0081] Optionally, the second operating system 12 is further configured to, upon detecting a power-on command, acquire sixth battery information, use the sixth battery information as third initial battery information, and display the third initial battery information in the second operating system.

[0082] It should be noted that the power display device provided in the above embodiments is only illustrated by the division of the above functional modules when executing the power display method. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the power display device and the power display method embodiments provided in the above embodiments belong to the same concept, and the implementation process is detailed in the method embodiments, which will not be repeated here.

[0083] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0084] In this embodiment, when switching from the second operating system to the first operating system, first power information at the time the first operating system is shut down and second power information before the switch are obtained. Then, a power information difference is obtained based on the first and second power information. A threshold is set, and first initial power information is determined based on the power information difference and the threshold. The first initial power information is then displayed on the display interface, achieving a smooth transition in power display when switching from the second operating system to the first operating system. When switching from the first operating system to the second operating system, third power information before the switch is obtained and then used as the second initial power information for switching from the first operating system to the second operating system. The second initial power information is then displayed on the display interface. The switched operating system directly uses the power information displayed by the previous operating system and displays it in this system, achieving a smooth transition in power display when switching from the first operating system to the second operating system.

[0085] This application also provides a computer storage medium that can store multiple instructions, which are adapted to be loaded and executed by a processor as described above. Figures 1-7 The power display method of the illustrated embodiment can be found in the following document for a detailed execution process: Figures 1-7 The specific details of the illustrated embodiments will not be elaborated here.

[0086] Please see Figure 9 This document provides a schematic diagram of the structure of a terminal device according to an embodiment of this application. Figure 9 As shown, the terminal device may include one or more of the following components: a first processor 110, a second processor 120, a memory 130, an input device 140, an output device 150, and a bus 160. The first processor 110, the second processor 120, the memory 130, the input device 140, and the output device 150 are connected by a neutral line 160.

[0087] The first processor 110 may include one or more processing cores, connecting various parts of the terminal device via various interfaces and lines. It executes various functions and processes data of the terminal device 100 by running or executing instructions, programs, code sets, or instruction sets stored in the memory 130, and by calling data stored in the memory 130. Optionally, the first processor 110 may be implemented using at least one hardware form selected from digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The first processor 110 may integrate one or more of the following: a central processing unit (CPU), a graphics processing unit (GPU), and a modem. The CPU primarily handles the first operating system and applications; the GPU is responsible for rendering and drawing the displayed content; and the modem handles wireless communication. It is understood that the modem may also not be integrated into the first processor 110, but may be implemented separately using a communication chip.

[0088] Similarly, the second processor 120 may include one or more processing cores, connecting various parts within the terminal device via various interfaces and lines. It executes instructions, programs, code sets, or instruction sets stored in the memory 130, and calls data stored in the memory 130 to perform various functions and process data of the terminal device 100. Optionally, the second processor 120 may be implemented using at least one hardware form of DSP, FPGA, or PLA. The second processor 120 may integrate one or more of the following: CPU, GPU, and modem. It is understood that the aforementioned modem may not be integrated into the first processor 110, but may be implemented separately using a communication chip.

[0089] The memory 130 may include random access memory (RAM) or read-only memory (ROM). Optionally, the memory 130 may include a non-transitory computer-readable storage medium. The memory 130 may be used to store instructions, programs, code, code sets, or instruction sets. The memory 130 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as touch functionality, sound playback functionality, image playback functionality, etc.), instructions for implementing the various method embodiments described below, etc. The data storage area may also store data created by the terminal device during use, such as phonebooks, audio and video data, chat log data, etc.

[0090] See Figure 10 As shown, the memory 130 can be divided into operating system space and user space. The operating system runs in the operating system space, while native and third-party applications run in the user space. The operating system space is further divided into a first operating system space and a second operating system space. The first operating system runs in the first operating system space, and the second operating system runs in the second operating system space. To ensure that different third-party applications can achieve good operating results, the first or second operating system allocates corresponding system resources for each application. However, different application scenarios within the same third-party application have different requirements for system resources. For example, in local resource loading scenarios, third-party applications require high disk read speeds; in animation rendering scenarios, third-party applications require high GPU performance. Since the first and second operating systems are independent of the third-party applications, the operating system often cannot promptly perceive the current application scenario of the third-party application, resulting in the operating system's inability to adapt system resources accordingly.

[0091] In order for the first and second operating systems to distinguish the specific application scenarios of third-party applications, it is necessary to establish data communication between the third-party applications and the operating systems. This would allow the first and second operating systems to obtain the current scenario information of the third-party applications at any time, and then perform targeted system resource adaptation based on the current scenario.

[0092] Taking Android as the primary operating system as an example, the programs and data stored in memory 130 are as follows: Figure 11As shown, the memory can store the Linux kernel layer 320, the system runtime library layer 340, the application framework layer 360, and the application layer 380. The Linux kernel layer 320, system runtime library layer 340, and application framework layer 360 belong to the first operating system space, while the application layer 380 belongs to the user space. The Linux kernel layer 320 provides low-level drivers for various hardware components of the terminal device, such as display drivers, audio drivers, camera drivers, Bluetooth drivers, Wi-Fi drivers, and power management. The system runtime library layer 340 provides support for key features of the Android system through several C / C++ libraries. For example, the SQLite library provides database support, the OpenGL / ES library provides 3D graphics support, and the Webkit library provides browser kernel support. The system runtime library layer 340 also provides the Android runtime library, which mainly provides core libraries that allow developers to write Android applications using the Java language. The application framework layer 360 provides various APIs that may be used when building applications. Developers can also use these APIs to build their own applications, such as activity management, window management, view management, notification management, content provider, package management, call management, resource management, and location management. The application layer 380 runs at least one application. These applications can be native applications that come with the first operating system, such as contacts, SMS, clock, and camera apps; or third-party applications developed by third-party developers, such as games, instant messaging, photo editing, and battery display applications. Multimedia software can be either native applications that come with the first operating system or applications developed by third-party developers.

[0093] Taking the first operating system as an example, the programs and data stored in memory 130 are as follows: Figure 12As shown, the iOS system includes: Core OS layer 420, Core Services layer 440, Media layer 460, and Cocoa Touch layer 480. Core OS layer 420 includes the operating system kernel, drivers, and low-level program frameworks. These low-level program frameworks provide hardware-level functionality for use by the program frameworks located in Core Services layer 440. Core Services layer 440 provides system services and / or program frameworks required by applications, such as Foundation framework, account framework, advertising framework, data storage framework, network connectivity framework, geolocation framework, motion framework, etc. Media layer 460 provides applications with audiovisual interfaces, such as interfaces related to graphics and images, audio technology, video technology, and AirPlay (wireless playback of audio and video transmission technologies). Cocoa Touch layer 480 provides various commonly used interface-related frameworks for application development and is responsible for user touch interaction on the terminal device. Examples include local notification services, remote push services, advertising frameworks, game tool frameworks, message user interface (UI) frameworks, UIKit user interface frameworks, map frameworks, and so on.

[0094] exist Figure 12 The framework shown includes, but is not limited to, the base framework in the core service layer 440 and the UIKit framework in the touchable layer 480. The base framework provides many basic object classes and data types, offering the most basic system services to all applications, and is independent of the UI. The UIKit framework, on the other hand, provides a basic UI class library for creating touch-based user interfaces. iOS applications can use the UIKit framework to provide their UI, thus providing the application's infrastructure for building user interfaces, drawing, handling user interaction events, responding to gestures, and so on.

[0095] The methods and principles for implementing data communication between third-party applications and the operating system in the iOS system can be referenced from the Android system, and will not be elaborated here.

[0096] The input device 140 is used to receive input instructions or data, and includes, but is not limited to, a keyboard, mouse, camera, microphone, or touch device. The output device 150 is used to output instructions or data, and includes, but is not limited to, a display device and a speaker. In one example, the input device 140 and the output device 150 can be combined into a touch screen, which is used to receive touch operations from the user using a finger, stylus, or any suitable object on or near it, and to display the user interface of various applications. The touch screen is usually located on the front panel of the terminal device. The touch screen can be designed as a full-screen, curved screen, or irregularly shaped screen. The touch screen can also be designed as a combination of a full-screen and a curved screen, or a combination of an irregularly shaped screen and a curved screen; this embodiment of the application does not limit this.

[0097] In addition, those skilled in the art will understand that the structure of the terminal device shown in the above figures does not constitute a limitation on the terminal device. The terminal device may include more or fewer components than shown, or combine certain components, or have different component arrangements. For example, the terminal device may also include radio frequency circuits, input units, sensors, audio circuits, wireless fidelity (WiFi) modules, power supplies, Bluetooth modules, etc., which will not be described in detail here.

[0098] The terminal device in this embodiment may also be equipped with a display device, which can be various devices capable of display functions, such as: cathode ray tube display (CR), light-emitting diode display (LED), e-ink screen, liquid crystal display (LCD), plasma display panel (PDP), etc. Users can use the display device on the terminal device 101 to view displayed text, images, videos, and other information. The terminal device may be a smartphone, tablet computer, gaming device, AR (Augmented Reality) device, automobile, data storage device, audio playback device, video playback device, laptop, desktop computing device, wearable device such as electronic watch, electronic glasses, electronic helmet, electronic bracelet, electronic necklace, electronic clothing, etc.

[0099] exist Figure 9 In the terminal device shown, the first processor 110 and the second processor 120 can be used together to call the power display application stored in the memory 130 and specifically perform the following operations: When the first operating system switches to the second operating system, the first battery information before the switch is obtained; The second operating system determines the first initial power information based on the first power information and displays the first initial power information in the second operating system.

[0100] Optionally, the following operations may also be performed: The second operating system obtains the second power information when the second operating system is shut down; The second operating system obtains the power information difference between the first power information and the second power information; The second processor 120 executes the second operating system to determine the first initial power information based on the first power information, including: The second operating system determines the first initial power information based on the power information difference between the first power information and the second power information.

[0101] Optionally, when the second processor 120 executes the second operating system to determine the first initial power information from the first power information and the second power information based on the power information difference, it specifically performs the following operations: When the difference in the power information is less than or equal to the threshold, the second operating system determines the second power information as the first initial power information; When the difference in the power information is greater than a threshold, the second operating system determines the first power information as the first initial power information.

[0102] Optionally, when the second processor 120 executes the second operating system to determine the first initial power information from the first power information and the second power information based on the power information difference, it also performs the following operations: When the difference in the power information is less than or equal to the threshold, the second operating system determines the second power information as the first initial power information; When the difference in the power information is greater than a threshold, the second operating system calculates the current power information and determines the current power information as the first initial power information.

[0103] Optionally, the first processor 110 and the second processor 120 work together to call the power display application stored in the memory 130, and also perform the following operations: When the second operating system switches to the first operating system, the third battery information prior to the switch to the second operating system is obtained; The second operating system sends the third battery information to the first operating system; The first operating system uses the third battery information as the second initial battery information and displays the second initial battery information in the first operating system.

[0104] Optionally, after the first processor 110 executes the first operating system to use the third battery information as the second initial battery information and displays the second initial battery information in the first operating system, it further performs the following operations: After the second operating system detects the switch from the second operating system to the first operating system, it continuously acquires the fourth battery information before the second operating system is shut down; The second operating system sends the fourth battery information to the first operating system; The first operating system uses the fourth battery information as the current battery information and displays the current battery information in the first operating system.

[0105] Optionally, after the first processor 110 executes the first operating system to use the fourth battery information as the current battery information and displays the current battery information in the first operating system, it further performs the following operations: After the second operating system switches to the first operating system and the second operating system is shut down, the fifth power information is obtained; The first operating system uses the fifth battery information as the current battery information and displays the current battery information in the first operating system.

[0106] Optionally, the first processor 110 and the second processor 120 work together to call the power display application stored in the memory 130, and also perform the following operations: When a power-on command is detected, the sixth battery level information is obtained, and the sixth battery level information is used as the third initial battery level information, which is then displayed in the second operating system.

[0107] In this embodiment, when switching from the second operating system to the first operating system, first power information at the time the first operating system is shut down and second power information before the switch are obtained. Then, a power information difference is obtained based on the first and second power information. A threshold is set, and first initial power information is determined based on the power information difference and the threshold. The first initial power information is then displayed on the display interface, achieving a smooth transition in power display when switching from the second operating system to the first operating system. When switching from the first operating system to the second operating system, third power information before the switch is obtained and then used as the second initial power information for switching from the first operating system to the second operating system. The second initial power information is then displayed on the display interface. The switched operating system directly uses the power information displayed by the previous operating system and displays it in this system, achieving a smooth transition in power display when switching from the first operating system to the second operating system.

[0108] Those skilled in the art will clearly understand that the technical solutions of this application can be implemented using software and / or hardware. In this specification, "unit" and "module" refer to software and / or hardware capable of independently performing or cooperating with other components to perform specific functions. Hardware may include, for example, a Field-Programmable Gate Array (FPGA), an Integrated Circuit (IC), etc.

[0109] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

[0110] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0111] In the several embodiments provided in this application, it should be understood that the disclosed apparatus can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some service interface; the indirect coupling or communication connection between devices or units may be electrical or other forms.

[0112] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0113] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0114] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage device (CMD). Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned memory includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0115] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, which may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc.

[0116] The foregoing description is merely an exemplary embodiment of this disclosure and should not be construed as limiting the scope of this disclosure. Any equivalent changes and modifications made in accordance with the teachings of this disclosure shall still fall within the scope of this disclosure. Other embodiments of this disclosure will be readily apparent to those skilled in the art upon consideration of the specification and practice of the disclosure herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not described herein. The specification and embodiments are to be considered exemplary only, and the scope and spirit of this disclosure are defined by the claims.

Claims

1. A method for displaying battery level, characterized in that, The method is applied to a terminal device, which includes a first operating system and a second operating system. The power consumption of the terminal device running the first operating system is less than that of the terminal device running the second operating system. The power consumption calculation accuracy of the first operating system and the second operating system differs. The method includes: When the first operating system switches to the second operating system, the first battery information before the switch is obtained; The second operating system acquires second battery information when the second operating system is shut down; wherein, the second battery information refers to the battery power information calculated before the second operating system is shut down when the terminal device switches from the second operating system to the first operating system; The second operating system obtains the power information difference between the first power information and the second power information; The second operating system determines a first initial power information from the first power information and the second power information based on the power information difference, and displays the first initial power information in the second operating system to achieve a smooth transition of power display when switching from the first operating system to the second operating system.

2. The method according to claim 1, characterized in that, The method further includes: When the second operating system switches to the first operating system, the third battery information prior to the switch to the second operating system is obtained; The second operating system sends the third battery information to the first operating system; The first operating system uses the third battery information as the second initial battery information and displays the second initial battery information in the first operating system.

3. The method according to claim 2, characterized in that, After the first operating system uses the third battery information as the second initial battery information and displays the second initial battery information in the first operating system, it further includes: After the second operating system switches to the first operating system, it continuously acquires the fourth battery information before the second operating system is shut down. The fourth battery information is the battery information of the second operating system when it is running in the background. The second operating system sends the fourth battery information to the first operating system; The first operating system uses the fourth battery information as the current battery information and displays the current battery information in the first operating system.

4. The method according to claim 3, characterized in that, After the first operating system uses the fourth battery information as the current battery information and displays the current battery information in the first operating system, it further includes: After the second operating system switches to the first operating system and the second operating system is shut down, the fifth power information is obtained; The first operating system uses the fifth battery information as the current battery information and displays the current battery information in the first operating system.

5. The method according to any one of claims 1-4, characterized in that, The difference in power calculation accuracy between the first operating system and the second operating system includes: the power calculation accuracy of the second operating system is higher than that of the first operating system. The method further includes: When a power-on command is detected, the sixth battery level information is obtained, and the sixth battery level information is used as the third initial battery level information, which is then displayed in the second operating system.

6. The method according to claim 1, characterized in that, The second operating system determines first initial battery information based on the difference in battery information between the first battery information and the second battery information, including: When the difference in the power information is less than or equal to the threshold, the second operating system determines the second power information as the first initial power information; When the difference in the power information is greater than a threshold, the second operating system determines the first power information as the first initial power information.

7. The method according to claim 1, characterized in that, The second operating system determines first initial battery information based on the difference in battery information between the first battery information and the second battery information, including: When the difference in the power information is less than or equal to the threshold, the second operating system determines the second power information as the first initial power information; When the difference in the power information is greater than a threshold, the second operating system calculates the current power information and determines the current power information as the first initial power information.

8. A power display device, characterized in that, Applied to a terminal device, the terminal device includes a first operating system and a second operating system. The power consumption of the terminal device running the first operating system is less than the power consumption of the terminal device running the second operating system. The power calculation accuracy of the first operating system and the second operating system differs. The power display device includes: The first operating system is used to obtain the first battery information before the switch when the first operating system is switched to the second operating system; The second operating system is used to obtain second power information when the second operating system is shut down; wherein, the second power information refers to the battery power information calculated before the second operating system is shut down when the terminal device switches from the second operating system to the first operating system; The second operating system is further configured to obtain the power information difference between the first power information and the second power information; based on the power information difference, determine the first initial power information from the first power information and the second power information, and display the first initial power information in the second operating system, so as to achieve a smooth transition of power display when switching from the first operating system to the second operating system.

9. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.

10. A terminal device, characterized in that, include: A processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and to execute the steps of the method as claimed in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Display device, electronic equipment and screen display control method

    CN108319360A

  • Mobile terminal and control method thereof

    KR1020110084767A