Power supply management method and device based on open source swan gap system, medium and product

By using reference counting to manage device power states in the open-source HarmonyOS system and calling resume and suspend callback functions, the problem of inconsistent device power state management is solved, achieving unified management of device power states, reducing system power consumption and improving performance.

CN120909409APending Publication Date: 2025-11-07HONGHU WANLIAN (JIANGSU) TECH DEV CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511031634.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-24
Publication Date
2025-11-07

AI Technical Summary

Technical Problem

In the open-source HarmonyOS system, the inconsistent management of device power status leads to problems such as low management efficiency, high system power consumption, and low performance.

Method used

By responding to the usage and release commands of the target device, the power management function is called to adjust the power state of the device. The power state of the device is managed using a reference count value, including a recovery callback function, a release function, and a suspension callback function, so as to achieve unified and centralized management of the device power state.

Benefits of technology

It enables unified management of device power status, reduces system power consumption, extends battery life and device lifespan, and improves system performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120909409A_ABST
    Figure CN120909409A_ABST
Patent Text Reader

Abstract

The invention discloses a power supply management method and device based on an open source gap system, a medium and a product, and the method comprises the steps: obtaining a current power supply use state through calling a power supply management use function in response to a use instruction of a target device, and increasing a reference count value; when the current power supply use state is a suspended state, adjusting the power supply use state to an operation state by calling a recovery callback function; in response to a release instruction of target equipment, after the reference count value is reduced by calling a power management release function, the reference count value is detected; when it is detected that the reference count value is 0, if a use instruction for the target equipment is not received within the preset duration, the power supply use state of the target equipment is adjusted to a suspended state by calling a corresponding suspended callback function, and unified and centralized management of the power supply states of all the equipment is achieved; therefore, the hanging operation on the equipment which is not used by any user is ensured, the system power consumption is reduced, and the system performance is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power status management technology, and in particular to a power management method, device, medium and product based on the open source HarmonyOS system. Background Technology

[0002] The open-source HarmonyOS system typically includes various controllable devices, such as input devices, output devices, storage devices, network devices, and sensors. These devices work together to support the overall functionality of the system during operation.

[0003] However, in the actual operation of the open-source HarmonyOS system, these devices often fail to be turned off in time after use, or remain on for a long time without being used. This not only occupies additional system resources and causes a decrease in system performance, but also reduces the system's power efficiency and increases the system's power consumption.

[0004] While the open-source HarmonyOS possesses some power management capabilities, it lacks a dedicated and unified approach to handling the power states of various devices. The power management module primarily influences the states of some devices indirectly through power mode settings. For example, in power-saving or ultra-power-saving modes, the system periodically turns off the screen or adjusts the wireless network power consumption. However, turning off the screen requires an interface through the power display module, and adjusting wireless network power consumption necessitates the wireless network driver layer listening for power mode events, resulting in inconsistent control methods. Furthermore, some devices within the open-source HarmonyOS lack implemented power management functionality, making power state control impossible. This fragmented and inconsistent management approach reduces the ease of adding power management functionality to individual devices, decreases the efficiency of power state management for each device, increases system power consumption, and degrades system performance. Summary of the Invention

[0005] This invention provides a power management method, device, medium, and product based on the open-source HarmonyOS system, to solve the problems of inconsistent power state management methods based on the open-source HarmonyOS system, and the resulting low management efficiency, high system power consumption, and low system performance.

[0006] According to one aspect of the present invention, a power management method based on the open-source HarmonyOS system is provided, comprising:

[0007] In response to usage commands for target devices in the open-source HarmonyOS system, the current power usage status of the target device is obtained by calling the power management usage function, and the reference count value of the target device is incremented;

[0008] When the current power usage status is obtained as suspended, the power usage status of the target device is adjusted to running by calling the corresponding recovery callback function of the target device.

[0009] In response to a release instruction for a target device in the open source OS, a reference count value of the target device is detected after a power management release function is called to reduce the reference count value of the target device.

[0010] When the reference count value of the target device is detected as 0, if a use instruction for the target device is not received within a preset time length, a suspend callback function corresponding to the target device is called to adjust a power use state of the target device to a suspended state.

[0011] According to another aspect of the embodiments of the present application, a power management device based on an open source OS is provided, comprising:

[0012] A use response module is configured to, in response to a use instruction for a target device in the open source OS, acquire a current power use state of the target device by calling a power management use function, and increase a reference count value of the target device.

[0013] A resume callback module is configured to, when the acquired current power use state is a suspended state, adjust a power use state of the target device to a running state by calling a resume callback function corresponding to the target device.

[0014] A release response module is configured to, in response to a release instruction for a target device in the open source OS, detect a reference count value of the target device after a power management release function is called to reduce the reference count value of the target device.

[0015] A suspend callback module is configured to, when the reference count value of the target device is detected as 0, if a use instruction for the target device is not received within a preset time length, call a suspend callback function corresponding to the target device to adjust a power use state of the target device to a suspended state.

[0016] According to another aspect of the embodiments of the present application, an electronic device is provided, comprising:

[0017] At least one processor, and a memory connected to the at least one processor in communication; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to execute the power management method based on the open source OS according to any one of the embodiments of the present application.

[0018] According to another aspect of the embodiments of the present application, a computer readable storage medium is provided, which stores computer instructions for enabling a processor to execute the power management method based on the open source OS according to any one of the embodiments of the present application.

[0019] According to another aspect of the embodiments of the present application, there is also provided a computer program product comprising a computer program which, when executed by a processor, implements the steps of the method according to any of the embodiments of the present application.

[0020] The technical solution of the embodiments of the present application, in response to a use instruction for a target device in an open source Hongmeng system, the system acquires the current power state of the device by calling a power management use function, and increases the reference count of the device. If the reference count value is greater than or equal to 1, it indicates that the device is being used by a user or a process. If the device is in a suspended state, the system will automatically call a resume callback function to restore it to a running state, ensuring that the device is automatically started into a running state. In response to a release instruction for a target device in an open source Hongmeng system, the system reduces the reference count by calling a power management release function. If the reference count drops to zero and no new use instruction is received within a preset time, the system will automatically call a suspend callback function to put the device into a suspended state, realizing unified and centralized management of the power states of various devices, ensuring that the devices that are not in use are automatically suspended, reducing system power consumption, prolonging battery life and device service life, and improving system performance.

[0021] It should be understood that the content described in this part is not intended to identify key or important features of the embodiments of the present application, nor is it used to limit the scope of the present application. Other features of the present application will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS

[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can also be obtained by those skilled in the art without creative labor.

[0023] Figure 1 is a flowchart of a power management method based on an open source Hongmeng system according to an embodiment of the present application;

[0024] Figure 2 is a flowchart of another power management method based on an open source Hongmeng system according to an embodiment of the present application;

[0025] Figure 3 is a flowchart of another power management method based on an open source Hongmeng system according to an embodiment of the present application;

[0026] Figure 4 is a structural schematic diagram of a power management device based on an open source Hongmeng system according to an embodiment of the present application;

[0027] Figure 5 is a structural schematic diagram of an electronic device implementing the power management method based on the open-source MeeGo system according to an embodiment of the present application. DETAILED DESCRIPTION

[0028] In order to make the personnel in the technical field better understand the present application scheme, the technical scheme in the embodiments of the present application will be clearly and completely described below in combination with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor should belong to the scope of protection of the present application.

[0029] It should be noted that the terms "first", "second", and the like in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0030] Embodiment one

[0031] Figure 1 A flowchart of a power management method based on an open-source MeeGo system is provided for the first embodiment of the present application. The present embodiment can be applicable to the case of managing the power usage state of a device based on an open-source MeeGo system. The method can be performed by a power management device based on an open-source MeeGo system, which can be realized in the form of hardware and / or software and can generally be configured in an electronic device. As shown in the figure, the method comprises: Figure 1

[0032] S110, in response to a usage instruction for a target device in the open-source MeeGo system, obtaining the current power usage state of the target device by calling a power management usage function, and increasing the reference count value of the target device.

[0033] In the embodiments of the present application, the open-source MeeGo system can be understood as an open-source operating system for the Internet of Things and smart devices. The system supports cross-device connection of multiple device types, provides integration and management of each device in the form of a unified software platform, and realizes unified power management of each device.

[0034] ​The power usage state can be specifically understood as: the current power mode or running state of the device, which can include: a running state, i.e., the device is normally working and in a full-power running mode; a suspended state, i.e., the device temporarily stops working and is in a low-power consumption mode, and usually cannot immediately respond to user requests and needs to return to the full-power running state through a recovery process; an idle state, i.e., the device is in a low-power consumption mode due to not being used, and the power consumption is slightly higher than that in the suspended state, and the device in the idle state maintains a certain activity so as to be able to quickly respond to user requests and almost no waiting time is needed to recover to the full-power running state; and a shutdown state, i.e., the device is completely turned off and does not consume power.

[0035] The reference count value can be specifically understood as: a value used to record the number of times the device is used or referenced, which can be counted by using a counter corresponding to the target device. When the reference count value corresponding to the device is 0, it indicates that the current device is not used by a process or a user. Each time a process or a user starts to use the device, the corresponding reference count is increased by 1; each time a process or a user stops using the device, the corresponding reference count is decreased by 1. The system can switch the power usage state of the target device according to the reference count value to optimize power management and system performance.

[0036] The power management usage function can be specifically understood as: when a certain module or a certain user in the system needs to use a target device in the open source Hongmeng system, a function for obtaining the current power usage state of the target device and increasing the reference count value of the target device by 1, indicating that the number of times the device is used is increased by one. Typically, when a certain module or a certain user in the system needs to use a certain device, the power management usage function needs to be called, and the device identifier parameter (data type is string) to be used needs to be passed in the power management usage function. The parameter is passed in the form of a reference, cannot be modified, and cannot be empty. The return value type of the power management usage function is a 32-bit integer type, which is used to return whether the operation is successful: returning 0 indicates success, and returning -1 indicates failure. It can be understood that, in order to realize the above power management usage function, the power management usage function needs to implement a pre-designed power management usage interface. In a specific example, the form of the power management usage interface can be: int32_t get(const std::string&descriptor), wherein the parameter name is descriptor, the parameter type is const std::string&, indicating that the parameter is a constant reference, used to pass an object of the std::string (string) type, and the return value type: int32_t is a 32-bit integer type, used to return whether the operation is successful, for example, returning 0 indicates success, and returning -1 indicates failure.

[0037] Specifically, when a user or a system issues a use instruction for using a target device in the open-source OS, the system, in response to the use instruction, calls a power management use function to acquire a current power use state of the target device, and meanwhile, increases a reference count value of the target device.

[0038] S120, when the acquired current power use state is the suspended state, adjusting the power use state of the target device to the running state by calling a recovery callback function corresponding to the target device.

[0039] In the embodiment of the application, the recovery callback function can be specifically understood as a function for recovering a device from a suspended state to a normal running state, and defines operation steps required for recovering the running state of the device, and can specifically include: reinitializing the device to a state before suspension, recovering register settings of the device, and reestablishing communication with the device, so as to ensure that the device can work normally.

[0040] Specifically, when the system detects that the target device is currently in the suspended state, the system calls the recovery callback function corresponding to the target device to wake up the device from the suspended state and recover the device to the normal running state.

[0041] S130, in response to a release instruction for the target device in the open-source OS, detecting a reference count value of the target device after the reference count value of the target device is reduced by calling a power management release function.

[0042] In the embodiment of the present application, the power management release function can be understood as follows: when a certain module or a certain user in the system no longer needs to use a certain target device in the open source Hongmeng system, a function for reducing the reference count value of the target device by 1, indicating that the number of uses of the device is reduced by one. Typically, when a certain module or a certain user in the system no longer needs to use a certain device, the power management release function needs to be called, and the power management release function needs to pass in the device identifier parameter that is no longer needed to use. The parameter is passed in the form of a reference, cannot be modified, and cannot be empty. The return value type of the power management release function is a 32-bit integer type, which is used to return whether the operation is successful: returning 0 indicates successful release of the device, and returning -1 indicates failure to release the device. It can be understood that, in order to implement the above power management release function, the power management release function needs to implement a pre-designed power management release interface. In a specific example, the form of the power management release interface can be: int32_t Put(const std::string&descriptor), wherein the parameter name is descriptor, the parameter type is const std::string&, indicating that the parameter is a constant reference, used to pass an object of the std::string (string) type, and the return value type: int32_t is a 32-bit integer type, used to return whether the operation is successful, for example, returning 0 indicates success, and returning -1 indicates failure.

[0043] Specifically, when a certain target device in the open source Hongmeng system is no longer needed to be used, the user or the system will issue a release instruction for the device. The system responds to the release instruction and calls the power management release function to reduce the reference count value of the target device. After each reduction of the reference count value, the system detects the reference count value of the device to detect how many processes or users are currently using the device.

[0044] S140, when it is detected that the reference count value of the target device is 0, if a use instruction for the target device is not received within a preset time length, the power use state of the target device is adjusted to a suspended state by calling a suspension callback function corresponding to the target device.

[0045] In the embodiment of the present application, the suspension callback function can be understood as follows: a function for switching a device from a running state to a suspended state, which defines the operation steps required to switch the device to the suspended state, and can specifically include: saving the device state, that is, saving the current state of the device before suspending the device, so that the device can quickly return to the working state before suspension when the device is restored; stopping device operation, that is, stopping the operation of the current running state of the device, and releasing the resources occupied by the device; switching the power use state of the target device, that is, switching the power use state of the target device to a suspended mode.

[0046] Specifically, when the system detects that the reference count value of the target device is 0, it indicates that no other user or process is currently using the target device. The system can use an event-driven mechanism to monitor whether a use instruction for the target device is received within a preset time length, that is, when the device is used, a corresponding event is triggered, and if no event is triggered within the preset time length, it is determined that the device is idle. Alternatively, the system can use a timer polling method to monitor whether a use instruction for the target device is received within a preset time length, that is, the device state is checked periodically, so as to monitor whether a use instruction for the target device is received within a preset time length. If no use instruction for the target device is received within the preset time length, the system will automatically call the suspension callback function corresponding to the target device, so as to adjust the power usage state of the device from the running state to the suspended state.

[0047] The technical scheme of the embodiment of the application, in response to a use instruction for a target device in an open source Hongmeng system, the system acquires the current power state of the device by calling a power management use function, and increases the reference count of the device. If the reference count value is greater than or equal to 1, it indicates that the device is being used by a user or a process. If the device is in a suspended state, the system will automatically call a recovery callback function to restore it to a running state, ensuring that the device is automatically started into a running state. In response to a release instruction for a target device in an open source Hongmeng system, the system reduces the reference count by calling a power management release function. If the reference count drops to zero and no new use instruction is received within a preset time, the system will automatically call a suspension callback function to place the device in a suspended state, realizing unified and centralized management of the power states of various devices, ensuring that the devices that are not used are automatically suspended, reducing system power consumption, prolonging battery life and device service life, and improving system performance.

[0048] Optionally, on the basis of each of the above embodiments, the use instruction and the release instruction for the target device in the open source Hongmeng system are dynamically generated by the open source Hongmeng system by real-time monitoring of the current system power mode and power level of each device according to a preset device priority.

[0049] It can be understood that the use instruction and the release instruction for the target device in the open source Hongmeng system can be manually issued by a user or a system administrator through an application program or a system interface, to explicitly require the use or release of a certain target device. The use instruction and the release instruction for the target device in the open source Hongmeng system can also be automatically issued by the system based on the power mode, the power level and the device priority.

[0050] In the embodiment of the present application, the power mode can be specifically understood as the current power management state of the device. Different power modes correspond to different power management and performance, which can specifically include: normal mode, i.e. the device runs at normal performance without any power limit; power saving mode, i.e. the device reduces performance to reduce power consumption and prolong battery life; performance mode, i.e. the device keeps high performance output mode, which will increase power consumption, and is suitable for scenarios that require high load operation or graphics processing; super power saving mode, i.e. the device will further reduce power consumption on the basis of the power saving mode, and will further limit some unnecessary functions to maximize the battery life.

[0051] The power level can be specifically understood as the current remaining battery power of the device, which can be displayed in percentage. When the power level is high, the system allows the device to run in performance mode to provide better user experience. When the power level is low, the system will automatically switch to power saving mode or super power saving mode to reduce power consumption and prolong battery life. Users can also manually select the power mode to adapt to different use scenarios and needs.

[0052] The device priority can be specifically understood as the priority assigned by the system to each device according to its type and function, which is stored in the device priority configuration file. High-priority devices will have priority access to power support when system resources are limited.

[0053] Specifically, the open source Hongmeng system uses the power mode manager in the power management module to monitor the power mode and power level in real time, and combines the device priority set in the device priority configuration file to dynamically generate usage instructions and release instructions for the target device.

[0054] In a specific example, assuming that the system is currently in power saving mode and the power level is low, the system will prioritize normal use of high-priority devices (such as a phone microphone in a call) while generating release instructions for low-priority devices (such as background running applications) to limit their resource occupation. When the user ends the call, the phone microphone will be released, and the system will re-evaluate and adjust the usage instructions of other devices according to the current power mode and power level.

[0055] By dynamically generating usage instructions and release instructions for the target device, it can ensure that high-priority devices can obtain sufficient power support when needed, while in low power or power saving mode, it prioritizes the operation of critical devices and limits or suspends the use of non-critical devices to save energy, improving the utilization of system power resources.

[0056] Embodiment two

[0057] Figure 2The flowchart of another power management method based on the open source Honeycomb system provided in Embodiment Two of the present application is a refinement of the above-mentioned embodiment "when the reference count value of the target device is detected to be 0, if a use instruction for the target device is not received within a preset time length, the power use state of the target device is adjusted to a suspended state by calling the suspension callback function corresponding to the target device", and can specifically include: when the reference count value of the target device is detected to be 0, the idle suspension timer corresponding to the target device is started by calling the idle callback function corresponding to the target device; and when the idle suspension timer does not receive a use instruction for the target device in the open source Honeycomb system within a preset time length after being started, the power use state of the target device is adjusted to a suspended state by calling the suspension callback function corresponding to the target device.

[0058] Correspondingly, as shown in Figure 2 The method comprises:

[0059] S210, in response to a use instruction for a target device in the open source Honeycomb system, the current power use state of the target device is obtained by calling a power management use function, and the reference count value of the target device is increased.

[0060] S220, when the obtained current power use state is a suspended state, the power use state of the target device is adjusted to a running state by calling the recovery callback function corresponding to the target device.

[0061] S230, in response to a release instruction for the target device in the open source Honeycomb system, the reference count value of the target device is detected after the reference count value of the target device is reduced by calling a power management release function.

[0062] S240, when the reference count value of the target device is detected to be 0, the idle suspension timer corresponding to the target device is started by calling the idle callback function corresponding to the target device.

[0063] In the embodiment of the present application, the idle callback function can be specifically understood as: a function for starting the idle suspension timer, making the target device enter an idle state and starting the timer. The idle suspension timer can be specifically understood as: a timer started when the device enters an idle state, used to monitor whether the target device is used within a preset time length.

[0064] Specifically, when the system detects that the reference count value of the target device is 0, it indicates that no other user or process is currently using the device. The system calls the idle callback function corresponding to the target device, thereby starting the idle suspension timer associated with the target device, and monitors whether a use instruction for the device is received within a preset time length.

[0065] Further, on the basis of the above-mentioned embodiments, after starting the idle suspension timer corresponding to the target device, the following can also be included:

[0066] When the idle suspension timer receives a use instruction for the target device in the open source Hongmeng system within a preset time period after starting, the idle suspension timer corresponding to the target device is reset and closed.

[0067] Specifically, if the system receives a use instruction for the device during the running of the timer, it means that the device is about to be used. At this time, the system resets and closes the idle suspension timer, avoiding the device being suspended when the user needs to use it, ensuring that the device can quickly respond when the user needs it, while saving energy when idle.

[0068] S250, when the idle suspension timer does not receive a use instruction for the target device in the open source Hongmeng system within a preset time period after starting, the power use state of the target device is adjusted to a suspended state by calling the suspension callback function corresponding to the target device.

[0069] Specifically, after the idle suspension timer starts, if the system does not detect a use instruction for the target device within a preset time period, the system calls the suspension callback function corresponding to the target device to adjust the power use state of the target device to a suspended state.

[0070] The technical scheme of the embodiment of the application, in response to a use instruction for a target device in the open source Hongmeng system, the system acquires the current power state of the device by calling the power management use function, and increases the reference count of the device. If the reference count value is greater than or equal to 1, it means that the device is being used by a user or a process. If the device is in a suspended state, the system will automatically call the recovery callback function to restore it to a running state, ensuring that the device is automatically started into a running state. In response to a release instruction for a target device in the open source Hongmeng system, the system reduces the reference count by calling the power management release function. When it is detected that the reference count value of the target device is 0, it means that no other process or user is using the device at this time, the idle callback function corresponding to the target device is called, and the idle suspension timer corresponding to the target device is started, the idle state of the device is timed, and when the idle suspension timer does not receive a use instruction for the target device in the open source Hongmeng system within a preset time period after starting, it means that the device has been continuously idle within the preset time period and has not been called by any process or user, and the system will automatically call the suspension callback function to set the device to a suspended state. By taking the idle suspension timer as part of the unified power management strategy, the system realizes unified and centralized management of the power states of various devices, ensures automatic suspension of unused devices, reduces system power consumption, prolongs battery life and device service life, and improves system performance.

[0071] Embodiment three

[0072] Figure 3 A flowchart of another power management method based on the open source Hongmeng system is provided for embodiment three of the application. This embodiment is a refinement of the power management method based on the open source Hongmeng system described in the above embodiments. Specifically, before responding to the usage instruction for the target device in the open source Hongmeng system, the method can further include: in response to the start of the open source Hongmeng system, loading the device driver library of each registered device by initializing the hardware driver framework, reading the hardware configuration source file of each device, and initializing the device driver by calling the device initialization function; registering the identifier of each device and the corresponding callback function in the device power state switching function mapping table by calling the registration function; wherein the callback function includes a suspend callback function, a resume callback function, and an idle callback function; based on the device power state switching function mapping table and the identifier of each device, calling the suspend callback function of each device to adjust the power usage state of each device to the suspended state; resetting the reference count value of each device to 0, and adding the identifier of each device and the corresponding reference count value to the device usage count list.

[0073] Correspondingly, as shown in Figure 3 , the method includes:

[0074] S310, in response to the start of the open source Hongmeng system, loading the device driver library of each registered device by initializing the hardware driver framework, reading the hardware configuration source file of each device, and initializing the device driver by calling the device initialization function.

[0075] In the embodiment of the application, the hardware driver framework can be understood as a unified interface hardware framework in the open source Hongmeng system, which is used to coordinate the loading, initialization and management of all registered device drivers in the system, so that the device can interact with the system. The device driver library can be understood as a file including a device driver program and data resources, which is used to control and manage the device and provide an interface for communication with the device. Each driver library corresponds to a hardware device, and the process of loading the driver library includes loading the device driver program and data resources into the memory and requires corresponding initialization.

[0076] The hardware configuration source file can be understood as a file in the open source Hongmeng system for describing hardware configuration information, which defines the configuration information of the properties, resources and drivers of the device in the form of key-value pairs. The device initialization function can be understood as a function in the device driver program for initializing the device, which can specifically include operations such as configuring hardware resources, setting device state and allocating memory. By calling the device initialization function when the system starts or the device loads, the device is in a normal working state.

[0077] Specifically, when the open source Hongmeng system starts, the registered device driver library is loaded by initializing the hardware driver framework, the hardware configuration source file is read and each device initialization function is called, and the driver program will complete the initialization operation of the hardware device according to the information in the hardware configuration source file, for example, the obtained configuration parameters are set to the device register through the initialization function to complete the bottom layer driver initialization, so as to ensure that the device is in a consistent initial state.

[0078] S320, register the identifiers of the devices and the corresponding callback functions into the device power state switching function mapping table by calling the registration function.

[0079] The callback function includes a suspend callback function, a resume callback function and an idle callback function.

[0080] In the embodiment of the application, the registration function can be specifically understood as an interface for registering the identifier of the device and the corresponding callback function into the mapping table. Typically, the parameters of the registration function can include the device identifier and the power state switching callback function class object of the device. The function return value is a 32-bit integer type, and 0 is returned for successful registration and -1 is returned for failed registration.

[0081] The device power state switching function mapping table can be specifically understood as a data structure for storing the identifiers of the devices and the corresponding callback functions in the form of key-value pairs. The key is the identifier of the device (the data type can be a string), and the value is the corresponding callback function (the corresponding power state switching callback function class object). The system can determine which callback function of which device should be called when the power state changes by looking up the device power state switching function mapping table.

[0082] The callback function of the device needs to implement a power state switching callback function class (an abstract interface class of power management), and the power state switching callback function class includes pure virtual functions for processing the suspend, resume and idle state switching operations of the device. Each pure virtual function has no parameters and returns a 32-bit integer type value. 0 indicates that the state switching operation is successful, and -1 indicates that the state switching operation fails. The callback function of the specific device needs to inherit this class and implement these pure virtual functions, that is, it needs to define the specific power state switching callback object, that is, the callback function, by calling the corresponding bottom layer driver function of the device. The bottom layer driver function can be specifically understood as a function that directly interacts with the hardware and performs specific power management operations.

[0083] Specifically, each device needs to define the specific callback function by calling the bottom layer driver function to implement the power state switching callback function class interface according to its own needs. Then, the device identifier and the callback function are registered into the device power state switching function mapping table by calling the registration function.

[0084] S330, based on the device power state switching function mapping table and the identifiers of the devices, calling the suspension callback functions of the devices, and adjusting the power usage states of the devices to the suspended state.

[0085] Specifically, the corresponding suspension callback function is retrieved from the device power state switching function mapping table according to the identifier of the device, and is called. The suspension callback function ensures that the power usage state of the device is initialized to the suspended state by calling the underlying driver function.

[0086] S340, resetting the reference count values of the devices to 0, and adding the identifiers of the devices and the corresponding reference count values to the device usage count list.

[0087] In the embodiments of the application, the device usage count list can be specifically understood as a data structure for recording the reference count values of each device. The list includes the identifiers of the devices and the corresponding reference count values, and the system monitors the usage state of the device through the list.

[0088] Specifically, each device registered in the device power state switching function mapping table will create a corresponding reference count variable, and is initialized to 0, indicating that the device is not used initially. Then, the identifier (data type can be a string) of the device and the reference count value (data type can be an integer type) are added to the device usage count list, so that the system can track the usage state of the device through the reference count.

[0089] S350, in response to a usage instruction for a target device in the open source Hongmeng system, obtaining the current power usage state of the target device by calling the power management usage function, and increasing the reference count value of the target device.

[0090] Optionally, on the basis of the above-mentioned embodiments, the current power usage state of the target device is obtained by calling the power management usage function, and the reference count value of the target device is increased, which can include:

[0091] The current power usage state of the target device is obtained by calling the power management usage function, and the reference count value of the target device is determined and increased based on the identifier of the target device and the device usage count list;

[0092] The reference count value of the target device is reduced by calling the power management release function, including:

[0093] The reference count value of the target device is determined and reduced based on the identifier of the target device and the device usage count list by calling the power management release function.

[0094] Specifically, when a module or a user needs to use a target device, the system calls a power management use function to obtain the current power state of the target device, and finds and increases the reference count value corresponding to the device in the device use count list through the device identifier, indicating that a new user starts to use the device.

[0095] When the module or the user no longer needs to use the target device, the system calls a power management release function to find and decrease the reference count value corresponding to the device in the device use count list through the device identifier, indicating that a user of the device has ended the use. By using the device use count list, the system can update the use state of the device in time, and realize unified and centralized management of the power states of the devices.

[0096] S360, when the obtained current power use state is the suspended state, the power use state of the target device is adjusted to the running state by calling the recovery callback function corresponding to the target device.

[0097] S370, in response to a release instruction for the target device in the open source Hongmeng system, the reference count value of the target device is detected after the power management release function is called to decrease the reference count value of the target device.

[0098] S380, when the reference count value of the target device is detected to be 0, if no use instruction for the target device is received within a preset time length, the power use state of the target device is adjusted to the suspended state by calling the suspension callback function corresponding to the target device.

[0099] The technical scheme of the embodiment of the application initializes the hardware driver framework to load the registered device driver library, reads the hardware configuration source file and initializes the device driver when the open source Hongmeng system starts, ensures that the device is in a consistent initial state. At the same time, the device identifier and the callback function are registered in the mapping table to realize centralized management of the device power state. After the system starts, the device is set to the suspended state by default by calling the suspend callback function, the initial power consumption is reduced, and the device reference count value is initialized to 0 to dynamically manage the power state of the device. In response to a use instruction for a target device in the open source Hongmeng system, the system obtains the current power state of the device by calling the power management use function, and increases the reference count of the device. If the device is in the suspended state, the system will automatically call the resume callback function to restore it to the running state. In response to a release instruction for a target device in the open source Hongmeng system, the system reduces the reference count by calling the power management release function. If the reference count decreases to zero and no new use instruction is received within a preset time, the system will automatically call the suspend callback function to set the device to the suspended state, realize unified and centralized management of the power state of each device, ensure that the device that is not used is automatically suspended, reduce the system power consumption, prolong the battery life and the service life of the device, and improve the system performance.

[0100] Optionally, on the basis of each of the above embodiments, when the obtained current power use state is the suspended state, the power use state of the target device is adjusted to the running state by calling the resume callback function corresponding to the target device, which can include:

[0101] When the obtained current power use state is the suspended state, the resume callback function corresponding to the target device is determined based on the device power state switching function mapping table and the identifier of the target device;

[0102] The power use state of the target device is adjusted to the running state by calling the resume callback function corresponding to the target device;

[0103] The idle suspend timer corresponding to the target device is started by calling the idle callback function corresponding to the target device, which can include:

[0104] The idle callback function corresponding to the target device is determined based on the device power state switching function mapping table and the identifier of the target device;

[0105] The idle suspend timer corresponding to the target device is started by calling the idle callback function corresponding to the target device;

[0106] The power use state of the target device is adjusted to the suspended state by calling the suspend callback function corresponding to the target device, which can include:

[0107] determine the suspension callback function corresponding to the target device based on the device power state switching function mapping table and the identifier of the target device;

[0108] adjust the power usage state of the target device to the suspended state by calling the suspension callback function corresponding to the target device.

[0109] Specifically, in response to a usage instruction for a target device in an open source Hongmeng system, when the system detects that the current power usage state of the target device is in the suspended state, the device power state switching function mapping table is queried according to the identifier of the target device, the corresponding recovery callback function is found and called, and the specific power recovery operation is performed to adjust the power usage state of the device from suspended to running.

[0110] In response to a release instruction for a target device in an open source Hongmeng system, the system determines and calls the idle callback function corresponding to the target device through the device power state switching function mapping table and the identifier of the target device, starts the idle suspension timer corresponding to the target device, and monitors whether the device is used within a preset time length.

[0111] In response to a release instruction for a target device in an open source Hongmeng system, and when no usage instruction for the target device is received within a preset time length, the system queries the device power state switching function mapping table according to the identifier of the target device, determines and calls the suspension callback function corresponding to the target device, and executes the specific suspension operation to adjust the power usage state of the device from the current state to suspended.

[0112] By using the device power state switching function mapping table and the identifier of the target device, the system can efficiently manage the power state of the device, realize quick switching of the power state, improve the resource optimization efficiency, realize unified and centralized management of the power state of each device, and improve the system performance.

[0113] Embodiment Four

[0114] Figure 4 A structural schematic diagram of a power management device based on an open source Hongmeng system is provided for the fourth embodiment of the present application. As shown in the figure, the device comprises: Figure 4

[0115] The usage response module 410 is configured to, in response to a usage instruction for a target device in an open source Hongmeng system, obtain the current power usage state of the target device by calling the power management usage function, and increase the reference count value of the target device.

[0116] The recovery callback module 420 is configured to, when the obtained current power usage state is in the suspended state, adjust the power usage state of the target device to the running state by calling the recovery callback function corresponding to the target device.

[0117] ​The release response module 430 is configured to, in response to a release instruction for the target device in the open source Hongmeng system, reduce a reference count value of the target device by calling a power management release function, and detect the reference count value of the target device.

[0118] The suspension callback module 440 is configured to, when it is detected that the reference count value of the target device is 0, if a use instruction for the target device is not received within a preset time length, adjust a power use state of the target device to a suspended state by calling a suspension callback function corresponding to the target device.

[0119] The technical scheme of the embodiment of the application, in response to a use instruction for a target device in an open source Hongmeng system, the system acquires a current power state of the device by calling a power management use function, and increases the reference count of the device. If the reference count value is greater than or equal to 1, it indicates that the device is being used by a user or a process. If the device is in a suspended state, the system will automatically call a recovery callback function to restore it to a running state, ensuring that the device is automatically started into a running state. In response to a release instruction for a target device in an open source Hongmeng system, the system reduces the reference count by calling a power management release function. If the reference count drops to zero and no new use instruction is received within a preset time, the system will automatically call a suspension callback function to set the device to a suspended state, realizing unified and centralized management of the power states of the devices, ensuring that the devices that are not used are automatically suspended, reducing system power consumption, prolonging battery life and device service life, and improving system performance.

[0120] On the basis of the above-mentioned embodiments, the suspension callback module 440 is specifically configured to:

[0121] When it is detected that the reference count value of the target device is 0, an idle suspension timer corresponding to the target device is started by calling an idle callback function corresponding to the target device.

[0122] When the idle suspension timer does not receive a use instruction for the target device in the open source Hongmeng system within a preset time length after being started, the power use state of the target device is adjusted to a suspended state by calling a suspension callback function corresponding to the target device.

[0123] Optionally, on the basis of the above-mentioned embodiments, the suspension callback module 440 can include:

[0124] The reset-off unit is configured to, after starting the idle suspension timer corresponding to the target device, when the idle suspension timer receives a use instruction for the target device in the open source Hongmeng system within a preset time length after being started, reset and turn off the idle suspension timer corresponding to the target device.

[0125] Further, based on the above embodiments, the power management apparatus based on the open source OS system can further comprise:

[0126] an initialization module, configured to, in response to the start of the open source OS system, load the device driver library of each registered device by initializing the hardware driver framework, read the hardware configuration source file of each device, and initialize the device driver by calling the device initialization function of each device, before responding to the use instruction for the target device in the open source OS system.

[0127] a mapping table module, configured to register the identifier of each device and the corresponding callback function into the device power state switching function mapping table by calling the registration function; wherein the callback function comprises a suspend callback function, a resume callback function, and an idle callback function.

[0128] an initial suspend module, configured to call the suspend callback function of each device based on the device power state switching function mapping table and the identifier of each device, and adjust the power use state of each device to the suspend state.

[0129] an initial count module, configured to reset the reference count value of each device to 0, and add the identifier of each device and the corresponding reference count value to the device use count list.

[0130] Based on the above embodiments, the use response module 410 is specifically configured to:

[0131] obtain the current power use state of the target device by calling the power management use function, and determine and increase the reference count value of the target device based on the identifier of the target device and the device use count list.

[0132] Based on the above embodiments, the release response module 430 is specifically configured to:

[0133] determine and reduce the reference count value of the target device based on the identifier of the target device and the device use count list by calling the power management release function.

[0134] Based on the above embodiments, the resume callback module 420 is specifically configured to:

[0135] when the obtained current power use state is the suspend state, determine the resume callback function corresponding to the target device based on the device power state switching function mapping table and the identifier of the target device;

[0136] adjust the power use state of the target device to the running state by calling the resume callback function corresponding to the target device.

[0137] Based on the above embodiments, the suspend callback module 440 is further configured to:

[0138] determine the idle callback function corresponding to the target device based on the device power state switching function mapping table and the identifier of the target device;

[0139] start the idle suspension timer corresponding to the target device by calling the idle callback function corresponding to the target device.

[0140] On the basis of the above embodiments, the suspension callback module 440 is further used for:

[0141] determine the suspension callback function corresponding to the target device based on the device power state switching function mapping table and the identifier of the target device;

[0142] adjust the power usage state of the target device to the suspension state by calling the suspension callback function corresponding to the target device.

[0143] On the basis of the above embodiments, the usage instruction and the release instruction of the target device in the open source Hongmeng system are dynamically generated by the open source Hongmeng system by monitoring the current system power mode and power level of each device in real time according to the preset device priority.

[0144] The power management device based on the open source Hongmeng system provided in the embodiments of the present application can execute the power management method based on the open source Hongmeng system provided in any embodiment of the present application, and has the corresponding function modules and beneficial effects of the execution method.

[0145] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved in the technical solution comply with relevant laws and regulations and do not violate public order and good customs.

[0146] Embodiment five

[0147] Figure 5 A structural schematic diagram of an electronic device 10 that can be used to implement embodiments of the present application is shown. The electronic device is intended to represent various forms of digital computers, such as laptops, desktops, tablets, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular telephones, smart phones, wearable devices (e.g., headsets, glasses, watches, etc.), and other similar computing devices. The components shown here, their connections and relationships, and their functions, are meant to be examples only, and are not intended to limit the implementations of the present application described and / or claimed in this document.

[0148] As Figure 5As shown, the electronic device 10 includes at least one processor 11, and a memory, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., which is communicatively connected to the at least one processor 11, wherein the memory stores a computer program that can be executed by the at least one processor. The processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or loaded from the storage unit 18 into the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0149] A plurality of components in the electronic device 10 are connected to the I / O interface 15, including an input unit 16, such as a keyboard, a mouse, etc., an output unit 17, such as various types of displays, a loudspeaker, etc., a storage unit 18, such as a magnetic disk, an optical disk, etc., and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network, such as the Internet, and / or various telecommunication networks.

[0150] The processor 11 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 performs various methods and processes described above, such as the power management method based on the open-source Hongmeng system, that is:

[0151] In response to a use instruction for a target device in the open-source Hongmeng system, a current power use state of the target device is obtained by calling a power management use function, and a reference count value of the target device is increased;

[0152] When the obtained current power use state is a suspended state, the power use state of the target device is adjusted to a running state by calling a recovery callback function corresponding to the target device;

[0153] In response to a release instruction for the target device in the open-source Hongmeng system, the reference count value of the target device is detected after the reference count value of the target device is reduced by calling a power management release function;

[0154] When it is detected that the reference count value of the target device is 0, if a use instruction for the target device is not received within a preset time length, the power use state of the target device is adjusted to a suspended state by calling a suspension callback function corresponding to the target device.

[0155] In some embodiments, the open-source-Maemo-based power management method can be implemented as a computer program tangibly embodied in a computer readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed onto the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded onto the RAM 13 and executed by the processor 11, one or more steps of the open-source-Maemo-based power management method described above can be performed. Alternatively, in other embodiments, the processor 11 can be configured to perform the open-source-Maemo-based power management method by any other suitable means, such as by means of firmware.

[0156] Various implementations of the systems and techniques described above can be realized in digital electronic circuitry, integrated circuitry, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on a chip (SOC), a programmable logic device (PLD), a computer hardware, firmware, software, and / or combinations thereof. These various implementations can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.

[0157] Computer programs used to implement the methods of the application can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the computer program, when executed, implements the functions / acts specified in the flowcharts and / or block diagrams. The computer program can be executed entirely on a machine, partially on a machine, partially on a machine and partially on a remote machine or entirely on a remote machine or server.

[0158] In the context of the present application, a computer-readable storage medium can be a tangible medium that can contain or store computer programs for use by or in connection with an instruction execution system, apparatus, or device. Computer-readable storage media can include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium can be a machine-readable signal medium. More specific examples of a machine-readable storage medium will include one or more lines of a program of instructions in a transitory signal, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0159] To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the electronic device. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.

[0160] The systems and techniques described here can be implemented in a computing system that includes a back end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front end component (e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back end, middleware, or front end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0161] The computing system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system, to solve the defects of large management difficulty and weak business scalability in traditional physical host and VPS service.

[0162] It should be understood that the various forms of flow shown above can be used to reorder, add or delete steps. For example, each step described in the present application can be executed in parallel, sequentially or in a different order, as long as the desired results of the technical solutions of the present application can be achieved, which is not limited herein.

[0163] The above detailed description does not constitute a limitation on the protection scope of the present application. Those skilled in the art should understand that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent replacements and improvements made within the spirit and principles of the present application shall be included in the protection scope of the present application.

Claims

1. A power management method based on an open-source Hongmeng system, characterized in that, The method comprises the following steps: in response to a use instruction for a target device in an open source Hongmeng system, obtaining a current power use state of the target device by calling a power management use function, and increasing a reference count value of the target device; when the obtained current power use state is a suspended state, adjusting the power use state of the target device to a running state by calling a corresponding resume callback function of the target device; in response to a release instruction for the target device in the open source Hongmeng system, detecting the reference count value of the target device after reducing the reference count value of the target device by calling a power management release function; when the reference count value of the target device is detected to be 0, if a use instruction for the target device is not received within a preset time length, adjusting the power use state of the target device to a suspended state by calling a corresponding suspend callback function of the target device.

2. The method of claim 1, wherein, When the reference count value of the target device is detected to be 0, if a use instruction for the target device is not received within a preset time length, adjusting the power use state of the target device to a suspended state by calling a corresponding suspend callback function of the target device, comprising: when the reference count value of the target device is detected to be 0, starting an idle suspension timer corresponding to the target device by calling an idle callback function corresponding to the target device; if the idle suspension timer does not receive a use instruction for the target device in the open source Hongmeng system within a preset time length after being started, adjusting the power use state of the target device to a suspended state by calling a corresponding suspend callback function of the target device.

3. The method of claim 2, wherein, After starting the idle suspension timer corresponding to the target device, further comprising: if the idle suspension timer receives a use instruction for the target device in the open source Hongmeng system within a preset time length after being started, resetting and closing the idle suspension timer corresponding to the target device.

4. The method according to any one of claims 1 to 3, characterized in that, Before responding to the use instruction for the target device in the open source Hongmeng system, further comprising: in response to the start of the open source Hongmeng system, loading device driver libraries of each registered device by initializing a hardware driver framework, reading hardware configuration source files of each device, and initializing device drivers by calling device initialization functions; registering identifiers of each device and corresponding callback functions in a device power state switching function mapping table by calling a registration function; wherein the callback functions include a suspend callback function, a resume callback function, and an idle callback function; based on the device power state switching function mapping table and the identifiers of each device, calling the suspend callback function of each device to adjust the power use state of each device to a suspended state; resetting the reference count value of each device to 0, and adding the identifiers of each device and the corresponding reference count values to a device use count list.

5. The method of claim 4, wherein, obtaining the current power use state of the target device by calling the power management use function, and increasing the reference count value of the target device, comprising: obtaining the current power use state of the target device by calling the power management use function, and determining and increasing the reference count value of the target device based on the identifier of the target device and the device use count list; reducing the reference count value of the target device by calling the power management release function, comprising: By calling the power management release function, based on the identifier of the target device and the device usage count list, the reference count value of the target device is determined and reduced.

6. The method of claim 4, wherein, When the obtained current power usage state is the suspended state, the power usage state of the target device is adjusted to the running state by calling the recovery callback function corresponding to the target device, including: When the obtained current power usage state is the suspended state, the recovery callback function corresponding to the target device is determined based on the device power state switching function mapping table and the identifier of the target device; The power usage state of the target device is adjusted to the running state by calling the recovery callback function corresponding to the target device; By calling the idle callback function corresponding to the target device, the idle suspension timer corresponding to the target device is started, including: The idle callback function corresponding to the target device is determined based on the device power state switching function mapping table and the identifier of the target device; By calling the idle callback function corresponding to the target device, the idle suspension timer corresponding to the target device is started; By calling the suspend callback function corresponding to the target device, the power usage state of the target device is adjusted to the suspended state, including: The suspend callback function corresponding to the target device is determined based on the device power state switching function mapping table and the identifier of the target device; By calling the suspend callback function corresponding to the target device, the power usage state of the target device is adjusted to the suspended state.

7. The method of claim 1, wherein, The use instruction and the release instruction of the target device in the open source Hongmeng system are dynamically generated by the open source Hongmeng system by monitoring the current system power mode and power level of each device in real time according to the preset device priority.

8. An electronic device, comprising: The electronic device includes: At least one processor; and The memory is in communication connection with the at least one processor; wherein The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to execute the power management method based on the open source Hongmeng system in any one of claims 1-7.

9. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer instructions, and the computer instructions are used to enable the processor to execute the power management method based on the open source Hongmeng system in any one of claims 1-7.

10. A computer program product, characterised in that, The computer program product includes a computer program, and the computer program is executed by the processor to implement the power management method based on the open source Hongmeng system according to any one of claims 1-7.