Charging method, electronic equipment and storage medium

By obtaining and updating the battery capacity target threshold of electronic devices, the problem of inflexibility of existing charging methods is solved, and the flexibility and personalization of charging is achieved, and the user experience is improved.

CN119813403APending Publication Date: 2025-04-11BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311303065.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-10-09
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

The existing charging methods for electronic devices are based on the default battery limit parameters and cannot flexibly meet different scenarios and user needs, resulting in inflexible charging.

Method used

By obtaining the target threshold value associated with the battery power in the electronic device, updating the threshold default value of the battery power, and charging control based on the target threshold value, the flexibility and personalization of charging are achieved.

Benefits of technology

It realizes the flexibility and personalization of charging electronic devices, and can customize the threshold value of battery power according to different scenarios and user needs, improving the user's charging experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119813403A_ABST
    Figure CN119813403A_ABST
Patent Text Reader

Abstract

The invention relates to a charging method, electronic equipment and a storage medium. The charging method comprises the following steps: acquiring a target threshold value associated with the electric quantity of a battery in the electronic equipment; updating the threshold default value of the electric quantity of the battery to the target threshold value; and performing charging control on the electronic equipment based on the target threshold value. According to the embodiment of the invention, the threshold default value of the electric quantity of the battery can be changed, and the charging requirements of electronic equipment in different scenes can be met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of charging, and in particular to a charging method, an electronic device, and a storage medium. Background Art

[0002] At present, the charging methods of electronic devices are all designed based on the system's own charging solution. Usually, the threshold parameters associated with the battery power have a default value. However, the charging method based on the default value can only meet one charging solution and cannot meet the different charging needs of users in different scenarios. Therefore, the existing charging solutions have the problem of inflexible charging. Summary of the invention

[0003] In order to overcome the problems existing in the related art, the present disclosure provides a charging method, an electronic device, and a storage medium, which can meet the charging needs in various scenarios.

[0004] According to a first aspect of an embodiment of the present disclosure, a charging method is provided, comprising at least:

[0005] Obtaining a target threshold value associated with a battery power level in an electronic device;

[0006] Updating the battery power threshold default value to the target threshold value;

[0007] Based on the target threshold value, charging control is performed on the electronic device.

[0008] In some embodiments, the target threshold value includes an upper limit value of charging power;

[0009] The controlling the charging of the electronic device based on the target threshold value includes:

[0010] When the current power level of the electronic device reaches the upper limit of the charging power level, the electronic device is controlled to stop charging.

[0011] In some embodiments, the target threshold value includes a low battery lower limit value;

[0012] The controlling the charging of the electronic device based on the target threshold value includes:

[0013] When the current power level of the electronic device reaches the low power lower limit, a low power warning message is output to remind the user to charge.

[0014] In some embodiments, the electronic device includes an application layer and a framework layer;

[0015] The step of obtaining a target threshold value associated with a battery power level in the electronic device includes:

[0016] Receiving the target threshold value broadcasted by the application layer through a receiver of the battery management module in the framework layer;

[0017] The updating of the threshold default value of the battery power to the target threshold value includes:

[0018] The threshold parameter of the battery power is updated from the threshold default value to the target threshold value through the receiver.

[0019] In some embodiments, obtaining a target threshold value associated with a battery power level in the electronic device includes:

[0020] Responsive to an update operation on the electronic device, obtaining the target threshold value;

[0021] or,

[0022] When a change in the charging scenario is detected, receiving the target threshold value sent by the cloud server; wherein different charging scenarios correspond to different target threshold values;

[0023] or,

[0024] When the electronic device is switched from the off state to the on state, the target threshold value is obtained from a database.

[0025] In some embodiments, the method further comprises:

[0026] Defining a storage function in a battery management module of the electronic device;

[0027] The target threshold value is stored in the database by calling the storage function.

[0028] In some embodiments, obtaining the target threshold value from a database includes:

[0029] During the initialization of the battery management module of the electronic device, the target threshold value is read from the database by calling a reading function of the battery management module.

[0030] In some embodiments, the method further comprises:

[0031] Sending sample threshold values ​​under different charging scenarios to the cloud server, so that the cloud server can perform training based on the sample threshold values ​​to obtain a trained learning model;

[0032] The receiving the target threshold value sent by the cloud server includes:

[0033] Receive the target threshold value corresponding to the current charging scenario of the electronic device, which is output by the cloud server based on the trained learning model.

[0034] According to a second aspect of an embodiment of the present disclosure, there is provided an electronic device, including:

[0035] An acquisition module, configured to acquire a target threshold value associated with a battery power level in the electronic device;

[0036] An updating module, configured to update the threshold default value of the battery power to the target threshold value;

[0037] The control module is configured to control the charging of the electronic device based on the target threshold value.

[0038] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, including:

[0039] processor;

[0040] a memory for storing processor-executable instructions;

[0041] Wherein, the processor is configured to execute the charging method as described in the first aspect above.

[0042] According to a fourth aspect of an embodiment of the present disclosure, there is provided a storage medium, including:

[0043] When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the charging method as described in the first aspect above.

[0044] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:

[0045] In the disclosed embodiment, the electronic device obtains the target threshold value associated with the battery power, updates the threshold default value of the battery power to the target threshold value, and controls the charging of the electronic device based on the target threshold value. In other words, the disclosed embodiment is not based on the threshold default value for charging, but can modify the threshold default value of the battery power to the target threshold value, and control the charging of the electronic device based on the target threshold value, so that the target threshold value can be customized according to actual needs, which can not only make the charging of the electronic device more flexible to meet different charging scenarios, but also meet the personalized needs of different users through customized settings, and improve the user's charging experience.

[0046] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0048] Figure 1 is a flow chart of a charging method according to an exemplary embodiment.

[0049] Figure 2 A display interface of an electronic device according to an exemplary embodiment Figure 1 .

[0050] Figure 3 A display interface of an electronic device according to an exemplary embodiment Figure 2 .

[0051] Figure 4 It is a system framework diagram of an electronic device according to an exemplary embodiment.

[0052] Figure 5 The present invention is a diagram of a charging display interface of an electronic device according to an exemplary embodiment.

[0053] Figure 6 The figure is a flow chart of storing a target threshold value according to an exemplary embodiment.

[0054] Figure 7 The figure is a flowchart of initializing a battery management module of an electronic device system according to an exemplary embodiment.

[0055] Figure 8 The diagram is a diagram showing the interaction between an electronic device and a cloud server according to an exemplary embodiment.

[0056] Fig. 9 An electronic device frame is shown according to an exemplary embodiment Figure 1 .

[0057] Fig.10 An electronic device frame is shown according to an exemplary embodiment Figure 2 . DETAILED DESCRIPTION

[0058] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of charging methods and electronic devices consistent with some aspects of the present disclosure as detailed in the appended claims.

[0059] The disclosed embodiment provides a charging method, which can solve the problem that the electronic device cannot flexibly set the threshold parameters of the battery power. Figure 1 is a schematic diagram of a charging method according to an exemplary embodiment Figure 1 ,like Figure 1 As shown, the charging method comprises the following steps:

[0060] S101, obtaining a target threshold value associated with the battery power in the electronic device;

[0061] S102, updating the default threshold value of the battery power to the target threshold value;

[0062] S103: Control charging of the electronic device based on the target threshold value.

[0063] In the embodiments of the present disclosure, generally, the charging method is applied to the scenario of charging an electronic device, and the electronic device can change the target threshold value of the battery power by executing the charging method to control the charging process of the electronic device in different charging scenarios. For example, in the scenario of stopping charging, the charging power upper limit value of the battery power is changed from 100% to 95%, so as to control the electronic device to stop charging when the current power reaches 95%.

[0064] It should be noted that the electronic device may be a mobile terminal device, a smart home device, etc. Among them, the mobile terminal device may include a mobile phone or a tablet computer; the smart home device may include a speaker device. The embodiments of the present disclosure are not limited to this.

[0065] In step S101, the electronic device stores a plurality of target threshold values ​​associated with battery power, which may include: a charging power upper limit value, a low power lower limit value or a battery charging temperature warning value, etc., which is not limited in the embodiments of the present disclosure.

[0066] The above-mentioned acquisition of the target threshold value associated with the battery power in the electronic device may include: in response to an update request for the battery power, acquiring the target threshold value associated with the battery power. The update request may be formed by a user acting on the display screen of the electronic device, or by a user performing a preset gesture, or of course, may be sent by a cloud server, and the embodiments of the present disclosure are not limited to this.

[0067] It should be noted that, when the update request is generated by the user acting on the display screen of the electronic device or by the user performing a preset gesture, the target threshold value may be user input; when the update request is sent by a cloud server, the target threshold value may be carried in the update request and generated by the cloud server.

[0068] Here, in case the user inputs the target threshold value, the display screen of the electronic device can display a threshold adjustment bar corresponding to the threshold parameter of the battery power, and by dragging the threshold adjustment bar to the target position, the threshold value corresponding to the target position can be used as the target threshold value.

[0069] In the case where the cloud server generates the target threshold value, the cloud server may generate it based on the battery type of the electronic device, the current performance of the battery and / or the user's usage habits. For example, the user's usage habits indicate that the user stops charging when the current power reaches 95%, and the charging power limit value generated by the cloud server is 95%.

[0070] For example, Figure 2 A display interface of an electronic device according to an exemplary embodiment Figure 1 ,like Figure 2 As shown, the target threshold value is the upper limit value of the charging power, and the display screen of the electronic device can display the charging control interface, which includes a first power rectangular diagram showing the upper limit value of the charging power, and a charging power upper limit value adjustment bar is set on the first power rectangular diagram. The charging control interface also has a text prompt box "Please select the required upper limit value of the charging power, and intelligently stop charging when the charging power reaches the upper limit value." When the user drags the adjustment bar of the upper limit value of the charging power to 80%, the corresponding upper limit value of the charging power input by the user is 80%.

[0071] For example, Figure 3 A display interface of an electronic device according to an exemplary embodiment Figure 2 ,like Figure 3 As shown, the target threshold value is the low power lower limit value, and the display screen of the electronic device can display the charging control interface, which includes a second power rectangular diagram showing the low power lower limit value, and a low power lower limit value adjustment bar is set on the second power rectangular diagram. The charging control interface also has a text prompt box "Please select the required low power lower limit value, and you will be intelligently warned when the power is equal to the low power lower limit value." When the user drags the low power lower limit value adjustment bar to 30%, the corresponding low power lower limit value input by the user is 30%.

[0072] In the disclosed embodiment, different charging scenarios may correspond to different target threshold values ​​associated with the battery power, and obtaining the target threshold value associated with the battery power may include: obtaining the target threshold value corresponding to the charging scenario under different charging scenarios.

[0073] Exemplarily, when the charging scenario is that the user is charging before going out during the day, the target threshold value may be a first charging rate threshold value, and the charging of the electronic device may be controlled based on the first charging rate threshold value; or, when the charging scenario is that the user is charging before going to bed at night, the target threshold value may be a second charging rate threshold value, and the charging of the electronic device may be controlled based on the second charging rate threshold value, wherein the second charging rate threshold value is less than the first charging rate threshold value.

[0074] In steps S102 and S103, under normal circumstances, the threshold parameter of the battery power in the electronic device is a threshold default value. For example, the threshold default value of the battery power shutdown alarm is 5%; the threshold default value of the low battery power reminder is 15% or 20%; the threshold default value of the high temperature shutdown of the battery power is 68 degrees Celsius, etc.

[0075] In the disclosed embodiment, the user can customize the modified threshold value as the target threshold value according to the use requirements. For example, in the case where it is necessary to ensure the use of the electronic device for a preset time, the low battery threshold default value of 20% of the battery power can be updated to 50% to remind the user to charge in time. For another example, in the case where the user lives in a cold climate area, the high temperature shutdown threshold default value of 68 degrees Celsius of the battery power can be updated to 58 degrees Celsius to improve the temperature control sensitivity of the electronic device.

[0076] The target threshold value is a value corresponding to the threshold default value. After the threshold default value of the battery power is updated to the target threshold value, the electronic device will perform charging control based on the target threshold value during the charging process. In the embodiment of the present disclosure, the charging rate, charging stop conditions, and battery usage can be controlled to ensure that the battery power remains stable within the target threshold value, so that charging is more in line with user habits.

[0077] For example, when the upper limit of the battery charge is updated from 100% to 95%, the electronic device will stop charging when the current charge reaches 95%. When the shutdown alarm threshold of the battery charge is updated from 5% to 10%, the electronic device will output a shutdown alarm message to remind the user that the device is about to shut down when the current charge drops to 10%.

[0078] It should be noted that the above-mentioned process of controlling the charging of the electronic device may include: when the electronic device is plugged into the charging device, the charging management module (such as the charging management chip (Battery Management System, BMS)) integrated in the electronic device will communicate with the charging device to identify the charging protocol and charge the battery in the electronic device based on the charging protocol. During the charging process, the charging can be controlled based on the updated target threshold value to achieve intelligent charging and improve the user's charging experience.

[0079] Among them, the battery management chip can be responsible for monitoring and managing the battery charging process. For example, the battery management chip can monitor the battery's voltage, temperature, current and other parameters, and ensure the safety and efficiency of the charging process.

[0080] In the disclosed embodiment, the electronic device obtains the target threshold value associated with the battery power, updates the threshold default value of the battery power to the target threshold value, and controls the charging of the electronic device based on the target threshold value. In other words, the disclosed embodiment is not based on the threshold default value for charging, but can modify the threshold default value of the battery power to the target threshold value, and control the charging of the electronic device based on the target threshold value, so that the target threshold value can be customized according to actual needs, which can not only make the charging of the electronic device more flexible to meet different charging scenarios, but also meet the personalized needs of different users through customized settings, and improve the user's charging experience.

[0081] In one embodiment, the target threshold value includes an upper limit value of charging power;

[0082] The controlling the charging of the electronic device based on the target threshold value includes:

[0083] When the current power level of the electronic device reaches the upper limit of the charging power level, the electronic device is controlled to stop charging.

[0084] In the disclosed embodiment, the upper limit of charging power is a predetermined battery power percentage, which is used to determine when to control the electronic device to stop charging.

[0085] The upper limit of the charging power can be obtained by the user on the display screen of the electronic device, or can be automatically determined by the server according to the device type and performance. Here, the target threshold value can be adjusted in the battery management module of the electronic device to meet the personalized stop charging requirements.

[0086] After the above-mentioned electronic device updates the threshold default value to the charging power upper limit value, the charging control process will manage the charging of the electronic device based on the charging power upper limit value, including: the battery management module will continuously monitor the current power of the electronic device, which can be achieved by measuring indicators such as battery power percentage or battery voltage; when the electronic device starts charging, the electronic device will compare the current power with the set charging power upper limit value to ensure that the current power does not exceed the charging power upper limit value; if the current power is detected to be the charging power upper limit value during the charging process, the electronic device will send an instruction to stop charging.

[0087] It should be noted that the upper limit of the charging power can be dynamic, so the system will continue to monitor the battery power and take control measures when necessary to ensure that the battery power remains less than or equal to the upper limit of the charging power.

[0088] In the disclosed embodiment, the electronic device can customize the upper limit of the charging power, which can not only make the charging of the electronic device more flexible to meet different charging stop scenarios, but also meet the personalized needs of different users through customized settings, and improve the user's experience of stopping charging. In addition, the electronic device manages the charging process by detecting the upper limit of the charging power generated by the battery performance and battery type, which can prevent the battery from being overcharged, thereby helping to extend the battery life and maintain the battery health.

[0089] In some embodiments, the target threshold value includes a low battery lower limit value;

[0090] The controlling the charging of the electronic device based on the target threshold value includes:

[0091] When the current power level of the electronic device reaches the low power lower limit, a low power warning message is output to remind the user to charge.

[0092] In the disclosed embodiment, the low-battery lower limit value is a predetermined battery power percentage, which is used to determine when to trigger a low-battery warning of the electronic device.

[0093] The low battery lower limit value can be obtained by the user on the display screen of the electronic device, or can be automatically determined according to the device type and performance. Here, the target threshold value can be adjusted in the battery management module of the electronic device to meet the personalized low battery warning requirements.

[0094] After the above-mentioned electronic device updates the threshold default value to the low power lower limit value, the charging control process will manage the charging of the electronic device based on the low power lower limit value, including: the battery management module will continuously monitor the current power of the electronic device, which can be achieved by measuring indicators such as battery power percentage or battery voltage; the electronic device will compare the current power with the set low power lower limit value to ensure that the electronic device outputs low power warning information to remind the user to charge; if the electronic device detects that the power continues to decrease, it will continue to send low power warnings to ensure that the user takes appropriate charging measures.

[0095] It should be noted that the low battery warning information may include the user's current battery level, the user's current battery level reaching the low battery lower limit, or the user's current battery level is low. The output form of the low battery warning information may be a text notification, a vibration warning, or a voice output, etc., which is not limited in the embodiments of the present disclosure.

[0096] In the disclosed embodiment, the electronic device can customize the low power lower limit value, which can not only make the warning timing of the electronic device more flexible to meet different charging scenarios, but also meet the personalized needs of different users through customized settings, and improve the user's charging warning experience. In addition, the electronic device monitors the battery power by detecting the low power lower limit value generated by the battery performance and battery type, and can promptly remind the user of the low power situation to ensure that the user can take charging measures to maintain the availability of the electronic device.

[0097] In some embodiments, Figure 4 is a system framework diagram of an electronic device according to an exemplary embodiment. Figure 4 As shown, the electronic device includes an application layer and a framework layer;

[0098] The step of obtaining a target threshold value associated with a battery power level in the electronic device includes:

[0099] Receiving the target threshold value broadcasted by the application layer through a receiver of the battery management module in the framework layer;

[0100] The updating of the threshold default value of the battery power to the target threshold value includes:

[0101] The threshold parameter of the battery power is updated from the threshold default value to the target threshold value through the receiver.

[0102] It should be noted that the application layer (System Apps) is a key layer in the computer network architecture. It is responsible for handling the communication between user applications and the underlying network protocols. The application layer provides an interface for users and applications to access network services, and handles functions such as data formatting, data encryption, data compression, error detection and correction.

[0103] The above-mentioned framework layer (JAVA API Framework) is an important layer in software development. It provides developers with tools, libraries and frameworks for building applications. The framework layer provides applications with interfaces to access underlying hardware and operating system functions, and also provides general tools and functions to simplify the application development process.

[0104] like Figure 4As shown, the system of the electronic device also includes: an intermediate layer (Healthd), which is located between the core network layer (Linux Kernel) and the framework layer in the electronic device system, responsible for registering the underlying listening events and receiving the underlying reported battery status information through callbacks; the kernel layer (Native C / C++ Libraries & Android Runtime), which is the lowest level of easily replaceable software that interfaces with the electronic device hardware, is responsible for connecting all applications running in "user mode" to the physical hardware, and allows the server's processes to obtain each other's information using inter-process communication; the hardware abstraction layer (Hardware Abstract Layer, HAL), is an interface layer located between the kernel layer and the hardware circuit, and is used to abstract the hardware.

[0105] Among them, different operating systems and platforms have different framework layers. For example, Android applications use the Android application framework, iOS applications use the iOS development framework, and Windows applications use the Windows API, etc. The embodiments of the present disclosure do not limit this.

[0106] The above-mentioned receiving the target threshold value broadcast by the application layer through the receiver of the battery management module in the framework layer includes: when the user or the system needs to update the battery power threshold value, the application layer can broadcast a message containing the target threshold value, and the broadcast method can be a standard broadcast or an ordered broadcast. The application layer can send the target threshold value by calling the broadcast function and the local broadcast manager, wherein the broadcast function can be sendBroadcast() or sendOrderedBroadcast().

[0107] The battery management module in the framework layer can register a receiver to monitor the broadcast event containing battery power threshold value information in the application layer.

[0108] The above-mentioned updating the threshold parameter of the battery power from the threshold default value to the target threshold value by the receiver includes: extracting the threshold parameter of the battery power from the broadcast by the receiver, and updating the extracted threshold parameter from the threshold default value to the target threshold value.

[0109] Here, updating the extracted threshold parameter from the threshold default value to the target threshold value may include updating the threshold default value to the target threshold value by calling an update function.

[0110] It should be noted that after the receiver obtains the target threshold value, the target threshold value may be stored in a database to ensure that it is applied in subsequent charging management.

[0111] The threshold parameter of the battery power may be BATTERY_SCALE, and the update function may be update().

[0112] In the disclosed embodiment, the battery power threshold value is transmitted and updated between the application layer and the framework layer through a broadcast mechanism, so that the application layer can flexibly communicate with the framework layer to achieve more flexible dynamic adjustment of the battery power threshold parameters.

[0113] In some embodiments, obtaining a target threshold value associated with a battery power level in the electronic device includes:

[0114] Responsive to an update operation on the electronic device, obtaining the target threshold value;

[0115] or,

[0116] When a change in the charging scenario is detected, receiving the target threshold value sent by the cloud server; wherein different charging scenarios correspond to different target threshold values;

[0117] or,

[0118] When the electronic device is switched from the off state to the on state, the target threshold value is obtained from a database.

[0119] In the embodiment of the present disclosure, responding to an update operation on an electronic device may include: responding to an update operation on a charging control interface of a display screen in the electronic device; or responding to an update operation on a virtual key formed on a frame in the electronic device.

[0120] For example, Figure 5 is a diagram showing a charging display interface of an electronic device according to an exemplary embodiment. Figure 5 As shown in the left interface in the figure, the display screen of the electronic device includes multiple application interfaces, and the user can enter the charging display interface by clicking on the application; Figure 5 As shown in the right interface of the figure, the charging display interface shows the current battery power value, estimated charging time, charging mode and other information. You can click the setting icon in the upper right corner of the charging display interface to enter the charging control interface, such as Figure 2 and Figure 3 As shown, when a user opens a charging control interface on an electronic device, a target threshold value can be obtained based on an update operation acting on the charging control interface, so that the electronic device can perform charging control based on the target threshold value.

[0121] It should be noted that, by responding to the update operation of the charging control interface, the application layer transmits the acquired target threshold value to the framework layer for updating so as to be used by the battery management module.

[0122] In the above case where a change in the charging scenario is detected, receiving the target threshold value sent by the cloud server includes: the battery management module in the electronic device regularly monitors the charging scenario, such as plugging / unplugging the charging device, positioning information, etc.

[0123] In one case, when the electronic device detects a change in the charging scenario, it can send a request to the cloud server, requesting the target threshold value under a specific scenario. The cloud server will transmit the corresponding target threshold value back to the electronic device based on different scenarios (such as home charging scenarios, office charging scenarios); in another case, when the cloud server detects a change in the charging scenario, it can transmit the target threshold value corresponding to the charging scenario to the electronic device.

[0124] The above-mentioned obtaining the target threshold value from the database when the electronic device is switched from the off state to the on state includes: when the electronic device is switched from the off state to the on state, the battery management module can obtain the target threshold value from the local database or the cloud database.

[0125] Exemplarily, the battery management module may call a read function to read the target threshold value during the initialization process, wherein the read function may include load BATTERY_SCALE().

[0126] It should be noted that the target threshold value previously configured or set by the user will be stored in the database of the electronic device to ensure that the settings can be retained even between shutdown and startup, where the database may include a relational database, an embedded database, an in-memory database, etc., which is not limited in this embodiment of the present disclosure.

[0127] In the disclosed embodiments, by obtaining a target threshold value in response to an update operation of the electronic device, the user can customize the target threshold value based on his or her own needs to meet the personalized needs of different users and enhance the user experience; by receiving the target threshold value sent by the cloud server when a change in the charging scenario is detected, the electronic device can be set with a more intelligent target threshold value, making the charging method of the electronic device more flexible to meet different charging scenarios; when the electronic device is switched from a shutdown state to a power-on state, the target threshold value is obtained from a database, and when the electronic device is restarted, the target threshold value in the database can still be automatically obtained, thereby reducing the loss of the target threshold value after restarting, so that the electronic device can better control charging.

[0128] In some embodiments, the method further comprises:

[0129] Defining a storage function in a battery management module of the electronic device;

[0130] The target threshold value is stored in the database by calling the storage function.

[0131] It should be noted that in the battery management module of the electronic device, a storage function needs to be defined first. The storage function is used to store the target threshold value in the database. The storage function can be implemented using the function definition method in a programming language (such as C++, Java, etc.).

[0132] When the user performs settings or updates in the application layer or user interface of the electronic device, the target threshold value is transmitted to the battery management module via broadcast; after receiving the broadcast, the receiver in the battery management module will call the storage function defined above, so that the received target threshold value can be stored in the database of the electronic device through the storage function.

[0133] For example, Figure 6 is a flow chart of storing target threshold values ​​according to an exemplary embodiment, such as Figure 6 As shown, the application layer sends a broadcast carrying a target threshold value, the receiver receives the target threshold value carried in the broadcast, and updates the threshold default value to the target threshold value through an update function, and the receiver can also store the target threshold value in a database of the electronic device through a storage function.

[0134] The storage function may include SaveBATTERY-SCALE().

[0135] It should be noted that the database of the electronic device has a preset table structure to store the target threshold value. Exemplarily, the fields in the table structure may include the target threshold value, timestamp, etc. The storage function inserts the threshold parameter and the target threshold value into the corresponding database table through database operation.

[0136] In the disclosed embodiment, the battery management module of the electronic device can define a storage function and call the storage function in the framework layer so as to effectively store the target threshold value in the database, thereby ensuring that the default threshold value is not used after the electronic device is shut down. Instead, the last updated target threshold value can be obtained from the database to meet the battery management requirements in the power on and off scenarios.

[0137] In some embodiments, obtaining the target threshold value from a database includes:

[0138] During the initialization of the battery management module of the electronic device, the target threshold value is read from the database by calling a reading function of the battery management module.

[0139] It should be noted that a reading function is provided in the battery management module of the electronic device, and the reading function is used to read the target threshold value from the database.

[0140] In the disclosed embodiment, when the electronic device switches from the off state to the on state, the operating system of the electronic device will also be reloaded, and the battery management module will automatically trigger initialization when the device is loaded, or the battery management module can be manually initialized when needed.

[0141] For example, Figure 7 FIG. 1 is a flowchart of initializing a battery management module of an electronic device system according to an exemplary embodiment. Figure 7 As shown, during the initialization process of the battery management module, the battery management module will first define the class, that is, the definition of member variables (corresponding to the attributes of things) and the definition of member methods (corresponding to the behavior of things); then execute the constructor. The Java language stipulates that when creating a class, there must be a constructor to initialize member variables, that is, all member attributes and member methods are set to default values. The task of the constructor is to initialize the internal state of an object.

[0142] During the process of the battery management module automatically executing the constructor, the above-defined reading function will be called to read the target threshold value from the database.

[0143] Here, after reading the target threshold value through the reading function, the battery management module will update the default threshold value to the target threshold value, so that the electronic device can perform charging control based on the target threshold value.

[0144] In the embodiment of the present disclosure, the battery management module of the electronic device can obtain the target threshold value from the database by calling the read function during the initialization process, so that the electronic device will not use the default threshold value after initialization, but can obtain the last updated target threshold value from the database to ensure that the target threshold value is not lost when the electronic device switches from the power-on state to the power-off state, and can continue to perform charging control based on the target threshold value.

[0145] In some embodiments, the method further comprises:

[0146] Sending sample threshold values ​​under different charging scenarios to the cloud server, so that the cloud server can perform training based on the sample threshold values ​​to obtain a trained learning model;

[0147] The receiving the target threshold value sent by the cloud server includes:

[0148] Receive the target threshold value corresponding to the current charging scenario of the electronic device, which is output by the cloud server based on the trained learning model.

[0149] In the disclosed embodiment, sending the sample threshold values ​​in different charging scenarios to the cloud server includes: the battery management module of the electronic device can regularly collect sample threshold values ​​in different charging scenarios, such as home charging scenarios, office charging scenarios, travel charging scenarios, etc. These sample threshold values ​​may include the upper limit value of battery power, the lower limit value of low power, etc.; after collecting the sample threshold values, the collected sample threshold values ​​are sent to the cloud server via an Internet connection for subsequent training. Here, the electronic device and the cloud server can exchange information by using a network communication protocol.

[0150] For example, Figure 8 is a diagram showing an interaction between an electronic device and a cloud server according to an exemplary embodiment, Figure 8 As shown, the cloud server will obtain the first sample threshold value corresponding to the home charging scenario of the electronic device, the second sample threshold value corresponding to the travel charging scenario, and the third sample threshold value corresponding to the office charging scenario, and train the learning model based on the correspondence between the charging scenario and the sample threshold value. In the embodiment of the present disclosure, the cloud server can actively predict the target threshold value based on the trained learning model after detecting the scene change and return it to the electronic device; or the electronic device can upload the current charging scenario to the cloud server to request the cloud server to return the target threshold value corresponding to the charging scenario.

[0151] In the embodiment of the present disclosure, when the target threshold value is the upper limit value of the charging power, the travel charging scenario corresponds to the first upper limit value of the charging power, the office charging scenario corresponds to the second upper limit value of the charging power, and the home charging scenario corresponds to the third upper limit value of the charging power. Since the travel charging scenario needs to meet the battery life, the home charging scenario can protect the battery to reduce the upper limit value of the charging power, and the office charging scenario can meet both the battery life and the battery protection requirements, therefore, the first upper limit value of the charging power can be set to be greater than the second upper limit value of the charging power, and the second upper limit value of the charging power can be set to be greater than the third upper limit value of the charging power.

[0152] When the cloud server receives the sample threshold value from the electronic device, the machine learning algorithm can be used to train the learning model to obtain a trained learning model. Here, after obtaining the trained learning model, the trained learning model can be updated according to the target threshold value obtained in response to the update operation acting on the electronic device, and the target threshold value output by the updated learning model is sent to the electronic device. In this way, a target threshold value that better meets user needs can be obtained based on a more accurate model to improve the user's charging experience.

[0153] In the disclosed embodiment, the battery management module may periodically request the cloud server to obtain the target threshold value for use in charging control. After receiving the request from the electronic device, the cloud server will predict the target threshold value under the current charging scenario based on the trained learning model and send it back to the electronic device. After the electronic device receives the target threshold value sent by the cloud server, it is used for battery management and charging control. For example, when a scene change is detected, the upper limit of the battery power or the lower limit of the low power power is automatically adjusted.

[0154] In the disclosed embodiments, the electronic device can dynamically adjust the target threshold value according to different scenarios, which can not only make the charging of the electronic device more intelligent, but also improve the accuracy of automatic updating.

[0155] The present disclosure provides an electronic device, Fig. 9 An electronic device frame is shown according to an exemplary embodiment Figure 1 ,like Fig. 9 As shown, the electronic device 1000 includes:

[0156] An acquisition module 1001 is configured to acquire a target threshold value associated with a battery power level in an electronic device;

[0157] An updating module 1002 is configured to update the threshold default value of the battery power to the target threshold value;

[0158] The control module 1003 is configured to control charging of the electronic device based on the target threshold value.

[0159] In some embodiments, the target threshold value includes an upper limit value of charging power; and the control module includes:

[0160] The charging stop control module is configured to control the electronic device to stop charging when the current power of the electronic device reaches the upper limit of the charging power.

[0161] In some embodiments, the target threshold value includes a low battery lower limit value; and the control module includes:

[0162] The warning information control module is configured to output low-battery warning information to remind the user to charge when the current battery level of the electronic device reaches the low-battery lower limit.

[0163] In some embodiments, the electronic device includes an application layer and a framework layer;

[0164] The acquisition module is further configured to receive the target threshold value broadcast by the application layer through a receiver of the battery management module in the framework layer;

[0165] The updating module is further configured to update the threshold parameter of the battery power from the threshold default value to the target threshold value through the receiver.

[0166] In some embodiments, the acquisition module is further configured to acquire the target threshold value in response to an update operation acting on the electronic device; or, when a change in the charging scenario is detected, receive the target threshold value sent by the cloud server; wherein different charging scenarios correspond to different target threshold values; or, when the electronic device is switched from a power-off state to a power-on state, acquire the target threshold value from a database.

[0167] In some embodiments, the electronic device further comprises:

[0168] A definition module, configured to define a storage function in a battery management module of the electronic device;

[0169] A storage module is configured to store the target threshold value in the database by calling the storage function.

[0170] In some embodiments, the acquisition module is further configured to read the target threshold value from the database by calling a read function of the battery management module during the initialization of the battery management module of the electronic device.

[0171] In some embodiments, the electronic device further comprises:

[0172] A sending module, configured to send sample threshold values ​​under different charging scenarios to the cloud server, so that the cloud server can perform training based on the sample threshold values ​​to obtain a trained learning model;

[0173] The receiving module is configured to receive the target threshold value corresponding to the current charging scenario of the electronic device output by the cloud server based on the trained learning model.

[0174] The specific manner in which each module in the electronic device in the above embodiment performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0175] Fig.10 An electronic device frame is shown according to an exemplary embodiment Figure 2 For example, the electronic device 1000 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, and the like.

[0176] Reference Fig.10, the electronic device 1000 may include one or more of the following components: a processing component 802 , a memory 804 , a power component 806 , a multimedia component 808 , an audio component 810 , an input / output (I / O) interface 812 , a sensor component 814 , and a communication component 816 .

[0177] The processing component 802 generally controls the overall operation of the electronic device 1000, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.

[0178] The memory 804 is configured to store various types of data to support operations on the electronic device 1000. Examples of such data include instructions for any application or method operating on the electronic device 1000, contact data, phone book data, messages, pictures, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0179] The power supply component 806 provides power to various components of the electronic device 1000. The power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 1000.

[0180] The multimedia component 808 includes a screen that provides an output interface between the electronic device 1000 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0181] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC), and when the electronic device 1000 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 804 or sent via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.

[0182] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: home button, volume button, start button, and lock button.

[0183] The sensor assembly 814 includes one or more sensors for providing various aspects of status assessment for the electronic device 1000. For example, the sensor assembly 814 can detect the open / closed state of the device 800, the relative positioning of components, such as the display and keypad of the electronic device 1000, and the sensor assembly 814 can also detect the position change of the electronic device 1000 or a component of the electronic device 1000, the presence or absence of user contact with the electronic device 1000, the orientation or acceleration / deceleration of the electronic device 1000, and the temperature change of the electronic device 1000. The sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 814 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0184] The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 1000 and other devices. The electronic device 1000 can access a wireless network based on a communication standard, such as WiFi, 3G or 5G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0185] In an exemplary embodiment, the electronic device 1000 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.

[0186] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, and the instructions can be executed by the processor 820 of the electronic device 1000 to complete the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0187] A non-temporary computer-readable storage medium, when the instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to perform a charging method, the method comprising: obtaining a target threshold value associated with a battery power level in the electronic device; updating a threshold default value of the battery power level to the target threshold value; and controlling the charging of the electronic device based on the target threshold value.

[0188] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0189] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A charging method, characterized in that: include: Obtaining a target threshold value associated with a battery power level in an electronic device; Updating the battery power threshold default value to the target threshold value; Based on the target threshold value, charging control is performed on the electronic device.

2. The method according to claim 1, characterized in that The target threshold value includes an upper limit value of charging power; The controlling the charging of the electronic device based on the target threshold value includes: When the current power level of the electronic device reaches the upper limit of the charging power level, the electronic device is controlled to stop charging.

3. The method according to claim 1, characterized in that The target threshold value includes a low battery lower limit value; The controlling the charging of the electronic device based on the target threshold value includes: When the current power level of the electronic device reaches the low power lower limit, a low power warning message is output to remind the user to charge.

4. The method according to any one of claims 1 to 3, characterized in that: The electronic device comprises an application layer and a framework layer; The step of obtaining a target threshold value associated with a battery power level in the electronic device includes: Receiving the target threshold value broadcasted by the application layer through a receiver of the battery management module in the framework layer; The updating of the threshold default value of the battery power to the target threshold value includes: The threshold parameter of the battery power is updated from the threshold default value to the target threshold value through the receiver.

5. The method according to any one of claims 1 to 3, characterized in that: The step of obtaining a target threshold value associated with a battery power level in the electronic device includes: Responsive to an update operation on the electronic device, obtaining the target threshold value; or, When a change in the charging scenario is detected, receiving the target threshold value sent by the cloud server; wherein different charging scenarios correspond to different target threshold values; or, When the electronic device is switched from the off state to the on state, the target threshold value is obtained from a database.

6. The method according to claim 5, characterized in that The method further comprises: Defining a storage function in a battery management module of the electronic device; The target threshold value is stored in the database by calling the storage function.

7. The method according to claim 5, characterized in that The step of acquiring the target threshold value from a database includes: During the initialization of the battery management module of the electronic device, the target threshold value is read from the database by calling a reading function of the battery management module.

8. The method according to claim 5, characterized in that The method further comprises: Sending sample threshold values ​​under different charging scenarios to the cloud server, so that the cloud server can perform training based on the sample threshold values ​​to obtain a trained learning model; The receiving the target threshold value sent by the cloud server includes: Receive the target threshold value corresponding to the current charging scenario of the electronic device, which is output by the cloud server based on the trained learning model.

9. An electronic device, characterized in that: include: An acquisition module, configured to acquire a target threshold value associated with a battery power level in the electronic device; An updating module, configured to update the threshold default value of the battery power to the target threshold value; The control module is configured to control the charging of the electronic device based on the target threshold value.

10. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to execute the charging method according to any one of claims 1 to 8.

11. A non-transitory computer-readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the charging method according to any one of claims 1 to 8.