Battery test method and device, electronic equipment and storage medium
By developing a battery test method on the new ARM platform, obtaining the initial and charging state of charge of the battery, judging the charging function, and evaluating the discharge function through battery power supply, the lack of battery testing methods under the WOA system is solved, and the problem of battery testing methods is realized. Complete verification of battery functions and power management.
Patent Information
- Application Number
- CN202411481862.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-22
- Publication Date
- 2025-02-11
AI Technical Summary
On the new ARM platform, the original EC-based battery charging and discharging test method is no longer applicable, resulting in the urgent need for development of battery charging and discharging test methods for WOA systems.
A battery testing method is provided, by obtaining the initial state of charge of the battery and obtaining the first state of charge after charging, to determine whether the charging function is normal. Then, when the battery is charged to exceed the preset power, the device is powered by the battery, and the second charge state after power is observed to evaluate the discharge function.
This method can accurately judge the charging and discharging functions of the battery, ensure that the charging and discharging functions of the battery are fully verified before leaving the factory, and effectively manage the remaining battery power by setting the preset amount, ensuring that the battery power at the time of leaving the factory meets the standards.
Smart Images

Figure CN119414264A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a battery testing method, device, electronic device and storage medium. Background Art
[0002] The rapid development of WOA (Windows on ARM) has driven the accelerated deployment of many ODMs (Original Design Manufacturers) and OEMs (Original Equipment Manufacturers). For OEMs, having efficient automated testing tools is crucial to quickly launch laptops that comply with the WOA ecosystem.
[0003] In terms of battery charge and discharge testing, the traditional X86 platform is usually responsible for battery management and charge and discharge control by EC (Embedded Controller). On the new ARM platform, the battery control is transferred to PMIC (Power Management Integrated Circuit). Therefore, the original EC-based charge and discharge test method is no longer used, and the battery charge and discharge test method for the WOA system needs to be developed urgently. Summary of the invention
[0004] The present disclosure provides a battery test, device, electronic device and storage medium to at least solve the above technical problems existing in the prior art.
[0005] According to a first aspect of the present disclosure, a battery testing method is provided, the method comprising:
[0006] Obtaining an initial state of charge of the battery;
[0007] Charging the battery through an external power source to obtain a first state of charge of the battery after charging;
[0008] Based on the initial state of charge and the first state of charge, determining whether a charging function of the battery is normal;
[0009] In response to the first state of charge being greater than a preset power level, supplying power to the device through the battery, and acquiring a second state of charge of the battery after supplying power;
[0010] Based on the second state of charge and the preset power, it is determined whether the discharge function of the battery is normal.
[0011] In one possible implementation manner, supplying power to the device through the battery includes:
[0012] The Type-C charging control pin of the battery charging management chip is controlled through the general input and output interface GPIO corresponding to the charging interface to prohibit the external power supply from charging the device and enable the battery to charge the device.
[0013] In one possible implementation manner, charging the battery through the external power supply includes:
[0014] The global charging control pin of the battery charging management chip is controlled through the input-output control interface IOCTL, so that the external power supply charges the battery.
[0015] In one possible implementation manner, the determining whether the discharge function of the battery is normal based on the second state of charge and the preset power includes:
[0016] In response to the second state of charge being equal to the preset power, it is determined that the discharge function of the battery is normal.
[0017] In one possible implementation, controlling the Type-C charging control pin of the battery charging management chip through the general input and output interface GPIO corresponding to the charging interface includes:
[0018] Control the output state of the GPIO pin corresponding to the charging interface through WMI;
[0019] Based on the output state of the GPIO pin, the output state of the Type-C charging control pin of the battery charging management chip is controlled.
[0020] In one possible implementation, determining whether the charging function of the battery is normal based on the initial state of charge and the first state of charge includes:
[0021] If the first state of charge is greater than the initial state of charge, it is determined that the charging function of the battery is normal.
[0022] In one possible implementation manner, the preset power level is 60%.
[0023] According to a second aspect of the present disclosure, a battery testing device is provided, the device comprising:
[0024] An acquisition module, used for acquiring the initial state of charge of the battery;
[0025] The acquisition module is further used to charge the battery through an external power supply and acquire a first state of charge of the battery after charging;
[0026] a determination module, configured to determine whether a charging function of the battery is normal based on the initial state of charge and the first state of charge;
[0027] The acquisition module is further configured to, in response to the first state of charge being greater than a preset power level, supply power to the device through the battery, and acquire a second state of charge of the battery after power supply;
[0028] The determination module is further used to determine whether the discharge function of the battery is normal based on the second state of charge and the preset power.
[0029] According to a third aspect of the present disclosure, there is provided an electronic device, including:
[0030] at least one processor; and
[0031] a memory communicatively connected to the at least one processor; wherein,
[0032] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method described in the present disclosure.
[0033] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause the computer to execute the method described in the present disclosure.
[0034] The battery testing method, device, electronic device and storage medium disclosed in the present invention can accurately determine whether the charging function of the battery is normal by obtaining the initial charge state of the battery and obtaining the first charge state after charging. Furthermore, when the battery is charged to a level exceeding a preset power level, the battery is used to power the device, and the second charge state after power supply is observed, thereby accurately evaluating the discharge function of the battery. This method not only ensures that the charging and discharging functions of the battery are fully verified before leaving the factory, but also effectively manages the remaining power of the battery by setting a preset power level, thereby ensuring that the power level of the battery meets the established standards or requirements when the device leaves the factory.
[0035] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] The above and other objects, features and advantages of the exemplary embodiments of the present disclosure will become readily understood by reading the detailed description below with reference to the accompanying drawings. In the accompanying drawings, several embodiments of the present disclosure are shown in an exemplary and non-limiting manner, in which:
[0037] In the drawings, the same or corresponding reference numerals represent the same or corresponding parts.
[0038] Figure 1 The schematic diagram shows the implementation process of a battery testing method according to an embodiment of the present disclosure. Figure 1 ;
[0039] Figure 2 A schematic diagram of a design framework of a battery testing method according to an embodiment of the present disclosure is shown;
[0040] Figure 3 A timing diagram of a battery testing method according to an embodiment of the present disclosure is shown;
[0041] Figure 4 The schematic diagram shows the implementation process of a battery testing method according to an embodiment of the present disclosure. Figure 2 ;
[0042] Figure 5 A schematic diagram of the structure of a battery testing device according to an embodiment of the present disclosure is shown;
[0043] Figure 6 A schematic diagram of the structure of an electronic device according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0044] In order to make the purpose, features, and advantages of the present disclosure more obvious and easy to understand, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present disclosure.
[0045] During the testing phase of electronic products before they leave the factory, an external power supply is usually connected to power the system. In this configuration, the battery's charge and discharge functions cannot be effectively tested.
[0046] Based on this, a first aspect of an embodiment of the present disclosure provides a battery testing method, which is applied to an electronic device connected to an external power supply. Figure 1 The schematic diagram shows the implementation process of a battery testing method according to an embodiment of the present disclosure. Figure 1 ,like Figure 1 As shown, the method comprises the following steps:
[0047] Step 101, obtaining the initial state of charge of the battery.
[0048] The state of charge refers to the ratio of the remaining power of the battery to the power in its fully charged state, usually expressed as a percentage, that is, the remaining power of the battery. In this step, the initial power of the battery, that is, the initial state of charge, is first obtained and recorded.
[0049] Step 102: Charge the battery through an external power source to obtain a first state of charge of the battery after charging.
[0050] The battery is charged using an external power source (such as a charger). After charging for a preset time (such as 1 minute), the state of charge of the battery is obtained again and recorded as a first state of charge.
[0051] Step 103: Determine whether the charging function of the battery is normal based on the initial state of charge and the first state of charge.
[0052] By comparing the initial state of charge and the first state of charge, it is determined whether the charging function of the battery is normal. If the first state of charge is significantly higher than the initial state of charge, it indicates that the charging function of the battery is normal. If the change in the state of charge is not obvious, it indicates that there is a problem with the charging function of the battery and the battery needs to be repaired.
[0053] Step 104 , in response to the first state of charge being greater than a preset power level, powering the device via the battery, and acquiring a second state of charge of the battery after powering.
[0054] The preset power level is a preset power threshold, and the specific value can be set according to the actual situation. In one embodiment, in order to ensure the safety and stability of the battery when the electronic product leaves the factory, it is necessary to ensure that the battery power is maintained within the range of 60% ± 5% when leaving the factory. Based on this, the preset power level can be set to 60%. If the first state of charge after charging is greater than the preset power level, stop supplying power to the battery. Then start the battery to supply power to the device. After the battery supplies power to the device for a period of time, the battery power is obtained again, that is, the second state of charge.
[0055] Step 105: Determine whether the discharge function of the battery is normal based on the second state of charge and the preset power.
[0056] In this step, the second state of charge is compared with the preset power, and if the second state of charge is close to the preset power, it indicates that the discharge function of the battery is normal. If the second state of charge is significantly higher than the preset power, it indicates that the discharge function of the battery is abnormal.
[0057] The battery testing method of this embodiment can still effectively perform charge and discharge tests on batteries based on the WOA system when the electronic device is connected to an external power supply. By obtaining the initial charge state of the battery and obtaining the first charge state after charging, it is possible to accurately determine whether the charging function of the battery is normal. Furthermore, when the battery is charged to a level exceeding a preset power level, the battery is used to power the device, and the second charge state after power supply is observed, thereby accurately evaluating the discharge function of the battery. This method not only ensures that the charging and discharging functions of the battery are fully verified before leaving the factory, but also effectively manages the remaining power of the battery by setting a preset power level, thereby ensuring that the power level of the battery meets the established standards or requirements when the device leaves the factory.
[0058] According to another embodiment of the present disclosure, the powering of the device by the battery can be specifically achieved through the following technical means: controlling the Type-C charging control pin of the battery charging management chip through the GPIO (General-purpose input / output) corresponding to the charging interface to prohibit the external power supply from charging the device, so that the battery charges the device.
[0059] Battery charge management chip refers to the component responsible for power distribution and management in electronic devices, such as SMB2360 chip. Type-C charging control pin is used to control the charging function of the charging interface, which can turn on or off the charging function of the Type-C interface. For example, the EM_DIS_TC pin of the SMB2360 chip.
[0060] When the battery is needed to power the device instead of using an external power source, a control signal is sent to the battery charging management chip through the GPIO corresponding to the charging interface. Specifically, the GPIO will send a high or low signal to the Type-C charging control pin (depending on the design of the battery charging management chip). Once the Type-C charging control pin receives this control signal, it will cut off the charging channel between the external power source and the device. When the external power source is prohibited from charging, the device will rely on the battery for power supply. In this way, the purpose of allowing the battery to power the device when needed is achieved.
[0061] According to another embodiment of the present disclosure, charging the battery through the external power supply includes: controlling the global charging control pin of the battery charging management chip through IOCTL (input / output control, input / output control interface) so that the external power supply charges the battery.
[0062] The IOCTL interface is a device control interface, which is used in the present disclosure to control the global charge control pin of the battery charge management chip. The global charge control pin is a specific pin on the battery management chip, which is used to control the battery charge enable state. When the pin is set to enable the charge state, the charging chip will allow an external power source to charge the battery through appropriate circuits and interfaces. The global charge control pin, for example, is the EM_DIS_CHG pin of the SMB2360 chip.
[0063] Specifically, when an external power source is required to charge the battery, a control signal (e.g., a low-level signal) is sent to the battery management chip through the IOCTL interface. This signal tells the battery charge management chip to turn on the charging function, allowing the external power source to charge the battery. With the charging function turned on, the external power source will charge the battery with the appropriate current and voltage according to the instructions of the battery charge management chip, so that the purpose of charging the battery through the external power source can be achieved.
[0064] According to another embodiment of the present disclosure, determining whether the discharge function of the battery is normal based on the second state of charge and the preset power includes: in response to the second state of charge being equal to the preset power, determining that the discharge function of the battery is normal.
[0065] Before the battery starts to supply power to the device, the state of charge of the battery is recorded as a first state of charge. This first state of charge is greater than a preset power level. After the battery starts to supply power to the device for a period of time, the state of charge of the battery is measured again to obtain a second state of charge. If the discharge function of the battery is normal, the second state of charge will be less than or equal to the preset power level. In this embodiment, during the discharge process of the battery, the response second state of charge is equal to the preset power level. In this way, the power level of the battery can be accurately maintained at the preset power level.
[0066] According to another embodiment of the present disclosure, the output state of the GPIO pin corresponding to the charging interface is controlled by WMI; based on the output state of the GPIO pin, the output state of the Type-C charging control pin of the battery charging management chip is controlled.
[0067] Specifically, this embodiment involves the comprehensive use of WMI technologies such as WMI Consumers (WMI users), WMI Infrastructure (WMI infrastructure), and WMI Provider (WMI provider), as well as communicating with the underlying hardware through ACPI (Advanced Configuration and Power Interface) and GPIO to control the battery charging management chip, thereby turning on or off the battery charging function.
[0068] like Figure 2 As shown in the figure, WMI Consumers corresponds to the application of WMI tool, which is written in C++ and can operate the WMI methods defined in WMI interface by calling WMI resources and WMI interface. WMIInfrastructure is the core component of Windows system, including two key modules: WMI Service and WMIRepository. WMI Service will automatically create root\WMI namespace when the system starts, and pre-install some definition information of WMI classes. At the same time, WMI Service will read the information in WMI Repository, so that the operating system and applications can access and manage these WMI classes and instances. WMI Repository is the bridge between WMIService and underlying software. It consists of DLL files and MOF files, and its location is registered in WMIService. When WMI Consumers send data, WMI Service will route these requests to the corresponding WMIProvider. WMIProvider contains WMI ACPI call model, which defines a series of method interfaces in MOF files. These MOF files are embedded in ACPI asl code (Advanced Configuration and Power Management Interface Source Language Code). In ACPI asl code, the methods corresponding to MOF files are implemented to store the definitions and instance information of these classes so that the operating system and applications can access and manage them. WMIProvider is responsible for processing data requests sent by WMI Service, returning the processing results to WMI Service, and then forwarding them to the WMI tool application through the COM (Component Object Model) interface.
[0069] In ACPI asl code, the GPIO-related operation area is accessed through system memory. Specifically, the two registers TLMM_GPIO_CFGn (configuration register) and TLMM_GPIO_IN_OUTn (output register) are configured to control the GPIO pins. When Bit9 of the TLMM_GPIO_CFGn register is set to 1, the GPIO pin is configured to control the output enable. By configuring the TLMM_GPIO_IN_OUTn register, the output state of the GPIO pin is controlled.
[0070] After achieving control over the output state of the GPIO pin, the output state of the GPIO pin corresponding to the Type-C port on the SOC (System on Chip) can be further controlled. This control process is achieved by configuring the high and low states of the GPIO pin, and then controlling the high and low states of the pins of the battery charging management chip to enable or disable Type-C charging.
[0071] For example, if you want to power the device through the battery. First, WMI Consumers (that is, the WMItool application) will send a request to turn off the charging function to the WMI Service. After receiving the request, the WMI Service will route it to the corresponding WMI Provider. The WMIProvider will call the method defined in the WMI ACPI call model according to the request, and the method will perform related operations in the ACPI asl code. Specifically, it is to configure the TLMM_GPIO_CFGn and TLMM_GPIO_IN_OUTn registers of the GPIO to change the status of the relevant pins of the battery charging management chip, thereby turning off the battery charging function.
[0072] Figure 3 Is a timing flow chart to implement the above process, such as Figure 3 As shown in the figure, before the application communicates with the WMI service, it first needs to initialize the COM interface and request the WMI service to create a service object that can interact with it. In response to the application's request, WMI creates and returns a WMI service object, allowing the application to perform specific management operations. The application queries the WMI service object for methods that can be used to control the charging function, enters the necessary data (such as on or off), and then requests the WMI service to execute the method. The WMI service calls the corresponding WMI method based on the application's request. The ACPIWMI code is responsible for processing requests from the WMI service and controls the charging function to be turned on or off by directly accessing the state of the GPIO pins in the memory. The hardware level detects changes in the state of the GPIO pins to know whether the charging function should be turned on or off. Once the hardware state changes (that is, the charging function is turned on or off), the ACPI WMI code returns this state information to the WMI service. The WMI service then returns this state information to the application. Finally, after the application completes the operation, it releases the WMI service object and closes the COM interface to release system resources.
[0073] The above includes the process from the user software interface to the hardware-level function control, and the control of the charging function is achieved through the WMI service as the middle layer, as well as ACPI and GPIO technology.
[0074] The method is described in detail below by using a specific embodiment. The preset power in this embodiment is set to 60%. Figure 4 As shown, the method includes:
[0075] Obtain the initial state of charge of the battery; after charging the battery for one minute, obtain the first state of charge of the battery. Then, compare the first state of charge with the initial state of charge. If the first state of charge is not greater than the initial state of charge, it means that the battery may need repair. If the first state of charge is greater than the initial state of charge, it indicates that the charging function of the battery is normal, and then continue to determine the specific value of the first state of charge.
[0076] If the first state of charge is equal to 60%, the intelligent charging mode is set to keep the power within the range of 60% ± 5%. If the first state of charge is not equal to 60%, it is further determined whether it is greater than 60%. If it is not greater than 60%, the fourth state of charge of the battery is obtained multiple times until the fourth state of charge is equal to 60%. Once it is equal to 60%, the intelligent charging mode is set to keep the power within the range of 60% ± 5%. If the first state of charge is greater than 60%, the charging function is turned off and the battery is no longer charged.
[0077] After a period of time, the second state of charge of the battery is obtained. During this process, the battery is discharged. If the second state of charge is equal to 60%, it means that the discharge function of the battery is normal, and then the charging function is turned on again, and the intelligent charging mode is set to keep the power within the range of 60% ± 5%.
[0078] Through the above steps, intelligent management and maintenance of battery charging and discharging can be achieved.
[0079] According to another aspect of the present disclosure, a battery testing device is provided. Figure 5 As shown, the device comprises:
[0080] An acquisition module 501 is used to acquire the initial state of charge of the battery;
[0081] The acquisition module 501 is further used to charge the battery through an external power source to acquire a first state of charge of the battery after charging;
[0082] A determination module 502, configured to determine whether a charging function of the battery is normal based on the initial state of charge and the first state of charge;
[0083] The acquisition module 501 is further configured to, in response to the first state of charge being greater than a preset power level, supply power to the device through the battery, and acquire a second state of charge of the battery after power supply;
[0084] The determination module 502 is further configured to determine whether the discharge function of the battery is normal based on the second state of charge and the preset power.
[0085] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device and a readable storage medium.
[0086] According to another embodiment of the present disclosure, the acquisition module 501 is also used to control the Type-C charging control pin of the battery charging management chip through the general input and output interface GPIO corresponding to the charging interface to prohibit the external power supply from charging the device and enable the battery to charge the device.
[0087] According to another embodiment of the present disclosure, the acquisition module 501 is further used to control the global charging control pin of the battery charging management chip through the input-output control interface IOCTL, so that the external power supply charges the battery.
[0088] According to another embodiment of the present disclosure, the determining module 502 is further configured to determine that the discharge function of the battery is normal in response to the second state of charge being equal to the preset power.
[0089] According to another embodiment of the present disclosure, the acquisition module 501 is further used to control the output state of the GPIO pin corresponding to the charging interface through WMI;
[0090] Based on the output state of the GPIO pin, the output state of the Type-C charging control pin of the battery charging management chip is controlled.
[0091] According to another embodiment of the present disclosure, the determining module 502 is further configured to determine that the charging function of the battery is normal if the first state of charge is greater than the initial state of charge.
[0092] According to another embodiment of the present disclosure, the preset power level is 60%.
[0093] Figure 6 A schematic block diagram of an example electronic device 800 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0094] like Figure 6 As shown, the device 800 includes a computing unit 801, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 802 or a computer program loaded from a storage unit 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the device 800 can also be stored. The computing unit 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0095] A number of components in the device 800 are connected to the I / O interface 805, including: an input unit 806, such as a keyboard, a mouse, etc.; an output unit 807, such as various types of displays, speakers, etc.; a storage unit 808, such as a disk, an optical disk, etc.; and a communication unit 809, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 809 allows the device 800 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0096] The computing unit 801 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 801 performs the various methods and processes described above, such as a battery testing method. For example, in some embodiments, the battery testing method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 808. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 800 via ROM 802 and / or communication unit 809. When the computer program is loaded into RAM 803 and executed by the computing unit 801, one or more steps of the battery testing method described above may be performed. Alternatively, in other embodiments, the computing unit 801 may be configured to perform the battery testing method in any other appropriate manner (e.g., by means of firmware).
[0097] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0098] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0099] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0100] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0101] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0102] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0103] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0104] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of the present disclosure, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0105] The above is only a specific embodiment of the present disclosure, but the protection scope of the present disclosure is not limited thereto. Any person skilled in the art who is familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present disclosure, which should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.
Claims
1. A battery testing method, characterized in that: The device where the battery is located is connected to an external power source, and the method includes: Obtaining an initial state of charge of the battery; Charging the battery through an external power source to obtain a first state of charge of the battery after charging; Based on the initial state of charge and the first state of charge, determining whether a charging function of the battery is normal; In response to the first state of charge being greater than a preset power level, supplying power to the device through the battery, and acquiring a second state of charge of the battery after supplying power; Based on the second state of charge and the preset power, it is determined whether the discharge function of the battery is normal.
2. The method according to claim 1, characterized in that: The supplying power to the device through the battery comprises: The Type-C charging control pin of the battery charging management chip is controlled through the general input and output interface GPIO corresponding to the charging interface to prohibit the external power supply from charging the device, so that the battery supplies power to the device.
3. The method according to claim 1, characterized in that The step of charging the battery through the external power supply comprises: The global charging control pin of the battery charging management chip is controlled through the input-output control interface IOCTL, so that the external power supply charges the battery.
4. The method according to claim 1, characterized in that: The determining whether the discharge function of the battery is normal based on the second state of charge and the preset power includes: In response to the second state of charge being equal to the preset power, it is determined that the discharge function of the battery is normal.
5. The method according to claim 2, characterized in that: The method of controlling the Type-C charging control pin of the battery charging management chip through the GPIO corresponding to the charging interface includes: Control the output state of the GPIO pin corresponding to the charging interface through WMI; Based on the output state of the GPIO pin, the output state of the Type-C charging control pin of the battery charging management chip is controlled.
6. The method according to claim 1, characterized in that The determining whether the charging function of the battery is normal based on the initial state of charge and the first state of charge includes: If the first state of charge is greater than the initial state of charge, it is determined that the charging function of the battery is normal.
7. The method according to claim 1, characterized in that The preset power level is 60%.
8. A battery testing device, characterized in that: The device comprises: An acquisition module, used for acquiring the initial state of charge of the battery; The acquisition module is further used to charge the battery through an external power supply and acquire a first state of charge of the battery after charging; a determination module, configured to determine whether a charging function of the battery is normal based on the initial state of charge and the first state of charge; The acquisition module is further configured to, in response to the first state of charge being greater than a preset power level, supply power to the device through the battery, and acquire a second state of charge of the battery after power supply; The determination module is further used to determine whether the discharge function of the battery is normal based on the second state of charge and the preset power.
9. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 7.
10. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to make a computer execute the method according to any one of claims 1-7.