Multi-adapter self-adaptive charging parameter adjusting method and device
The method and device for self-adaptive charging parameter adjustment in smart POS machines address the challenge of mismatched charging parameters by identifying adapter power levels and adjusting charging modes, ensuring safe and efficient charging.
Patent Information
- Application Number
- CN202510369245.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-27
- Publication Date
- 2025-06-17
AI Technical Summary
Smart POS machines often use different power adapters that lack USB communication functionality, making it difficult to fully match charging power, leading to potential damage from mismatched charging parameters.
A method and device for self-adaptive adjustment of charging parameters by initializing and verifying communication with the charging IC, detecting real-time charging current, determining adapter power levels, setting safe current thresholds, and switching between constant current and constant voltage charging modes based on battery charge levels.
Automatically identifies and adapts to different power adapters, ensuring safe and efficient charging by setting appropriate current limits, thereby protecting adapters and batteries.
Smart Images

Figure CN120165477A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of intelligent charging, and particularly to a method for adaptively adjusting charging parameters of multiple adapters, a device for adaptively adjusting charging parameters of multiple adapters, an electronic device, and a computer-readable medium. Background Art
[0002] In order to meet the charging needs of customers, intelligent POS machines often come with power adapters of different powers. Limited by cost control, power adapters only have a charging function and do not have a USB communication function, and the charging parameters cannot be fully matched with the charging power. For diversified adapters, it is very difficult to achieve complete isolation only through the hardware list, and ultimately it will only accelerate the damage of functional devices. Summary of the Invention
[0003] In view of the above problems, the present invention is proposed to provide a method for adaptively adjusting charging parameters of multiple adapters and a corresponding device for adaptively adjusting charging parameters of multiple adapters, an electronic device, and a computer-readable medium that overcome or at least partially solve the above problems.
[0004] The present invention discloses a method for adaptively adjusting charging parameters of multiple adapters, the method comprising:
[0005] Initializing a charging IC and verifying the communication function;
[0006] Detecting the real-time charging current of the charging IC in the pre-charging mode to verify the charging working state;
[0007] Collecting the charging current data of the charging IC multiple times, determining the power level of the adapter according to the continuous collection results, and setting an adapter power level flag bit;
[0008] Setting a corresponding charging current safety threshold based on the adapter power level, and storing the charging current safety threshold as the charging parameter of the current adapter; the charging current safety threshold is lower than the rated current value of the adapter;
[0009] Switching between constant current or constant voltage charging mode according to the real-time battery power;
[0010] Clearing the adapter power level flag bit after the adapter is disconnected;
[0011] When the adapter is reconnected, reading the stored charging parameters of the adapter, setting the charging current according to the charging parameters, and detecting whether the real-time charging current exceeds the set range corresponding to the charging parameters; if not, maintaining the current charging parameters; if so, re-executing the adapter power level identification process.
[0012] Optionally, initialize the charging IC and verify the communication function, including:
[0013] Perform initialization settings on the charging IC and communicate with the charging IC to request the ID value of the charging IC;
[0014] If the acquisition of the ID value of the charging IC fails, determine that the communication of the charging IC is abnormal;
[0015] If the ID value of the charging IC is successfully acquired, determine that the communication of the charging IC is normal.
[0016] Optionally, detect the real-time charging current of the charging IC in the pre-charge mode and verify the charging working state, including:
[0017] Enter the pre-charge mode at the initial stage of charging and set the pre-charge current at the battery terminal;
[0018] Detect whether the real-time charging current is consistent with the pre-charge current. If not, stop charging and prompt charging abnormality; if consistent, determine that the charging of the charging IC is normal.
[0019] Optionally, collect the charging current data of the charging IC multiple times and determine the power level of the adapter according to the continuous collection results, including:
[0020] Compare the charging current data with multiple increasing preset current thresholds in sequence. The multiple preset current thresholds include a first threshold, a second threshold, and higher-order thresholds, where each threshold corresponds to the boundary value of adjacent power levels;
[0021] If the consecutive comparison results are all less than or equal to the lowest-order first threshold, determine that the adapter is of the lowest power level;
[0022] If the consecutive comparison results are all greater than the Nth threshold and less than or equal to the (N + 1)th threshold, determine that the adapter is of the intermediate power level associated with the (N + 1)th threshold;
[0023] If the consecutive comparison results are all greater than the highest-order threshold, determine that the adapter is of the highest power level.
[0024] Optionally, switch between constant current or constant voltage charging mode according to the real-time battery power, including:
[0025] When the real-time battery power reaches the second preset power, adopt the constant voltage charging mode and gradually reduce the charging current according to the increase of the real-time battery power;
[0026] When the real-time battery power is between the first preset power and the second preset power, adopt the constant current charging mode and dynamically adjust the upper limit of the charging current according to the rated power of the adapter.
[0027] Optionally, the method further includes:
[0028] Set the maximum charging current at the battery end and the adapter end respectively according to the maximum output power inside the adapter.
[0029] Read the adapter-end voltage, battery-end voltage, adapter-end charging current, and battery-end charging current in real time, synchronously save them to the power subsystem node, and report them to the system for real-time monitoring.
[0030] The present invention also discloses a multi-adapter adaptive charging parameter adjustment device, and the device includes:
[0031] A communication connection verification module, used to initialize the charging IC and verify the communication function;
[0032] A charging working state verification module, used to detect the real-time charging current of the charging IC in the pre-charge mode and verify the charging working state;
[0033] An adapter power level determination module, used to collect the charging current data of the charging IC multiple times, determine the power level of the adapter according to the continuous collection results, and set the adapter power level flag bit;
[0034] A charging current safety threshold determination module, used to set a corresponding charging current safety threshold based on the adapter power level and store the charging current safety threshold as the charging parameter of the current adapter; the charging current safety threshold is lower than the rated current value of the adapter;
[0035] A charging mode control module, used to switch the constant current or constant voltage charging mode according to the real-time battery power;
[0036] An adapter disconnection processing module, used to clear the adapter power level flag bit after the adapter is disconnected;
[0037] A reconnection control module, used to read the stored charging parameters of the adapter when the adapter is reconnected, set the charging current according to the charging parameters, and detect whether the real-time charging current exceeds the set range corresponding to the charging parameters; if not, maintain the current charging parameters; if so, re-execute the adapter power level identification process.
[0038] Optionally, the communication connection verification module includes:
[0039] An ID value acquisition sub-module, used to initialize the charging IC and communicate with the charging IC to request the ID value of the charging IC;
[0040] A communication anomaly determination sub-module, used to determine that the charging IC communication is abnormal if the ID value of the charging IC cannot be obtained;
[0041] A communication normal determination sub-module, which is used to determine that the charging IC communicates normally if the ID value of the charging IC is successfully obtained.
[0042] Optionally, the charging working state verification module includes:
[0043] A pre-charge current setting sub-module, which is used to enter the pre-charge mode at the initial stage of charging and set the pre-charge current at the battery end;
[0044] A charging working state judgment sub-module, which is used to detect whether the real-time charging current is consistent with the pre-charge current. If not, stop charging and prompt charging abnormality; if consistent, determine that the charging IC works normally for charging.
[0045] Optionally, the adapter power level determination module includes:
[0046] A current comparison sub-module, which is used to sequentially compare the charging current data with multiple increasing preset current thresholds. The multiple preset current thresholds include a first threshold, a second threshold, and higher-order thresholds, where each threshold corresponds to the boundary value of adjacent power levels;
[0047] A first power level determination sub-module, which is used to determine that the adapter is at the lowest power level if the comparison results are all less than or equal to the lowest-order first threshold for multiple consecutive times;
[0048] A second power level determination sub-module, which is used to determine that the adapter is at an intermediate power level associated with the (N + 1)th threshold if the comparison results are all greater than the Nth threshold and less than or equal to the (N + 1)th threshold for multiple consecutive times;
[0049] A third power level determination sub-module, which is used to determine that the adapter is at the highest power level if the comparison results are all greater than the highest-order threshold for multiple consecutive times.
[0050] Optionally, the charging mode control module includes:
[0051] A constant voltage charging mode control sub-module, which is used to adopt the constant voltage charging mode and gradually reduce the charging current according to the increase of the real-time battery power when the real-time battery power reaches the second preset power;
[0052] A constant current charging mode control sub-module, which is used to adopt the constant current charging mode and dynamically adjust the upper limit of the charging current according to the rated power of the adapter when the real-time battery power is between the first preset power and the second preset power.
[0053] Optionally, the device further includes:
[0054] A maximum charging current setting module, which is used to respectively set the maximum charging currents at the battery end and the adapter end according to the maximum output power inside the adapter;
[0055] The current and voltage real-time reading and monitoring module is used to real-time read the adapter-end voltage, battery-end voltage, adapter-end charging current, and battery-end charging current, synchronously save them to the power subsystem node, and report to the system for real-time monitoring.
[0056] The present invention also discloses an electronic device, including a processor, a communication interface, a memory, and a communication bus. Among them, the processor, the communication interface, and the memory complete communication with each other through the communication bus;
[0057] The memory is used to store computer programs;
[0058] When the processor is used to execute the program stored on the memory, it realizes the method for adaptively adjusting charging parameters of multiple adapters as described in the present invention.
[0059] The present invention also discloses one or more computer-readable media, on which instructions are stored. When executed by one or more processors, the instructions cause the processors to execute the method for adaptively adjusting charging parameters of multiple adapters as described in the present invention.
[0060] The present invention includes the following advantages:
[0061] The method for adaptively adjusting charging parameters of multiple adapters according to the present invention initializes the charging IC and verifies the communication function, detects the real-time charging current of the charging IC in the pre-charge mode, verifies the charging state, collects charging current data multiple times, determines the adapter power level and sets a flag bit, sets and stores a charging current safety threshold according to the power level, and this threshold is lower than the rated current of the adapter. It switches between constant current and constant voltage charging modes according to the battery power. After the adapter is disconnected, it clears the power level flag bit. When reconnecting, it reads the stored charging parameters, sets the charging current, and detects whether the real-time current exceeds the limit. If it does not exceed the limit, it maintains the parameters. If it exceeds the limit, it re-identifies the adapter power level. This method automatically distinguishes the adapter power through software algorithms, adaptively adjusts the charging parameters, avoids excessive output power, and protects the adapter, battery, and charging IC. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] Figure 1 is a flowchart of the steps of a method for adaptively adjusting charging parameters of multiple adapters provided by an embodiment of the present invention;
[0063] Figure 2 is a flowchart for distinguishing adapter power levels provided by an embodiment of the present invention;
[0064] Figure 3 is a structural block diagram of a device for adaptively adjusting charging parameters of multiple adapters provided by an embodiment of the present invention;
[0065] Figure 4It is a block diagram of an electronic device provided by an embodiment of the present invention;
[0066] Figure 5 It is a schematic diagram of a computer-readable medium provided by an embodiment of the present invention. Detailed implementation manners
[0067] To make the above objects, features, and advantages of the present invention more obvious and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific implementation manners.
[0068] Refer to Figure 1 , which shows a flowchart of steps of a method for adaptively adjusting charging parameters of multiple adapters provided in an embodiment of the present invention, and specifically may include the following steps:
[0069] Step 101, initialize the charging IC and verify the communication function;
[0070] Step 102, detect the real-time charging current of the charging IC in the pre-charging mode and verify the charging working state;
[0071] Step 103, collect the charging current data of the charging IC multiple times, determine the power level of the adapter according to the continuous collection results, and set the adapter power level flag bit;
[0072] Step 104, set a corresponding charging current safety threshold based on the adapter power level, and store the charging current safety threshold as the charging parameter of the current adapter; the charging current safety threshold is lower than the rated current value of the adapter;
[0073] Step 105, switch between constant current or constant voltage charging mode according to the real-time battery power;
[0074] Step 106, clear the adapter power level flag bit after the adapter is disconnected;
[0075] Step 107, when the adapter is reconnected, read the charging parameters stored by the adapter, set the charging current according to the charging parameters, and detect whether the real-time charging current exceeds the set range corresponding to the charging parameters; if not, maintain the current charging parameters; if so, re-execute the adapter power level identification process.
[0076] During the boot process, the charging IC can be initialized and the communication function can be verified to ensure normal communication between the charging IC and the system, laying a foundation for the subsequent adjustment of charging parameters. Detect the real-time charging current of the charging IC in the pre-charging mode and verify whether the charging working state is normal to ensure that the charging IC can work properly.
[0077] By collecting the charging current data of the charging IC multiple times, determine the power level of the adapter according to the continuous collection results, and set the adapter power level flag bit. After the setting is completed, save the data, set the flag bit to the power_supply power subsystem node, and report it to the system service. By obtaining this driver node, the system can identify the type of power adapter currently in use. After the identification is completed, set an appropriate charging current according to the value of the different adapter flag bits, and store the charging current as the charging parameter of the current adapter. For example, set a charging current of 1.8A for a 2A adapter and 2.8A for a 3A adapter. To protect the adapter, the charging current value needs to be lower than the rated current value of the adapter.
[0078] After the adapter is unplugged, the flag bit will be cleared to 0. When the adapter is detected to be inserted again, the stored charging parameters are preferentially written, and the real-time current value is read through the register of the charging IC. If the current value does not exceed the set value, the requirement is met; otherwise, the detection process is restarted. This method reduces the number of judgments in the software logic, improving the accuracy and stability.
[0079] This method of the present invention can automatically distinguish adapters of different powers using a software logic algorithm, adaptively set charging parameters, save charging configuration parameters, can protect the machine power management module in real time, and extend the machine life cycle. While reducing the input of manpower and material resources, the product can be continuously optimized.
[0080] In an optional embodiment of the present invention, initializing the charging IC and verifying the communication function includes:
[0081] Perform an initialization setting on the charging IC, and communicate with the charging IC to request to obtain the ID value of the charging IC;
[0082] If the ID value of the charging IC cannot be obtained, it is determined that the charging IC communication is abnormal;
[0083] If the ID value of the charging IC is successfully obtained, it is determined that the charging IC communication is normal.
[0084] In this embodiment, during the boot process, the charging IC is initialized and set, and communicated with it to read the ID value of the charging IC, so as to determine whether the communication is normal. The specific process includes: First, perform an initialization configuration on the charging IC to ensure that it is in an operable state; then, send a communication request to the charging IC to obtain its ID value. If the ID value cannot be successfully obtained, it indicates that the charging IC communication is abnormal and further troubleshooting is required; if the ID value is successfully obtained, it means that the charging IC communication is normal and it can work properly. This step ensures that the charging IC can reliably perform various functions during the subsequent charging process, providing a basic guarantee for adaptively adjusting the charging parameters.
[0085] In an alternative embodiment of the present invention, during the pre-charge mode, the real-time charging current of the charging IC is detected to verify the charging working state, including:
[0086] Enter the pre-charge mode at the initial stage of charging and set the pre-charge current at the battery terminal;
[0087] Detect whether the real-time charging current is consistent with the pre-charge current. If not, stop charging and prompt charging abnormality; if consistent, determine that the charging IC is working properly for charging.
[0088] In this embodiment, the charging IC first enters the trickle pre-charge mode and sets the pre-charge current at the battery terminal, such as 100 mA. By reading the registers of the charging IC and the registers of the fuel gauge inside the intelligent module, the real-time charging current data is obtained. The system will read the current data three times in a loop and compare it with the set pre-charge current. If the read current data is consistent with the set pre-charge current, it is considered that the charging IC is working properly and the subsequent charging process can continue; if the current data is inconsistent, it is determined that the charging IC is working abnormally, and the system will immediately stop charging and prompt charging abnormality. This step ensures the normal operation of the charging IC by detecting and comparing the charging current in real time.
[0089] In an alternative embodiment of the present invention, the charging current data of the charging IC is collected multiple times, and the power level of the adapter is determined according to the consecutive collection results, including:
[0090] Compare the charging current data with multiple increasing preset current thresholds in sequence. The multiple preset current thresholds include a first threshold, a second threshold, and higher-order thresholds, where each threshold corresponds to the boundary value of adjacent power levels;
[0091] If the consecutive comparison results are all less than or equal to the lowest-order first threshold, it is determined that the adapter is of the lowest power level;
[0092] If the consecutive comparison results are all greater than the Nth threshold and less than or equal to the (N + 1)th threshold, it is determined that the adapter is of the intermediate power level associated with the (N + 1)th threshold;
[0093] If the consecutive comparison results are all greater than the highest-order threshold, it is determined that the adapter is of the highest power level.
[0094] Refer to Figure 2, in this embodiment, the real-time current value of the charging IC is collected multiple times, and the power level of the adapter is determined according to the continuous acquisition results. The specific method is as follows: Compare the read charging current value with a preset threshold. For example, set a current value greater than 2.1A as the comparison benchmark. Since the maximum output of the adapter with the minimum power is 2A, such adapters can be screened out by setting a threshold higher than 2A. The system will compare the current value 3 times in a loop. If all 3 values are less than 2.1A, it is determined that the adapter is of the lowest power level with a rating of 2A; if all 3 values are greater than 2.1A, it is determined that the adapter is of the intermediate power level with a rating of 3A. And so on, by comparing the current values of different thresholds, adapters with higher power levels can be identified in turn. This method can accurately distinguish adapters with different powers through multiple comparisons and logical judgments, providing a reliable basis for setting subsequent charging parameters.
[0095] In an alternative embodiment of the present invention, switching between constant current and constant voltage charging modes according to the real-time battery power includes:
[0096] When the real-time battery power reaches the second preset power, adopt the constant voltage charging mode and gradually reduce the charging current according to the increase of the real-time battery power;
[0097] When the real-time battery power is between the first preset power and the second preset power, adopt the constant current charging mode and dynamically adjust the upper limit of the charging current according to the rated power of the adapter.
[0098] In this embodiment, corresponding judgment conditions are set according to the different real-time battery powers to switch between constant current and constant voltage charging modes. The system first obtains the real-time battery power value and adopts different charging strategies according to the power range. When the battery power is greater than or equal to 95%, the battery enters the constant voltage charging mode. At this time, the charging current begins to gradually decrease (based on measured data), and only by setting a charging current of 2A at the battery end can the charging requirement be met. When the battery power is between 1% and 95%, the system adopts the constant current charging mode, which occupies most of the charging process. In the constant current mode, the charging current can be appropriately increased, but not exceeding the rated power of the adapter, to ensure the safety and efficiency of the charging process. This segmented charging strategy can effectively optimize the charging efficiency while protecting the battery and the adapter.
[0099] In an alternative embodiment of the present invention, the method further includes:
[0100] Respectively set the maximum charging currents at the battery end and the adapter end according to the maximum output power inside the adapter;
[0101] Read the voltage at the adapter end, the voltage at the battery end, the charging current at the adapter end, and the charging current at the battery end in real time, synchronously save them to the power subsystem node, and report them to the system for real-time monitoring.
[0102] In this embodiment, according to the limitation of the maximum output power inside the adapter, the maximum charging currents at the battery end and the adapter end are set respectively. For example, the maximum value of the charging current at the battery end is set to 2.2A, and the maximum value of the charging current at the adapter end is set to 3.3A. After the parameter setting is completed, the system will read and read back in real time four key data: the adapter end voltage, the battery end voltage, the adapter end charging current, and the battery end charging current of the chip. These data will be synchronously saved to the node of the power_supply power subsystem and reported to the system for real-time monitoring. In this way, all parameters during the charging process can be comprehensively grasped.
[0103] In addition, the present invention can be adapted to multiple systems and has the following advantages in terms of versatility:
[0104] ① It has strong transplantation compatibility, is applicable to different android systems, and can be compatible with different interfaces.
[0105] ② It is automated, does not require manual intervention, uses software algorithms to implement logical judgment, and can also capture charging anomalies in a timely manner and notify the system.
[0106] ③ It is efficient and stable, adaptively sets charging parameters and saves data, and preferentially uses the stored data when the adapter is inserted next time, improving the detection efficiency and being stable.
[0107] Generally speaking, the present invention can keep the power management module in the product in an efficient and stable working state.
[0108] It should be noted that for the method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that the embodiments of the present invention are not limited by the described action sequences, because according to the embodiments of the present invention, certain steps can be carried out in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily essential for the embodiments of the present invention.
[0109] Referring to Figure 3 , a structural block diagram of a multi-adapter adaptive charging parameter adjustment device provided in an embodiment of the present invention is shown, which may specifically include the following modules:
[0110] The communication connection verification module 301 is used to initialize the charging IC and verify the communication function;
[0111] The charging working state verification module 302 is used to detect the real-time charging current of the charging IC in the pre-charge mode and verify the charging working state;
[0112] The adapter power level determination module 303 is configured to collect the charging current data of the charging IC multiple times, determine the power level of the adapter according to the continuous collection results, and set the adapter power level flag bit;
[0113] The charging current safety threshold determination module 304 is configured to set a corresponding charging current safety threshold based on the adapter power level and store the charging current safety threshold as the charging parameter of the current adapter; the charging current safety threshold is lower than the rated current value of the adapter;
[0114] The charging mode control module 305 is configured to switch between constant current or constant voltage charging mode according to the real-time battery power;
[0115] The adapter disconnection processing module 306 is configured to clear the adapter power level flag bit after the adapter is disconnected;
[0116] The reconnection control module 307 is configured to, when the adapter is reconnected, read the stored charging parameters of the adapter, set the charging current according to the charging parameters, and detect whether the real-time charging current exceeds the set range corresponding to the charging parameters; if not, maintain the current charging parameters; if so, re-execute the adapter power level identification process.
[0117] Optionally, the communication connection verification module includes:
[0118] The ID value acquisition sub-module is configured to initialize the charging IC and communicate with the charging IC to request the ID value of the charging IC;
[0119] The communication anomaly determination sub-module is configured to determine that the charging IC communication is abnormal if the acquisition of the ID value of the charging IC fails;
[0120] The communication normal determination sub-module is configured to determine that the charging IC communication is normal if the ID value of the charging IC is successfully acquired.
[0121] Optionally, the charging working state verification module includes:
[0122] The pre-charge current setting sub-module is configured to enter the pre-charge mode at the initial stage of charging and set the pre-charge current at the battery end;
[0123] The charging working state judgment sub-module is configured to detect whether the real-time charging current is consistent with the pre-charge current. If not, stop charging and prompt a charging anomaly; if so, determine that the charging IC is working normally for charging.
[0124] Optionally, the adapter power level determination module includes:
[0125] A current comparison sub-module, configured to sequentially compare the charging current data with a plurality of increasing preset current thresholds, where the plurality of preset current thresholds include a first threshold, a second threshold, and higher-order thresholds, and each threshold corresponds to the demarcation value of adjacent power levels;
[0126] A first power level determination sub-module, configured to determine that the adapter is at the lowest power level if the comparison results are all less than or equal to the lowest-order first threshold for multiple consecutive times;
[0127] A second power level determination sub-module, configured to determine that the adapter is at an intermediate power level associated with the (N + 1)-th threshold if the comparison results are all greater than the N-th threshold and less than or equal to the (N + 1)-th threshold for multiple consecutive times;
[0128] A third power level determination sub-module, configured to determine that the adapter is at the highest power level if the comparison results are all greater than the highest-order threshold for multiple consecutive times.
[0129] Optionally, the charging mode control module includes:
[0130] A constant voltage charging mode control sub-module, configured to adopt a constant voltage charging mode and gradually reduce the charging current according to the increase of the real-time battery power when the real-time battery power reaches a second preset power;
[0131] A constant current charging mode control sub-module, configured to adopt a constant current charging mode and dynamically adjust the upper limit of the charging current according to the rated power of the adapter when the real-time battery power is between a first preset power and a second preset power.
[0132] Optionally, the device further includes:
[0133] A maximum charging current setting module, configured to respectively set the maximum charging currents at the battery end and the adapter end according to the maximum output power inside the adapter;
[0134] A current and voltage real-time reading and monitoring module, configured to real-time read the adapter-end voltage, the battery-end voltage, the adapter-end charging current, and the battery-end charging current, synchronously save them to the power subsystem node, and report them to the system for real-time monitoring.
[0135] For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple. For related parts, please refer to the partial description of the method embodiment.
[0136] In addition, an embodiment of the present invention further provides an electronic device, as Figure 4 shown, including a processor 401, a communication interface 402, a memory 403, and a communication bus 404. Among them, the processor 401, the communication interface 402, and the memory 403 complete communication with each other through the communication bus 404,
[0137] A memory 403 for storing computer programs;
[0138] A processor 401, when executing the program stored on the memory 403, implements the method for adaptively adjusting charging parameters of multiple adapters as described in the above embodiments.
[0139] The communication bus mentioned in the above terminal may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of representation, only a thick line is shown in the figure, but it does not mean that there is only one bus or one type of bus.
[0140] The communication interface is used for communication between the above terminal and other devices.
[0141] The memory may include a Random Access Memory (RAM), or may also include a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located far from the aforementioned processor.
[0142] The above-mentioned processor may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0143] As Figure 5 shown, in another embodiment provided by the present invention, there is also provided a computer-readable storage medium 501. Instructions are stored in this computer-readable storage medium. When it runs on a computer, it causes the computer to execute the method for adaptively adjusting charging parameters of multiple adapters as described in the above embodiments.
[0144] In another embodiment provided by the present invention, a computer program product including instructions is further provided. When it runs on a computer, it causes the computer to execute the method for adaptively adjusting charging parameters of multiple adapters described in the above embodiment.
[0145] In the above embodiment, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present invention are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that the computer can access, or a data storage device such as a server or data center that includes one or more integrated available media. The available medium can be a magnetic medium (such as a floppy disk, hard disk, magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk (SSD)).
[0146] It should be noted that in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "including", "comprising", or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article, or device including a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, article, or device including the element.
[0147] Each embodiment in this specification is described in a related manner. For the same or similar parts among the embodiments, reference can be made to each other. Each embodiment focuses on the differences from other embodiments. In particular, for the device embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and for the relevant parts, reference can be made to the partial description of the method embodiments.
[0148] The above are only the preferred embodiments of the present invention and are not intended to limit the protection scope of the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention are all included in the protection scope of the present invention.
Claims
1. A method for adaptively adjusting charging parameters of multiple adapters, characterized in that: The method comprises: Initialize the charging IC and verify the communication function; Detect the real-time charging current of the charging IC in pre-charging mode to verify the charging working status; Collect the charging current data of the charging IC multiple times, determine the power level of the adapter based on the continuous collection results, and set the adapter power level flag; A corresponding charging current safety threshold is set based on the adapter power level, and the charging current safety threshold is stored as a charging parameter of the current adapter; the charging current safety threshold is lower than the rated current value of the adapter; Switch between constant current and constant voltage charging modes according to the real-time battery power; Clear the adapter power level flag after the adapter is disconnected; When the adapter is connected again, the charging parameters stored in the adapter are read, and the charging current is set according to the charging parameters, and it is detected whether the real-time charging current exceeds the set range corresponding to the charging parameters; if not, the current charging parameters are maintained; if exceeded, the adapter power level identification process is re-executed.
2. The method according to claim 1, characterized in that Initialize the charging IC and verify communication functions, including: Initialize the charging IC and communicate with the charging IC to request the ID value of the charging IC; If the ID value of the charging IC fails to be obtained, it is determined that the charging IC communication is abnormal; If the ID value of the charging IC is successfully obtained, it is determined that the charging IC communication is normal.
3. The method according to claim 1, characterized in that In pre-charge mode, detect the real-time charging current of the charging IC and verify the charging working status, including: Enter the pre-charge mode at the initial stage of charging and set the pre-charge current at the battery end; Detect whether the real-time charging current is consistent with the pre-charging current. If not, stop charging and prompt charging abnormality; if consistent, determine that the charging IC is working normally.
4. The method according to claim 1, characterized in that: Collect the charging current data of the charging IC multiple times, and determine the power level of the adapter based on the continuous collection results, including: Comparing the charging current data with a plurality of increasing preset current thresholds in sequence, the plurality of preset current thresholds comprising a first threshold, a second threshold and a higher-order threshold, wherein each threshold corresponds to a boundary value of adjacent power levels; If the comparison results are less than or equal to the first threshold of the lowest order for multiple consecutive times, the adapter is determined to be at the lowest power level; If the comparison results are greater than the Nth threshold and less than or equal to the N+1th threshold for multiple consecutive times, the adapter is determined to be at an intermediate power level associated with the N+1th threshold; If the comparison results are greater than the highest-order threshold for multiple consecutive times, the adapter is determined to be at the highest power level.
5. The method according to claim 1, characterized in that Switch between constant current and constant voltage charging modes according to the real-time battery charge level, including: When the real-time power level of the battery reaches the second preset power level, a constant voltage charging mode is adopted and the charging current is gradually reduced according to the increase of the real-time power level of the battery; When the real-time battery power is between the first preset power and the second preset power, a constant current charging mode is adopted and the upper limit of the charging current is dynamically adjusted according to the rated power of the adapter.
6. The method according to claim 1, characterized in that The method further comprises: According to the maximum output power of the adapter, set the maximum charging current of the battery and adapter respectively; The adapter terminal voltage, battery terminal voltage, adapter terminal charging current and battery terminal charging current are read in real time, saved synchronously to the power subsystem node, and reported to the system for real-time monitoring.
7. A device for adaptively adjusting charging parameters of multiple adapters, characterized in that: The device comprises: Communication connection verification module, used to initialize the charging IC and verify the communication function; The charging working status verification module is used to detect the real-time charging current of the charging IC in the pre-charging mode and verify the charging working status; The adapter power level determination module is used to collect the charging current data of the charging IC multiple times, determine the power level of the adapter according to the continuous collection results, and set the adapter power level flag; A charging current safety threshold determination module, used to set a corresponding charging current safety threshold based on the adapter power level, and store the charging current safety threshold as a charging parameter of the current adapter; the charging current safety threshold is lower than the rated current value of the adapter; Charging mode control module, used to switch constant current or constant voltage charging mode according to the real-time battery power; The adapter disconnection processing module is used to clear the adapter power level flag after the adapter is disconnected; The reconnection control module is used to read the charging parameters stored in the adapter when the adapter is connected again, set the charging current according to the charging parameters, and detect whether the real-time charging current exceeds the set range corresponding to the charging parameters; if not, maintain the current charging parameters; if exceeded, re-execute the adapter power level identification process.
8. The device according to claim 7, characterized in that The communication connection verification module includes: The ID value acquisition submodule is used to initialize the charging IC and communicate with the charging IC to request the ID value of the charging IC; A communication abnormality determination submodule, used to determine that the charging IC communication is abnormal if the acquisition of the charging IC ID value fails; The normal communication determination submodule is used to determine that the charging IC communication is normal if the ID value of the charging IC is successfully obtained.
9. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; The memory is used to store computer programs; The processor is used to implement the method for adaptively adjusting charging parameters of multiple adapters as described in any one of claims 1 to 6 when executing the program stored in the memory.
10. One or more computer-readable media having instructions stored thereon, which, when executed by one or more processors, enable the processors to execute the method for adaptively adjusting charging parameters of multiple adapters according to any one of claims 1-6.