Drive method, readable storage medium and electronic device
By detecting whether the target power management data exists in the memory and driving the hardware based on the data, the problem of difficult to modify the power management data in the PMIC register is solved, and the rapid, convenient and permanent update of the power management data of the electronic device hardware is achieved, avoiding equipment abnormalities.
Patent Information
- Application Number
- PCT/CN2023/128136
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-10-31
- Publication Date
- 2025-05-08
AI Technical Summary
The power management data in the PMIC register in existing electronic devices is difficult to modify by users, resulting in abnormalities in electronic devices when the settings are unreasonable.
A driving method is provided, by detecting whether target power management data exists in the memory, if it exists, it drives the hardware based on the data, and if it does not exist, it drives the hardware based on the original power management data in the PMIC register, and stores the target power management data in a nonvolatile memory partition, ensuring that the updated data is still valid after restart.
It realizes fast, convenient and permanent updates of the hardware power management data of electronic equipment, avoids equipment abnormalities caused by unreasonable power management data settings, and improves user experience.
Smart Images

Figure CN2023128136_08052025_PF_FP_ABST
Abstract
Description
Driving method, readable storage medium, and electronic device Technical Field
[0001] The present application relates to the field of terminal technology, and in particular to a driving method, a readable storage medium, and an electronic device. Background Art
[0002] Power management integrated circuits (PMIC) are circuits used to manage the electrical energy of various devices or modules in electronic devices. PMCI is provided with multiple registers for storing power management data corresponding to different hardware, such as voltage thresholds, current thresholds, etc. During the startup process, the kernel of the operating system of the electronic device can generate driving nodes for different hardware (used to indicate the range of the operating voltage, operating current, etc. of the hardware) based on the power management data in the registers in the PMIC (hereinafter referred to as PMIC registers). After the operating system of the electronic device is started, the electronic device can drive each hardware based on the driving node, such as setting the operating current, operating voltage, etc.
[0003] Generally speaking, the power management data in the PMIC registers is written by the electronic device manufacturer before the device leaves the factory and cannot be modified by the user. Improper power management data in the PMIC registers of an electronic device can cause the device to malfunction. For example, setting the upper voltage or current threshold of a hardware device too high can cause the device to generate excessive heat during operation.
[0004] Summary of the Invention
[0005] In view of this, the present application provides a driving method, a readable storage medium, and an electronic device, which can quickly and conveniently permanently update the power management data of the hardware in the electronic device.
[0006] In a first aspect, the present application provides a driving method, which is applied to an electronic device; the method includes: detecting whether first power management data exists in a first memory of the electronic device, wherein the first power management data is used to update: second power management data of first hardware in the electronic device stored in a second memory in a power management chip; corresponding to the existence of the first power management data in the first memory, driving the first hardware based on the first power management data; corresponding to the absence of the first power management data in the first memory, driving the first hardware based on the second power management data.
[0007] In this method, when it is necessary to update the power management parameters of the first hardware (e.g., target hardware hereinafter) in the electronic device, the electronic device can obtain (or receive user input) first power management data (e.g., target power management data hereinafter) from other electronic devices and store it in the first memory (e.g., target storage partition hereinafter). In this way, when the electronic device detects that the first power management data exists in the first memory, it can drive the first hardware based on the first power management data. For example, the first electronic device can generate a driver node for the first hardware based on the first power management data.
[0008] In this way, the power management data of the hardware in the electronic device can be permanently updated quickly and conveniently, and the updated first power management data will not disappear when the electronic device is restarted.
[0009] In addition, if the electronic device does not need to update the power management data of the first hardware, that is, the first power management data does not exist in the first memory, the electronic device can drive the first hardware based on the second power management data (such as the original power management data below) in the second memory (such as the PMIC register), for example, generate a driving node for the first hardware based on the second power management data.
[0010] In a possible implementation of the first aspect, the first memory includes any one of a general flash memory, a memory card, and a read-only memory, and the second memory includes a register.
[0011] In a possible implementation of the first aspect, the power management data is used to indicate at least one of a range of an operating voltage of the first hardware and a range of an operating current of the first hardware.
[0012] In a possible implementation of the first aspect, the first power management data includes at least one of a first voltage threshold and a first current threshold, and the second power management data includes at least one of a second voltage threshold and a second current threshold.
[0013] In a possible implementation of the first aspect above, the first power management data exists in the first memory, and the first hardware is driven based on the first power management data, including at least one of the following methods: limiting the operating current of the first hardware to a first voltage range corresponding to a first voltage threshold; limiting the operating current of the first hardware to a first current range corresponding to a first current threshold.
[0014] For example, assuming that the first voltage threshold is the upper threshold of the operating voltage of the first hardware, the first voltage range may be a range smaller than the first voltage threshold. assuming that the first current threshold is the upper threshold of the operating current of the first hardware, the first current range may be a range smaller than the first current threshold.
[0015] In a possible implementation of the first aspect above, the above corresponding to the absence of the first power management data in the first memory, driving the first hardware based on the second power management data, includes at least one of the following methods: limiting the operating current of the first hardware to a second voltage range corresponding to the second voltage threshold; limiting the operating current of the first hardware to a second current range corresponding to the second current threshold.
[0016] For example, assuming that the second voltage threshold is an upper threshold of the operating voltage of the first hardware, the second voltage range may be a range smaller than the second voltage threshold. assuming that the second current threshold is an upper threshold of the operating current of the first hardware, the second current range may be a range smaller than the second current threshold.
[0017] In a possible implementation of the first aspect above, the above-mentioned detection of whether the first power management data exists in the first memory of the electronic device includes: reading at least one third power management data from the first memory during the startup process of the electronic device, wherein the third power management data includes a third address of a memory in the power management chip for storing power management data of hardware corresponding to the third power management data; when, in at least one third power management data, there is power management data whose third address is the same as the address of the second memory, it is determined that the first power management data exists in the first memory.
[0018] That is, during the startup process (e.g., during the boot process described below), the electronic device can read from the first memory at least one third power management data stored in the first memory, and each third power management data includes a third address of a memory in the power management chip for storing power management data of the hardware corresponding to the third power management data. If the at least one third power management data includes power management data whose third address is the same as the address of the second memory, the electronic device can determine the first memory.
[0019] In a possible implementation of the first aspect above, when there is power management data whose third address is the same as the address of the second memory in at least one third power management data, determining that the first power management data exists in the first memory includes: generating at least one command line corresponding to at least one third power management data during the process of running the boot program of the electronic device, the command line carrying the third address corresponding to the corresponding power management data; during the kernel startup process of the operating system of the electronic device, corresponding to the presence of a command line in at least one command line carrying the third address the same as the address of the second memory, determining that the first power management data exists in the first memory.
[0020] That is, after obtaining at least one third power management data, the electronic device can generate a command line corresponding to each third power management data (or generate one command line for multiple third power management data) during the process of running a boot program (for example, executing an application boot loader). When the electronic device runs the kernel of the operating system to generate a driver node for the first hardware, it can determine whether the first power management data exists based on whether the third address carried in the command line is the same as the address of the first memory.
[0021] In a second aspect, the present application provides a driving method, which includes: the kernel of an operating system of an electronic device detects whether there is first power management data in a first memory of the electronic device, wherein the first power management data is used to update: the second power management data of the first hardware in the electronic device stored in the second memory in the power management chip; corresponding to the existence of the first power management data in the first memory, the kernel generates a driving node for the first hardware based on the first power management data; corresponding to the absence of the first power management data in the first memory, the kernel generates a driving node for the first hardware based on the second power management data; wherein the driving node is used to indicate at least one of the range of the operating voltage and the range of the operating current of the first hardware.
[0022] In this method, when the power management parameters of the first hardware (e.g., target hardware hereinafter) in the electronic device need to be updated, the electronic device can obtain (or receive user input) first power management data (e.g., target power management data hereinafter) from other electronic devices and store it in a first memory (e.g., target storage partition hereinafter). In this way, when the kernel of the operating system of the electronic device detects the presence of the first power management data in the first memory, it can generate a driver node for the first hardware based on the first power management data. In this way, the power management data of the hardware in the electronic device can be permanently updated quickly and conveniently, and the updated first power management data will not be lost when the electronic device is restarted.
[0023] In a possible implementation of the second aspect above, the kernel of the operating system of the electronic device detects whether the first power management data exists in the first memory of the electronic device, including: the kernel obtains at least one command line, at least one command line is a command line generated by the electronic device during the operation of the boot program, corresponding to at least one third power management data, and the command line carries a third address of the memory in the power management chip for storing the power management data of the hardware corresponding to the corresponding third power management data; the kernel determines that the first power management data exists in the first memory when there is at least one command line with the third address carried being the same as the address of the second memory.
[0024] In a possible implementation of the second aspect, the first memory includes any one of a general flash memory, a memory card, and a read-only memory, and the second memory includes a register.
[0025] In a third aspect, the present application provides a readable storage medium, which includes instructions. When the instructions are executed by an electronic device, the electronic device implements the driving method provided in the first aspect and any possible implementation of the first aspect.
[0026] In a fourth aspect, the present application provides an electronic device, comprising: a memory for storing instructions; and at least one processor for executing instructions so that the electronic device implements the driving method provided in the first aspect and any possible implementation of the first aspect.
[0027] In some implementations, the electronic device may further include a power management chip, which may be at least inside the processor or may be a device independent of the processor.
[0028] In a fifth aspect, the present application provides a program product, which, when running on an electronic device, enables the electronic device to implement the driving method provided in the first aspect and any possible implementation of the first aspect.
[0029] It should be understood that the beneficial effects of the third to fifth aspects mentioned above can be referred to the description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] FIG1 is a schematic diagram showing a process of an electronic device performing power management on hardware in the electronic device according to some embodiments of the present application;
[0031] FIG2 shows a schematic diagram of a scenario of updating power management data of a camera of an electronic device 10 according to some embodiments of the present application;
[0032] FIG3 is a schematic diagram showing a process of a driving method according to some embodiments of the present application;
[0033] FIG4 is a schematic diagram showing a flow chart of a driving method according to some embodiments of the present application;
[0034] FIG5 shows a schematic diagram of operating voltage / current of a camera of an electronic device 10 before and after updating power management data according to some embodiments of the present application;
[0035] FIG6 is a schematic flow chart showing a method for driving a kernel of an operating system according to some embodiments of the present application;
[0036] FIG7 shows a schematic diagram of a software architecture of an electronic device 10 according to some embodiments of the present application;
[0037] FIG8 shows a schematic structural diagram of an electronic device 10 according to some embodiments of the present application. DETAILED DESCRIPTION
[0038] Illustrative embodiments of the present application include, but are not limited to, a driving method, a readable storage medium, and an electronic device.
[0039] The technical solution of this application is introduced below with reference to the accompanying drawings.
[0040] It should be understood that the driving method provided in the embodiments of the present application can be applied to any electronic device, including but not limited to mobile phones, tablet computers, wearable devices, head-mounted displays, mobile email devices, portable game consoles, portable music players, reader devices, laptops, smart home devices, etc.
[0041] As mentioned above, during the startup process, the kernel of the operating system of the electronic device can generate driver nodes for different hardware based on the power management data in the PMIC register. After the operating system of the electronic device is started, the electronic device can drive each hardware based on the driver node, such as setting the operating current, operating voltage, etc. of the hardware based on the power management data. However, since users generally cannot modify the power management data in the PMIC register, if the power management data in the PMIC register of the electronic device is set unreasonably, it will cause the electronic device to malfunction. For example, if the voltage threshold or current threshold upper limit of a certain hardware is set too high, the device will generate a lot of heat when it is working.
[0042] For example, FIG1 shows a schematic diagram of a process for an electronic device to perform power management on hardware in the electronic device according to some embodiments of the present application. The execution subject of the process is the electronic device, and as shown in FIG1 , the process includes the following steps:
[0043] S01: Load the boot program.
[0044] After the electronic device is started, for example, after the user presses the power button of the electronic device, the electronic device is powered on and the boot program is loaded (that is, the startup of the electronic device enters the BootRom stage). In the BootRom stage, the electronic device boot chip code starts to execute from a predefined storage location (such as the read-only memory (ROM) solidified in the electronic device), loads the boot program (such as Bootloader) into the random access memory (random access memory, RAM, such as the memory of the electronic device or the cache of the electronic device processor) of the electronic device, and then starts execution.
[0045] In some embodiments, the boot program is a program that runs before the operating system of the electronic device runs, and is used to copy the operating system image file to the RAM and then jump to the entry of the image file to execute the file.
[0046] S02: Run the bootloader and read the power management data in the PMIC register.
[0047] After the boot program is loaded into the RAM, the electronic device runs the boot program (ie, the electronic device enters the Bootloader stage) and reads the power management data in the PMIC register.
[0048] In some embodiments, during the bootloader phase, the electronic device may run a primary boot loader (PBL), an extensible boot loader (XBL), an application boot loader (ABL), and the like. The XBL is used to initialize the hardware environment of the electronic device, such as reading power management data from a PMIC register; the ABL can be used to implement functions or data defined by the electronic device's production, such as generating a command line (cmdline) for instructing the kernel of the electronic device's operating system to run.
[0049] In some embodiments, the XBL may also be referred to as a unified extensible firmware interface (UEFI).
[0050] S03: Generate driving nodes for various hardware based on the power management data read from the PMIC register.
[0051] After the bootloader completes, the electronic device can run the operating system kernel (e.g., the kernel process in the Linux kernel, at which point the electronic device's operating system boot enters the kernel phase) to initialize the operating system kernel of the electronic device. For example, the electronic device can generate driver nodes for various hardware devices (i.e., initialize the driver nodes for various hardware devices) based on the power management data read from the PMIC register.
[0052] In some embodiments, the power management data may include hardware voltage thresholds (e.g., an upper voltage threshold and a lower voltage threshold), power thresholds (e.g., an upper current threshold and a lower voltage threshold), etc., to indicate the operating voltage range and the operating current range of the hardware.
[0053] In some embodiments, a driving node of a hardware generated by an electronic device records data such as the voltage threshold (e.g., the upper voltage threshold and the lower voltage threshold), the power supply threshold (e.g., the upper current threshold and the lower voltage threshold) of the hardware, which is used to indicate the range of the operating voltage and the range of the operating current of the hardware.
[0054] For example, assuming that the value in the PMIC register corresponding to the camera's voltage threshold upper limit is 0x90 (corresponding to decimal 144), and the value in the PMIC register corresponding to the camera's current threshold upper limit is 0x4f (corresponding to decimal 79), then the driving node corresponding to the camera generated by the electronic device can record the voltage threshold upper limit as 144 millivolts (mV) and the current threshold upper limit as 79 milliamperes (mA).
[0055] S04: Drive the hardware based on the driver node to implement related functions.
[0056] After running the kernel process, the electronic device can run the initialization process (for example, the init process, that is, the startup of the electronic device's operating system enters the init stage) in sequence to initialize the operating system of the electronic device, run the incubator (zygote) process (that is, the startup of the electronic device's operating system enters the zygote stage) to start the virtual machine (Dalvik virtual machine or ART virtual machine) / system service (system server) process, run the system server process (that is, the startup of the electronic device's operating system enters the system server stage) to start the service in the operating system of the electronic device, and run the desktop launcher (launcher) to complete the startup of the operating system of the electronic device.
[0057] After the electronic device's operating system boots up, it can then use the driver node to drive the hardware to implement related hardware functions. For example, if the camera's driver node records an upper voltage threshold of 144mV and an upper current threshold of 79mA, the electronic device can control the camera's voltage within 144mV and current within 79mA while driving the camera to capture an image.
[0058] Based on the above process, it can be seen that the power management data recorded in the driver nodes of each hardware in the electronic device is the power management data in the PMIC register corresponding to each hardware. Since users generally cannot modify the values in the PMIC register, if the power management data in the PMIC register of the electronic device is not set properly, it may cause the electronic device to malfunction (for example, if the voltage threshold or current threshold upper limit of a component is set too high, the component will generate excessive heat during operation).
[0059] In order to avoid abnormalities in electronic devices caused by unreasonable settings of the power management data in the PMIC register, in some embodiments, maintenance personnel can temporarily adjust the power management data recorded in the driver node of a certain hardware through Android debug bridge (ADB) instructions when the electronic device is turned on, so that the electronic device can drive the hardware to implement related functions based on the adjusted driver node. However, after adjusting the power management data in the driver node through the ADB instruction, if the electronic device is restarted, the electronic device will still generate the driver node of the hardware based on the power management data in the PMIC register. In this way, the electronic device needs to adjust the power management data recorded in the driver node of the hardware through the ADB instruction every time it is restarted. The process is cumbersome and affects the user experience.
[0060] Based on this, an embodiment of the present application provides a driving method, which adjusts the way in which the kernel of the operating system generates the driving node of the hardware to achieve permanent update of the power management data in the driving node of the hardware generated by the electronic device without modifying the content in the PMIC register, so that the electronic device can drive the hardware based on the updated power management data.
[0061] Specifically, a non-volatile storage partition for storing power management data to be updated (such as the address of a PMIC register whose power management data needs to be updated, power management data to be updated in the electronic device, etc.) can be set in other memories in the electronic device, such as universal flash storage (UFS), a memory card, a read-only memory (ROM), etc., such as an original equipment manufacturer (OEM) partition or an original design manufacturer (ODM) partition of the electronic device, hereinafter referred to as a target storage partition.
[0062] When the power management data of the target hardware (i.e., the hardware that needs to adjust the power management data) needs to be updated, the electronic device can obtain the power management data that needs to be updated in the electronic device (hereinafter referred to as the target power management data) from the server or other electronic devices and store it in the target storage partition. When the kernel of the operating system of the electronic device generates the driver node of the hardware, if the target power management data of the hardware is stored in the target storage partition, the driver node of the hardware is generated based on the target power management data; if the target power management data of the hardware is not stored in the target storage partition, the driver node of the hardware is generated based on the power management data in the PMIC register corresponding to the hardware (hereinafter the power management data stored in the PMIC register is referred to as the original power management data). Then, after the operating system is started, the electronic device can implement the relevant functions of the hardware for the driving hardware based on the generated driver node.
[0063] Based on the above method, electronic device developers or maintenance personnel can send target power management data to the electronic device, allowing the electronic device to manage the target hardware using the target power management data. This can prevent electronic device abnormalities caused by improper settings of the target hardware's original power management data. Furthermore, because the target power management data is stored in a non-volatile storage area, it will not be lost when the electronic device is powered off or restarted. After the electronic device is restarted, the driver node for the target hardware will still be generated based on the target power management data.
[0064] In some embodiments, the PMIC can be a standalone device in an electronic device, or it can be disposed within a system-on-chip (SoC) (e.g., a central processing unit (CPU)) of the electronic device, without limitation herein. It should be understood that the PMIC can also be disposed within other processors of the electronic device.
[0065] It should be understood that in some embodiments, the memory used to store power management data in the PMIC may not be a PMIC register, but other forms of memory, such as a cache, etc., which is not limited here.
[0066] In some embodiments, there may be one or more PMIC registers in the PMIC, and each PMIC register may store at least one power management data of one hardware or multiple hardware.
[0067] In some embodiments, there may be one or more PMICs in the electronic device, and different PMICs may be distinguished by PMIC identifiers.
[0068] In some embodiments, the power management data may include, but is not limited to, a voltage threshold and a current threshold, wherein the voltage threshold is used to indicate the range of the hardware's operating voltage, and the power threshold is used to indicate the range of the operating current.
[0069] In some embodiments, the target storage partition may be a partition in any non-volatile memory in the electronic device, such as the OEM partition or ODM partition.
[0070] In some embodiments, the OEM partition or ODM partition is used to store data customized by the manufacturer / designer / manufacturer of the electronic device, such as application programs, system parameters, driver information, and the like. The specific name of the OEM partition or ODM partition may vary depending on the manufacturer / designer / manufacturer, and may be called an OEMINFO partition, for example.
[0071] In some embodiments, when the electronic device performs power management on the hardware based on the driving node, the operating voltage of the hardware can be limited to the voltage threshold range recorded in the driving node, and the operating current of the hardware can be limited to the current threshold range recorded in the driving node.
[0072] For example, referring to FIG2 , assuming that the temperature of the camera of electronic device 10 is too high due to the original power management data in the PMIC register, electronic device 10 can obtain target power management data (the upper voltage threshold in the target power management data is lower than the upper voltage threshold in the original power management data, and / or the upper current threshold in the target power management data is lower than the upper current threshold in the original power management data) and store it in the target storage partition. After restarting, electronic device 10 can generate a driving node of electronic device 10 based on the target power management data, so that electronic device 10 drives the camera based on the target power management data. Since the upper voltage threshold in the target power management data is lower than the upper voltage threshold in the original power management data and / or the upper current threshold in the target power management data is lower than the upper current threshold in the original power management data, the temperature decreases and the heating of the camera is reduced.
[0073] It should be understood that lowering the upper voltage threshold and the upper current threshold of the camera in the embodiment shown in Figure 2 is only an example. In other embodiments, such as scenarios where the hardware's operating current or operating voltage is too low, resulting in insufficient hardware performance, the corresponding upper voltage threshold and the upper current threshold of the hardware may also be increased. There is no limitation on this.
[0074] The technical solution of this application is introduced below with reference to the accompanying drawings.
[0075] FIG3 shows a schematic diagram of a driving method according to some embodiments of the present application. As shown in FIG3 , the process includes the following steps:
[0076] S3.1, the electronic device 10 obtains target power management data from the electronic device 20.
[0077] For example, the electronic device 10 may include a port management module, a command writing module, and other service modules. The port management module is used to manage the communication port (e.g., serial port identifier) between the electronic device 20 and the electronic device 10; the command writing module (e.g., a serial port tool, debugging software, etc.) is used to send target power data that needs to be updated to the electronic device 10 in the form of AT commands (a type of command used for connection and communication between terminal devices and computer applications) based on user operations and the communication port provided by the port management module.
[0078] In some embodiments, the electronic device 20 can send an AT command of the form "AT^xx=index,address,value" to the electronic device 10, which is used to instruct the electronic device 10 to write "index,address,value" to the storage area with address xx, where xx can be the address of the target storage partition, index can represent the identifier of the PMIC corresponding to the target power management data, address can represent the address of the PMIC register corresponding to the target power management data, and value represents the value of the target power management data.
[0079] For example, assuming that the PMIC identifier of the PMIC corresponding to the camera of the electronic device 10 is 0x01, the address of the PMIC register corresponding to the upper voltage threshold of the camera is 0x0443, and the address of the PMIC register corresponding to the upper current threshold of the camera is 0x0444. In the target power management data, the upper voltage threshold of the camera is 0x80mV, the upper current threshold of the camera is 0x3f, and the address of the target storage partition is 0xaaa, the AT command sent by the electronic device 20 to the electronic device 10 may include "AT^0xaaa=0x01,0x0443,0x80" and "AT^0xaaa=0x01,0x0444,0x3f".
[0080] For another example, assuming that the PMIC identifier of the PMIC corresponding to the motor of the electronic device 10 is 0x02, the address of the PMIC register corresponding to the upper limit of the voltage threshold of the motor is 0x0604, and the address of the PMIC register corresponding to the upper limit of the current threshold of the motor is 0x0605, and the upper limit of the voltage threshold of the motor in the target power management data is 0x0b mV, the upper limit of the current threshold of the motor is 0x12, and the address of the target storage partition is 0xbbb, the AT command sent by the electronic device 20 to the electronic device 10 may include "AT^0xbbb=0x02,0x0604,0x0b" and "AT^0xbbb=0x02,0x0605,0x12".
[0081] It should be understood that in other embodiments, the electronic device 10 may also obtain the target power management data through other means. For example, the electronic device 10 may obtain the target power management data from the electronic device 20 (such as a desktop computer, laptop computer, server or other terminal device) through a local area network, the Internet, Bluetooth or other wired / wireless communication methods. For another example, the electronic device 10 may interact with the user through a user interface to obtain the target power management data entered by the user on the electronic device 10. The embodiments of the present application do not limit the manner in which the electronic device 10 obtains the target power management data.
[0082] S3.2, the electronic device 10 writes the target power management data into the target storage partition.
[0083] After acquiring the target power management data from the electronic device 20 , the electronic device 10 may write the target power management data into the target storage partition.
[0084] Exemplarily, in some embodiments, a command service (cmdserver) may be stored in the vendor partition of the electronic device 10, which is used to receive AT commands from the electronic device 20 using a command channel, and after parsing the AT commands, implement the functions corresponding to the AT commands, such as writing data to the memory, modifying data stored in the memory, deleting data in the memory, etc.
[0085] In some embodiments, the electronic device 10 may write the target power management data into the target storage partition based on the HIDL hardware abstraction layer interface definition language (HIDL).
[0086] It should be understood that the target storage partition can be any storage partition in the non-volatile memory of the electronic device 10, including but not limited to UFS, memory card, ROM, etc. In some embodiments, the target storage partition can be the aforementioned OEM partition, ODM partition, OEMINFO partition set in the ROM or other memory of the electronic device 10.
[0087] S3.3, the electronic device 10 loads the boot program after restarting.
[0088] After writing the target power management data into the target storage partition, the electronic device 10 may be restarted, and a boot program, such as the aforementioned PBL, may be loaded when the electronic device 10 restarts to the BootRom stage.
[0089] S3.4, the electronic device 10 reads the power management data in the PMIC register.
[0090] After entering the Bootloader stage, the electronic device 10 can run the XBL and read the power management data (ie, original power management data) in the PMIC register.
[0091] S3.5, the electronic device 10 reads the target power management data.
[0092] When the electronic device 10 runs the ABL in the Bootloader stage, the target power management data can be read from the target storage partition.
[0093] S3.6, the electronic device 10 generates a command line corresponding to the target power management data.
[0094] After the electronic device 10 reads the target power management data in the Bootloader stage, it can generate a command line corresponding to the target power management data, which is used to indicate the PMIC corresponding to the target power management data, the PMIC register and the specific value corresponding to the target power management data.
[0095] For example, the electronic device 10 may generate a command line "index=address1,value1;address2,value2", where index represents the PMIC identifier of the PMIC, address1 represents the address of the PMIC register corresponding to the first target power management data in the target power management data, value1 represents the value corresponding to the first target power management data, address2 represents the address of the PMIC register corresponding to the second target power management data in the target power management data, and value2 represents the value corresponding to the second target power management data. It should be understood that when there are K (K≥1) target power management data corresponding to the PMIC identifier index in the target power management data, the above command line may include the addresses and values of the PMIC registers corresponding to the K target power management data.
[0096] For example, for the target power management data of the electronic device 10 mentioned in the aforementioned step S3.1, the command line generated by the electronic device 10 can be 0x01=0x0443, 0x800x0444, 0x3f; for the target power management data of the motor of the electronic device 10 mentioned in the aforementioned step S3.1, the command line generated by the electronic device 10 can be 0x02=0x0604, 0x0b; 0x0605, 0x12.
[0097] In some embodiments, the electronic device 10 may also save a command line for each PMIC register, which is not limited here.
[0098] It should be understood that the above command line is only an example. In other embodiments, the command line may be in other forms, which is not limited here.
[0099] S3.7, the electronic device 10 starts PMIC-related drivers.
[0100] After the Bootloader stage is completed, the electronic device 10 can start the kernel of the operating system (such as the Linux kernel, that is, the kernel stage entered when the electronic device 10 is started).
[0101] In the kernel stage, the electronic device can start PMIC-related drivers, such as drivers for various hardware of the electronic device 10 such as cameras, motors, sensors, and displays.
[0102] S3.8, the electronic device 10 determines whether there is a command line corresponding to the legal target power management data.
[0103] After starting the PMIC-related driver, the kernel of the operating system of electronic device 10 can determine whether a command line corresponding to the legal target power management data exists. If a command line corresponding to the legal target power management data exists, it indicates that the target power management data, which is different from the original power management data in the PMIC register, can be used to load the driver node of the corresponding target hardware, and the process proceeds to step S3.9. If a command line corresponding to the target power management data does not exist, or a command line corresponding to the target power management data exists but is illegal, it indicates that the original power management data needs to be used to load the driver node, and the process proceeds to step S3.11.
[0104] In some embodiments, after receiving the command line of the target power management data, the kernel of the operating system of the electronic device 10 can determine whether the command line is legal based on the PMIC identifier, PMIC register address, and the value of the target power management data recorded in the command line (for example, whether the PMIC identifier and PMIC register address are in a preset list, whether the value of the target power management data is within a preset range, etc.).
[0105] In some embodiments, the command line of the target power management data may also include a check code, and the kernel of the operating system of the electronic device 10 may determine whether the command line is legal by whether the check code matches a preset check code (or generated according to preset rules).
[0106] It should be understood that in other embodiments, the electronic device 10 may also determine whether there is a command line corresponding to the legal target power management data in other ways, which is not limited here.
[0107] Based on the judgment in S3.8, it is possible to prevent illegal power management data from causing abnormality in the electronic device 10.
[0108] S3.9, the electronic device 10 parses the command line to obtain target power management data.
[0109] When determining that there is a command line corresponding to the legal target power management data, the kernel of the operating system of the electronic device 10 parses the command line to obtain the target power management data.
[0110] S3.10, the electronic device 10 generates a driving node based on the target power management data.
[0111] After obtaining the target power management data, the electronic device 10 may generate a hardware driver node corresponding to the target power management data based on the target power management data.
[0112] In some embodiments, if the target power management data only includes part of the power management data of a certain hardware, when the electronic device generates a driving node for the hardware based on the target power management data, it can obtain another part of the power management data from the power management data read in the aforementioned step S3.4, and combine the other part of the power management data and the target power management data to generate the driving node for the hardware.
[0113] It should be understood that the driver node records the power management data of the corresponding hardware, such as voltage threshold, current threshold, etc.
[0114] S3.11, the electronic device 10 generates a driving node based on the power management data in the PMIC.
[0115] Exemplarily, after generating the driver node of the hardware corresponding to the target power management data (i.e., the target hardware) based on the target power management data, the kernel of the operating system of the electronic device 10 can generate the driver nodes of other hardware based on the original power management data in the PMIC register in the PMIC.
[0116] In some embodiments, when it is determined that there is no command line for valid target power management data, the kernel of the operating system of the electronic device 10 can generate driver nodes for all hardware in the electronic device 10 based on the original power management data obtained from the PMIC register in the aforementioned step S3.4.
[0117] After the kernel of the operating system of the electronic device 10 is started, the electronic device 10 may run the init process, the zygote process, and the system server process in sequence to complete the startup of the operating system of the electronic device 10 .
[0118] After the operating system of the electronic device 10 is started, the electronic device 10 can drive the hardware of the electronic device based on the generated driving node so that the operating voltage and operating current of each hardware during operation are within the threshold range recorded by the driving node.
[0119] Based on the driving method shown in Figure 3, the electronic device 10 can update the power management data corresponding to the target hardware by obtaining the target power management data from other devices or receiving the target power management data input by the user. The process is simple and convenient, and can avoid abnormalities of the electronic device 10 caused by unreasonable power management data settings when the electronic device 10 leaves the factory.
[0120] Furthermore, FIG4 shows a schematic flow chart of a driving method according to some embodiments of the present application. The execution subject of the process is the electronic device 10, and as shown in FIG4, the process includes the following steps:
[0121] S401: Acquire target power management data, and store the target power management data in a target storage partition.
[0122] When the electronic device 10 needs to update the power management data of the target hardware, it can obtain the target power management data and store the target power management data in the target storage partition.
[0123] For example, assuming that the PMIC identifier of the PMIC corresponding to the camera of the electronic device 10 is 0x01, the address of the PMIC register corresponding to the upper voltage threshold of the camera is 0x0443, and the address of the PMIC register corresponding to the upper current threshold of the camera is 0x0444. In the target power management data, the upper voltage threshold of the camera is 0x80mV, and the upper current threshold of the camera is 0x3f, then the target power management data may include "0x01, 0x0443, 0x80" and "0x01, 0x0444, 0x3f".
[0124] For another example, assuming that the PMIC identifier of the PMIC corresponding to the motor of the electronic device 10 is 0x02, the address of the PMIC register corresponding to the upper limit of the voltage threshold of the motor is 0x0604, and the address of the PMIC register corresponding to the upper limit of the current threshold of the motor is 0x0605, and the upper limit of the voltage threshold of the motor in the target power management data is 0x0b mV, and the upper limit of the current threshold of the motor is 0x12, then the target power management data may include "0x02, 0x0604, 0x0b" and "0x02, 0x0605, 0x12".
[0125] It should be understood that the above-mentioned form of the target power management data is only an example. In other embodiments, the target power management data may also be data in other forms and / or other bases, which is not limited here.
[0126] In some embodiments, the target power management data may include the PMIC identifier of the PMIC storing the power management data of the target hardware, the address of the PMIC register (or other identifier of the PMIC register), the value of the target power management data, etc.
[0127] In some embodiments, the electronic device 10 can obtain target power management data from other electronic devices (e.g., a host computer such as a desktop computer or laptop computer, a server, etc.) via a wired or wireless method. For example, the electronic device 10 can obtain target power management data from other electronic devices by receiving AT commands (or other commands) sent by the other electronic devices via a serial port. The electronic device can also obtain target power management data from a server via over-the-air technology (OTA) or an application.
[0128] In some embodiments, the electronic device 10 may receive target power management data input by a user on the electronic device 10 .
[0129] In some embodiments, the target storage partition may be any non-volatile memory storage partition in the electronic device 10, including but not limited to UFS, memory card, ROM, etc. In some embodiments, the target storage partition may be the aforementioned OEM partition, ODM partition, OEMINFO partition set in the ROM or other memory of the electronic device 10.
[0130] S402: Detect whether there is target power management data corresponding to the target hardware in the target storage partition.
[0131] When the electronic device 10 restarts and reaches the kernel stage to generate a driver node for any target hardware, it can detect whether the target power management data corresponding to the target hardware exists in the target partition. If the target power management data for the target hardware exists in the target storage partition, it indicates that the driver node for the target hardware needs to be generated based on the target power management data, and the process proceeds to step S403. Otherwise, if the target power management data for the target hardware does not exist in the target storage partition, it indicates that the driver node for the target hardware needs to be generated based on the original power management data in the PMIC register, and the process proceeds to step S404.
[0132] Exemplarily, during the process of running the ABL in the Bootloader phase, the electronic device 10 can read all the power management data in the target storage partition and generate corresponding command lines respectively. During the kernel phase, the electronic device 10 can detect whether the target power management data corresponding to the target hardware exists in the target storage partition based on a comparison between the PMIC identifier and PMIC register address in the command line and the PMIC identifier and PMIC register address storing the power management data of the target hardware. For example, if there is a command line whose PMIC identifier and PMIC register address match the PMIC identifier and PMIC register address storing the power management data of the target hardware, it is determined that the target power management data corresponding to the target hardware exists.
[0133] It should be understood that in other embodiments, the electronic device 10 may also detect whether the target power management data corresponding to the target hardware exists in the target storage partition in other ways, which are not limited here.
[0134] S403: When target power management data corresponding to the target hardware exists in the target storage partition, a driver node of the target hardware is generated based on the target power management data.
[0135] When the target power management data corresponding to the target hardware exists in the target storage partition, the electronic device 10 can generate a driver node for the target hardware based on the target power management data. That is, the power management data of the target hardware recorded in the driver node of the target hardware is the target power management data. For example, corresponding to the camera of the aforementioned electronic device 10, in the PMIC with a PMIC identifier of 0x01, the value in the PMIC register with an address of 0x0443 is 0x90, and the value in the PMIC register with an address of 0x0444 is 0x4f (corresponding to the original power management data of the camera). Since the target power management data contains target power management data of the PMIC registers with addresses 0x0443 and 0x0444 in the PMIC with a PMIC identifier of 0x01, the power management data in the driving node generated by the electronic device 10 for the camera is 0x80 and 0x3f mentioned in step S401, which respectively correspond to the camera voltage threshold upper limit of 0x80 (corresponding to 128 in decimal) mV and the camera current threshold upper limit of 0x3f (corresponding to 63 in decimal) mA.
[0136] That is, referring to FIG5 , before executing the method provided in the embodiment of the present application, when electronic device 10 captures an image through the camera, the camera's upper voltage threshold is 144mV and the upper current threshold is 79mA. At this time, the camera of electronic device 10 may heat up due to excessive voltage or current. However, after the method in the embodiment of the present application generates the camera's drive node based on the target power management data, the camera's upper voltage threshold is 128mV and the upper current threshold is 63mA, which reduces the camera's voltage and current, preventing camera heating.
[0137] For another example, corresponding to the motor of the aforementioned electronic device 10, the upper limit of the voltage threshold of the motor limited by the driving node generated by the electronic device 10 is 0x0b (corresponding to 11 in decimal) mV, and the upper limit of the current threshold of the motor is 0x12 (corresponding to 18 in decimal) mA.
[0138] In some embodiments, the electronic device 10 may also verify whether the target power management data is valid. If the target power management data is valid, the driver node of the target hardware is generated based on the target power management data. Otherwise, if the target power management data is invalid, the driver node of the target hardware is generated based on the original power management data of the target hardware. In this way, electronic device anomalies caused by invalid target power data can be avoided.
[0139] S404: When the target power management data corresponding to the target hardware does not exist in the target storage partition, a driver node of the target hardware is generated based on the original power management data.
[0140] If the target power management data corresponding to the target hardware does not exist in the target storage partition, the electronic device 10 generates a driver node of the target hardware based on the original power management data, that is, the original power management data of the target hardware recorded in the driver node of the target hardware.
[0141] S405: driving the target hardware based on the generated driver node.
[0142] After the operating system is started, if the electronic device 10 needs to drive the target hardware to implement related services, such as driving the camera to capture images, driving the motor to vibrate, etc., it can drive the target hardware based on the generated driving node so that the operating voltage and operating current of the target hardware are within the threshold range recorded by the driving node.
[0143] Based on the driving method shown in Figure 4, the electronic device 10 can update the power management data corresponding to the target hardware by obtaining the target power management data from other devices or receiving the target power management data input by the user. The process is simple and convenient, and can avoid abnormalities of the electronic device 10 caused by unreasonable power management data settings when the electronic device 10 leaves the factory.
[0144] The embodiment of the present application also provides a driving method applied to the kernel of an operating system.
[0145] For example, FIG6 shows a flowchart of a driving method applied to the kernel of an operating system according to some embodiments of the present application. The execution subject of the process is the kernel of the operating system. As shown in FIG6, the process includes the following steps:
[0146] S601: Start PMIC related drivers.
[0147] When the boot process of the operating system of the electronic device 10 is in the kernel stage, the kernel of the operating system may start the PMIC-related drivers.
[0148] S602: Determine whether there is a command line corresponding to the legal target power management data.
[0149] After the PMIC-related driver is started, the operating system kernel can determine whether a command line corresponding to the valid target power management data exists. If a command line corresponding to the valid target power management data exists, it indicates that the target power management data can be used to load the driver node, and the process proceeds to step S603. If a command line corresponding to the target power management data does not exist, or a command line corresponding to the target power management data exists but is invalid, it indicates that the original power management data is required to load the driver node, and the process proceeds to step S604.
[0150] The specific method for the kernel of the operating system to determine whether there is a command line corresponding to the legal target power management data can be referred to the aforementioned step S3.8 and will not be described in detail here.
[0151] S603: Generate a driver node for the target hardware based on the target power management data, and generate driver nodes for other hardware other than the target hardware based on the original power management data.
[0152] In the presence of a command line containing target power management data, the operating system kernel generates a driver node for the target hardware corresponding to the target power management data based on the target power management data, and generates driver nodes for hardware other than the target hardware based on the original power management data. Specifically, the target hardware power management data recorded in the target hardware driver node is the target power management data in the target storage partition, while the target hardware power management data recorded in the driver nodes for hardware other than the target hardware is the original power management data.
[0153] S604: Generate a driver node based on the original power management data.
[0154] If the target power management data command line does not exist, or if the target power management data command line exists but is invalid, the operating system kernel generates driver nodes for each hardware device based on the original power management data. In other words, the power management data recorded in the driver nodes for each hardware device is the original power management data.
[0155] Based on the above method, when the target hardware power management data needs to be updated, the electronic device 10 only needs to store the target power management data to be updated in the target storage partition, and the kernel of the operating system of the electronic device 10 can generate the driver node of the target hardware based on the target power management data. The process is convenient and permanent.
[0156] FIG7 shows a schematic diagram of a software architecture of an electronic device 10 according to some embodiments of the present application.
[0157] As shown in FIG7 , the software architecture of the electronic device 10 includes an application layer, an application framework layer, a local layer, and a kernel layer.
[0158] The application layer includes application programs in the electronic device 10, such as a desktop launcher (also called a desktop, desktop application, etc.).
[0159] The application framework layer is used to provide an application programming interface (API) and a programming framework for applications in the application layer.
[0160] In some embodiments, the application framework layer may include a system service (system server). The system server process corresponding to the system service can be used to start various services in the Java framework at runtime, such as: Device Identifiers Policy Service (DIPS), Power Manager (PM), System Recovery Service (RSS), Backlight Service (LS), System Service Manager (SSM), Input Management Service (IMS), Window Management Service (WMS), etc.
[0161] The native layer may include a C language base library, a C language tool library, an init process, a service manager, etc. When running, the init process may mount the file system in the electronic device, load Selinux (security-enhanced linux, a security policy) rules, initialize the operating system, and start the service manager process and the zygote process.
[0162] In some embodiments, the local layer may further include the aforementioned cmdserver, which is used to receive AT instructions carrying target power management data from other electronic devices and write the target power management data into the target storage partition.
[0163] In other embodiments, the local layer may further include more modules, such as a hardware abstraction layer, etc., which is not limited here.
[0164] The application framework layer and the native layer communicate via Java native interfaces (JIN). The zygote process sits between the application framework layer and the native layer. At runtime, the zygote process can launch virtual machines (Dalvik or ART) and system server processes. The zygote process also defines a socket to receive application launch requests from the Activity Manager Service (AMS).
[0165] The kernel layer may include a kthreadd process, a swapper process, hardware drivers of the electronic device 10 (such as PMIC-related drivers, drivers of hardware such as cameras, motors, and sensors in the electronic device 10), and the like.
[0166] When the swapper process is running, it can be used to initialize process management, memory management, load drivers, and start the init process and threadd process. The kthreadd process is the first process in the operating system kernel and is used to create kernel daemons such as the kernel worker thread kworkder, the soft interrupt thread ksoftirqd, and the thermal process.
[0167] Based on the above software architecture, the startup process of the operating system of the electronic device 10 can generally include a bootloader stage, a kernel stage, an initialization (init) stage, a zygote stage, a system server stage and a launcher stage.
[0168] Optionally, in other embodiments, the software architecture of the electronic device 10 may further include more layers, and each layer may further include more modules, which is not limited here.
[0169] An embodiment of the present application also provides an electronic device.
[0170] FIG8 shows a schematic structural diagram of an electronic device 10 according to some embodiments of the present application.
[0171] As shown in Figure 8, the electronic device 10 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and the like.
[0172] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), at least one PMIC, etc. The different processing units may be independent devices or integrated into one or more processors.
[0173] It should be understood that in some embodiments, the PMIC may not be disposed inside the processor 110 but may be an independent device, which is not limited here.
[0174] In some embodiments, the PMIC may include one or more PMIC registers for storing power management data corresponding to one or more hardware of the electronic device 10, where the power management data is used to indicate the range of operating voltage and operating current of the hardware in the electronic device during operation.
[0175] In some embodiments, the processor 110 may call and execute instructions corresponding to the driving methods provided in various embodiments of the present application stored in the memory to implement the driving methods provided in the embodiments of the present application. For example, the processor 110 may be used to execute instructions for obtaining target power management data and writing the target power management data to a target storage partition, instructions for generating a driver node for a hardware based on the target power management data when the target power management data of the hardware exists in the target storage partition, instructions for driving the hardware based on the generated driver node, etc.
[0176] USB interface 130 is an interface that complies with USB standards and specifications, and may be a Mini USB interface, a Micro USB interface, a USB Type-C interface, or the like. USB interface 130 can be used to connect a charger to charge electronic device 10, or to transfer data between electronic device 10 and peripheral devices. It can also be used to connect headphones to play audio. This interface can also be used to connect other electronic devices.
[0177] In some embodiments, the electronic device 10 can obtain target power management data from other electronic devices via the USB interface 130. For example, the electronic device 10 can establish a serial communication connection with another electronic device via the USB interface 130, so that the other electronic device can send the target power management data to the electronic device 10 via AT commands.
[0178] The charging management module 140 is configured to receive charging input from a charger. While charging the battery 142 , the charging management module 140 can also provide power to the electronic device through the power management module 141 .
[0179] The power management module 141 is used to connect the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 to provide power to the processor 110, the internal memory 121, the display 194, the camera 193, and the wireless communication module 160.
[0180] The wireless communication function of the electronic device 10 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0181] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals.
[0182] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to the electronic device 10. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.
[0183] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc. applied to the electronic device 10. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0184] The display screen 194 is used to display images, videos, etc.
[0185] Electronic device 10 implements display functionality through a GPU, display screen 194, and an application processor. A GPU is a microprocessor for image processing that connects display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or modify display information.
[0186] For example, in some embodiments, the display screen 194 may be used to display the interface of the application and the first animation.
[0187] Camera 193 is used to capture still images or videos. Objects are projected onto the photosensitive element through the lens to generate an optical image. In some embodiments, electronic device 10 may include one or N cameras 193, where N is a positive integer greater than one.
[0188] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 10. The external memory card communicates with the processor 110 via the external memory interface 120 to implement data storage. For example, in some embodiments, the electronic device 10 can store target power management data in a memory card connected to the external memory interface 120.
[0189] The internal memory 121 can be used to store computer executable program code, which includes instructions. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function, etc. The data storage area may store data created during the use of the electronic device 10, etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 110 executes various functional applications of the electronic device 10 by running instructions stored in the internal memory 121 and / or instructions stored in a memory provided in the processor 110. In some embodiments, the data partition of the electronic device 10 may be stored in the internal memory 121.
[0190] In some embodiments, the aforementioned target power management data may be stored in the internal memory 121 .
[0191] The electronic device 10 can implement audio functions such as music playback and recording through the audio module 170 , the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0192] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. The speaker 170A, also known as a "speaker," is used to convert audio electrical signals into sound signals. The receiver 170B, also known as a "handset," is used to convert audio electrical signals into sound signals. The microphone 170C, also known as a "microphone" or "microphone," is used to convert sound signals into electrical signals. The headphone jack 170D is used to connect wired headphones.
[0193] Keys 190 include a power button, a volume button, and the like. Keys 190 may be mechanical or touch-sensitive. Electronic device 10 may receive key inputs and generate key signal inputs related to user settings and function control of electronic device 10. In some embodiments, electronic device 10 may respond to a user operation on the power button, such as a long press of the power button, to start electronic device 10 and enter the BootROM phase of the electronic device 10 startup process.
[0194] Motor 191 can generate vibration prompts.
[0195] The indicator 192 may be an indicator light, which may be used to indicate the charging status, power level changes, messages, missed calls, notifications, etc.
[0196] The SIM card interface 195 is used to connect a SIM card.
[0197] It should be understood that the structure of the electronic device 10 shown in the embodiment of the present application does not constitute a specific limitation on the electronic device 10. In other embodiments of the present application, the electronic device 10 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0198] The structure of the electronic device 10 shown in FIG8 is only an example. In other embodiments, the electronic device 10 may include more or fewer modules, or some modules may be merged or split, which is not limited here.
[0199] An embodiment of the present application further provides a program product, which, when executed on an electronic device, can enable the electronic device to implement the driving methods provided in the aforementioned embodiments.
[0200] An embodiment of the present application further provides a readable storage medium, in which one or more programs are stored. When the one or more programs are executed by an electronic device, the electronic device implements the driving methods provided by the aforementioned embodiments.
[0201] The various embodiments of the mechanisms disclosed in this application can be implemented in hardware, software, firmware, or a combination of these implementation methods. The embodiments of the present application can be implemented as a computer program or program code or program product executed on a programmable system, the programmable system including at least one processor, a storage system (including volatile and non-volatile memory and / or storage elements), at least one input device, and at least one output device.
[0202] Program code can be applied to input instructions to perform the functions described herein and generate output information. The output information can be applied to one or more output devices in a known manner. For purposes of this application, a processing system includes any system having a processor such as, for example, a digital signal processor, a microcontroller, an application specific integrated circuit, or a microprocessor.
[0203] Program code can be implemented with a high-level programming language or an object-oriented programming language to communicate with the processing system. Where necessary, program code can also be implemented in assembly language or machine language. In fact, the mechanism described in this application is not limited to the scope of any particular programming language. In either case, the language can be a compiled language or an interpreted language.
[0204] In some cases, the disclosed embodiments may be implemented in hardware, firmware, software, or any combination thereof. The disclosed embodiments may also be implemented as instructions carried or stored on one or more temporary or non-temporary machine-readable (e.g., computer-readable) storage media, which may be read and executed by one or more processors. For example, instructions may be distributed over a network or through other computer-readable storage media. Therefore, a machine-readable storage medium may include any mechanism for storing or transmitting information in a form readable by a machine (e.g., a computer), including but not limited to a floppy disk, an optical disk, an optical disk, a magneto-optical disk, a random access memory, an erasable programmable read-only memory, an electrically erasable programmable read-only memory, a magnetic card or an optical card, a flash memory, or a tangible machine-readable memory for transmitting information (e.g., a carrier wave, an infrared signal, a digital signal, etc.) using the Internet in an electrical, optical, acoustic, or other form of propagation signal. Therefore, a machine-readable storage medium includes any type of machine-readable storage medium suitable for storing or transmitting electronic instructions or information in a form readable by a machine (e.g., a computer).
[0205] In the accompanying drawings, some structural, module, or method features may be shown in a particular arrangement and / or order. However, it should be understood that such a particular arrangement and / or order may not be required. Rather, in some embodiments, these features may be arranged in a manner and / or order different from that shown in the illustrative drawings. In addition, the inclusion of structural or method features in a particular figure does not imply that such features are required in all embodiments, and in some embodiments, these features may not be included or may be combined with other features.
[0206] It should be noted that in the examples and description of this patent, relational terms such as first and second, etc. are merely used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. In addition, the term "comprising" means that a process, method, article or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or apparatus.
[0207] Although the present application has been shown and described with reference to certain preferred embodiments thereof, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the application.
Claims
1. A driving method, applied to an electronic device, characterized in that: include: Detecting whether there is first power management data in a first memory of the electronic device, wherein the first power management data is used to update: second power management data of first hardware in the electronic device stored in a second memory in the power management chip; corresponding to the first power management data existing in the first memory, driving the first hardware based on the first power management data; Corresponding to the first power management data not existing in the first memory, the first hardware is driven based on the second power management data.
2. The method according to claim 1, characterized in that The first memory includes any one of a general flash memory, a memory card, and a read-only memory, and the second memory includes a register.
3. The method according to claim 1, characterized in that The power management data is used to indicate at least one of a range of an operating voltage of the first hardware and a range of an operating current of the first hardware.
4. The method according to claim 1, characterized in that: The first power management data includes at least one of a first voltage threshold and a first current threshold, and the second power management data includes at least one of a second voltage threshold and a second current threshold.
5. The method according to claim 4, characterized in that The step of corresponding to the first power management data existing in the first memory and driving the first hardware based on the first power management data comprises at least one of the following: limiting the operating current of the first hardware to a first voltage range corresponding to the first voltage threshold; The operating current of the first hardware is limited to a first current range corresponding to the first current threshold.
6. The method according to claim 4, characterized in that The driving of the first hardware based on the second power management data corresponding to the absence of the first power management data in the first memory includes at least one of the following methods: limiting the operating current of the first hardware to a second voltage range corresponding to the second voltage threshold; The operating current of the first hardware is limited to a second current range corresponding to the second current threshold.
7. The method according to any one of claims 1 to 6, characterized in that The detecting whether there is first power management data in the first memory of the electronic device includes: reading at least one third power management data from the first memory during the startup process of the electronic device, wherein the third power management data includes a third address of a memory in the power management chip for storing power management data of hardware corresponding to the third power management data; When there is power management data whose third address is the same as the address of the second memory in the at least one third power management data, it is determined that the first power management data exists in the first memory.
8. The method according to claim 7, characterized in that When there is power management data whose third address is the same as the address of the second memory in the at least one third power management data, determining that the first power management data exists in the first memory includes: generating, during the process of the electronic device running the boot program, at least one command line corresponding to the at least one third power management data, wherein the command line carries a third address corresponding to the corresponding power management data; During the kernel startup process of the operating system of the electronic device, corresponding to the existence of The command line in which the third address carried is the same as the address of the second memory determines that the first power management data exists in the first memory.
9. A driving method, characterized in that: include: The kernel of the operating system of the electronic device detects whether there is first power management data in the first memory of the electronic device, wherein the first power management data is used to update: second power management data of the first hardware in the electronic device stored in the second memory in the power management chip; Corresponding to the first power management data existing in the first memory, the kernel generates a driver node of the first hardware based on the first power management data; Corresponding to the first power management data not existing in the first memory, the kernel generates a driver node of the first hardware based on the second power management data; The driving node is used to indicate at least one of a range of an operating voltage and a range of an operating current of the first hardware.
10. The method according to claim 9, characterized in that The kernel of the operating system of the electronic device detects whether there is first power management data in the first memory of the electronic device, including: The kernel obtains at least one command line, where the at least one command line is a command line generated by the electronic device during the running of the boot program and corresponds to at least one third power management data, and the command line carries a third address of a memory in the power management chip for storing power management data of hardware corresponding to the corresponding third power management data; The kernel determines that first power management data exists in the first memory when there is a command line in the at least one command line that carries the third address that is the same as the address of the second memory.
11. The method according to claim 9, characterized in that The first memory includes any one of a general flash memory, a memory card, and a read-only memory, and the second memory includes a register.
12. A readable storage medium, characterized in that: The readable storage medium includes instructions, and when the instructions are executed by the electronic device, the electronic device implements the driving method according to any one of claims 1 to 8, or the driving method according to any one of claims 9 to 11.
13. An electronic device, characterized in that: include: A memory for storing instructions; At least one processor is used to execute the instructions so that the electronic device implements the driving method according to any one of claims 1 to 8, or the driving method according to any one of claims 9 to 11.
Citation Information
Patent Citations
Method and device for detecting circuit overcurrent protection of electronic equipment
CN111897669A
Image processing architecture and method, storage medium and electronic equipment
CN113902608A
Charging method and terminal equipment
CN116865407A
Method and apparatus for hibernation operation in multiple operating system environments
US20170212793A1
Electronic device including structure into which insertable device is inserted, and operating method therefor
WO2022131636A1