Calculation Method for System Power Consumption and Electronic Device
By obtaining the downstream data of the second electronic device and calculating the system power consumption, the problem of difficult to obtain the output current of the charging device is solved, accurate calculation of the system power consumption and timely monitoring of the equipment temperature are achieved, and user experience is improved.
Patent Information
- Application Number
- CN202211103457.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-09
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2042-09-09
AI Technical Summary
In charging scenarios, since the output current of the charging device is not easy to obtain, the system power consumption is difficult to determine, and the charging speed and device temperature cannot be taken into account, which makes the user experience poor.
By acquiring the downstream data of the second electronic device, using the downstream data to indicate the maximum output current value at the preset time, the system power consumption of the first electronic device is calculated, and accurate calculation without the need for a physical channel is achieved.
It realizes efficient and accurate calculation of system power consumption, can timely judge the equipment temperature, take measures to take into account both charging rate and temperature, and improve user experience.
Smart Images

Figure CN115441541B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of terminals, and in particular, to a method for calculating system power consumption and an electronic device. Background Art
[0002] To improve the user experience, intelligent control of the charging current (i.e., the output current of the charging device) has been implemented in different scenarios to avoid the problem of rapid deterioration of the device temperature.
[0003] However, in the above charging scenario, since the output current of the charging device is not easily obtained, it is difficult to determine the system power consumption, and further, it is impossible to further balance the charging speed and the device temperature based on the system power consumption, resulting in a poor user experience. Summary of the Invention
[0004] This application provides a method for calculating system power consumption and an electronic device, which realizes efficient and accurate calculation of system power consumption.
[0005] In a first aspect, a method for calculating system power consumption is provided, which is applied to a first electronic device. The first electronic device includes a battery, and the battery is charged through a second electronic device. The method includes: when the battery is in a charging state, the first electronic device obtains the current current of the battery, the current voltage of the battery, the current output current of the second electronic device, and the current output voltage of the second electronic device; the first electronic device determines the system power consumption of the first electronic device based on the current current, the current voltage, the current output current, and the current output voltage; wherein the current output current is obtained by the first electronic device at least based on the down-current data of the second electronic device, and the down-current data is used to indicate the maximum value of the output current of the second electronic device at a preset moment.
[0006] In this application, the first electronic device can obtain the current output current of the second electronic device at least based on the down-current data of the second electronic device. Since the down-current data is used to indicate the maximum value of the output current of the second electronic device at a preset moment, that is, without any physical channel, the first electronic device can accurately calculate the current output current of the second electronic device at the preset moment as the current corresponding to the preset moment, and further can realize efficient and accurate calculation of the system power consumption based on the current output current.
[0007] In combination with the first aspect, in a certain implementation manner of the first aspect, the obtaining of the current output current of the second electronic device includes: the first electronic device determines a first output current from the current-down data, where the first output current is the output current corresponding to a first preset moment in the current-down data, and the first preset moment is the obtaining moment of the current output current or the moment in the current-down data that is separated from the obtaining moment by a preset time interval; the first electronic device determines that the current output current of the second electronic device is equal to the first output current.
[0008] In combination with the first aspect, in a certain implementation manner of the first aspect, before the obtaining of the current output current of the second electronic device, the method further includes: the first electronic device sends reference information to the second electronic device, where the reference information includes the current voltage of the battery or a reference output current; the obtaining of the current output current of the second electronic device includes: the first electronic device determines the current output current of the second electronic device based on the current-down data and the reference information.
[0009] In combination with the first aspect, in a certain implementation manner of the first aspect, before the first electronic device sends the reference information to the second electronic device, the method further includes: the first electronic device compares the reference information with the reference information sent to the second electronic device last time; the first electronic device sending the reference information to the second electronic device includes: in the case where it is determined that the reference information is different from the reference information sent to the second electronic device last time, the first electronic device sends the reference information to the second electronic device.
[0010] In combination with the first aspect, in a certain implementation of the first aspect, the above reference information is the above reference output current, and the above reference output current is determined by the above first electronic device based on the first charging reference data. The above first charging reference data includes a plurality of voltages and corresponding plurality of currents. Before obtaining the current output current of the above second electronic device, the method further includes: the above first electronic device sending second charging reference data to the above second electronic device, where the above second charging reference data includes at least one voltage and at least one corresponding current, and the above at least one voltage is greater than the maximum voltage of the above battery; the above first electronic device determining a first output current from the above current reduction data, where the above first output current is the output current corresponding to a first preset moment in the above current reduction data, and the above first preset moment is the acquisition moment of the above current output current or the moment in the above current reduction data that is separated from the above acquisition moment by a preset time interval; obtaining the current output current of the above second electronic device includes: in the case where it is determined that the above first output current is less than the above reference output current, the above first electronic device determines that the current output current of the above second electronic device is equal to the above first output current; or, in the case where it is determined that the above first output current is greater than or equal to the above reference output current, the above first electronic device determines that the current output current of the above second electronic device is equal to the above reference output current.
[0011] In combination with the first aspect, in a certain implementation of the first aspect, the above reference output current is less than or equal to the limit current, and the above limit current is used to indicate the maximum current corresponding to the above first electronic device when running at least one application.
[0012] In combination with the first aspect, in a certain implementation of the first aspect, the above reference information is the current voltage of the above battery. Before obtaining the current output current of the second electronic device, the method further includes: the first electronic device sending first charging reference data to the second electronic device, the first charging reference data including a plurality of voltages and corresponding plurality of currents; the first electronic device determining a first output current from the down-current data, the first output current being the output current corresponding to a first preset moment in the down-current data, the first preset moment being the acquisition moment of the current output current or the moment in the down-current data separated from the acquisition moment by a preset time interval; the first electronic device determining the current corresponding to the current voltage of the battery based on the first charging reference data; obtaining the current output current of the second electronic device includes: in a case where it is determined that the first output current is less than the current corresponding to the current voltage of the battery, the first electronic device determining that the current output current of the second electronic device is equal to the first output current; or, in a case where it is determined that the first output current is greater than or equal to the current corresponding to the current voltage of the battery, the first electronic device determining that the current output current of the second electronic device is equal to the current corresponding to the current voltage of the battery.
[0013] In combination with the first aspect, in a certain implementation of the first aspect, the system power consumption satisfies the following formula: Psys = v bus *i bus *loss - v batt *i batt , where Psys is the system power consumption, v bus is the current output voltage of the second electronic device, i bus is the current output current of the second electronic device, v batt is the current voltage of the battery, i batt is the current current of the battery, and loss is the conduction loss and the device conversion rate loss.
[0014] Second aspect, applied to a first electronic device, the first electronic device includes a battery, and the battery is charged through a second electronic device. The electronic device includes: an acquisition module and a processing module. The acquisition module is configured to, when the battery is being charged, acquire the current current of the battery, the current voltage of the battery, the current output current of the second electronic device, and the current output voltage of the second electronic device; the processing module is configured to determine the system power consumption of the first electronic device based on the current current, the current voltage, the current output current, and the current output voltage; wherein, the current output current is obtained by the first electronic device at least based on the current reduction data of the second electronic device, and the current reduction data is used to indicate the maximum value of the output current of the second electronic device at a preset moment.
[0015] In combination with the second aspect, in a certain implementation manner of the second aspect, the processing module is configured to: determine a first output current from the current reduction data, the first output current being the output current corresponding to a first preset moment in the current reduction data, the first preset moment being the acquisition moment when the current output current is acquired or the moment separated from the acquisition moment by a preset time interval in the current reduction data; and determine that the current output current of the second electronic device is equal to the first output current.
[0016] In combination with the second aspect, in a certain implementation manner of the second aspect, the processing module is configured to: send reference information to the second electronic device, the reference information including the current voltage of the battery or a reference output current; determine the current output current of the second electronic device based on the current reduction data and the reference information.
[0017] In combination with the second aspect, in a certain implementation manner of the second aspect, the processing module is configured to: compare the reference information with the reference information sent to the second electronic device last time; and send the reference information to the second electronic device when it is determined that the reference information is different from the reference information sent to the second electronic device last time.
[0018] In combination with the second aspect, in a certain implementation manner of the second aspect, the above reference information is the above reference output current, and the above reference output current is determined by the above first electronic device based on the first charging reference data. The above first charging reference data includes a plurality of voltages and corresponding plurality of currents. The processing module is configured to: send second charging reference data to the above second electronic device, where the second charging reference data includes at least one voltage and at least one corresponding current, and the at least one voltage is greater than the maximum voltage of the above battery; determine a first output current from the above current reduction data, where the first output current is the output current corresponding to a first preset time in the above current reduction data, and the first preset time is the acquisition time of the above current output or the time in the above current reduction data that is separated from the above acquisition time by a preset time interval; in a case where it is determined that the first output current is less than the above reference output current, determine that the current output of the above second electronic device is equal to the first output current; or, in a case where it is determined that the first output current is greater than or equal to the above reference output current, determine that the current output of the above second electronic device is equal to the above reference output current.
[0019] In combination with the second aspect, in a certain implementation manner of the second aspect, the above reference output current is less than or equal to a limit current, and the limit current is used to indicate the maximum current corresponding to the above first electronic device when running at least one application.
[0020] In combination with the second aspect, in a certain implementation manner of the second aspect, the above reference information is the current voltage of the above battery. The processing module is configured to: send the first charging reference data to the above second electronic device, where the first charging reference data includes a plurality of voltages and corresponding plurality of currents; determine a first output current from the above current reduction data, where the first output current is the output current corresponding to a first preset time in the above current reduction data, and the first preset time is the acquisition time of the above current output or the time in the above current reduction data that is separated from the above acquisition time by a preset time interval; determine the current corresponding to the current voltage of the above battery based on the above first charging reference data; in a case where it is determined that the first output current is less than the current corresponding to the current voltage of the above battery, determine that the current output of the above second electronic device is equal to the first output current; or, in a case where it is determined that the first output current is greater than or equal to the current corresponding to the current voltage of the above battery, determine that the current output of the above second electronic device is equal to the current corresponding to the current voltage of the above battery.
[0021] In combination with the second aspect, in a certain implementation manner of the second aspect, the system power consumption satisfies the following formula: Psys = v bus *i bus *loss - v batt *i batt, where Psys is the power consumption of the above system, and v bus is the current output voltage of the second electronic device, and i bus is the current output current of the above second electronic device, and v batt is the current voltage of the above battery, and i batt is the current current of the above battery, and loss is the path loss and the device conversion rate loss.
[0022] In a third aspect, another electronic device is provided. The device includes a processor, which is coupled to a memory and can be used to execute instructions in the memory to implement the method in any possible implementation manner of the first aspect above. Optionally, the electronic device further includes a memory. Optionally, the electronic device further includes a communication interface, and the processor is coupled to the communication interface.
[0023] In a fourth aspect, a processor is provided, including: an input circuit, an output circuit, and a processing circuit. The processing circuit is used to receive a signal through the input circuit and transmit a signal through the output circuit, so that the processor executes the method in any possible implementation manner of the first aspect above.
[0024] In a specific implementation process, the above processor may be a chip, the input circuit may be an input pin, the output circuit may be an output pin, and the processing circuit may be transistors, gate circuits, flip-flops, and various logic circuits, etc. The input signal received by the input circuit may be received and input by, for example, but not limited to, a receiver, and the signal output by the output circuit may be output to, for example, but not limited to, a transmitter and transmitted by the transmitter, and the input circuit and the output circuit may be the same circuit, and this circuit is used as the input circuit and the output circuit at different times respectively. The embodiments of the present application do not limit the specific implementation manners of the processor and various circuits.
[0025] In a fifth aspect, a processing device is provided, including a processor and a memory. The processor is used to read instructions stored in the memory and can receive a signal through a receiver and transmit a signal through a transmitter to execute the method in any possible implementation manner of the first aspect above.
[0026] Optionally, the processor is one or more, and the memory is one or more.
[0027] Optionally, the memory may be integrated with the processor, or the memory is separately provided from the processor.
[0028] In the specific implementation process, the memory can be a non-transitory memory, such as a read only memory (ROM), which can be integrated with the processor on the same chip or can be separately provided on different chips. The embodiments of the present application do not limit the type of the memory and the setting manner of the memory and the processor.
[0029] It should be understood that the related data interaction process, such as sending the indication information, can be a process of outputting the indication information from the processor, and the receiving capability information can be a process of the processor receiving the input capability information. Specifically, the processed output data can be output to the transmitter, and the input data received by the processor can come from the receiver. Among them, the transmitter and the receiver can be collectively referred to as a transceiver.
[0030] The processing device in the above fifth aspect can be a chip, and the processor can be implemented by hardware or by software. When implemented by hardware, the processor can be a logic circuit, an integrated circuit, etc.; when implemented by software, the processor can be a general-purpose processor, which is implemented by reading the software code stored in the memory. The memory can be integrated in the processor or can be located outside the processor and exist independently.
[0031] In a sixth aspect, a computer program product is provided. The computer program product includes: a computer program (which can also be referred to as code or instruction). When the computer program is run, the computer is caused to execute the method in any one of the possible implementation manners in the above first aspect.
[0032] In a seventh aspect, a computer-readable storage medium is provided. The computer-readable storage medium stores a computer program (which can also be referred to as code or instruction). When it runs on a computer, the computer is caused to execute the method in any one of the possible implementation manners in the above first aspect. Description of the Drawings
[0033] Figure 1 is a schematic diagram of an application scenario provided by an embodiment of the present application;
[0034] Figure 2 is a schematic diagram of the system architecture of a first electronic device provided by an embodiment of the present application;
[0035] Figure 3 is a flowchart of an example of a method for calculating the system power consumption provided by an embodiment of the present application;
[0036] Figure 4 is a flowchart of a first specific example of a method for calculating the system power consumption provided by an embodiment of the present application;
[0037] Figure 5It is a flowchart of the second specific example of the system power consumption calculation method provided by the embodiments of the present application;
[0038] Figure 6 It is a flowchart of the third specific example of the system power consumption calculation method provided by the embodiments of the present application;
[0039] Figure 7 It is a structural block diagram of an example of the electronic device provided by the embodiments of the present application;
[0040] Figure 8 It is a structural schematic diagram of another example of the electronic device provided by the embodiments of the present application. Detailed implementation manners
[0041] Next, the technical solutions in the present application will be described with reference to the accompanying drawings.
[0042] In order to facilitate a clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, terms such as "first" and "second" are used to distinguish identical or similar items with basically the same functions and effects. For example, the first instruction and the second instruction are used to distinguish different user instructions, and the sequence order thereof is not limited. Those skilled in the art can understand that terms such as "first" and "second" do not limit the quantity and execution order, and terms such as "first" and "second" do not necessarily mean different.
[0043] It should be noted that in the present application, words such as "exemplarily" or "for example" are used to represent examples, illustrations or explanations. Any embodiment or design solution described as "exemplarily" or "for example" in the present application should not be construed as being more preferred or having more advantages than other embodiments or design solutions. Exactly speaking, using words such as "exemplarily" or "for example" aims to present relevant concepts in a specific manner.
[0044] In addition, "at least one" means one or more, and "a plurality" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist simultaneously, and B exists alone, where A and B may be singular or plural. The character " / " generally represents that the associated objects before and after are in an "or" relationship. "At least one (item)" or its similar expression below refers to any combination of these items, including any combination of single item (item) or plural items (items). For example, at least one (item) of a, b, and c may represent: a, or b, or c, or a and b, or a and c, or b and c, or a, b, and c, where a, b, and c may be single or multiple.
[0045] Figure 1A schematic block diagram of application scenario 100 provided by an embodiment of the present application. As Figure 1 shown, application scenario 100 includes a first electronic device 101 and a second electronic device 102. The first electronic device 101 may include a battery (not shown in the figure). When the second electronic device 102 is connected to the first electronic device, it can charge the battery of the first electronic device.
[0046] It should be understood that in the above charging scenario, the greater the system power consumption, the higher the device temperature of the current first electronic device 101 can be indicated. Therefore, the first electronic device 101 can determine whether there is a problem of poor user experience caused by too high device temperature based on the system power consumption, and then take relevant measures to balance the charging rate and the temperature of the first electronic device 101 when it is determined that the device temperature is too high. However, it is difficult to obtain the current output current of the above second electronic device 102, resulting in difficulties and inaccuracies in calculating the system power consumption.
[0047] In view of this, an embodiment of the present application provides a method for calculating system power consumption and an electronic device. The first electronic device can obtain the current output current of the second electronic device at least based on the current reduction data of the second electronic device. Since the above current reduction data is used to indicate the maximum value of the output current of the second electronic device at a preset moment, that is, without any physical channel, the first electronic device can accurately calculate the current output current of the second electronic device at the preset moment as the current corresponding to the preset moment, and then can realize efficient and accurate calculation of the system power consumption based on the current output current.
[0048] It should be understood that the second electronic device involved in the embodiments of the present application may be an adapter, and the first electronic device may be a mobile phone, a tablet computer, a laptop computer, a handheld computer, a mobile internet device (MID), a wearable device, a virtual reality (VR) device, an augmented reality (AR) device, a smart screen, an artificial intelligence (AI) speaker, headphones, a terminal in industrial control, a terminal in self-driving, a terminal in remote medical surgery, a terminal in a smart grid, a terminal in transportation safety, a terminal in a smart city, a terminal in a smart home, a personal digital assistant (PDA), etc. The embodiments of the present application are not limited thereto.
[0049] Exemplarily, Figure 2 FIG. is a schematic diagram of the system architecture of the first electronic device provided by the embodiments of the present application.
[0050] As Figure 2 shown, the first electronic device includes a processor 210, a transceiver 220, and a power supply 230.
[0051] Optionally, the first electronic device may further include a memory 240. The processor 210, the transceiver 220, and the memory 240 may communicate with each other through an internal connection path to transfer charging data. The memory 240 is used to store a computer program, and the processor 210 is used to call and run the computer program from the memory 240.
[0052] The above-mentioned first electronic device may further include a power supply 230 for supplying power to various devices or circuits in the first electronic device.
[0053] The above-mentioned processor 210 and the memory 240 may be integrated into a processing device, and more commonly, they are independent components. The processor 210 is used to execute the program code stored in the memory 240 to implement the above functions. Specifically, the memory 240 may also be integrated in the processor 210, or independent of the processor 210.
[0054] In addition, in order to make the functions of the first electronic device more complete, the first electronic device may further include one or more of an input unit 250, a sensor 260, etc.
[0055] It can be understood that Figure 2 The operations and / or functions of the respective modules in the first electronic device shown are respectively for implementing the corresponding processes in the following method embodiments. For details, reference may be made to the descriptions in the following method embodiments. To avoid repetition, the detailed descriptions are appropriately omitted herein.
[0056] It can be understood that Figure 2 The processor 210 in the first electronic device shown may include one or more processing units. For example, the processor 210 may include an application processor (AP), a modem processor, a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units may be independent devices or integrated in one or more processors.
[0057] A memory may also be provided in the processor 210 for storing instructions and data. In some embodiments, the memory in the processor 210 is a cache memory. This memory can save the instructions or data that the processor 210 has just used or recycled. If the processor 210 needs to use the instruction or data again, it can be directly called from the above memory. This avoids repeated accesses, reduces the waiting time of the processor 210, and thus improves the efficiency of the system.
[0058] In some embodiments, the processor 210 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0059] The UART interface is a general-purpose serial data bus for asynchronous communication. This bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is typically used to connect the processor 210 and the transceiver 220. For example, the processor 210 communicates with the Bluetooth module in the transceiver 220 through the UART interface to implement the Bluetooth function. In some embodiments, the audio circuit 270 can transmit audio signals to the transceiver 220 through the UART interface.
[0060] The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or a data signal. In some embodiments, the GPIO interface can be used to connect the processor 210 with the transceiver 220, the audio module circuit 280, the sensor 260, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, etc.
[0061] It can be understood that the interface connection relationships among the modules illustrated in the embodiments of this application are only illustrative descriptions and do not constitute a structural limitation on the first electronic device. In other embodiments of this application, the first electronic device can also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0062] It can be understood that Figure 2 The power supply 230 shown is used to supply power to the processor 210, the memory 240, the input unit 250, the transceiver 220, etc.
[0063] The transceiver 220 can provide wireless communication solutions applied to the first electronic device, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared technology (IR), etc. The transceiver 120 can be one or more devices integrating at least one communication processing module.
[0064] The memory 240 can be used to store computer-executable program code, and the above executable program code includes instructions. The memory 240 can include a program storage area and a data storage area. Among them, the program storage area can store an operating system, application programs required for at least one function, etc. The data storage area can store data created during the use of the first electronic device (such as charging data), etc. In addition, the memory 240 can include high-speed random access memory, and can also include non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 210 executes various functional applications and data processing of the first electronic device by running the instructions stored in the memory 240, and / or the instructions stored in the memory provided in the processor.
[0065] The first electronic device can implement audio functions through the audio circuit 270, as well as an application processor, etc. For example, playing a charging completion prompt tone, playing a start charging prompt tone, etc.
[0066] The audio circuit 270 is used to convert digital audio information into an analog audio signal for output, and is also used to convert an analog audio input into a digital audio signal. The audio circuit 270 can also be used for encoding and decoding audio signals. In some embodiments, the audio circuit 270 can be disposed in the processor 210, or a partial functional module of the audio circuit 270 can be disposed in the processor 210.
[0067] In order to make the objectives and technical solutions of the present application clearer and more intuitive, the following will, in conjunction with the accompanying drawings and embodiments, elaborate in detail on the system power consumption calculation method and the electronic device provided by the embodiments of the present application. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0068] Figure 3 is a schematic flowchart of a system power consumption calculation method 300 provided by an embodiment of the present application. The method 300 can be applied to Figure 1 the application scenario shown, and in addition, it can also be applied to other application scenarios, which are not limited in the present application. The present application can be executed by a first electronic device including a battery, and the battery can be charged by a second electronic device. As Figure 3 shown, the method 300 can include the following steps:
[0069] S301, when the battery is in a charging state, the first electronic device obtains the current current of the battery, the current voltage of the battery, the current output current of the second electronic device, and the current output voltage of the second electronic device.
[0070] In a possible implementation, the first electronic device determines the current output current of the second electronic device based on the current reduction data.
[0071] It should be understood that the current reduction data may include the correspondence between at least one preset moment and at least one current (which can be understood as the output current), and this current reduction data is used to indicate that in the case of the above at least one preset moment, the output current of the second electronic device is equal to the output current corresponding to the above at least one preset moment.
[0072] Exemplarily, at least one preset moment in the above current reduction data includes a first preset moment. The first electronic device can determine a first output current from the above current reduction data, and this first output current is the output current corresponding to the first preset moment in the above current reduction data. The first electronic device can determine that the current output current of the second electronic device is equal to the above first output current.
[0073] It should be understood that the above first preset moment can be the acquisition moment of acquiring the above current output current or can be the moment in the current reduction data that is separated from the above acquisition moment by a preset time interval.
[0074] In a possible implementation, the first electronic device may pre-store the correspondence between the current reduction data of multiple electronic devices and the identities (identification, ID) of these multiple electronic devices. The IDs of these multiple electronic devices include the ID of the second electronic device. The first electronic device can, when receiving the ID of the second electronic device sent by the second electronic device, obtain the current reduction data of the second electronic device based on this ID of the second electronic device.
[0075] It should be understood that at least one output current corresponding to at least one preset moment in the above current reduction data can be the maximum value, that is, the current reduction data can be used to indicate the maximum value of the output current of the second electronic device at the preset moment.
[0076] S302, the first electronic device determines the system power consumption of the first electronic device based on the current current, the current voltage, the current output current, and the current output voltage.
[0077] In this application, the first electronic device can obtain the current output current of the second electronic device at least based on the current reduction data of the second electronic device. Since the above current reduction data is used to indicate the maximum value of the output current of the second electronic device at the preset moment, that is, without any physical channel, the first electronic device can accurately calculate at the preset moment that the current output current of the second electronic device is the current corresponding to the above predetermined moment, and based on this current output current, an efficient and accurate calculation of the system power consumption is achieved.
[0078] In addition, when determining the power consumption of the above system, the first electronic device can also judge the temperature of the current first electronic device based on the system power consumption. For example, when it is determined that the temperature of the first electronic device is too high, the first electronic device can take corresponding current reduction measures to balance the charging rate and the temperature of the first electronic device, and avoid the problem of poor user experience caused by too low charging rate and / or too high temperature of the first electronic device.
[0079] Taking the first electronic device as a mobile phone and the second electronic device as an adapter as an example, the method for calculating the system power consumption provided in this application will be described below.
[0080] Figure 4 It is a schematic flowchart of a method 400 for calculating the system power consumption provided in an embodiment of this application. As Figure 4 shown, the method 400 includes the following steps:
[0081] S401, the adapter sends the adapter ID to the mobile phone. Correspondingly, the mobile phone receives the adapter ID from the adapter.
[0082] S402, the mobile phone determines the current reduction data of the adapter based on the above adapter ID.
[0083] It should be understood that the current reduction data may include at least one correspondence between a preset moment and at least one output current.
[0084] Table 1 shows the current reduction data of the adapter provided in this application.
[0085] Table 1
[0086] Preset moment Output current First preset moment First output current Second preset moment Second output current Third preset moment Third output current
[0087] As shown in Table 1, the above current reduction data includes the correspondence between three preset moments and three output currents. As described in Table 1, the output current corresponding to the first preset moment is the first output current, the output current corresponding to the second preset moment is the second output current, and the output current corresponding to the third preset moment is the third output current. Among them, the second preset moment is earlier than the first preset moment, the third preset moment is earlier than the second preset moment, the first output current is less than the second output current, and the second output current is less than the third output current.
[0088] It should be understood that the current reduction data shown above is only exemplary. In addition to the preset moments and output currents shown above, the current reduction data may also include the correspondence between a preset time period and an output current, the relationship between a preset moment and the adjustment amount of the output current, or the relationship between a preset time period and the adjustment amount of the output current. This application does not make any limitations in this regard.
[0089] S403, the mobile phone sends the first message to the adapter. Correspondingly, the adapter receives the first message from the mobile phone, and the first message is used to instruct the adapter to start charging the battery of the mobile phone.
[0090] S404, the mobile phone activates the first timer.
[0091] S405, the adapter activates the second timer.
[0092] It should be understood that the closer the activation times of the above-mentioned first timer and second timer are, the more accurate the output current of the adapter determined subsequently will be. In the case where the activation time of the above-mentioned first timer is later than that of the second timer, the mobile phone can, when using the timing moment of the first timer subsequently, add the time difference between the activation time of the first timer and the activation time of the second timer to the actually obtained timing moment, thereby realizing the timing synchronization between the mobile phone and the adapter and improving the accuracy of the current output current of the adapter. In the embodiments of the present application, the calculation method of the system power consumption provided by the present application is mainly described by taking the activation times of the above-mentioned first timer and second timer as the same as an example.
[0093] S406, the adapter charges the battery of the mobile phone with the initial output current. Correspondingly, the mobile phone accepts the second device to charge its battery.
[0094] In a possible implementation manner, the above-mentioned initial current can be determined according to the battery power.
[0095] Exemplarily, when the adapter is connected to the mobile phone and the mobile phone determines that the current battery power is x%, the mobile phone determines that the maximum charging current of the current battery is y and sends the maximum charging current to the adapter. Correspondingly, the adapter receives the maximum charging current and uses the maximum charging current as the above-mentioned initial output current to charge the mobile phone battery.
[0096] It should be understood that the above-mentioned current reduction data is used to instruct that in the case of the above-mentioned at least one preset moment, the adapter adjusts the output current to the output current corresponding to the above-mentioned at least one moment.
[0097] Exemplarily, when the timing moment of the second timer is equal to the first preset moment shown in Table 1 above, the adapter can adjust its current output current to the output current corresponding to the first preset moment, that is, the first output current. When the timing moment of the second timer is equal to the second preset moment shown in Table 1 above, the adapter can adjust its current output current to the output current corresponding to the second preset moment, that is, the second output current. Or, when the timing moment of the second timer is equal to the third preset moment shown in Table 1 above, the adapter can adjust its current output current to the output current corresponding to the third preset moment, that is, the third output current.
[0098] S407. The mobile phone determines the current output current of the adapter based on the timing moment of the first timer and the current-down data of the adapter.
[0099] In a possible case, when it is determined that the timing moment of the first timer is the same as the first preset moment in the current-down data, the mobile phone can determine that the adapter is currently performing, or about to perform, a current-down operation, that is, adjusting the current output current to the output current corresponding to the first preset moment. In other words, when the moment when the mobile phone obtains the current output current of the adapter is equal to the first preset moment, the mobile phone can determine the first output current corresponding to the first preset moment based on the current-down data, and can determine that the current output current of the adapter is equal to the output current corresponding to the first preset moment, that is, the first current.
[0100] In another possible case, when it is determined that the timing moment of the first timer is different from the first preset moment in the current-down data, the mobile phone can determine the output current of the adapter based on the timing moment of the first timer, the first preset moment, and the moment separated by a preset time interval from the timing moment of the first timer (that is, the moment when the current output current of the adapter is obtained).
[0101] Exemplarily, when the timing moment of the first timer is between the first preset moment and the second preset moment, the mobile phone can determine that the current output current of the adapter is the output current corresponding to the second preset moment. The mobile phone can determine the second output current corresponding to the second preset moment based on the second preset moment and the current-down data shown in Table 1, and determine that the current output current of the adapter is equal to the second output current.
[0102] Exemplarily, when the timing moment of the first timer is not between the first preset moment and the second preset moment, and the timing moment of the first timer is greater than the first preset moment, the mobile phone can determine that the most recent current reduction operation of the adapter was performed at the first preset moment. The mobile phone can determine the first output current corresponding to the first preset moment based on the first preset moment and the current reduction data shown in Table 1 above, and determine that the current output current of the adapter is equal to the first output current.
[0103] S408, the mobile phone determines the system power consumption based on the current current of the battery, the current voltage of the battery, the current output current of the adapter, and the current output voltage of the adapter.
[0104] Exemplarily, the system power consumption satisfies the following formula: Psys = v bus *i bus *loss - v batt *i batt , where Psys is the above-mentioned system power consumption, v bus is the current output voltage of the adapter, i bus is the current output current of the adapter, v batt is the current voltage of the battery, i batt is the current current of the battery, and loss is the path loss and the device conversion rate loss.
[0105] It should be understood that when the adapter charges the mobile phone, the mobile phone and the adapter time simultaneously. Therefore, the mobile phone can determine whether there is a current reduction of the second device at the current moment based on the timing moment and the current reduction data of the second device. Furthermore, when it is determined that there is a current reduction, without any physical channel, the mobile phone can accurately determine that the current output current of the adapter is the current corresponding to the above-mentioned timing moment. In other words, since the efficiency and accuracy of the determined current output current of the adapter are relatively high, the efficiency and accuracy of the calculated system power consumption are also relatively high.
[0106] Optionally, the mobile phone can also judge the current temperature of the current mobile phone based on the system power consumption, and then can take corresponding current reduction measures to balance the charging rate and the temperature of the mobile phone, and avoid the problem of poor user experience caused by too low charging rate and / or too high mobile phone temperature.
[0107] Optionally, in addition to the first device determining the current output current of the second device based on the current reduction data as shown above, the first electronic device also determines the current output current of the second electronic device based on the above-mentioned current reduction data and reference information. Wherein, the reference information includes the current voltage of the battery or the reference output current.
[0108] The following takes the above reference information where the current voltage of the battery is, the first electronic device is a mobile phone, and the second electronic device is an adapter as an example to describe in detail the method for calculating the system power consumption provided by this application.
[0109] Figure 5 It is a schematic flowchart of another method 500 for calculating the system power consumption provided by this application. As Figure 5 shown, the method 500 includes the following steps:
[0110] S501, the adapter sends the adapter ID to the mobile phone. Correspondingly, the mobile phone receives the adapter ID from the adapter.
[0111] S502, the mobile phone determines the current-down data of the adapter based on the above adapter ID.
[0112] It should be understood that the above current-down data includes at least one preset moment and the corresponding at least one output current. The current-down data is used to indicate that in the case of the above at least one moment, the output current of the adapter is equal to the output current corresponding to the above at least one preset moment. For specific details, reference can be made to the description of the above embodiments. To avoid repetition, it will not be elaborated here.
[0113] S503, the mobile phone sends the first information to the adapter. Correspondingly, the adapter receives the first information from the mobile phone. The first information is used to indicate that the adapter starts to charge the battery of the mobile phone, and the first information may carry first charging reference data.
[0114] It should be understood that the above first charging reference data may include multiple voltages and the corresponding multiple currents. The multiple voltages can be understood as multiple battery voltages, and the multiple currents can also be understood as multiple charging currents. The first charging reference data can be used to indicate that when the voltage of the battery is greater than or equal to any one of the above multiple voltages, the output current of the adapter is equal to the charging current corresponding to any one of the above multiple voltages.
[0115] Table 2 shows the first charging reference data provided by the embodiments of this application.
[0116] Table 2
[0117] Battery voltage Charging current First voltage First charging current Second voltage Second charging current Third voltage Third charging current
[0118] As shown in Table 2, the above first charging reference data includes three pairs of relationships between voltage and charging current. As shown in Table 2, when the battery voltage is greater than or equal to the first voltage and less than the second voltage, the charging current of the battery is the first charging current, that is, the output current of the adapter is equal to the above first charging current. When the battery voltage is greater than or equal to the second voltage and less than the third voltage, the charging current of the battery is the second charging current, that is, the output current of the adapter is equal to the above second charging current. When the battery voltage is greater than or equal to the third voltage, the charging current of the battery is the third charging current, that is, the output current of the adapter is equal to the above third charging current.
[0119] S504, the mobile phone turns on the first timer.
[0120] S505, the adapter turns on the second timer.
[0121] It should be understood that the closer the start times of the above first timer and the second timer are, the more accurate the output current of the adapter determined subsequently will be. When the start time of the above first timer is later than the start time of the second timer, the mobile phone can, when using the timing moment of the first timer subsequently, add the time difference between the start time of the first timer and the start time of the second timer on the basis of the actually obtained timing moment, so as to achieve the timing synchronization between the mobile phone and the adapter and improve the accuracy of the current output current of the adapter. In the embodiments of the present application, mainly taking the start time of the above first timer being the same as the start time of the second timer as an example, the calculation method of the system power consumption provided by the present application is described.
[0122] S506, the adapter charges the battery of the mobile phone with the initial output current. Correspondingly, the mobile phone accepts the adapter to charge its battery.
[0123] In a possible implementation manner, the above initial current can be determined according to the battery power.
[0124] Exemplarily, when the adapter is connected to the mobile phone and the mobile phone determines that the current power of the battery is x%, the mobile phone determines that the maximum charging current of the current battery is y and sends the maximum charging current to the adapter. Correspondingly, the adapter receives the maximum charging current and uses the maximum charging current as the above initial output current to charge the battery of the mobile phone.
[0125] S507, the adapter sends information requesting the current voltage of the battery to the mobile phone. Correspondingly, the mobile phone receives the information requesting the current voltage of the battery.
[0126] S508, the mobile phone sends the current voltage of the battery to the adapter based on the above information requesting the current voltage of the battery.
[0127] Optionally, before the mobile phone sends the current voltage of the battery to the adapter based on the information of the requested battery current voltage sent by the adapter, the mobile phone can compare the current voltage of the battery with the voltage of the battery sent to the adapter last time. When it is determined that the current voltage of the battery is different from the voltage of the battery sent to the adapter last time, the mobile phone sends the current voltage of the battery to the adapter. Or, when it is determined that the current voltage of the battery is the same as the voltage of the battery sent to the adapter last time, the mobile phone can do nothing. Correspondingly, when the adapter does not receive the current voltage of the battery sent by the mobile phone within a preset time range, it can be determined not to change the current output current, that is, the adapter keeps charging the battery of the mobile phone with the current output current.
[0128] S509. The adapter determines the current output current based on the current voltage of the battery and the first charging reference data.
[0129] Exemplarily, corresponding to the first charging reference data shown in Table 2 above, when the current voltage of the battery is greater than the first voltage and less than the second voltage, the adapter determines to adjust the initial output current to the first charging current corresponding to the first voltage in Table 2, that is, the current output current of the adapter is equal to the first charging current.
[0130] S510. The adapter charges the battery with the output current. Correspondingly, the mobile phone receives the charging of the battery by the adapter.
[0131] S511. The mobile phone determines the current output current of the adapter based on the current voltage of the battery, the current reduction data, and the timing moment of the first timer.
[0132] In a possible case, when the timing moment of the first timer is the same as the first preset moment in the current reduction data, the mobile phone can determine that the adapter is currently performing or about to perform a current reduction operation at the current moment, and the mobile phone can determine the first output current corresponding to the first preset moment based on the current reduction data. The mobile phone can determine the first charging current corresponding to the voltage of the battery based on the first charging reference data shown in Table 2 and the current voltage of the battery. When the mobile phone determines that the first output current is less than the first charging current, it can determine that the current output current of the adapter is equal to the first output current. Or, when the first output current is greater than or equal to the first charging current, it is determined that the current output current of the adapter is equal to the first charging current.
[0133] In another possible case, when it is determined that the timing moment of the first timer is different from the first preset moment in the above-mentioned down-current data, the mobile phone can determine the output current of the adapter based on the timing moment of the first timer, the first preset moment, and the moment separated by a preset time interval from the timing moment of the first timer (i.e., the acquisition moment of the current output current of the adapter).
[0134] Exemplarily, the timing moment of the first timer is between the first preset moment and the second preset moment. The mobile phone can determine the second output current corresponding to the second preset moment based on the second preset moment and the down-current data shown in Table 1. The mobile phone can determine the first charging current corresponding to the current voltage of the battery based on the first charging reference data shown in Table 2 and the current voltage of the battery. The mobile phone can determine that the current output current of the adapter is equal to the second output current when it is determined that the second output current is less than the second charging current. Or, when the mobile phone determines that the second output current is greater than or equal to the first charging current, it determines that the current output current of the adapter is equal to the first charging current.
[0135] Exemplarily, the timing moment of the first timer is not between the first preset moment and the second preset moment, and the timing moment of the first timer is greater than the first preset moment. The mobile phone can determine that the most recent down-current operation of the adapter was performed at the first preset moment. The mobile phone can determine the first output current corresponding to the first preset moment based on the first preset moment and the down-current data shown in the above Table 1, and determine that the current output current of the adapter is equal to the first output current when it is determined that the first output current is less than the first charging current. Otherwise, the mobile phone can determine that the current output current of the adapter is equal to the first charging current.
[0136] S512, the mobile phone determines the system power consumption based on the current current of the battery, the current voltage of the battery, the current output current of the adapter, and the current output voltage of the adapter.
[0137] Exemplarily, the above system power consumption satisfies the following formula: Psys = v bus *i bus *loss - v batt *i batt , where Psys is the above system power consumption, v bus is the current output voltage of the adapter, i bus is the current output current of the adapter, v batt is the current voltage of the battery, i batt is the current current of the battery, and loss is the path loss and the device conversion rate loss.
[0138] It should be understood that when the adapter charges the mobile phone, without any physical channels, the mobile phone can accurately determine the current output of the adapter at the corresponding time of the timing moment, the current reduction data of the second device, the first charging reference data, and the current voltage of the battery, that is, the current corresponding to the timing moment or the current corresponding to the current voltage of the battery. In other words, due to the high efficiency and accuracy of the determined current output of the adapter, the efficiency and accuracy of the calculated system power consumption are also relatively high.
[0139] Similarly, the mobile phone can also take corresponding current reduction measures based on the system power consumption, taking into account the charging rate and the temperature of the mobile phone, and avoiding the problem of poor user experience caused by too low charging rate and / or too high temperature of the mobile phone.
[0140] Taking the above reference information as the reference output current, the first electronic device as the mobile phone, and the second electronic device as the adapter as an example, the calculation method of the system power consumption provided by the present application will be described in detail below.
[0141] Figure 6 It is a schematic flowchart of another calculation method 600 of the system power consumption provided by the present application. As Figure 6 shown, the method 600 includes the following steps:
[0142] S601, the adapter sends the adapter ID to the mobile phone. Correspondingly, the mobile phone receives the adapter ID from the adapter.
[0143] S602, the mobile phone determines the current reduction data of the adapter based on the above adapter ID.
[0144] It should be understood that the above current reduction data includes at least one preset moment and the corresponding at least one output current, and the current reduction data is used to indicate that in the case of the above at least one preset moment, the output current of the adapter is equal to the at least one output current corresponding to the preset moment. For specific details, reference can be made to the description of the above embodiments. To avoid repetition, it will not be elaborated here.
[0145] S603, the mobile phone sends the first information to the adapter. Correspondingly, the adapter receives the first information from the mobile phone, and the first information is used to indicate that the adapter starts to charge the battery of the mobile phone.
[0146] Optionally, the above first information can also carry the first charging reference data or the second charging reference data. The second charging parameter includes at least one voltage (which can be understood as the battery voltage) and at least one corresponding current (which can be understood as the charging current). Among them, at least one battery voltage in the second charging reference data is greater than the maximum voltage that the battery can reach in the embodiments of the present application. In addition, the first charging reference data can be referred to the description of the above embodiments and Table 2. To avoid repetition, it will not be elaborated here.
[0147] S604, the mobile phone activates the first timer.
[0148] S605, the adapter activates the second timer.
[0149] It should be understood that the closer the activation times of the above-mentioned first timer and second timer are, the more accurate the output current of the subsequent determined adapter will be. To avoid repetition, no further elaboration will be made here. For specific details, reference can be made to the description of the above embodiments.
[0150] S606, the adapter charges the battery of the mobile phone with the initial output current. Correspondingly, the mobile phone accepts the adapter to charge its battery.
[0151] In a possible implementation manner, the above initial current can be determined based on the battery power.
[0152] Exemplarily, when the adapter is connected to the mobile phone and the mobile phone determines that the current battery power is x%, the mobile phone determines that the maximum charging current of the current battery is y, and sends the maximum charging current to the adapter. Correspondingly, the adapter receives the maximum charging current and uses the maximum charging current as the above initial output current to charge the mobile phone battery.
[0153] S607, the adapter sends information requesting the current current of the battery to the mobile phone. Correspondingly, the mobile phone receives the information requesting the current current of the battery.
[0154] In a possible implementation manner, the adapter sends information requesting the current voltage of the battery to the mobile phone. When the mobile phone receives the information requesting the current voltage of the battery, it sends an indication message to the adapter. The adapter can receive the indication message and send the above information requesting the current current of the battery to the mobile phone based on the indication message.
[0155] S608, the mobile phone sends a reference output current to the adapter based on the above information requesting the current current of the battery.
[0156] Optionally, the above reference output current can also be less than or equal to a limit current, which is used to indicate the maximum current corresponding to the mobile phone when running at least one application.
[0157] Exemplarily, the adapter charges the battery when the mobile phone is running a game application. The mobile phone can determine the charging current corresponding to the current voltage of the battery based on the current voltage of the current battery and the first charging reference data shown in Table 2 based on the information of the current current of the requested battery. When the mobile phone determines that the charging current corresponding to the current voltage of the battery is less than or equal to the above-mentioned limit current, it can determine that the above-mentioned reference output current is equal to the charging current corresponding to the current voltage of the battery. Or, when it is determined that the charging current corresponding to the current voltage of the battery is greater than the above-mentioned limit current, in order to balance the charging speed and user experience, the mobile phone can determine that the reference output current is equal to the limit current, that is, the adapter charges the battery with a reference output current less than or equal to the limit current, avoiding the problem of poor user experience caused by the overheating of the mobile phone during the charging process when running the game application.
[0158] Optionally, before the mobile phone sends the current current of the battery to the adapter based on the information of the current current of the requested battery sent by the adapter, the mobile phone can compare the current current of the battery with the current of the battery sent to the adapter last time. When it is determined that the current current of the battery is different from the current of the battery sent to the adapter last time, the mobile phone sends the current current of the battery to the adapter. Or, when it is determined that the current current of the battery is the same as the current of the battery sent to the adapter last time, the mobile phone can do nothing. Correspondingly, when the adapter does not receive the current current of the battery sent by the mobile phone within a preset time range, it can determine not to change the current output current, that is, the adapter continues to charge the battery of the mobile phone with the above-mentioned current output current.
[0159] S609, the adapter charges the battery of the mobile phone with the above-mentioned reference output current. Correspondingly, the mobile phone receives the charging of the battery by the adapter.
[0160] S610, the mobile phone determines the current output current of the adapter based on the above-mentioned reference output current, the current reduction data, and the timing moment of the above-mentioned first timer.
[0161] In a possible case, when the timing moment of the above-mentioned first timer is the same as the first preset moment in the above-mentioned current reduction data, the mobile phone can determine that the adapter is currently performing, or will perform, a current reduction operation at the current moment. The mobile phone can determine the first output current corresponding to the first preset moment based on the above-mentioned current reduction data. When the mobile phone determines that the first output current is less than the reference output current, it can determine that the current output current of the adapter is equal to the first output current. Or, when the first output current is greater than or equal to the reference output current, it is determined that the current output current of the adapter is equal to the reference output current.
[0162] In another possible case, when it is determined that the timing moment of the first timer is different from the first preset moment in the above-mentioned down-current data, the mobile phone can determine the output current of the adapter based on the timing moment of the first timer, the first preset moment, and the moment separated by a preset time interval from the timing moment of the first timer (i.e., the acquisition moment of the current output current of the adapter).
[0163] Exemplarily, the timing moment of the first timer is between the first preset moment and the second preset moment. The mobile phone can determine the second output current corresponding to the second preset moment based on the second preset moment and the down-current data shown in Table 1. When the mobile phone determines that the second output current is less than the reference output current, it can determine that the current output current of the adapter is equal to the second output current. Alternatively, when the mobile phone determines that the second output current is greater than or equal to the reference output current, it can determine that the current output current of the adapter is equal to the reference output current.
[0164] Exemplarily, the timing moment of the first timer is not between the first preset moment and the second preset moment, and the timing moment of the first timer is greater than the first preset moment. The mobile phone can determine that the most recent down-current operation of the adapter was performed at the first preset moment. The mobile phone can determine the first output current corresponding to the first preset moment based on the first preset moment and the down-current data shown in Table 1 above, and when it determines that the first output current is less than the reference output current, it can determine that the current output current of the adapter is equal to the first output current. Otherwise, the mobile phone can determine that the current output current of the adapter is equal to the reference output current.
[0165] S611, the mobile phone determines the system power consumption based on the current current of the battery, the current voltage of the battery, the current output current of the adapter, and the current output voltage of the adapter.
[0166] Exemplarily, the above-mentioned system power consumption satisfies the following formula: Psys = v bus *i bus *loss - v batt *i batt , where Psys is the above-mentioned system power consumption, v bus is the current output voltage of the adapter, i bus is the current output current of the adapter, v batt is the current voltage of the battery, i batt is the current current of the battery, and loss is the path loss and the device conversion rate loss.
[0167] It should be understood that when the adapter charges the mobile phone, without any physical channels, the mobile phone can accurately determine the current output current of the adapter at the timing moment as the current corresponding to the timing moment or the reference output current based on the timing moment, the down - current data of the second device, and the reference output current. In other words, since the efficiency and accuracy of the determined current output current of the adapter are relatively high, the efficiency and accuracy of the calculated system power consumption are also relatively high.
[0168] Similarly, the mobile phone can also take corresponding down - current measures based on the system power consumption, taking into account the charging rate and the temperature of the mobile phone, and avoiding the problem of poor user experience caused by too low charging rate and / or too high mobile phone temperature.
[0169] It should be understood that the above - mentioned various embodiments can also be coupled to each other, and this application does not make any limitations in this regard. And the magnitude of the sequence numbers of the above - mentioned processes does not mean the sequence of execution. The execution sequence of each process should be determined according to its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of this application.
[0170] In the above text, in combination with Figures 1 to 6 , the calculation method of the system power consumption of the embodiments of this application is described in detail. Next, in combination with Figures 7 to 8 , the electronic device of the embodiments of this application will be described in detail.
[0171] Figure 7 FIG. shows an electronic device 700 provided by an embodiment of this application. The electronic device 700 includes: an acquisition module 701 and a processing module 702.
[0172] Among them, the acquisition module 701 is used for: when the above - mentioned battery is in a charging state, acquiring the current current of the above - mentioned battery, the current voltage of the above - mentioned battery, the current output current of the above - mentioned second electronic device, and the current output voltage of the above - mentioned second electronic device; the processing module 702 is used for: determining the system power consumption of the above - mentioned first electronic device based on the above - mentioned current current, the above - mentioned current voltage, the above - mentioned current output current, and the above - mentioned current output voltage; where the above - mentioned current output current is obtained by the above - mentioned first electronic device at least based on the down - current data of the above - mentioned second electronic device, and the down - current data is used to indicate the maximum value of the output current of the above - mentioned second electronic device at a preset moment.
[0173] Optionally, the above - mentioned acquisition module 701 is used for: determining a first output current from the above - mentioned down - current data, where the first output current is the output current corresponding to a first preset moment in the above - mentioned down - current data, and the first preset moment is the acquisition moment for acquiring the above - mentioned current output current or the moment in the above - mentioned down - current data that is separated from the acquisition moment by a preset time interval; the above - mentioned processing module is used for: determining that the current output current of the above - mentioned second electronic device is equal to the above - mentioned first output current.
[0174] Optionally, the processing module 702 is configured to: send reference information to the second electronic device, where the reference information includes the current voltage or the reference output current of the battery; the obtaining module is configured to: determine the current output current of the second electronic device based on the current-limiting data and the reference information.
[0175] Optionally, the processing module 702 is configured to: compare the reference information with the reference information sent to the second electronic device last time; in a case where it is determined that the reference information is different from the reference information sent to the second electronic device last time, send the reference information to the second electronic device.
[0176] Optionally, the reference information is the reference output current, the reference output current is determined by the first electronic device based on first charging reference data, the first charging reference data includes a plurality of voltages and corresponding plurality of currents, the processing module 702 is configured to: send second charging reference data to the second electronic device, the second charging reference data includes at least one voltage and at least one corresponding current, the at least one voltage is greater than the maximum voltage of the battery; determine a first output current from the current-limiting data, the first output current is the output current corresponding to a first preset time in the current-limiting data, the first preset time is the obtaining time of the current output current or the time separated from the obtaining time by a preset time interval in the current-limiting data; in a case where it is determined that the first output current is less than the reference output current, determine that the current output current of the second electronic device is equal to the first output current; or, in a case where it is determined that the first output current is greater than or equal to the reference output current, determine that the current output current of the second electronic device is equal to the reference output current.
[0177] Optionally, the reference output current is less than or equal to a limiting current, and the limiting current is used to indicate the maximum current corresponding to the first electronic device when running at least one application.
[0178] Optionally, the above reference information is the current voltage of the above battery, and the processing module 702 is configured to: send first charging reference data to the above second electronic device, where the first charging reference data includes a plurality of voltages and corresponding plurality of currents; determine a first output current from the above current reduction data, where the first output current is the output current corresponding to a first preset moment in the above current reduction data, and the first preset moment is the acquisition moment of the above current output current or the moment separated from the above acquisition moment by a preset time interval in the above current reduction data; determine the current corresponding to the current voltage of the above battery based on the above first charging reference data; in a case where it is determined that the first output current is less than the current corresponding to the current voltage of the above battery, determine that the current output current of the above second electronic device is equal to the first output current; or, in a case where it is determined that the first output current is greater than or equal to the current corresponding to the current voltage of the above battery, determine that the current output current of the above second electronic device is equal to the current corresponding to the current voltage of the above battery.
[0179] Optionally, the above system power consumption satisfies the following formula: Psys = v bus *i bus *loss - v batt *i batt where Psys is the above system power consumption, v bus is the current output voltage of the second electronic device, i bus is the current output current of the above second electronic device, v batt is the current voltage of the above battery, i batt is the current current of the above battery, and loss is the path loss and the device conversion rate loss.
[0180] It should be understood that the electronic device 700 is embodied in the form of a functional module here. The term "module" here may refer to an application specific integrated circuit (ASIC), an electronic circuit, a processor (such as a shared processor, a dedicated processor, or a group of processors, etc.) for executing one or more software or firmware programs, and a memory, a combined logic circuit, and / or other suitable components that support the described functions. In an optional example, those skilled in the art can understand that the electronic device 700 may specifically be the first electronic device in the above embodiments, or the functions of the first electronic device in the above embodiments may be integrated in the electronic device 700. The electronic device 700 may be used to execute the respective processes and / or steps corresponding to the first electronic device in the above method embodiments. To avoid repetition, details are not described herein again.
[0181] The above-mentioned electronic device 700 has the function of implementing the corresponding steps executed by the first electronic device in the above-mentioned method; this function can be implemented by hardware or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above-mentioned function.
[0182] In the embodiments of the present application, Figure 7 the electronic device 700 in can also be a chip or a chip system, for example: a system on chip (SoC).
[0183] Figure 8 Another electronic device 800 provided by the embodiments of the present application is shown. The electronic device 800 includes: a transceiver 801, a processor 802, and a memory 803. Among them, the transceiver 801, the processor 802, and the memory 803 communicate with each other through an internal connection path. The memory 803 is used to store instructions, and the processor 802 is used to execute the instructions stored in the memory 803 to control the transceiver 801 to send signals and / or receive signals.
[0184] Among them, the transceiver 801 is used to: when the above-mentioned battery is in a charging state, obtain the current current of the above-mentioned battery, the current voltage of the above-mentioned battery, the current output current of the above-mentioned second electronic device, and the current output voltage of the above-mentioned second electronic device; the above-mentioned processor 802 is used to: based on the above-mentioned current current, the above-mentioned current voltage, the above-mentioned current output current, and the above-mentioned current output voltage, determine the system power consumption of the above-mentioned first electronic device; among them, the above-mentioned current output current is obtained by the above-mentioned first electronic device at least based on the current reduction data of the above-mentioned second electronic device, and the current reduction data is used to indicate the maximum value of the output current of the above-mentioned second electronic device at a preset moment.
[0185] Optionally, the above-mentioned transceiver 801 is used to: determine a first output current from the above-mentioned current reduction data, the first output current being the output current corresponding to a first preset moment in the above-mentioned current reduction data, the first preset moment being the acquisition moment when the above-mentioned current output current is acquired or the moment separated from the above-mentioned acquisition moment by a preset time interval in the above-mentioned current reduction data; the above-mentioned processor 802 is used to: determine that the current output current of the above-mentioned second electronic device is equal to the above-mentioned first output current.
[0186] Optionally, the above-mentioned processor 802 is used to: send reference information to the above-mentioned second electronic device, the reference information including the current voltage of the above-mentioned battery or a reference output current; the above-mentioned acquisition module is used to: based on the above-mentioned current reduction data and the above-mentioned reference information, determine the current output current of the above-mentioned second electronic device.
[0187] Optionally, the above-mentioned processor 802 is configured to: compare the above-mentioned reference information with the reference information sent to the second electronic device last time; in the case where it is determined that the above-mentioned reference information is different from the reference information sent to the second electronic device last time, send the above-mentioned reference information to the second electronic device.
[0188] Optionally, the above-mentioned reference information is the above-mentioned reference output current, and the above-mentioned reference output current is determined by the first electronic device based on first charging reference data, and the first charging reference data includes a plurality of voltages and corresponding plurality of currents. The transceiver 801 is configured to: send second charging reference data to the second electronic device, and the second charging reference data includes at least one voltage and at least one corresponding current, and the at least one voltage is greater than the maximum voltage of the battery; the processor 802 is configured to: determine a first output current from the above-mentioned current reduction data, and the first output current is the output current corresponding to a first preset moment in the above-mentioned current reduction data, and the first preset moment is the acquisition moment of the above-mentioned current output or the moment in the above-mentioned current reduction data that is separated from the acquisition moment by a preset time interval; in the case where it is determined that the first output current is less than the reference output current, determine that the current output of the second electronic device is equal to the first output current; or, in the case where it is determined that the first output current is greater than or equal to the reference output current, determine that the current output of the second electronic device is equal to the reference output current.
[0189] Optionally, the above-mentioned reference output current is less than or equal to the limit current, and the limit current is used to indicate the maximum current corresponding to the first electronic device when running at least one application.
[0190] Optionally, the above-mentioned reference information is the current voltage of the battery. The transceiver 801 is configured to: send first charging reference data to the second electronic device, and the first charging reference data includes a plurality of voltages and corresponding plurality of currents; the processor 802 is configured to: determine a first output current from the above-mentioned current reduction data, and the first output current is the output current corresponding to a first preset moment in the above-mentioned current reduction data, and the first preset moment is the acquisition moment of the above-mentioned current output or the moment in the above-mentioned current reduction data that is separated from the acquisition moment by a preset time interval; based on the first charging reference data, determine the current corresponding to the current voltage of the battery; in the case where it is determined that the first output current is less than the current corresponding to the current voltage of the battery, determine that the current output of the second electronic device is equal to the first output current; or, in the case where it is determined that the first output current is greater than or equal to the current corresponding to the current voltage of the battery, determine that the current output of the second electronic device is equal to the current corresponding to the current voltage of the battery.
[0191] Optionally, the power consumption of the above system satisfies the following formula: Psys = v bus *i bus *loss - v batt *i batt , where Psys is the power consumption of the above system, v bus is the current output voltage of the second electronic device, i bus is the current output current of the above second electronic device, v batt is the current voltage of the above battery, i batt is the current current of the above battery, and loss is the path loss and device conversion rate loss.
[0192] It should be understood that the electronic device 800 may specifically be the first electronic device in the above embodiments, or the functions of the first electronic device in the above embodiments may be integrated in the electronic device 800, and the electronic device 800 may be used to execute the respective steps and / or processes corresponding to the first electronic device in the above method embodiments.
[0193] Optionally, the memory 802 may include a read-only memory and a random access memory, and provide instructions and data to the processor 801. A part of the memory 802 may further include a non-volatile random access memory. For example, the memory 802 may also store information about the device type. The processor 801 may be used to execute the instructions stored in the memory, and when the processor executes the instructions, the processor 801 may execute the respective steps and / or processes corresponding to the first electronic device in the above method embodiments.
[0194] It should be understood that in the embodiments of the present application, the processor may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0195] In the implementation process, each step of the above method can be completed by the integrated logic circuit of the hardware in the processor or the instructions in the form of software. The steps of the method disclosed in combination with the embodiments of the present application can be directly embodied as being executed and completed by the hardware processor, or can be executed and completed by the combination of the hardware and software modules in the processor. The software module can be located in a mature storage medium in the art such as random access memory, flash memory, read-only memory, programmable read-only memory, or electrically erasable programmable memory, registers, etc. This storage medium is located in the memory, and the processor executes the instructions in the memory and combines its hardware to complete the steps of the above method. To avoid repetition, it will not be described in detail here.
[0196] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or by a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.
[0197] Those skilled in the art can clearly understand that for the convenience and conciseness of description, the specific working processes of the systems, devices, and units described above can refer to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0198] In several embodiments provided in the present application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the above division of units is only a logical function division, and there can be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed mutual coupling or direct coupling or communication connection can be through some interfaces, and the indirect coupling or communication connection of the device or unit can be in an electrical, mechanical, or other form.
[0199] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they can be located in one place, or can be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0200] In addition, in each embodiment of the present application, the functional units can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit.
[0201] If the above functions are implemented in the form of software function units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods in the various embodiments of this application. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs that can store program codes.
[0202] The above is only the specific implementation manner of this application, but the protection scope of this application is not limited thereto. Any person skilled in the art within the technical scope disclosed by this application can easily think of changes or substitutions, which should all be covered by the protection scope of this application. Therefore, the protection scope of this application shall be subject to the protection scope of the above-mentioned claims.
Claims
1. A method for calculating system power consumption, characterized in that, Applied to a first electronic device, the first electronic device includes a battery, and the battery is charged by a second electronic device. The method includes: When the battery is in a charging state, the first electronic device obtains the current current of the battery, the current voltage of the battery, the current output current of the second electronic device, and the current output voltage of the second electronic device; The first electronic device determines the system power consumption of the first electronic device based on the current current, the current voltage, the current output current, and the current output voltage; Wherein, the current output current is obtained by the first electronic device at least based on the current reduction data of the second electronic device, and the current reduction data is used to indicate the maximum value of the output current of the second electronic device at a preset moment. The first electronic device pre-stores the current reduction data of the second electronic device; The obtaining of the current output current of the second electronic device includes: The first electronic device determines a first output current from the current reduction data. The first output current is the output current corresponding to a first preset moment in the current reduction data. The first preset moment is the obtaining moment of obtaining the current output current or the moment separated from the obtaining moment by a preset time interval in the current reduction data; The first electronic device determines that the current output current of the second electronic device is equal to the first output current.
2. The method according to claim 1, wherein Before the obtaining of the current output current of the second electronic device, the method further includes: The first electronic device sends reference information to the second electronic device, and the reference information includes the current voltage of the battery or a reference output current; The obtaining of the current output current of the second electronic device includes: The first electronic device determines the current output current of the second electronic device based on the current reduction data and the reference information.
3. The method according to claim 2, characterized in that Before the first electronic device sends the reference information to the second electronic device, the method further includes: The first electronic device compares the reference information with the reference information sent to the second electronic device last time; The first electronic device sending the reference information to the second electronic device includes: When it is determined that the reference information is different from the reference information sent to the second electronic device last time, the first electronic device sends the reference information to the second electronic device.
4. The method according to claim 2 or 3, characterized in that, The reference information is the reference output current, and the reference output current is determined by the first electronic device based on first charging reference data. The first charging reference data includes a plurality of voltages and corresponding plurality of currents. Before the obtaining of the current output current of the second electronic device, the method further includes: The first electronic device sends second charging reference data to the second electronic device. The second charging reference data includes at least one voltage and at least one corresponding current, and the at least one voltage is greater than the maximum voltage of the battery; The first electronic device determines a first output current from the current-reducing data, where the first output current is the output current corresponding to a first preset moment in the current-reducing data, and the first preset moment is the acquisition moment of the current output current or the moment in the current-reducing data that is separated from the acquisition moment by a preset time interval; The acquiring the current output current of the second electronic device includes: In a case where it is determined that the first output current is less than the reference output current, the first electronic device determines that the current output current of the second electronic device is equal to the first output current; or, In a case where it is determined that the first output current is greater than or equal to the reference output current, the first electronic device determines that the current output current of the second electronic device is equal to the reference output current.
5. The method according to claim 2 or 3, characterized in that, The reference output current is less than or equal to a limit current, and the limit current is used to indicate the maximum current corresponding to the first electronic device when running at least one application.
6. The method according to claim 2 or 3, characterized in that The reference information is the current voltage of the battery. Before acquiring the current output current of the second electronic device, the method further includes: The first electronic device sends first charging reference data to the second electronic device, and the first charging reference data includes a plurality of voltages and corresponding plurality of currents; The first electronic device determines a first output current from the current-reducing data, where the first output current is the output current corresponding to a first preset moment in the current-reducing data, and the first preset moment is the acquisition moment of the current output current or the moment in the current-reducing data that is separated from the acquisition moment by a preset time interval; The first electronic device determines the current corresponding to the current voltage of the battery based on the first charging reference data; The acquiring the current output current of the second electronic device includes: In a case where it is determined that the first output current is less than the current corresponding to the current voltage of the battery, the first electronic device determines that the current output current of the second electronic device is equal to the first output current; or, In a case where it is determined that the first output current is greater than or equal to the current corresponding to the current voltage of the battery, the first electronic device determines that the current output current of the second electronic device is equal to the current corresponding to the current voltage of the battery.
7. The method according to claim 1, characterized in that The system power consumption satisfies the following formula: Psys = v bus *i bus *loss - v batt *i batt Among them, Psys is the system power consumption, v bus is the current output voltage of the second electronic device, i bus is the current output current of the second electronic device, v batt is the current voltage of the battery, i batt is the current current of the battery, and loss is the path loss and the device conversion rate loss.
8. An electronic device, characterized in that, Applied to a first electronic device, the first electronic device includes a battery, and the battery is charged by a second electronic device. The electronic device includes: An acquisition module, configured to acquire the current current of the battery, the current voltage of the battery, the current output current of the second electronic device, and the current output voltage of the second electronic device when the battery is in a charging state; A processing module, configured to determine the system power consumption of the first electronic device based on the current current, the current voltage, the current output current, and the current output voltage; Wherein, the current output current is obtained by the first electronic device at least based on the current reduction data of the second electronic device, and the current reduction data is used to indicate the maximum value of the output current of the second electronic device at a preset moment. The first electronic device prestores the current reduction data of the second electronic device; The processing module is configured to: determine a first output current from the current reduction data, where the first output current is the output current corresponding to a first preset moment in the current reduction data, and the first preset moment is the acquisition moment of obtaining the current output current or the moment in the current reduction data that is separated from the acquisition moment by a preset time interval; Determine that the current output current of the second electronic device is equal to the first output current.
9. The electronic device according to claim 8, wherein The processing module is configured to: Send reference information to the second electronic device, where the reference information includes the current voltage of the battery or a reference output current; Based on the current reduction data and the reference information, determine the current output current of the second electronic device.
10. The electronic device according to claim 9, wherein The processing module is configured to: Compare the reference information with the reference information sent to the second electronic device last time; In the case where it is determined that the reference information is different from the reference information sent to the second electronic device last time, send the reference information to the second electronic device.
11. The electronic device according to claim 9 or 10, characterized in that, The reference information is the reference output current, and the reference output current is determined by the first electronic device based on first charging reference data, where the first charging reference data includes a plurality of voltages and corresponding plurality of currents. The processing module is configured to: Send second charging reference data to the second electronic device, where the second charging reference data includes at least one voltage and at least one corresponding current, and the at least one voltage is greater than the maximum voltage of the battery; Determine a first output current from the current reduction data, where the first output current is the output current corresponding to a first preset moment in the current reduction data, and the first preset moment is the acquisition moment of the current output current or the moment in the current reduction data that is separated from the acquisition moment by a preset time interval; In the case where it is determined that the first output current is less than the reference output current, determine that the current output current of the second electronic device is equal to the first output current; Or, In the case where it is determined that the first output current is greater than or equal to the reference output current, determine that the current output current of the second electronic device is equal to the reference output current.
12. The electronic device according to claim 9 or 10, characterized in that, The reference output current is less than or equal to a limit current, and the limit current is used to indicate the maximum current corresponding to the first electronic device when running at least one application.
13. The electronic device according to claim 9 or 10, characterized in that, The reference information is the current voltage of the battery. The processing module is configured to: Send first charging reference data to the second electronic device, where the first charging reference data includes a plurality of voltages and corresponding plurality of currents; Determine a first output current from the current reduction data, where the first output current is the output current corresponding to a first preset moment in the current reduction data, and the first preset moment is the acquisition moment of the current output current or the moment in the current reduction data that is separated from the acquisition moment by a preset time interval; Based on the first charging reference data, determine the current corresponding to the current voltage of the battery; In the case where it is determined that the first output current is less than the current corresponding to the current voltage of the battery, determine that the current output current of the second electronic device is equal to the first output current; Or, In the case where it is determined that the first output current is greater than or equal to the current corresponding to the current voltage of the battery, determine that the current output current of the second electronic device is equal to the current corresponding to the current voltage of the battery.
14. The electronic device according to claim 11, wherein The system power consumption satisfies the following formula: Psys = v bus *i bus *loss - v batt *i batt where Psys is the system power consumption, v bus is the current output voltage of the second electronic device, i bus is the current output current of the second electronic device, v batt is the current voltage of the battery, i batt is the current current of the battery, and loss is the path loss and the device conversion rate loss.
15. An electronic device, characterized in that, Comprising a processor and a memory, the memory is used for storing code instructions; the processor is used for running the code instructions to execute the method according to any one of claims 1 to 8.
16. A computer-readable storage medium, characterized in that, For storing a computer program, the computer program comprises instructions for implementing the method according to any one of claims 1 to 7.
17. A computer program product, which includes computer program code, characterized in that, When the computer program code runs on a computer, the computer is caused to implement the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Charging method and device, electronic equipment and medium
CN111293744A