[go: up one dir, main page]

CN113764754A - Charging method, device, equipment and storage medium - Google Patents

Charging method, device, equipment and storage medium Download PDF

Info

Publication number
CN113764754A
CN113764754A CN202010487504.6A CN202010487504A CN113764754A CN 113764754 A CN113764754 A CN 113764754A CN 202010487504 A CN202010487504 A CN 202010487504A CN 113764754 A CN113764754 A CN 113764754A
Authority
CN
China
Prior art keywords
target
charging
current setting
power adapter
current
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010487504.6A
Other languages
Chinese (zh)
Other versions
CN113764754B (en
Inventor
李志杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN202010487504.6A priority Critical patent/CN113764754B/en
Publication of CN113764754A publication Critical patent/CN113764754A/en
Application granted granted Critical
Publication of CN113764754B publication Critical patent/CN113764754B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H01ELECTRIC ELEMENTS
    • H01MPROCESSES OR MEANS, e.g. BATTERIES, FOR THE DIRECT CONVERSION OF CHEMICAL ENERGY INTO ELECTRICAL ENERGY
    • H01M10/00Secondary cells; Manufacture thereof
    • H01M10/42Methods or arrangements for servicing or maintenance of secondary cells or secondary half-cells
    • H01M10/44Methods for charging or discharging
    • HELECTRICITY
    • H01ELECTRIC ELEMENTS
    • H01MPROCESSES OR MEANS, e.g. BATTERIES, FOR THE DIRECT CONVERSION OF CHEMICAL ENERGY INTO ELECTRICAL ENERGY
    • H01M10/00Secondary cells; Manufacture thereof
    • H01M10/42Methods or arrangements for servicing or maintenance of secondary cells or secondary half-cells
    • H01M10/44Methods for charging or discharging
    • H01M10/443Methods for charging or discharging in response to temperature
    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02JCIRCUIT ARRANGEMENTS OR SYSTEMS FOR SUPPLYING OR DISTRIBUTING ELECTRIC POWER; SYSTEMS FOR STORING ELECTRIC ENERGY
    • H02J7/00Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries
    • H02J7/00032Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries characterised by data exchange
    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02JCIRCUIT ARRANGEMENTS OR SYSTEMS FOR SUPPLYING OR DISTRIBUTING ELECTRIC POWER; SYSTEMS FOR STORING ELECTRIC ENERGY
    • H02J7/00Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries
    • H02J7/0029Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries with safety or protection devices or circuits
    • H02J7/00309Overheat or overtemperature protection
    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02JCIRCUIT ARRANGEMENTS OR SYSTEMS FOR SUPPLYING OR DISTRIBUTING ELECTRIC POWER; SYSTEMS FOR STORING ELECTRIC ENERGY
    • H02J7/00Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries
    • H02J7/007Regulation of charging or discharging current or voltage
    • H02J7/0071Regulation of charging or discharging current or voltage with a programmable schedule
    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02JCIRCUIT ARRANGEMENTS OR SYSTEMS FOR SUPPLYING OR DISTRIBUTING ELECTRIC POWER; SYSTEMS FOR STORING ELECTRIC ENERGY
    • H02J7/00Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries
    • H02J7/007Regulation of charging or discharging current or voltage
    • H02J7/00712Regulation of charging or discharging current or voltage the cycle being controlled or terminated in response to electric parameters
    • H02J7/00714Regulation of charging or discharging current or voltage the cycle being controlled or terminated in response to electric parameters in response to battery charging or discharging current
    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02JCIRCUIT ARRANGEMENTS OR SYSTEMS FOR SUPPLYING OR DISTRIBUTING ELECTRIC POWER; SYSTEMS FOR STORING ELECTRIC ENERGY
    • H02J7/00Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries
    • H02J7/007Regulation of charging or discharging current or voltage
    • H02J7/007188Regulation of charging or discharging current or voltage the charge cycle being controlled or terminated in response to non-electric parameters
    • H02J7/007192Regulation of charging or discharging current or voltage the charge cycle being controlled or terminated in response to non-electric parameters in response to temperature
    • H02J7/007194Regulation of charging or discharging current or voltage the charge cycle being controlled or terminated in response to non-electric parameters in response to temperature of the battery
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02BCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO BUILDINGS, e.g. HOUSING, HOUSE APPLIANCES OR RELATED END-USER APPLICATIONS
    • Y02B40/00Technologies aiming at improving the efficiency of home appliances, e.g. induction cooking or efficient technologies for refrigerators, freezers or dish washers
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02EREDUCTION OF GREENHOUSE GAS [GHG] EMISSIONS, RELATED TO ENERGY GENERATION, TRANSMISSION OR DISTRIBUTION
    • Y02E60/00Enabling technologies; Technologies with a potential or indirect contribution to GHG emissions mitigation
    • Y02E60/10Energy storage using batteries

Landscapes

  • Engineering & Computer Science (AREA)
  • Power Engineering (AREA)
  • Manufacturing & Machinery (AREA)
  • Chemical & Material Sciences (AREA)
  • Chemical Kinetics & Catalysis (AREA)
  • Electrochemistry (AREA)
  • General Chemical & Material Sciences (AREA)
  • Charge And Discharge Circuits For Batteries Or The Like (AREA)

Abstract

本申请公开了一种充电方法、装置、设备及存储介质,属于充电技术领域。所述方法包括:在检测到与目标电源适配器电连接时,获取目标电源适配器的类型,根据目标电源适配器的类型确定目标函数指针,目标函数指针指向与目标电源适配器的类型对应的目标电流设置表;确定所处的目标充电场景,并根据目标充电场景在目标电流设置表中设置第一充电电流;调用输入电流设置函数,通过输入电流设置函数获取目标函数指针,根据目标函数指针定位目标电流设置表,并在目标电流设置表中获取第一充电电流;根据第一充电电流对电子设备的电池进行充电。本申请实施例提供的技术方案能够减小输入电流设置函数的体积。

Figure 202010487504

The present application discloses a charging method, device, equipment and storage medium, which belong to the technical field of charging. The method includes: when detecting an electrical connection with the target power adapter, acquiring the type of the target power adapter, determining a target function pointer according to the type of the target power adapter, and the target function pointer points to a target current setting table corresponding to the type of the target power adapter ; Determine the target charging scene, and set the first charging current in the target current setting table according to the target charging scene; call the input current setting function, obtain the target function pointer through the input current setting function, and locate the target current setting according to the target function pointer table, and obtain the first charging current in the target current setting table; charge the battery of the electronic device according to the first charging current. The technical solutions provided by the embodiments of the present application can reduce the volume of the input current setting function.

Figure 202010487504

Description

Charging method, device, equipment and storage medium
Technical Field
The present disclosure relates to the field of charging technologies, and in particular, to a charging method, a charging apparatus, a charging device, and a storage medium.
Background
Currently, with the development of scientific technology, electronic devices such as smart phones are more and more common in people's daily life. In practical applications, batteries are disposed in many electronic devices, and the batteries in the electronic devices are charged to provide electric energy required for normal operations of the electronic devices. Generally, the electronic device may set a proper charging current according to the type of the power adapter and a charging scenario in which the electronic device is located, so as to avoid damage to the electronic device or influence on the use of the electronic device by a user during the charging process.
In the related art, the electronic device may call an input current setting function (input _ current _ limit function) to set the charging current, where the input current setting function includes a plurality of condition determination statements, and the input current setting function may finally find the type of the power adapter and the charging current corresponding to the charging scenario where the electronic device is located according to the plurality of condition determination statements.
However, the method of searching for the charging current by using a plurality of condition determination statements may result in a huge volume of the input current setting function, thereby affecting the execution efficiency of the input current setting function and increasing the maintenance difficulty of the input current setting function.
Disclosure of Invention
Based on this, embodiments of the present application provide a charging method, apparatus, device, and storage medium, which can reduce the volume of an input current setting function, thereby improving the execution efficiency of the input current setting function, and reducing the maintenance difficulty of the input current setting function.
In a first aspect, a charging method is provided, which includes:
when the electronic equipment is detected to be electrically connected with a target power adapter, acquiring the type of the target power adapter, and determining a target function pointer according to the type of the target power adapter, wherein the target function pointer points to a target current setting table corresponding to the type of the target power adapter; determining a target charging scene where the electronic equipment is located, and setting a first charging current in the target current setting table according to the target charging scene; calling an input current setting function, acquiring the target function pointer through the input current setting function, positioning the target current setting table according to the target function pointer, and acquiring the first charging current in the target current setting table; and charging the battery of the electronic equipment according to the first charging current.
In a second aspect, there is provided a charging device, the device comprising:
the determining module is used for acquiring the type of a target power adapter when detecting that the electronic equipment is electrically connected with the target power adapter, and determining a target function pointer according to the type of the target power adapter, wherein the target function pointer points to a target current setting table corresponding to the type of the target power adapter;
the first setting module is used for determining a target charging scene where the electronic equipment is located and setting a first charging current in the target current setting table according to the target charging scene;
the first acquisition module is used for calling an input current setting function, acquiring the target function pointer through the input current setting function, positioning the target current setting table according to the target function pointer and acquiring the first charging current in the target current setting table;
the first charging module is used for charging the battery of the electronic equipment according to the first charging current.
In a third aspect, an electronic device is provided, comprising a memory and a processor, the memory storing a computer program, the computer program implementing the charging method according to any one of the first aspect when executed by the processor.
In a fourth aspect, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the charging method as described in any one of the first aspects above.
The beneficial effects brought by the technical scheme provided by the embodiment of the application at least comprise:
in the technical solution provided in the embodiment of the present application, the electronic device obtains a type of a target power adapter into which the electronic device is inserted, and determines a target function pointer pointing to a target current setting table corresponding to the type of the target power adapter, in addition, the electronic device determines a target charging scenario in which the electronic device is located, and sets a first charging current in the target current setting table according to the target charging scenario, and then, the electronic device calls an input current setting function to obtain the target function pointer through the input current setting function, locates the target current setting table according to the target function pointer, and obtains the first charging current in the target current setting table, and then, the electronic device charges the battery according to the first charging current, because in the technical solution provided in the embodiment of the present application, the input current setting function only needs to obtain the target function pointer, the technical process of positioning the target current setting table according to the target function pointer and acquiring the first charging current from the target current setting table is adopted, so that the input current setting function only needs to comprise a function statement for acquiring the target function pointer and a function statement for acquiring the first charging current from the target current setting table, and does not need to comprise a plurality of condition judgment statements, and therefore, the volume of the input current setting function can be greatly reduced, the execution efficiency of the input current setting function can be improved, and the maintenance difficulty of the input current setting function is reduced.
Drawings
Fig. 1 is a block diagram of an electronic device according to an embodiment of the present disclosure;
fig. 2 is a flowchart of a charging method according to an embodiment of the present disclosure;
FIG. 3 is a flowchart illustrating an electronic device determining a target function pointer according to a type of a target power adapter according to an embodiment of the present application;
fig. 4 is a flowchart illustrating an electronic device setting a first charging current in a target current setting table according to a target charging scenario according to an embodiment of the present application;
fig. 5 is a flowchart illustrating a process that an electronic device detects that a target charging scene where the electronic device is located changes according to an embodiment of the present disclosure;
fig. 6 is a block diagram of a charging device according to an embodiment of the present disclosure;
fig. 7 is a block diagram of another charging device according to an embodiment of the present disclosure.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
In general, in a charging process, the electronic device needs to set a proper charging current to charge the battery, so that on one hand, damage or influence of an over-large charging current on the electronic device on use of the electronic device by a user is avoided, and on the other hand, influence of an over-small charging current on charging efficiency of the electronic device is avoided.
In practical applications, different types of power adapters can provide different charging currents, for example, a power adapter supporting a fast charging technology can provide a higher charging current, a power adapter not supporting the fast charging technology can provide a lower charging current, and meanwhile, the power adapters supporting different types of fast charging technologies can provide different charging currents, so that it is necessary for an electronic device to set the charging current according to the type of the power adapter into which the electronic device is plugged.
In addition, when setting the charging current, the electronic device needs to fully consider the charging scenario in which the electronic device is located. The charging scenario refers to a software usage status and a hardware usage status of the electronic device that may be affected by or influence the charging process. For example, the charging scene may include software usage states such as playing video, making a call, playing a game, and the like, and the charging scene may also include hardware usage states such as a charging interface temperature, a charging interface resistance, a battery temperature, and the like.
In practical application, due to joule heat generated by the charging current, the electronic device may generate heat during the charging process, when the electronic device is in some software use states, the heat generated by the electronic device due to software operation and the heat generated by charging are overlapped together, which may cause the temperature of the electronic device to exceed national or industrial standards, and because the heat generated by the electronic device due to software operation is different in different software use states, the electronic device generally needs to set the charging current according to the software use state thereof, so as to avoid the over-high temperature of the electronic device.
In addition, in order to ensure the safety compliance of the hardware of the electronic device, the electronic device needs to consider the hardware usage state when setting the charging current.
For example, when the temperature of the charging interface is high, if the charging current is high, the charging interface is likely to be damaged, and a "burning phenomenon" in a popular sense is likely to occur.
For example, when the resistance of the charging interface is small, it indicates that the charging interface is likely to contact with liquid and cause a short circuit, and in this case, if the charging current is large, the charging interface and the electronic device are likely to be damaged.
For example, when the battery temperature is high, if the charging current is large, the battery temperature may be further significantly increased, and the battery may be damaged.
In the related art, the electronic device may call an input current setting function (input _ current _ limit function) to set the charging current, where the input current setting function includes a plurality of first condition determination statements regarding types of power adapters, and through the plurality of first condition determination statements, the input current setting function may finally be located to the type of the power adapter into which the electronic device is inserted.
However, more conditional determination statements may cause a huge volume of the input current setting function, and particularly, the types of the current power adapters and the number of charging scenarios are larger, so that more conditional determination statements are required to locate the types of the power adapters inserted into the electronic device and the charging scenarios where the electronic device is located, which further increases the volume of the input current setting function. The huge volume of the input current setting function affects the execution efficiency of the input current setting function, wastes the computing resources of the electronic equipment, and increases the maintenance difficulty of the input current setting function.
In addition, the way of locating the type of the power adapter and the charging scenario through the condition judgment statement may result in poor expandability of the input current setting function, and in the future, if a new type of the power adapter or a new charging scenario occurs, a technician is required to write the input current setting function again.
In view of the above, embodiments of the present application provide a charging method, which can reduce the volume of an input current setting function, thereby improving the execution efficiency of the input current setting function, saving the computing resources of an electronic device, and reducing the maintenance difficulty of the input current setting function. Besides, the charging method can also increase the expandability of the input current setting function.
In the charging method provided in the embodiment of the present application, the electronic device may obtain a type of a target power adapter into which the electronic device is inserted, and determine a target function pointer pointing to a target current setting table corresponding to the type of the target power adapter, further, the electronic device may determine a target charging scenario in which the electronic device is located, and set a first charging current in the target current setting table according to the target charging scenario, and then, the electronic device may call an input current setting function to obtain the target function pointer through the input current setting function, locate the target current setting table according to the target function pointer, and obtain the first charging current in the target current setting table, and then, the electronic device may charge the battery according to the first charging current, because in the charging method provided in the embodiment of the present application, the input current setting function only needs to obtain the target function pointer, the technical process of positioning the target current setting table according to the target function pointer and acquiring the first charging current from the target current setting table is adopted, so that the input current setting function only needs to comprise a function statement for acquiring the target function pointer and a function statement for acquiring the first charging current from the target current setting table, and does not need to comprise a plurality of condition judgment statements, and therefore, the volume of the input current setting function can be greatly reduced, the execution efficiency of the input current setting function can be improved, the computing resource of electronic equipment is saved, and the maintenance difficulty of the input current setting function is reduced.
In addition, when a new power adapter type or a new charging scene occurs, technicians only need to add a new current setting table corresponding to the new power adapter type and a function pointer pointing to the new current setting table, and modify each current setting table based on the new charging scene, without rewriting an input current setting function, so that the expandability of the input current setting function can be improved.
The charging method provided by the embodiment of the application can be applied to electronic equipment, wherein the electronic equipment can be provided with a battery and a charging control chip, the battery can be a lithium battery, and the charging control chip can be used for controlling the electronic equipment to charge the battery. Optionally, the electronic device may be a notebook computer, a smart phone, a tablet computer, a wearable device, and the like.
Please refer to fig. 1, which is a schematic diagram of an exemplary internal structure of an electronic device. As shown in fig. 1, the electronic device includes a processor, a memory, a network interface, a display screen, and an input device connected through a system bus. Wherein the processor of the electronic device is configured to provide computing and control capabilities. The memory of the electronic equipment comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The computer program described above is executed by a processor to implement the charging method provided by the embodiments of the present application. The network interface of the electronic device is used for communicating with an external device through network connection. The display screen of the electronic equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the electronic equipment, an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the configuration shown in fig. 1 is a block diagram of only a portion of the configuration of an electronic device and does not constitute a limitation on the electronic device to which the present solution applies, and that a particular electronic device may include more or less components than those shown, or combine certain components, or have a different arrangement of components.
Referring to fig. 2, a flowchart of a charging method provided in an embodiment of the present application is shown, where the charging method can be applied to the electronic device described above. As shown in fig. 2, the charging method may include the steps of:
step 201, when detecting that the target power adapter is electrically connected, the electronic device obtains the type of the target power adapter, and determines the target function pointer according to the type of the target power adapter.
The electronic device detects that it is electrically connected to the target power adapter, indicating that the electronic device is plugged into the target power adapter and can be charged by the target power adapter, in which case the electronic device may obtain the type of the target power adapter.
Optionally, the electronic device may identify the type of the target power adapter according to a charging protocol, for example, the electronic device may identify the DCP power adapter, the SDP power adapter, and the CDP power adapter according to a BC1.2 charging protocol, for example, the electronic device may identify the QC power adapter according to an HVDCP charging protocol, for example, the electronic device may identify the PD power adapter according to a PD charging protocol, for example, the electronic device may identify a corresponding fast charging power adapter according to a super VOOC charging protocol and a VOOC charging protocol.
After identifying the type of the target power adapter, the electronic device may determine an objective function pointer according to the type of the target power adapter, wherein the objective function pointer points to a target current setting table corresponding to the type of the target power adapter. It should be noted that in the embodiments of the present application, different power adapter types correspond to different current setting tables.
Step 202, the electronic device determines a target charging scenario where the electronic device is located, and sets a first charging current in a target current setting table according to the target charging scenario.
The target charging scene where the electronic device is located refers to a software use state and a hardware use state of the electronic device, wherein the software use state and the hardware use state are influenced by a charging process or influence the charging process, the software use state can include playing videos, making calls, playing games and the like, and the hardware use state can include charging interface temperature, charging interface resistance values, battery temperature and the like.
In general, the electronic device may determine whether itself is in a certain software use state by using a user state, and meanwhile, the electronic device may determine whether itself is in a certain hardware use state according to whether itself is configured with a monitoring program for the certain hardware use state.
After obtaining the target charging scenario in which the electronic device is located, the electronic device may set the first charging current in the target current setting table according to the target charging scenario.
It should be noted that the number of target charging scenarios where the electronic device is located may be multiple, and in an alternative embodiment of the present application, the electronic device may set the first charging current in the target current setting table according to the multiple target charging scenarios.
Step 203, the electronic device calls an input current setting function, obtains a target function pointer through the input current setting function, positions a target current setting table according to the target function pointer, and obtains a first charging current from the target current setting table.
In an alternative embodiment of the present application, the input current setting function may include a first function statement that obtains a pointer to a target function and a second function statement that obtains the first charging current from a target current setting table.
Based on the first function statement, the input current setting function may implement obtaining a target function pointer, and based on the second function statement, the input current setting function may implement obtaining the first charging current in the target current setting table.
And step 204, the electronic equipment charges the battery according to the first charging current.
After obtaining the first charging current from the target current setting table, the input current setting function may write the first charging current into a preset current register, and the electronic device may read the first charging current from the current register and charge the battery according to the first charging current.
In the charging method provided by the embodiment of the application, the electronic device may obtain the type of the target power adapter into which the electronic device is inserted, determine the target function pointer pointing to the target current setting table corresponding to the type of the target power adapter, further, the electronic device may determine the target charging scenario in which the electronic device is located, set the first charging current in the target current setting table according to the target charging scenario, and then, the electronic device may call the input current setting function to obtain the target function pointer through the input current setting function, position the target current setting table according to the target function pointer, and obtain the first charging current in the target current setting table, and then, the electronic device may charge the battery according to the first charging current, because in the charging method provided by the embodiment of the application, the input current setting function only needs to obtain the target function pointer, the technical process of positioning the target current setting table according to the target function pointer and acquiring the first charging current from the target current setting table is adopted, so that the input current setting function only needs to comprise a function statement for acquiring the target function pointer and a function statement for acquiring the first charging current from the target current setting table, and does not need to comprise a plurality of condition judgment statements, and therefore, the volume of the input current setting function can be greatly reduced, the execution efficiency of the input current setting function can be improved, the computing resource of electronic equipment is saved, and the maintenance difficulty of the input current setting function is reduced.
In addition, when a new power adapter type or a new charging scene occurs, technicians only need to add a new current setting table corresponding to the new power adapter type and a function pointer pointing to the new current setting table, and modify each current setting table based on the new charging scene, without rewriting an input current setting function, so that the expandability of the input current setting function can be improved.
In the following, an alternative technical process for determining the target function pointer by the electronic device according to the type of the target power adapter will be briefly described in the embodiments of the present application, and please refer to fig. 3, where the technical process may include the following steps:
step 301, the electronic device modifies the state parameter corresponding to the type of the target power adapter in the function pointer table from a first value to a second value.
The function pointer table stores the type and state parameters of the power adapter and a plurality of groups of corresponding relations of the function pointers.
It should be noted that the function pointer table stores all types of power adapters that may be plugged into the electronic device.
In each set of corresponding relationships of the function pointer table, the state parameter is used to indicate whether the type of the power adapter corresponding to the state parameter is the type of the target power adapter currently inserted into the electronic device, optionally, the state parameter may include a first value and a second value, the first value is used to indicate that the type of the power adapter corresponding to the state parameter is not the type of the target power adapter currently inserted into the electronic device, the second value is used to indicate that the type of the power adapter corresponding to the state parameter is the type of the target power adapter currently inserted into the electronic device, optionally, the first value may be false, and the second value may be true.
In each group of corresponding relations of the function pointer table, the function pointer points to the current setting table corresponding to the type of the power adapter corresponding to the function pointer.
Please refer to table 1, which illustrates an exemplary function pointer table provided in an embodiment of the present application.
TABLE 1
Type of power adapter Status parameter Function pointer
DCP power adapter false Func1
…… ……
QC power adapter false Func9
As shown in table 1, the state parameter corresponding to the DCP power adapter is false, that is, the state parameter is a first value, which indicates that the type of the target power adapter currently inserted in the electronic device is not the DCP power adapter, and the function pointer Func1 points to the current setting table corresponding to the DCP power adapter.
In step 301, the electronic device may modify the state parameter corresponding to the type of the target power adapter in the function pointer table from a first value to a second value, for example, if the type of the target power adapter currently plugged in the electronic device is a DCP power adapter, the electronic device may modify the state parameter corresponding to the DCP power adapter in the function pointer table from false to true.
It should be noted that, because the electronic device can only be plugged into one target power adapter at a time, but cannot be plugged into a plurality of target power adapters at the same time, at most, only one state parameter of the second value exists in the function pointer table.
In view of the above considerations, in an alternative embodiment of the present application, before executing the technical process of step 301, the electronic device may detect whether the second value already exists in the function pointer table, if the second value already exists, the electronic device may modify the already existing second value into the first value, and execute the technical process of step 301 after the modification is completed, and if the second value does not already exist, the electronic device may directly execute the technical process of step 301. In this way, it is possible to avoid a malfunction of the function logic, which results in an inability to successfully set the first charging current in a subsequent step.
Optionally, in an embodiment of the application, if the electronic device detects that the electrical connection with the target power adapter is disconnected, it is indicated that the target power adapter is unplugged from the electronic device, or the electronic device cannot be charged through the target power adapter, at this time, the electronic device may modify all the second values in the function pointer table to the first values.
And step 302, the electronic equipment takes the function pointer corresponding to the second value in the function pointer table as a target function pointer.
In an alternative embodiment of the present application, the function pointer table may include a special entry, and the electronic device may write the target function pointer into the special entry after determining the target function pointer. Accordingly, the input current setting function may read the target function pointer directly from the special table entry.
As can be seen from the above description, if a new power adapter type occurs, a technician only needs to create a current setting table corresponding to the new power adapter type, create a corresponding relationship of the new power adapter type in the function pointer table, and write a function pointer of the newly created current setting table into the corresponding relationship, without rewriting the input current setting function, so that the expandability of the input current setting function can be improved.
In the following, an optional technical process of the electronic device setting the first charging current in the target current setting table according to the target charging scenario will be described in an embodiment of the present application, please refer to fig. 4, where the technical process may include the following steps:
step 401, the electronic device determines, according to the type of the target power adapter, standard charging currents corresponding to the target charging scenarios, respectively.
As described above, the electronic device may be located in a plurality of target charging scenarios, and in step 401, for each target charging scenario, the electronic device may determine a standard charging current corresponding to the target charging scenario according to the type of the target power adapter. The standard charging current corresponding to a certain charging scene refers to the maximum charging current which can ensure the safety compliance of electronic equipment hardware and ensure that the temperature of the electronic equipment does not exceed the national or industrial standard in the charging scene.
Next, the present embodiment will briefly describe a technical process of determining, by an electronic device, a standard charging current corresponding to a certain target charging scenario according to a type of a target power adapter, where the technical process includes the following steps a1 and a 2.
Step a1, the electronic device obtains the scene parameters of the target charging scene.
The scene parameter refers to a parameter for characterizing a charging scene. For example, for the software use state, the scene parameter may be an identifier of the software, a version number of the software, a duration of the software use, and the like, and for the hardware use state, the scene parameter may be a value of the charging interface temperature, a resistance value of the charging interface resistor, a value of the battery temperature, and the like.
Step a2, the electronic device queries a standard charging current meter according to the scene parameters of the target charging scene and the type of the target power adapter, and obtains a standard charging current corresponding to the target charging scene.
The standard charging ammeter stores a plurality of groups of corresponding relations between the type of the power adapter, the scene parameters of the charging scene and the standard charging current.
Please refer to table 2, which shows an exemplary standard charging current meter provided in the embodiments of the present application.
TABLE 2
Type of power adapter Scene parameters of charging scene Standard charging current
DCP power adapter A 1A
…… ……
QC power adapter B 2A
As shown in table 2, if the type of the target power adapter is a DCP power adapter and the scene parameter of the target charging scenario is a, the electronic device may obtain the standard charging current 1A of the target charging scenario by looking up table 2.
Step 402, the electronic device modifies the charging current corresponding to each target charging scenario in the target current setting table by using the standard charging current corresponding to each target charging scenario, and modifies the state parameter corresponding to each target charging scenario in the target current setting table from a first value to a second value.
The target current setting table stores a plurality of groups of corresponding relations of the charging scene, the state parameters and the charging current.
It should be noted that all charging scenarios that the electronic device may be in are stored in the target current setting table.
In each group of corresponding relations of the target current setting table, the state parameter is used for indicating whether the corresponding charging scene is the target charging scene in which the electronic device is currently located. Optionally, the state parameter may include a first value and a second value, where the first value is used to indicate that the charging scenario corresponding to the state parameter is not the target charging scenario in which the electronic device is currently located, and the second value is used to indicate that the charging scenario corresponding to the state parameter is the target charging scenario in which the electronic device is currently located, and optionally, the first value may be false, and the second value may be true.
In each set of corresponding relationships of the target current setting table, the charging current may be a maximum current or a minimum current default to a corresponding charging scenario, which is not specifically limited in the embodiment of the present application.
Please refer to table 3, which illustrates an exemplary target current setting table provided in the embodiments of the present application.
TABLE 3
Charging scenario Status parameter Charging current
Charging interface temperature false 5A
…… ……
Playing video false 3A
As shown in table 3, the state parameter corresponding to the charging interface temperature is false, that is, the state parameter is a first value, which indicates that the charging interface temperature is not the target charging scene where the electronic device is currently located, and the charging current 5A corresponding to the charging interface temperature is the default maximum current.
In step 402, the electronic device may modify the state parameter corresponding to each target charging scene in the target current setting table from a first value to a second value, for example, if the electronic device is in the charging scene of playing a video, the electronic device may modify the state parameter corresponding to the playing video in the target current setting table from false to true.
Meanwhile, the electronic device may modify the charging current corresponding to each target charging scene in the target current setting table by using the standard charging current corresponding to each target charging scene, for example, if the standard current corresponding to the target charging scene of playing the video is 2A, the electronic device may modify 3A in table 3 to 2A.
In step 403, the electronic device sets the minimum charging current in the charging currents corresponding to the second value in the target current setting table as the first charging current.
As shown in table 3, if the state parameter corresponding to the charging interface temperature and the state parameter corresponding to the playing video are both true, that is, both of them are the second values, the electronic device may use the minimum charging current of the charging current 5A corresponding to the charging interface temperature and the charging current 3A corresponding to the playing video in table 3 as the first charging current.
In an alternative embodiment of the present application, the target current setting table may include a special table entry, and the electronic device may write the first charging current into the special table entry after determining the first charging current. Accordingly, the input current setting function may read the first charging current directly from the dedicated entry.
Optionally, in an embodiment of the application, if the electronic device detects that the electrical connection with the target power adapter is disconnected, it is described that the target power adapter is pulled out from the electronic device, or the electronic device cannot be charged through the target power adapter, at this time, the electronic device may modify the charging current corresponding to each charging scenario in the target current setting table to a maximum current or a minimum current default to each charging scenario, and modify all second values in the target current setting table to the first value.
As can be seen from the above description, if a new charging scenario occurs, a technician only needs to create a corresponding relationship of the new charging scenario in each current setting table, and does not need to rewrite the input current setting function, so that the expandability of the input current setting function can be improved.
It is easily understood that, in order to adapt to a change of the target charging scenario, as shown in fig. 5, in an alternative embodiment of the present application, if the electronic device detects that the target charging scenario where the electronic device is located changes, the electronic device may perform the following technical processes:
step 501, the electronic device sets a second charging current in a target current setting table according to the changed target charging scene.
The technical process of setting the second charging current in the target current setting table by the electronic device is the same as the technical process of setting the first charging current in the target current setting table by the electronic device, and the embodiment of the application is not described herein again.
Step 502, the electronic device calls an input current setting function, obtains a target function pointer through the input current setting function, positions a target current setting table according to the target function pointer, and obtains a second charging current in the target current setting table.
The technical process of step 502 is the same as the technical process of step 203, and the embodiments of the present application are not described herein again.
And step 503, the electrons charge the battery according to the second charging current.
The technical process of step 503 is the same as the technical process of step 204, and the embodiments of the present application are not described herein again.
Referring to fig. 6, a block diagram of a charging device 600 according to an embodiment of the present disclosure is shown, where the charging device 600 may be configured in the electronic device. As shown in fig. 6, the charging device 600 may include: the device comprises a determination module 601, a first setting module 602, a first obtaining module 603 and a first charging module 604.
The determining module 601 is configured to, when it is detected that the electronic device is electrically connected to a target power adapter, obtain a type of the target power adapter, and determine a target function pointer according to the type of the target power adapter, where the target function pointer points to a target current setting table corresponding to the type of the target power adapter.
The first setting module 602 is configured to determine a target charging scenario in which the electronic device is located, and set a first charging current in the target current setting table according to the target charging scenario.
The first obtaining module 603 is configured to invoke an input current setting function, obtain the target function pointer through the input current setting function, locate the target current setting table according to the target function pointer, and obtain the first charging current in the target current setting table.
The first charging module 604 is configured to charge a battery of the electronic device according to the first charging current.
In an optional embodiment of the present application, the determining module 601 is specifically configured to: modifying the state parameter corresponding to the type of the target power adapter in a function pointer table from a first value to a second value, wherein the function pointer table stores a plurality of groups of corresponding relations among the type of the power adapter, the state parameter and the function pointer; and taking the function pointer corresponding to the second value in the function pointer table as the target function pointer.
In an optional embodiment of the present application, the determining module 601 is specifically configured to: and when the second value does not exist in the function pointer table, modifying the state parameter corresponding to the type of the target power adapter in the function pointer table from the first value to the second value.
In an optional embodiment of the present application, the first setting module 602 is specifically configured to: determining standard charging current corresponding to each target charging scene according to the type of the target power adapter; modifying the charging current corresponding to each target charging scene in the target current setting table by using the standard charging current corresponding to each target charging scene, and modifying the state parameter corresponding to each target charging scene in the target current setting table from a first value to a second value, wherein the target current setting table stores a plurality of groups of corresponding relations of the charging scenes, the state parameters and the charging currents; and taking the minimum charging current in the charging currents corresponding to the second value in the target current setting table as the first charging current.
In an optional embodiment of the present application, the first setting module 602 is specifically configured to: acquiring scene parameters of each target charging scene; inquiring a standard charging ammeter according to the scene parameters of each target charging scene and the type of the target power adapter to obtain standard charging currents corresponding to the target charging scenes respectively; the standard charging ammeter stores a plurality of groups of corresponding relations between the type of the power adapter, the scene parameters of the charging scene and the standard charging current.
Referring to fig. 7, a block diagram of another charging apparatus 700 provided in the embodiment of the present application is shown, where the charging apparatus 700 includes, in addition to the modules included in the charging apparatus 600, a first modifying module 605, a second modifying module 606, a second setting module 607, a second obtaining module 608, and a second charging module 609.
The first modification module 605 is configured to modify all the second values in the function pointer table to the first values when it is detected that the electronic device is electrically disconnected from the target power adapter.
The second modifying module 606 is configured to modify, when it is detected that the electronic device is electrically disconnected from the target power adapter, the charging current corresponding to each charging scenario in the target current setting table to be the maximum charging current corresponding to each charging scenario, and modify all second values in the target current setting table to be the first values.
The second setting module 607 is configured to set a second charging current in the target current setting table according to the changed target charging scenario when the target charging scenario is detected to be changed.
The second obtaining module 608 is configured to invoke the input current setting function, obtain the target function pointer through the input current setting function, locate the target current setting table according to the target function pointer, and obtain the second charging current in the target current setting table.
The second charging module 609 is configured to charge the battery of the electronic device according to the second charging current.
The charging device provided by the embodiment of the application can realize the method embodiment, the realization principle and the technical effect are similar, and the details are not repeated.
For specific limitations of the charging device, reference may be made to the above limitations of the charging method, which are not described herein again. The modules in the charging apparatus may be implemented in whole or in part by software, hardware, and a combination thereof. The modules can be embedded in a hardware form or independent of a processor in the electronic device, or can be stored in a memory in the electronic device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment of the present application, there is provided an electronic device comprising a memory and a processor, the memory having stored therein a computer program, the processor implementing the following steps when executing the computer program:
when the electronic equipment is detected to be electrically connected with a target power adapter, acquiring the type of the target power adapter, and determining a target function pointer according to the type of the target power adapter, wherein the target function pointer points to a target current setting table corresponding to the type of the target power adapter; determining a target charging scene where the electronic equipment is located, and setting a first charging current in the target current setting table according to the target charging scene; calling an input current setting function, acquiring the target function pointer through the input current setting function, positioning the target current setting table according to the target function pointer, and acquiring the first charging current in the target current setting table; and charging the battery of the electronic equipment according to the first charging current.
In one embodiment of the application, the processor when executing the computer program further performs the steps of: modifying the state parameter corresponding to the type of the target power adapter in a function pointer table from a first value to a second value, wherein the function pointer table stores a plurality of groups of corresponding relations among the type of the power adapter, the state parameter and the function pointer; and taking the function pointer corresponding to the second value in the function pointer table as the target function pointer.
In one embodiment of the application, the processor when executing the computer program further performs the steps of: and when the second value does not exist in the function pointer table, modifying the state parameter corresponding to the type of the target power adapter in the function pointer table from the first value to the second value.
In one embodiment of the application, the processor when executing the computer program further performs the steps of: and when the electronic equipment is detected to be disconnected from the target power adapter, all the second values in the function pointer table are modified into the first values.
In one embodiment of the application, the processor when executing the computer program further performs the steps of: determining standard charging current corresponding to each target charging scene according to the type of the target power adapter; modifying the charging current corresponding to each target charging scene in the target current setting table by using the standard charging current corresponding to each target charging scene, and modifying the state parameter corresponding to each target charging scene in the target current setting table from a first value to a second value, wherein the target current setting table stores a plurality of groups of corresponding relations of the charging scenes, the state parameters and the charging currents; and taking the minimum charging current in the charging currents corresponding to the second value in the target current setting table as the first charging current.
In one embodiment of the application, the processor when executing the computer program further performs the steps of: when the electronic equipment is detected to be electrically disconnected from the target power adapter, the charging current corresponding to each charging scene in the target current setting table is modified to be the maximum charging current corresponding to each charging scene, and all second values in the target current setting table are modified to be the first values.
In one embodiment of the application, the processor when executing the computer program further performs the steps of: acquiring scene parameters of each target charging scene; inquiring a standard charging ammeter according to the scene parameters of each target charging scene and the type of the target power adapter to obtain standard charging currents corresponding to the target charging scenes respectively; the standard charging ammeter stores a plurality of groups of corresponding relations between the type of the power adapter, the scene parameters of the charging scene and the standard charging current.
In one embodiment of the application, the processor when executing the computer program further performs the steps of: when the target charging scene is detected to be changed, setting a second charging current in the target current setting table according to the changed target charging scene; calling the input current setting function, acquiring the target function pointer through the input current setting function, positioning the target current setting table according to the target function pointer, and acquiring the second charging current in the target current setting table; and charging the battery of the electronic equipment according to the second charging current.
The electronic device provided by the embodiment of the application has the implementation principle and the technical effect similar to those of the method embodiment, and is not described herein again.
In an embodiment of the application, a computer-readable storage medium is provided, on which a computer program is stored, which computer program, when being executed by a processor, carries out the steps of:
when the electronic equipment is detected to be electrically connected with a target power adapter, acquiring the type of the target power adapter, and determining a target function pointer according to the type of the target power adapter, wherein the target function pointer points to a target current setting table corresponding to the type of the target power adapter; determining a target charging scene where the electronic equipment is located, and setting a first charging current in the target current setting table according to the target charging scene; calling an input current setting function, acquiring the target function pointer through the input current setting function, positioning the target current setting table according to the target function pointer, and acquiring the first charging current in the target current setting table; and charging the battery of the electronic equipment according to the first charging current.
In one embodiment of the application, the computer program when executed by the processor further performs the steps of: modifying the state parameter corresponding to the type of the target power adapter in a function pointer table from a first value to a second value, wherein the function pointer table stores a plurality of groups of corresponding relations among the type of the power adapter, the state parameter and the function pointer; and taking the function pointer corresponding to the second value in the function pointer table as the target function pointer.
In one embodiment of the application, the computer program when executed by the processor further performs the steps of: and when the second value does not exist in the function pointer table, modifying the state parameter corresponding to the type of the target power adapter in the function pointer table from the first value to the second value.
In one embodiment of the application, the computer program when executed by the processor further performs the steps of: and when the electronic equipment is detected to be disconnected from the target power adapter, all the second values in the function pointer table are modified into the first values.
In one embodiment of the application, the computer program when executed by the processor further performs the steps of: determining standard charging current corresponding to each target charging scene according to the type of the target power adapter; modifying the charging current corresponding to each target charging scene in the target current setting table by using the standard charging current corresponding to each target charging scene, and modifying the state parameter corresponding to each target charging scene in the target current setting table from a first value to a second value, wherein the target current setting table stores a plurality of groups of corresponding relations of the charging scenes, the state parameters and the charging currents; and taking the minimum charging current in the charging currents corresponding to the second value in the target current setting table as the first charging current.
In one embodiment of the application, the computer program when executed by the processor further performs the steps of: when the electronic equipment is detected to be electrically disconnected from the target power adapter, the charging current corresponding to each charging scene in the target current setting table is modified to be the maximum charging current corresponding to each charging scene, and all second values in the target current setting table are modified to be the first values.
In one embodiment of the application, the computer program when executed by the processor further performs the steps of: acquiring scene parameters of each target charging scene; inquiring a standard charging ammeter according to the scene parameters of each target charging scene and the type of the target power adapter to obtain standard charging currents corresponding to the target charging scenes respectively; the standard charging ammeter stores a plurality of groups of corresponding relations between the type of the power adapter, the scene parameters of the charging scene and the standard charging current.
In one embodiment of the application, the computer program when executed by the processor further performs the steps of: when the target charging scene is detected to be changed, setting a second charging current in the target current setting table according to the changed target charging scene; calling the input current setting function, acquiring the target function pointer through the input current setting function, positioning the target current setting table according to the target function pointer, and acquiring the second charging current in the target current setting table; and charging the battery of the electronic equipment according to the second charging current.
The implementation principle and technical effect of the computer-readable storage medium provided by this embodiment are similar to those of the above-described method embodiment, and are not described herein again.
Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the embodiments described above may be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the embodiments described above are not described, but should be considered as being within the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the claims. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (11)

1.一种充电方法,其特征在于,所述方法包括:1. A charging method, wherein the method comprises: 在检测到电子设备与目标电源适配器电连接时,获取所述目标电源适配器的类型,并根据所述目标电源适配器的类型确定目标函数指针,所述目标函数指针指向与所述目标电源适配器的类型相对应的目标电流设置表;When it is detected that the electronic device is electrically connected to the target power adapter, the type of the target power adapter is obtained, and the target function pointer is determined according to the type of the target power adapter, and the target function pointer points to the type of the target power adapter. Corresponding target current setting table; 确定所述电子设备所处的目标充电场景,并根据所述目标充电场景在所述目标电流设置表中设置第一充电电流;determining a target charging scene where the electronic device is located, and setting a first charging current in the target current setting table according to the target charging scene; 调用输入电流设置函数,通过所述输入电流设置函数获取所述目标函数指针,根据所述目标函数指针定位所述目标电流设置表,并在所述目标电流设置表中获取所述第一充电电流;Call the input current setting function, obtain the target function pointer through the input current setting function, locate the target current setting table according to the target function pointer, and obtain the first charging current in the target current setting table ; 根据所述第一充电电流对所述电子设备的电池进行充电。The battery of the electronic device is charged according to the first charging current. 2.根据权利要求1所述的方法,其特征在于,所述根据所述目标电源适配器的类型确定目标函数指针,包括:2. The method according to claim 1, wherein the determining the target function pointer according to the type of the target power adapter comprises: 将函数指针表中与所述目标电源适配器的类型对应的状态参数由第一值修改为第二值,所述函数指针表中存储有电源适配器的类型、状态参数以及函数指针的多组对应关系;Modify the state parameter corresponding to the type of the target power adapter in the function pointer table from the first value to the second value, and the function pointer table stores the type of the power adapter, the state parameter and the function pointer. Multiple sets of correspondences ; 将所述函数指针表中与第二值对应的函数指针作为所述目标函数指针。The function pointer corresponding to the second value in the function pointer table is used as the target function pointer. 3.根据权利要求2所述的方法,其特征在于,所述将函数指针表中与所述目标电源适配器的类型对应的状态参数由第一值修改为第二值,包括:3. The method according to claim 2, wherein the modifying the state parameter corresponding to the type of the target power adapter in the function pointer table from a first value to a second value comprises: 当所述函数指针表中不存在第二值时,将所述函数指针表中与所述目标电源适配器的类型对应的状态参数由第一值修改为第二值。When the second value does not exist in the function pointer table, the state parameter in the function pointer table corresponding to the type of the target power adapter is modified from the first value to the second value. 4.根据权利要求2所述的方法,其特征在于,所述方法还包括:4. The method according to claim 2, wherein the method further comprises: 当检测到所述电子设备与所述目标电源适配器的电连接断开时,将所述函数指针表中所有的第二值均修改为第一值。When it is detected that the electrical connection between the electronic device and the target power adapter is disconnected, all second values in the function pointer table are modified to first values. 5.根据权利要求1所述的方法,其特征在于,所述根据所述目标充电场景在所述目标电流设置表中设置第一充电电流,包括:5. The method according to claim 1, wherein the setting the first charging current in the target current setting table according to the target charging scenario comprises: 根据所述目标电源适配器的类型,确定各所述目标充电场景所分别对应的标准充电电流;According to the type of the target power adapter, determine the standard charging current corresponding to each of the target charging scenarios; 利用各所述目标充电场景分别对应的标准充电电流,修改所述目标电流设置表中各所述目标充电场景分别对应的充电电流,并将所述目标电流设置表中各所述目标充电场景对应的状态参数由第一值修改为第二值,其中,所述目标电流设置表中存储有充电场景、状态参数以及充电电流的多组对应关系;Using the standard charging current corresponding to each target charging scene, modify the charging current corresponding to each target charging scene in the target current setting table, and make the target current setting table corresponding to each target charging scene The state parameter of is modified from the first value to the second value, wherein the target current setting table stores multiple sets of corresponding relationships of charging scenarios, state parameters and charging current; 将所述目标电流设置表中与所述第二值对应的充电电流中最小的充电电流作为所述第一充电电流。The minimum charging current among the charging currents corresponding to the second value in the target current setting table is used as the first charging current. 6.根据权利要求5所述的方法,其特征在于,所述方法还包括:6. The method according to claim 5, wherein the method further comprises: 当检测到所述电子设备与所述目标电源适配器的电连接断开时,将所述目标电流设置表中各充电场景对应的充电电流修改为各充电场景对应的最大充电电流,并将所述目标电流设置表中所有的第二值均修改为第一值。When it is detected that the electrical connection between the electronic device and the target power adapter is disconnected, the charging current corresponding to each charging scene in the target current setting table is modified to the maximum charging current corresponding to each charging scene, and the All second values in the target current setting table are modified to the first values. 7.根据权利要求5所述的方法,其特征在于,所述根据所述目标电源适配器的类型,确定各所述目标充电场景所分别对应的标准充电电流,包括:7 . The method according to claim 5 , wherein the determining, according to the type of the target power adapter, the standard charging current corresponding to each of the target charging scenarios, comprising: 8 . 获取各所述目标充电场景的场景参数;acquiring scene parameters of each of the target charging scenes; 根据各所述目标充电场景的场景参数以及所述目标电源适配器的类型查询标准充电电流表,得到各所述目标充电场景所分别对应的标准充电电流;Query the standard charging current table according to the scene parameters of each of the target charging scenarios and the type of the target power adapter, and obtain the standard charging current corresponding to each of the target charging scenarios; 其中,所述标准充电电流表中存储有电源适配器的类型、充电场景的场景参数与标准充电电流的多组对应关系。Wherein, the standard charging current table stores multiple sets of correspondences between the type of the power adapter, the scene parameters of the charging scene and the standard charging current. 8.根据权利要求1所述的方法,其特征在于,所述调用输入电流设置函数,通过所述输入电流设置函数获取所述目标函数指针,根据所述目标函数指针定位所述目标电流设置表,并在所述目标电流设置表中获取所述第一充电电流之后,所述方法还包括:8 . The method according to claim 1 , wherein the calling an input current setting function, obtaining the target function pointer through the input current setting function, and locating the target current setting table according to the target function pointer. 9 . , and after obtaining the first charging current in the target current setting table, the method further includes: 当检测到所述目标充电场景发生变化时,根据变化后的目标充电场景在所述目标电流设置表中设置第二充电电流;When it is detected that the target charging scene changes, a second charging current is set in the target current setting table according to the changed target charging scene; 调用所述输入电流设置函数,通过所述输入电流设置函数获取所述目标函数指针,根据所述目标函数指针定位所述目标电流设置表,并在所述目标电流设置表中获取所述第二充电电流;Calling the input current setting function, obtaining the target function pointer through the input current setting function, locating the target current setting table according to the target function pointer, and obtaining the second target current setting table from the target current setting table recharging current; 根据所述第二充电电流对所述电子设备的电池进行充电。The battery of the electronic device is charged according to the second charging current. 9.一种充电装置,其特征在于,所述装置包括:9. A charging device, characterized in that the device comprises: 确定模块,用于在检测到电子设备与目标电源适配器电连接时,获取所述目标电源适配器的类型,并根据所述目标电源适配器的类型确定目标函数指针,所述目标函数指针指向与所述目标电源适配器的类型相对应的目标电流设置表;A determination module, configured to acquire the type of the target power adapter when it is detected that the electronic device is electrically connected to the target power adapter, and determine an objective function pointer according to the type of the target power adapter, and the target function pointer points to the same as the target power adapter. Target current setting table corresponding to the type of target power adapter; 第一设置模块,用于确定所述电子设备所处的目标充电场景,并根据所述目标充电场景在所述目标电流设置表中设置第一充电电流;a first setting module, configured to determine a target charging scene where the electronic device is located, and set a first charging current in the target current setting table according to the target charging scene; 第一获取模块,用于调用输入电流设置函数,通过所述输入电流设置函数获取所述目标函数指针,根据所述目标函数指针定位所述目标电流设置表,并在所述目标电流设置表中获取所述第一充电电流;The first obtaining module is used to call the input current setting function, obtain the target function pointer through the input current setting function, locate the target current setting table according to the target function pointer, and record the target current setting table in the target current setting table obtaining the first charging current; 第一充电模块,用于根据所述第一充电电流对所述电子设备的电池进行充电。A first charging module, configured to charge the battery of the electronic device according to the first charging current. 10.一种电子设备,其特征在于,包括存储器和处理器,所述存储器存储有计算机程序,所述计算机程序被所述处理器执行时实现如权利要求1至8任一所述的充电方法。10. An electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the charging method according to any one of claims 1 to 8 is implemented . 11.一种计算机可读存储介质,其特征在于,其上存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1至8任一所述的充电方法。11. A computer-readable storage medium, characterized in that a computer program is stored thereon, and when the computer program is executed by a processor, the charging method according to any one of claims 1 to 8 is implemented.
CN202010487504.6A 2020-06-02 2020-06-02 Charging method, device, equipment and storage medium Active CN113764754B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010487504.6A CN113764754B (en) 2020-06-02 2020-06-02 Charging method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010487504.6A CN113764754B (en) 2020-06-02 2020-06-02 Charging method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113764754A true CN113764754A (en) 2021-12-07
CN113764754B CN113764754B (en) 2023-11-03

Family

ID=78782249

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010487504.6A Active CN113764754B (en) 2020-06-02 2020-06-02 Charging method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113764754B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114865733A (en) * 2022-04-15 2022-08-05 合肥龙旗智能科技有限公司 Charging control method, device, equipment and medium for wearable electronic equipment

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105790345A (en) * 2014-12-26 2016-07-20 中兴通讯股份有限公司 Charging control method and device
WO2018129977A1 (en) * 2017-01-13 2018-07-19 广东欧珀移动通信有限公司 Charging control method and apparatus, storage medium, and computer device
CN108808785A (en) * 2018-06-27 2018-11-13 Oppo广东移动通信有限公司 Electronic equipment charging control method and device, electronic equipment and storage medium
CN109888885A (en) * 2019-04-02 2019-06-14 惠州Tcl移动通信有限公司 Charging control method, device, storage medium and electronic device
WO2019113732A1 (en) * 2017-12-11 2019-06-20 深圳市柔宇科技有限公司 Electronic device and charging control method
CN110266071A (en) * 2019-06-21 2019-09-20 深圳市晶祥鑫电子有限公司 A kind of intelligent charging method, device, equipment and readable medium
US20190372366A1 (en) * 2017-05-26 2019-12-05 Shenzhen Legendary Technology Co., Ltd Power adaptor, control method and device
CN110970954A (en) * 2018-09-29 2020-04-07 Oppo广东移动通信有限公司 Charging control method and device, storage medium and split type electronic equipment

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105790345A (en) * 2014-12-26 2016-07-20 中兴通讯股份有限公司 Charging control method and device
WO2018129977A1 (en) * 2017-01-13 2018-07-19 广东欧珀移动通信有限公司 Charging control method and apparatus, storage medium, and computer device
US20190372366A1 (en) * 2017-05-26 2019-12-05 Shenzhen Legendary Technology Co., Ltd Power adaptor, control method and device
WO2019113732A1 (en) * 2017-12-11 2019-06-20 深圳市柔宇科技有限公司 Electronic device and charging control method
CN108808785A (en) * 2018-06-27 2018-11-13 Oppo广东移动通信有限公司 Electronic equipment charging control method and device, electronic equipment and storage medium
CN110970954A (en) * 2018-09-29 2020-04-07 Oppo广东移动通信有限公司 Charging control method and device, storage medium and split type electronic equipment
CN109888885A (en) * 2019-04-02 2019-06-14 惠州Tcl移动通信有限公司 Charging control method, device, storage medium and electronic device
CN110266071A (en) * 2019-06-21 2019-09-20 深圳市晶祥鑫电子有限公司 A kind of intelligent charging method, device, equipment and readable medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114865733A (en) * 2022-04-15 2022-08-05 合肥龙旗智能科技有限公司 Charging control method, device, equipment and medium for wearable electronic equipment

Also Published As

Publication number Publication date
CN113764754B (en) 2023-11-03

Similar Documents

Publication Publication Date Title
CN110729790B (en) Charging method and device, computer equipment and storage medium
WO2020239114A1 (en) Charging method and apparatus, charging system, electronic device, storage medium
CN106655388A (en) Charging control method and device and terminal
CN106603861A (en) Power display method, device and terminal
CN107635078A (en) Game control method and device
CN115184764A (en) A chip testing method, device, electronic device and storage medium
CN110571887B (en) Battery selection method and device, storage medium and electronic equipment
CN111830394A (en) Charging circuit fault detection method, electronic device and computer readable storage medium
CN110350619A (en) Charging control method, device, terminal and storage medium
CN113764754B (en) Charging method, device, equipment and storage medium
CN112054564B (en) Circuit detection method and device, equipment and storage medium
CN108287605A (en) Charging control method and device, terminal equipment and storage medium
CN110416643A (en) A kind of processing method, device and electronic equipment
CN109617175B (en) Mobile terminal charger detection and control method, mobile terminal and storage medium
CN107613546B (en) BLE chip, control method of designated element in BLE chip and Bluetooth low-power-consumption equipment
CN114202045B (en) Data processing method, device, equipment and storage medium
CN112860501B (en) Detection method, detection device, storage medium and mobile terminal
CN112684360B (en) Charging test method, device, terminal and storage medium
CN117254584A (en) Power station operation state monitoring method and device, cloud control system and cloud server
CN117409841A (en) Memory test methods, devices, electronic equipment and storage media
CN115333196A (en) A mobile energy storage power fast charging method, system, device and storage medium
CN106848455B (en) A kind of charge/discharge control method of battery, battery component and mobile terminal
CN111198325B (en) Lithium battery performance testing method, system and computer readable storage medium
CN117950898A (en) Data processing method and device of energy storage system and energy storage system
CN114267396B (en) Flash memory chip programming method, device, system, electronic device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant