Charging demand adaptation method, electronic device, and related medium and program product

By receiving and updating charging data packets, the compatibility issues between different USB PD protocol versions are resolved, and stable charging communication and efficient charging are achieved between devices.

CN115912529BActive Publication Date: 2025-10-24SHENZHEN INJOINIC TECH
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111393257.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-03
Publication Date
2025-10-24
Estimated Expiration
2041-08-03

AI Technical Summary

Technical Problem

Due to the poor compatibility between different versions of the USB PD protocol, communication is unstable during the charging process, and repeated charging interruptions are likely to occur.

Method used

By receiving the charging data packet sent by the second device, the charging requirement information and protocol version information are determined. If they do not match, the original broadcast data packet is updated to a broadcast data packet corresponding to the second type of charging data packet to achieve charging requirement adaptation between devices.

Benefits of technology

It improves the communication stability and compatibility between devices, and optimizes charging efficiency and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115912529B_ABST
    Figure CN115912529B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a charging demand adaptation method, an electronic device, and related media and program products. The method comprises: determining whether a first device can meet a charging demand of a second device according to charging demand information; when the first device cannot meet the charging demand of the second device, determining whether charging protocol version information is first preset version information and whether a charging data packet type is a first type; when the charging protocol version information is the first preset version information and the charging data packet type is the first type, updating an original broadcast data packet to a broadcast data packet corresponding to a second type of charging data packet to obtain a target broadcast data packet, the target broadcast data packet being used for the second device to update the charging data packet. The embodiments of the present application help to improve the communication stability and reliability between the first device and the second device, and are conducive to improving the compatibility between the first device and the second device.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of information processing, in particular to a charging demand adaptation method, an electronic device and related media and program products. BACKGROUND

[0002] With the rapid development of charger technology, multiple versions of Universal Serial Bus Power Delivery (USB PD) protocols have appeared, such as USB PD 2.0, USB PD 3.0, etc. Due to the different time of appearance of multiple versions of USB PD, the charging protocol in the powered device may be USB PD 2.0 version, and the charging protocol in the power adapter may be USB PD 3.0 version. The compatibility between the USB PD 2.0 version powered device and the USB PD 3.0 version adapter is poor, the communication is unstable during charging, and the phenomenon of repeated charging and discharging easily occurs. Therefore, how to improve the compatibility between the USB PD 2.0 version powered device and the USB PD 3.0 version adapter has become a problem to be solved. SUMMARY

[0003] The embodiments of the present application provide a charging demand adaptation method, an electronic device and related media and program products, which help to improve the communication stability and reliability between the first device and the second device, and are beneficial to improve the compatibility between the first device and the second device.

[0004] In a first aspect, the embodiments of the present application provide a charging demand adaptation method applied to a first device, and the method comprises:

[0005] receiving a charging data packet sent by a second device, the charging data packet comprising: charging demand information, charging protocol version information and charging data packet type;

[0006] judging whether the first device can meet the charging demand of the second device according to the charging demand information;

[0007] when the first device cannot meet the charging demand of the second device, judging whether the charging protocol version information is first preset version information and whether the charging data packet type is a first type;

[0008] when the charging protocol version information is the first preset version information and the charging data packet type is the first type, updating an original broadcast data packet to a broadcast data packet corresponding to a second type of the charging data packet to obtain a target broadcast data packet, the target broadcast data packet being used for the second device to update the charging data packet.

[0009] In a second aspect, an embodiment of the present application provides a charging demand adaptation apparatus applied to a first device, the apparatus comprising: a receiving unit, a judging unit and an updating unit, wherein

[0010] The receiving unit is configured to receive a charging data packet sent by a second device, the charging data packet comprising: charging demand information, charging protocol version information and charging data packet type.

[0011] The judging unit is configured to judge whether the first device can meet the charging demand of the second device according to the charging demand information.

[0012] The judging unit is further configured to judge whether the charging protocol version information is first preset version information and whether the charging data packet type is a first type when the first device cannot meet the charging demand of the second device.

[0013] The updating unit is configured to update an original broadcast data packet into a broadcast data packet corresponding to a second type of the charging data packet to obtain a target broadcast data packet when the charging protocol version information is the first preset version information and the charging data packet type is the first type, the target broadcast data packet being used for the second device to update the charging data packet.

[0014] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor, a memory, a communication interface and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the processor, and the programs comprise instructions for performing the steps in the first aspect of the embodiments of the present application.

[0015] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program for electronic data exchange, and the computer program causes a computer to perform some or all of the steps described in the first aspect of the embodiments of the present application.

[0016] In a fifth aspect, an embodiment of the present application provides a computer program product, wherein the computer program product includes a non-transitory computer readable storage medium storing a computer program, and the computer program is operable to cause a computer to perform some or all of the steps described in the first aspect of the embodiments of the present application. The computer program product can be a software installation package.

[0017] By implementing the embodiments of the present application, the following beneficial effects are achieved:

[0018] It can be seen that the charging demand adaptation method, the electronic device and the related product provided in the embodiments of the present application can receive the charging data packet sent by the second device, the charging data packet comprising: charging demand information, charging protocol version information and charging data packet type, judging whether the first device can meet the charging demand of the second device according to the charging demand information, when the first device cannot meet the charging demand of the second device, judging whether the charging protocol version information is the first preset version information and whether the charging data packet type is the first type, when the charging protocol version information is the first preset version information and the charging data packet type is the first type, updating the original broadcast data packet into a broadcast data packet corresponding to the second type of charging data packet to obtain a target broadcast data packet, the target broadcast data packet being used for the second device to update the charging data packet, so that the first device performs charging demand adaptation with the second device according to the updated charging data packet, which is beneficial to improving the communication stability and reliability between the first device and the second device, and is beneficial to improving the compatibility between the first device and the second device, and further helps to improve the charging efficiency. BRIEF DESCRIPTION OF DRAWINGS

[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or the prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0020] Figure 1A is a structural schematic diagram of an electronic device provided by an embodiment of the present application;

[0021] Figure 1B is a flowchart of a charging demand adaptation method provided by an embodiment of the present application;

[0022] Figure 2 is a flowchart of a charging demand adaptation method provided by an embodiment of the present application;

[0023] Figure 3 is a flowchart of a charging demand adaptation method provided by an embodiment of the present application;

[0024] Figure 4 is a structural schematic diagram of an electronic device provided by an embodiment of the present application;

[0025] Figure 5A is a functional unit composition block diagram of a charging demand adaptation apparatus provided by an embodiment of the present application;

[0026] Figure 5B is a functional unit composition block diagram of a charging demand adaptation apparatus provided by an embodiment of the present application. DETAILED DESCRIPTION

[0027] The terms "first," "second," and the like in the specification and claims of this application and the accompanying drawings are used to distinguish between different objects, not to describe a particular order. Furthermore, the terms "including," "having," and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or elements is not limited to the listed steps or elements but may optionally include steps or elements not listed, or may optionally include other steps or elements inherent to the process, method, product, or apparatus.

[0028] References herein to "embodiments" mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0029] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0030] The electronic devices involved in the embodiments of the present application may be portable electronic devices that include other functions such as personal digital assistants and / or music player functions, such as mobile phones, tablet computers, wearable electronic devices with wireless communication functions (such as smart watches), etc. Exemplary embodiments of portable electronic devices include but are not limited to portable electronic devices equipped with IOS systems, Android systems, Microsoft systems or other operating systems. The above-mentioned portable electronic devices may also be other portable electronic devices, such as laptop computers (Laptop), etc. It should also be understood that in some other embodiments, the above-mentioned electronic devices may not be portable electronic devices, but desktop computers. The electronic device may also include a server.

[0031] like Figure 1A As shown, Figure 1AFig. 1 is a structural schematic diagram of an electronic device provided by an embodiment of the present application. The electronic device includes a processor, a memory, and the like. The memory is connected to the processor. The processor is the control center of the electronic device, connects each part of the electronic device through various interfaces and lines, executes software programs and / or modules stored in the memory and calls data stored in the memory, processes various functions and data of the electronic device, and thus monitors and processes the electronic device as a whole. The processor can be a central processing unit (CPU), a graphics processing unit (GPU), or a neural-network processing unit (NPU).

[0032] Further, the processor can integrate an application processor and a modem processor. The application processor mainly processes an operating system, a user interface, and an application program, and the modem processor mainly processes wireless communication. It can be understood that the modem processor can also not be integrated into the processor.

[0033] The memory is used to store software programs and / or modules, and the processor executes various functions of the electronic device by running the software programs and / or modules stored in the memory. The memory can mainly include a program storage area and a data storage area. The program storage area can store an operating system, software programs required by at least one function, and the like; and the data storage area can store data created according to the use of the electronic device, and the like. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state memory device.

[0034] Based on the above Figure 1A The electronic device described above can execute the following charging demand adaptation method, and the specific steps are as follows:

[0035] receiving a charging data packet sent by a second device, the charging data packet including charging demand information, charging protocol version information, and a charging data packet type;

[0036] determining whether the first device can meet the charging demand of the second device according to the charging demand information;

[0037] when the first device cannot meet the charging demand of the second device, determining whether the charging protocol version information is first preset version information and whether the charging data packet type is a first type;

[0038] When the charging protocol version information is the first preset version information and the charging data packet type is the first type, an original broadcast data packet is updated into a broadcast data packet corresponding to the charging data packet of the second type to obtain a target broadcast data packet, and the target broadcast data packet is used for the second device to update the charging data packet.

[0039] It can be seen that the electronic device described in the embodiments of the present application can receive the charging data packet sent by the second device, the charging data packet including charging demand information, charging protocol version information and charging data packet type, determine whether the first device can meet the charging demand of the second device according to the charging demand information, when the first device cannot meet the charging demand of the second device, determine whether the charging protocol version information is the first preset version information and whether the charging data packet type is the first type, when the charging protocol version information is the first preset version information and the charging data packet type is the first type, update the original broadcast data packet into a broadcast data packet corresponding to the charging data packet of the second type to obtain a target broadcast data packet, and the target broadcast data packet is used for the second device to update the charging data packet, so that the first device performs charging demand adaptation with the second device according to the updated charging data packet, which is beneficial to improve the communication stability and reliability between the first device and the second device, and is beneficial to improve the compatibility between the first device and the second device, and further helps to improve the charging efficiency.

[0040] In addition, the electronic device described above can be the first device or the second device, which is not limited herein. When the electronic device is the first device, the electronic device can be a power adapter. When the electronic device is the second device, the electronic device can be a power-using device that charges using the power adapter.

[0041] Please refer to Figure 1B , Figure 1B is a flowchart of a charging demand adaptation method provided by the embodiments of the present application, as shown in the figure, applied to an electronic device as shown in Figure 1A , the present charging demand adaptation method includes:

[0042] 101, receiving a charging data packet sent by a second device, the charging data packet including charging demand information, charging protocol version information and charging data packet type.

[0043] In the embodiments of the present application, the first device described above can be a power adapter, and the second device described above can be a power-using device that charges using the power adapter, which is not limited herein.

[0044] The charging data packet sent by the second device includes charging demand information, charging protocol version information, and charging data packet type. The charging demand information can be target voltage, target current, and other parameter information required by the second device during charging, such as target voltage can be 5V, 9V, 12V, 20V, and the like, and target current can be 0.5A, 1A, 2A, 3A, 5A, and the like, which are not limited herein.

[0045] The charging protocol version information can be the charging protocol version configured by the second device, such as USB PD 2.0, USB PD 3.0, and the like, which are not limited herein.

[0046] The charging data packet type can be set according to the charging protocol. For example, when the charging protocol is USB PD protocol, the charging data packet type can be fixed voltage power supply data object (Fixed Supply Power Data Object, PDO) type, or programmable power supply augmented power data object (Programmable Power Supply Augmented Power Data Object, PPS) type, which are not limited herein.

[0047] 102. According to the charging demand information, it is judged whether the first device can meet the charging demand of the second device.

[0048] The charging demand of the second device can be the demand corresponding to the charging demand information. For example, the charging demand information indicates that the target voltage required by the second device during charging is 5V and the target current is 2A, and the corresponding charging demand is 5V and 2A.

[0049] 103. When the first device cannot meet the charging demand of the second device, it is judged whether the charging protocol version information is first preset version information and the charging data packet type is first type.

[0050] The first preset version information can be preset by an administrator or default by the system, which is not limited herein. For example, the first preset version information can be USB PD 2.0 or USB PD 3.0.

[0051] The first type can be preset by an administrator or default by the system, which is not limited herein. For example, when the charging protocol is USB PD protocol, the first type can be PDO type or PPS type, which are not limited herein.

[0052] For example, the first preset version information can be USB PD 2.0, and the first type can be PPS type. That is, when the first device cannot meet the charging demand of the second device, it is determined whether the charging protocol version information is USB PD 2.0 version and whether the charging data packet type is PPS type.

[0053] In the related art, when the charging protocol corresponding to the second device is USB PD 2.0 version, the charging data packet sent by the second device to the first device is a PDO type charging data packet. When the charging protocol corresponding to the second device is USB PD 3.0 version, the charging data packet sent by the second device to the first device can be a PPS type charging data packet or a PDO type charging data packet.

[0054] Further, the situation in which the first device cannot meet the charging demand of the second device can be roughly divided into three categories: the output voltage provided by the first device does not match the target voltage required by the second device, the output current provided by the first device does not match the target current required by the second device, and the charging data packet type of the second device does not match the charging protocol version information corresponding to the second device. Among them, in the case where the charging data packet type of the second device does not match the charging protocol version information corresponding to the second device, if the output voltage and the output current provided by the first device can still meet the target voltage and the target current required by the second device, it is still considered that the first device can meet the charging demand of the second device.

[0055] When a first USB PD 3.0 device charges a second USB PD 2.0 device, the first USB PD 3.0 device sends a PPS-type advertising packet to the second USB PD 2.0 device. The second USB PD 2.0 device generates a PPS-type charging packet based on the PPS-type advertising packet and sends the PPS-type charging packet back to the first USB PD 3.0 device. During this process, some second USB PD 2.0 devices fail to recognize the PPS-type advertising packet sent by the first USB PD 3.0 device. As a result, the charging packet sent by the second USB PD 2.0 device to the first USB PD 3.0 device is a PPS-type charging packet containing incorrect charging request information. In other words, the charging packet is erroneous. Upon receiving the erroneous charging packet, the first USB PD 3.0 device rejects the charging request from the second USB PD 2.0 device and resends the PPS-type advertising packet to the second USB PD 2.0 device. When a USB PD 2.0 device receives a PPS-type broadcast packet, it will still generate an erroneous charging packet. This cycle repeats, causing unstable communication between the USB PD 3.0 device and the USB PD 2.0 device during charging, leading to repeated charging interruptions. This affects the charging efficiency and performance of the second device, and affects user satisfaction.

[0056] In addition, if the first device can meet the charging requirements of the second device, there is no need to determine the charging protocol version information and charging data packet type of the second device, and the voltage and current can be directly provided to the second device according to the charging requirements of the second device.

[0057] 104. When the charging protocol version information is the first preset version information and the charging data packet type is the first type, the original broadcast data packet is updated to a broadcast data packet corresponding to the second type of charging data packet to obtain a target broadcast data packet, and the target broadcast data packet is used by the second device to update the charging data packet.

[0058] For example, the first preset version information can be USB PD 2.0, the first type can be the PPS type, and the second type can be the PDO type. In a case where the first device cannot meet the charging demand of the second device, the charging protocol version information is the USB PD 2.0 version, and the charging data packet type is the PPS type, the original broadcast data packet sent by the first device is updated to a broadcast data packet corresponding to the PDO type, that is, a target broadcast data packet. The first device sends the target broadcast data packet to the second device, so that the second device updates the type of the charging data packet to the PDO type, and sends the charging data packet of the PDO type to the first device. In this way, the type of the broadcast data packet sent by the first device can be adjusted, so that the first device and the second device use the same type of broadcast data packet and charging data packet for charging, that is, when the charging protocol version information of the second device is the USB PD 2.0 version, the first device and the second device use the broadcast data packet and the charging data packet of the PDO type for charging, which helps the first device to establish relatively stable charging communication with the second device, improves the charging efficiency of the second device, and optimizes the user experience.

[0059] It can be seen that in the embodiments of the present application, the electronic device can receive the charging data packet sent by the second device, the charging data packet comprising: charging demand information, charging protocol version information and charging data packet type, according to the charging demand information, judging whether the first device can meet the charging demand of the second device, when the first device cannot meet the charging demand of the second device, judging whether the charging protocol version information is the first preset version information, and whether the charging data packet type is the first type, when the charging protocol version information is the first preset version information, and the charging data packet type is the first type, updating the original broadcast data packet to the broadcast data packet corresponding to the charging data packet of the second type, obtaining the target broadcast data packet, the target broadcast data packet is used for the second device to update the charging data packet, in this way, the first device adapts to the charging demand according to the updated charging data packet and the second device, which is beneficial to improve the communication stability and reliability between the first device and the second device, and is beneficial to improve the compatibility between the first device and the second device, and further helps to improve the charging efficiency.

[0060] In one possible example, before the step 101 of judging whether the first device can meet the charging demand of the second device, the method can further include the following steps:

[0061] 01, obtaining flag information;

[0062] 02, when the flag information indicates the first state, determining that the broadcast data packet corresponding to the charging data packet of the first type is the original broadcast data packet;

[0063] 03、in the second state, the broadcast data packet corresponding to the second type of charging data packet is determined as the original broadcast data packet;

[0064] 04、sending the original broadcast data packet to the second device.

[0065] The flag information can be used to indicate the type of the broadcast data packet sent by the first device to the second device. For example, when the first device sends a broadcast data packet corresponding to a PDO type of charging data packet, i.e. a PDO type of broadcast data packet, the flag information is 0. For another example, when the first device sends a broadcast data packet corresponding to a PPS type of charging data packet, i.e. a PPS type of broadcast data packet, the flag information is 1. It can be understood that the flag information can also be in other forms, such as high level and low level, which are not limited herein.

[0066] The first state can be a state where the flag information is 1. When the flag information is 1, the broadcast data packet corresponding to the PPS type of charging data packet is determined as the original broadcast data packet, i.e. the PPS type of broadcast data packet is determined as the original broadcast data packet.

[0067] The second state can be a state where the flag information is 0. When the flag information is 0, the broadcast data packet corresponding to the PDO type of charging data packet is determined as the original broadcast data packet, i.e. the PDO type of broadcast data packet is determined as the original broadcast data packet.

[0068] Specifically, after determining the original broadcast data packet, the original broadcast data packet is sent to the second device, and it is determined whether the first feedback information sent by the second device is received within a first preset time period. The first feedback information is used to indicate that the second device has received the broadcast data packet sent by the first device. If the first feedback information sent by the second device is received within the first preset time period, it is considered that the first device and the second device successfully establish communication, and it is determined whether the charging data packet sent by the second device is received within a second preset time period.

[0069] The first preset time period can be set according to the processor performance of the first device and / or the second device, the charging protocol version and other factors, which are not limited herein, for example, it can be 0.5 milliseconds, 0.9 milliseconds, 1 millisecond, 1.1 milliseconds, 1.5 milliseconds, etc. The second preset time period can be set according to the processor performance of the first device and / or the second device, the charging protocol version and other factors, which can be the same as or different from the first preset time period, which are not limited herein, for example, it can be 20 milliseconds, 24 milliseconds, 30 milliseconds, 36 milliseconds, etc.

[0070] In the first preset time period, if the first device does not receive the first feedback information sent by the second device, the corresponding broadcast data packet is determined according to the flag bit information, the original broadcast data packet is sent to the second device again, and the number of times of sending the original broadcast data packet when the first device does not receive the first feedback information sent by the second device is recorded. When the number of sending times exceeds the first preset number of times, the sending of the original broadcast data packet to the second device is stopped. The first preset number of times can be set according to the processor performance of the first device and / or the second device, the charging protocol version and other factors, which are not limited here. For example, when the charging protocol version information corresponding to the first device is USB PD 3.0, the first preset number of times can be 150 times. When the charging protocol version information corresponding to the first device is USB PD 2.0, the first preset number of times can be 200 times.

[0071] In the second preset time period, if the first device does not receive the charging data packet sent by the second device, the corresponding broadcast data packet is determined according to the flag bit information, the original broadcast data packet is sent to the second device again, and the number of times of sending the original broadcast data packet when the first device does not receive the charging data packet sent by the second device is recorded. When the number of sending times exceeds the second preset number of times, the sending of the original broadcast data packet to the second device is stopped. The preset number of times can be set according to the processor performance of the first device and / or the second device, the charging protocol version and other factors, which are not limited here. For example, when the charging protocol version information corresponding to the first device is USB PD 3.0, the second preset number of times can be 150 times. When the charging protocol version information corresponding to the first device is USB PD 2.0, the second preset number of times can be 200 times.

[0072] When the charging data packet sent by the second device is received in the second preset time period, whether the first device can meet the charging demand of the second device is judged according to the charging information in the charging data packet. When the first device cannot meet the charging demand of the second device, whether the charging protocol version information is the first preset version information and whether the charging data packet type is the first type are judged. When the charging protocol version information is the first preset version information and the charging data packet type is the first type, the original broadcast data packet is updated to the broadcast data packet corresponding to the second type of charging data packet to obtain the target broadcast data packet.

[0073] It can be seen that in the embodiment of the present application, the flag bit information can be acquired, when the flag bit information indicates the first state, it is determined that the broadcast data packet corresponding to the first type of charging data packet is the original broadcast data packet, when the flag bit information indicates the second state, it is determined that the broadcast data packet corresponding to the second type of charging data packet is the original broadcast data packet, and the original broadcast data packet is sent to the second device. In this way, the first device can directly determine the original broadcast data packet according to the flag bit information, the process of judging the charging protocol version information and the charging data packet type is reduced, and the communication efficiency of the first device and the second device is improved.

[0074] In one possible example, after the step 104, when the charging protocol version information is the first preset version information and the charging data packet type is the first type, the original broadcast data packet is updated to the broadcast data packet corresponding to the second type of charging data packet to obtain a target broadcast data packet, the method further includes the following steps:

[0075] 105. Update the flag bit information according to the target broadcast data packet.

[0076] Specifically, the initial state of the flag bit information can be the first state. That is to say, when the first device sends the original broadcast data packet to the second device for the first time, the broadcast data packet corresponding to the first type of charging data packet can be sent.

[0077] After the first device receives the communication established with the second device, if the first device cannot meet the communication demand of the second device, and the charging protocol version information of the second device is the first preset version information and the charging data packet type of the second device is the first type, the original broadcast data packet is updated to the broadcast data packet corresponding to the second type of charging data packet to obtain a target broadcast data packet, and the flag bit information is updated to the second state.

[0078] The first device sends the target broadcast data packet to the second device, and judges whether the first feedback information sent by the second device is received within the first preset time length. If not, at this time, the corresponding original broadcast data packet can be sent to the second device according to the updated flag bit information.

[0079] It can be seen that in the embodiment of the present application, the flag bit information is updated according to the target broadcast data packet, so that the first device can directly determine the original broadcast data packet according to the flag bit information, the process of judging the charging protocol version information and the charging data packet type is reduced, and the communication efficiency of the first device and the second device is improved.

[0080] In one possible example, the step 102 of judging whether the first device can meet the charging demand of the second device according to the charging demand information can include the following steps:

[0081] 1021、according to the charging demand information, obtaining a target voltage and a target current required by the second device;

[0082] 1022, obtaining an output voltage and an output current corresponding to the first device;

[0083] 1023, when the output voltage and the target voltage satisfy a first preset relationship, and the output current and the target current satisfy a second preset relationship, determining that the first device meets the charging demand of the second device.

[0084] Specifically, when the output voltage and the target voltage satisfy the first preset relationship, and the output current and the target current satisfy the second preset relationship, it is determined that the first device meets the charging demand of the second device. When the first device meets the charging demand of the second device, the first device sends second feedback information to the second device, and the second feedback information is used to indicate that the first device can meet the charging demand of the second device.

[0085] After the second device receives the second feedback information sent by the first device, the second device sends third feedback information to the first device, and the third feedback information is used to indicate that the second device has received the second feedback information sent by the first device. At this point, the first device and the second device enter a charging preparation state respectively, and the first device starts charging the second device.

[0086] It can be seen that in the embodiment of the application, according to the charging demand information, the target voltage and the target current required by the second device are obtained, the output voltage and the output current corresponding to the first device are obtained, and when the output voltage and the target voltage satisfy the first preset relationship, and the output current and the target current satisfy the second preset relationship, it is determined that the first device meets the charging demand of the second device. In this way, when it is determined that the first device can meet the charging demand of the second device, the second device is charged according to the charging demand of the second device, which helps to improve the charging efficiency and optimize the user experience.

[0087] In one possible example, the first preset relationship is:

[0088] U o = U t × (1 + I t / I o ) × P;

[0089] The second preset relationship is:

[0090] I o = I t × (1 + U t / U o ) × P;

[0091] Wherein, Ut U is the target voltage for the second device o I is the output current of the first device t I is the target current for the second device o I is the output current of the first device, and P is a circuit impact factor of the first device circuit.

[0092] The circuit impact factor can be determined according to factors such as part parameters, processor performance, and part aging degree of the first device circuit, which are not limited herein, and can be 0.81, 0.9, 0.98, etc.

[0093] For example, the charging demand information can be obtained according to the charging gear sent by the second device, and the target voltage U t is 5V, and the target current I t is 2A, and the output voltage U o of the first device is obtained. o is 7V, and the output current I o is 2.5A, and the circuit impact factor P of the first device circuit is 0.8. The above values are brought into the first preset relationship, and it can be obtained that the output voltage U t does not satisfy the first preset relationship, and the output current I o does not satisfy the second preset relationship. t

[0094] It can be understood that the output voltage U o and the output current I o obtained according to the first preset relationship and the second preset relationship are compared with the actual voltage U r and the actual current I r that the first device can actually output. If the voltage error and the current error are within the preset error range, it can still be considered that the first device can meet the charging demand of the second device.

[0095] The voltage error can be the ratio of the actual voltage to the output voltage, and the current error can be the ratio of the actual current to the output current. The preset error range can be set according to factors such as circuit performance and processor performance of the first device and the second device, which are not limited herein, and can be 95%, 90%, 85%, 80%, etc.

[0096] The preset error range of the voltage can be calculated according to the following steps:

[0097] The voltage mean and the voltage mean square error are determined according to the output voltage and the actual voltage.

[0098] The target voltage utility value corresponding to the voltage mean is determined according to the first mapping relationship between the preset voltage mean and the voltage utility value.​

[0099] Determining a target fine-tuning coefficient corresponding to the voltage mean square error according to a preset second mapping relationship between the voltage mean square error and the fine-tuning coefficient;

[0100] The target voltage utility value is adjusted according to the target fine-tuning coefficient to obtain a preset error range of the voltage.

[0101] The electronic device may pre-store a first mapping relationship between a preset voltage mean and a utility value, and a second mapping relationship between a preset voltage mean square error and a fine-tuning coefficient. The voltage utility value may be used to represent the effective value of the output voltage. The fine-tuning coefficient may be used to adjust the target voltage utility value based on the voltage mean square error to determine a preset error range. The fine-tuning coefficient may be set by an administrator or by system default. The fine-tuning coefficient may be set based on factors such as the circuit performance and processor performance of the first and second devices, and is not limited here. For example, it may be 1.8, 1.2, 0.98, 0.9, 0.85, 0.61, etc.

[0102] For example, according to the output voltage U o and the actual voltage U r , determine the voltage mean value and target mean square error According to the first mapping relationship between the preset voltage mean value and the voltage utility value, the voltage mean value is determined The corresponding target voltage utility value a is determined according to the second mapping relationship between the voltage mean square error and the fine-tuning coefficient, and the target fine-tuning coefficient b corresponding to the voltage mean square error σ is determined. By adjusting the target voltage utility value a according to the target fine-tuning coefficient b, the preset voltage error range c can be obtained. The specific calculation formula can be: It is understandable that when the value range of the fine-tuning coefficient b changes, the corresponding preset error range c will also be different.

[0103] Similarly, the preset error range of the current can be calculated according to the following steps:

[0104] Determine the current mean value and the current mean square error according to the output current and the actual current;

[0105] Determining a target current utility value corresponding to the current mean value according to a preset third mapping relationship between the current mean value and the current utility value;

[0106] Determining a target fine-tuning coefficient corresponding to the current mean square error according to a preset fourth mapping relationship between the current mean square error and the fine-tuning coefficient;

[0107] The target current utility value is adjusted according to the target fine-tuning coefficient to obtain a preset error range of the current.

[0108] The third mapping relationship between the preset current mean value and the current utility value and the fourth mapping relationship between the preset current mean square error and the fine-tuning coefficient can be pre-stored in the electronic device. The current utility value can be used to represent the effective value of the output current. The fine-tuning coefficient can be used to adjust the target current utility value according to the current mean square error to determine the preset error range. The fine-tuning coefficient can be set by the administrator or by default by the system. The fine-tuning coefficient can be set according to the circuit performance, processor performance, and other factors of the first device and the second device, which are not limited herein, for example, 1.8, 1.2, 0.98, 0.9, 0.85, 0.61, etc.

[0109] The preset error range of the current and the preset error range of the voltage have the same calculation formula principle. For details, refer to the embodiments of the preset error range of the voltage. That is, the preset error range of the current = (1 + target fine-tuning coefficient) / target current utility value. Details are not repeated here.

[0110] As can be seen, in the present application, the target fine-tuning coefficient, the target voltage utility value, and the target current utility value are used to adjust the preset error range, which is beneficial to flexibly adjust the situation that the first device meets the charging demand of the second device, and when it is determined that the first device can meet the charging demand of the second device, the second device is charged according to the charging demand of the second device, which helps to improve the charging efficiency and optimize the user experience.

[0111] In one possible example, the step 103 of determining whether the charging protocol version information is the first preset version information and whether the charging data packet type is the first type includes the following steps:

[0112] 1031. When the charging protocol version information is not the first preset version information and / or the charging data packet type is not the first type, the original broadcast data packet is updated according to the charging demand information to obtain the target broadcast data packet.

[0113] Specifically, when the charging protocol version information is not the first preset version information and / or the charging data packet type is not the first type, it indicates that the reason why the first device does not meet the charging demand of the second device is not that the charging protocol versions of the first device and the second device are incompatible, but that the output voltage provided by the first device fails to match the target voltage required by the second device, or the output current provided by the first device fails to match the target current. Therefore, at this time, the output voltage and the output current in the original broadcast data packet can be updated according to the charging demand information corresponding to the second device to obtain the target broadcast data packet, and the target broadcast data packet is sent to the second device.

[0114] It can be seen that, in the embodiment of the application, when the charging protocol version information is not the first preset version information or the charging data packet type is not the first type, the original broadcast data packet is updated according to the charging demand information to obtain a target broadcast data packet. In this way, the first device can adapt to the charging demand of the second device according to the updated charging data packet, thereby helping to improve the charging efficiency.

[0115] Consistent with the above Figure 1B described embodiment, please refer to Figure 2 , Figure 2 is a flowchart of a charging demand adaptation method provided by an embodiment of the application, applied to an electronic device as shown in Figure 1A , the charging demand adaptation method comprises the following steps:

[0116] 201, obtaining flag bit information.

[0117] 202, when the flag bit information indicates a first state, determining that a broadcast data packet corresponding to the first type of charging data packet is the original broadcast data packet.

[0118] 203, when the flag bit information indicates a second state, determining that a broadcast data packet corresponding to the second type of charging data packet is the original broadcast data packet.

[0119] 204, sending the original broadcast data packet to a second device.

[0120] 205, receiving a charging data packet sent by the second device, the charging data packet comprising charging demand information, charging protocol version information and charging data packet type.

[0121] 206, according to the charging demand information, judging whether the first device can meet the charging demand of the second device.

[0122] 207, when the first device cannot meet the charging demand of the second device, judging whether the charging protocol version information is a first preset version information and whether the charging data packet type is a first type.

[0123] 208, when the charging protocol version information is the first preset version information and the charging data packet type is the first type, updating the original broadcast data packet to a broadcast data packet corresponding to the second type of charging data packet to obtain a target broadcast data packet, the target broadcast data packet being used for the second device to update the charging data packet.

[0124] Among them, the specific description of the above steps 201-208 can refer to the corresponding steps of the charging demand adaptation method described above Figure 1B , which will not be described here.

[0125] It can be seen that the charging demand adaptation method described in the embodiments of the present application, the electronic device can obtain flag bit information, when the flag bit information indicates the first state, determine that the broadcast data packet corresponding to the first type of charging data packet is the original broadcast data packet, when the flag bit information indicates the second state, determine that the broadcast data packet corresponding to the second type of charging data packet is the original broadcast data packet, send the original broadcast data packet to the second device, receive the charging data packet sent by the second device, the charging data packet includes: charging demand information, charging protocol version information and charging data packet type, according to the charging demand information, judge whether the first device can meet the charging demand of the second device, when the first device cannot meet the charging demand of the second device, judge whether the charging protocol version information is the first preset version information and the charging data packet type is the first type, when the charging protocol version information is the first preset version information and the charging data packet type is the first type, update the original broadcast data packet to the broadcast data packet corresponding to the second type of charging data packet, get the target broadcast data packet, the target broadcast data packet is used for the second device to update the charging data packet, so that the first device adapts the charging demand with the second device according to the updated charging data packet, which is beneficial to improve the communication stability and reliability between the first device and the second device, and is beneficial to improve the compatibility between the first device and the second device, and further helps to improve the charging efficiency.

[0126] Consistent with the above Figure 1B Embodiments, please refer to Figure 3 , Figure 3 is a flowchart of a charging demand adaptation method provided by the embodiments of the present application, applied to an electronic device as shown in Figure 1A The charging demand adaptation method comprises the following steps:

[0127] 301, obtaining flag bit information.

[0128] 302, when the flag bit information indicates the first state, determine that the broadcast data packet corresponding to the first type of charging data packet is the original broadcast data packet.

[0129] 303, when the flag bit information indicates the second state, determine that the broadcast data packet corresponding to the second type of charging data packet is the original broadcast data packet.

[0130] 304, send the original broadcast data packet to the second device.

[0131] 305, receiving the charging data packet sent by the second device, the charging data packet includes: charging demand information, charging protocol version information and charging data packet type.

[0132] 306. Determine whether the first device can meet the charging requirement of the second device according to the charging requirement information.

[0133] 307. When the first device cannot meet the charging requirement of the second device, determine whether the charging protocol version information is first preset version information and the charging data packet type is a first type.

[0134] 308. When the charging protocol version information is the first preset version information and the charging data packet type is the first type, update the original broadcast data packet to a broadcast data packet corresponding to a second type of the charging data packet to obtain a target broadcast data packet, and the target broadcast data packet is used for the second device to update the charging data packet.

[0135] 309. Update the flag bit information according to the target broadcast data packet.

[0136] The specific description of steps 301-309 above can be referred to Figure 1B The corresponding steps of the charging requirement adaptation method described above will not be repeated here.

[0137] It can be seen that in the charging requirement adaptation method described in the embodiments of the present application, the electronic device can obtain flag bit information, when the flag bit information indicates a first state, determine that a broadcast data packet corresponding to a first type of charging data packet is an original broadcast data packet, when the flag bit information indicates a second state, determine that a broadcast data packet corresponding to a second type of charging data packet is an original broadcast data packet, send the original broadcast data packet to a second device, receive a charging data packet sent by the second device, the charging data packet includes charging requirement information, charging protocol version information and charging data packet type, according to the charging requirement information, determine whether the first device can meet the charging requirement of the second device, when the first device cannot meet the charging requirement of the second device, determine whether the charging protocol version information is first preset version information and the charging data packet type is a first type, when the charging protocol version information is the first preset version information and the charging data packet type is the first type, update the original broadcast data packet to a broadcast data packet corresponding to a second type of the charging data packet to obtain a target broadcast data packet, and the target broadcast data packet is used for the second device to update the charging data packet, and update the flag bit information according to the target broadcast data packet, so that the first device adapts to the charging requirement of the second device according to the updated charging data packet, which is conducive to improving the communication stability and reliability between the first device and the second device, and is conducive to improving the compatibility between the first device and the second device, and thus is conducive to improving the charging efficiency.

[0138] Inconsistent with the above embodiments, please refer to Figure 4 , Figure 4A structure schematic diagram of an electronic device is provided in the embodiments of the present application, as shown in the figure, the electronic device comprises a processor, a memory, a communication interface and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the processor, in the embodiments of the present application, the electronic device comprises a first device, and the programs comprise instructions for performing the following steps:

[0139] receiving a charging data packet sent by a second device, the charging data packet comprising: charging demand information, charging protocol version information and charging data packet type;

[0140] determining whether the first device can meet the charging demand of the second device according to the charging demand information;

[0141] when the first device cannot meet the charging demand of the second device, determining whether the charging protocol version information is first preset version information and whether the charging data packet type is a first type;

[0142] when the charging protocol version information is the first preset version information and the charging data packet type is the first type, updating an original broadcast data packet to a broadcast data packet corresponding to a second type of the charging data packet to obtain a target broadcast data packet, the target broadcast data packet being used for the second device to update the charging data packet.

[0143] It can be seen that the electronic device described in the embodiments of the present application can receive a charging data packet sent by a second device, the charging data packet comprising: charging demand information, charging protocol version information and charging data packet type, determine whether the first device can meet the charging demand of the second device according to the charging demand information, when the first device cannot meet the charging demand of the second device, determine whether the charging protocol version information is first preset version information and whether the charging data packet type is a first type, when the charging protocol version information is the first preset version information and the charging data packet type is the first type, update an original broadcast data packet to a broadcast data packet corresponding to a second type of the charging data packet to obtain a target broadcast data packet, the target broadcast data packet being used for the second device to update the charging data packet, so that the first device adapts to the charging demand of the second device according to the updated charging data packet, which is conducive to improving the communication stability and reliability between the first device and the second device, improving the compatibility between the first device and the second device, and further improving the charging efficiency.

[0144] In one possible example, before the determination of whether the first device can meet the charging demand of the second device, the programs further comprise instructions for performing the following steps:

[0145] obtaining flag information;

[0146] determining that a broadcast data packet corresponding to the first type of charging data packet is the original broadcast data packet when the flag bit information indicates a first state;

[0147] determining that a broadcast data packet corresponding to the second type of charging data packet is the original broadcast data packet when the flag bit information indicates a second state;

[0148] sending the original broadcast data packet to the second device.

[0149] In one possible example, when the charging protocol version information is the first preset version information and the charging data packet type is the first type, the above procedure includes instructions for performing the following steps after updating the original broadcast data packet to a target broadcast data packet corresponding to the second type of charging data packet:

[0150] updating the flag bit information according to the target broadcast data packet.

[0151] In one possible example, in terms of judging whether the first device can meet the charging demand of the second device according to the charging demand information, the above procedure includes instructions for performing the following steps:

[0152] obtaining a target voltage and a target current required by the second device according to the charging demand information;

[0153] obtaining an output voltage and an output current corresponding to the first device;

[0154] determining that the first device meets the charging demand of the second device when the output voltage and the target voltage meet a first preset relationship and the output current and the target current meet a second preset relationship.

[0155] In one possible example, the first preset relationship is:

[0156] U o = U t × (1 + I t / I o ) × P;

[0157] The second preset relationship is:

[0158] I o = I t × (1 + U t / U o ) × P;

[0159] wherein U t is the target voltage, Uo is the output voltage, I t is the target current, I o is the output current, P is a circuit impact factor of the first device circuit.

[0160] In one possible example, when the charging protocol version information is the first preset version information and the charging data packet type is the first type, the original broadcast data packet is updated into a broadcast data packet corresponding to the charging data packet of the second type, to obtain a target broadcast data packet, and the above procedure further includes instructions for performing the following steps:

[0161] When the charging protocol version information is not the first preset version information or the charging data packet type is not the first type, the original broadcast data packet is updated according to the charging demand information to obtain the target broadcast data packet.

[0162] The above mainly describes the scheme of the embodiments of the present application from the perspective of the method execution process. It can be understood that, in order to implement the above functions, it includes the hardware structure and / or software module corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the unit and algorithm steps of each example described in the embodiments provided herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is implemented in hardware or computer software driven hardware depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods for each specific application to implement the described functions, but such implementation should not be considered beyond the scope of the present application.

[0163] The embodiments of the present application can divide the functional units according to the above method examples, for example, each functional unit can be divided according to each function, or two or more functions can be integrated in one processing unit. The above integrated unit can be realized in the form of hardware or software functional unit. It should be noted that the division of units in the embodiments of the present application is illustrative, and is only a logical function division. When actually implemented, there can be another division method.

[0164] Please refer to Figure 5A , Figure 5A is a functional unit composition block diagram of the charging demand adaptation device 500 involved in the embodiments of the present application, the device 500 includes a receiving unit 501, a judging unit 502 and an updating unit 503, wherein,

[0165] The receiving unit 501 is configured to receive a charging data packet sent by a second device, and the charging data packet includes charging demand information, charging protocol version information and charging data packet type.

[0166] The determining unit 502 is configured to determine, based on the charging requirement information, whether the first device can meet the charging requirement of the second device;

[0167] The determining unit 502 is further configured to determine whether the charging protocol version information is the first preset version information and whether the charging data packet type is the first type when the first device cannot meet the charging demand of the second device;

[0168] The update unit 503 is used to update the original broadcast data packet to a broadcast data packet corresponding to the second type of charging data packet when the charging protocol version information is the first preset version information and the charging data packet type is the first type, to obtain a target broadcast data packet, and the target broadcast data packet is used by the second device to update the charging data packet.

[0169] It can be seen that the charging demand adaptation device described in the embodiment of the present application can receive a charging data packet sent by the second device, and the charging data packet includes: charging demand information, charging protocol version information and charging data packet type. According to the charging demand information, it is determined whether the first device can meet the charging demand of the second device. When the first device cannot meet the charging demand of the second device, it is determined whether the charging protocol version information is the first preset version information and whether the charging data packet type is the first type. When the charging protocol version information is the first preset version information and the charging data packet type is the first type, the original broadcast data packet is updated to a broadcast data packet corresponding to the second type of charging data packet to obtain a target broadcast data packet. The target broadcast data packet is used for the second device to update the charging data packet. In this way, the first device adapts the charging demand with the second device according to the updated charging data packet, which is beneficial to improving the communication stability and reliability between the first device and the second device, and is beneficial to improving the compatibility between the first device and the second device, thereby helping to improve the charging efficiency.

[0170] In one possible example, Figure 5B As shown above Figure 5A In comparison, the apparatus 500 may further include: an acquiring unit 504, a determining unit 505, and a sending unit 506, wherein:

[0171] The acquiring unit 504 is configured to acquire flag information:

[0172] The determining unit 505 is configured to determine, when the flag bit information indicates a first state, that the broadcast data packet corresponding to the first type of charging data packet is the original broadcast data packet;

[0173] The determining unit 505 is further configured to determine that a broadcast data packet corresponding to the second type of charging data packet is the original broadcast data packet when the flag bit information indicates a second state.

[0174] The sending unit 506 is configured to send the original broadcast data packet to the second device.

[0175] It can be seen that the charging demand adaptation device provided by the embodiments of the present application can obtain flag bit information, determine that a broadcast data packet corresponding to a first type of charging data packet is an original broadcast data packet when the flag bit information indicates a first state, determine that a broadcast data packet corresponding to a second type of charging data packet is the original broadcast data packet when the flag bit information indicates a second state, send the original broadcast data packet to a second device, receive a charging data packet sent by the second device, the charging data packet including charging demand information, charging protocol version information, and a charging data packet type, determine whether the first device can meet the charging demand of the second device according to the charging demand information, determine whether the charging protocol version information is first preset version information and whether the charging data packet type is a first type when the first device cannot meet the charging demand of the second device, update the original broadcast data packet to a broadcast data packet corresponding to the second type of charging data packet to obtain a target broadcast data packet when the charging protocol version information is the first preset version information and the charging data packet type is the first type, and the target broadcast data packet is used for the second device to update the charging data packet. In this way, the first device can adapt to the charging demand of the second device according to the updated charging data packet, which is conducive to improving the communication stability and reliability between the first device and the second device, is conducive to improving the compatibility between the first device and the second device, and is further conducive to improving the charging efficiency.

[0176] In a possible example, after the charging protocol version information is the first preset version information and the charging data packet type is the first type, the original broadcast data packet is updated to a broadcast data packet corresponding to the second type of charging data packet to obtain a target broadcast data packet, the updating unit 503 is specifically further configured to:

[0177] update the flag bit information according to the target broadcast data packet.

[0178] In a possible example, in terms of determining whether the first device can meet the charging demand of the second device according to the charging demand information, the determining unit 502 is specifically further configured to:

[0179] obtain a target voltage and a target current required by the second device according to the charging demand information;

[0180] obtain an output voltage and an output current corresponding to the first device.

[0181] determining that the first device meets the charging demand of the second device when the output voltage meets the first preset relationship with the target voltage and the output current meets the second preset relationship with the target current.

[0182] In one possible example, when the charging protocol version information is the first preset version information and the charging data packet type is the first type, the updating unit 503 is specifically configured to update the original broadcast data packet to a broadcast data packet corresponding to the charging data packet of a second type to obtain a target broadcast data packet.

[0183] When the charging protocol version information is not the first preset version information or the charging data packet type is not the first type, the updating unit 503 is configured to update the original broadcast data packet according to the charging demand information to obtain the target broadcast data packet.

[0184] It can be understood that the functions of the program modules of the charging demand adaptation apparatus in this embodiment can be specifically implemented according to the methods in the above method embodiments, and the specific implementation process can be referred to the related description of the above method embodiments, which will not be described here.

[0185] The embodiment of the present application further provides a computer storage medium, wherein the computer storage medium stores a computer program for electronic data exchange, and the computer program causes a computer to execute part or all steps of any method described in the above method embodiments, and the computer includes a control platform.

[0186] The embodiment of the present application further provides a computer program product, and the computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute part or all steps of any method described in the above method embodiments. The computer program product can be a software installation package, and the computer includes a control platform.

[0187] It should be noted that, for the above method embodiments, in order to simply describe, they are all described as a series of action combinations, but those skilled in the art should know that the present application is not limited to the action sequence described, because according to the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification all belong to preferred embodiments, and the actions and modules involved are not necessarily necessary for the present application.

[0188] In the above embodiments, the description of each embodiment has its own emphasis, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments.

[0189] In several embodiments provided in the present application, it should be understood that the disclosed apparatus can be implemented in other manners. For example, the division of the apparatus embodiments described above is merely illustrative, and the division of the units can be changed according to actual needs. For example, the units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections can be indirect couplings or communication connections through some interfaces, devices or units, and can be in electrical, mechanical or other forms.

[0190] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, i.e., can be located in one place, or can be distributed on multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiments.

[0191] In addition, each functional unit in the various embodiments of the present application can be integrated into one processing unit, or each unit can exist physically, or two or more units can be integrated into one unit. The integrated unit can be implemented in the form of hardware or in the form of a software functional unit.

[0192] The integrated unit, if implemented in the form of a software functional unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application, essentially or the part that makes a contribution to the prior art, or all or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a mobile hard disk, a magnetic disk or an optical disk, and various media that can store program codes.

[0193] Those of ordinary skill in the art can understand that all or part of the steps of the various methods in the above embodiments can be completed by a program instructing relevant hardware, and the program can be stored in a computer readable storage medium, which can include a flash disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, etc.

[0194] The above has introduced the embodiments of the present application in detail, and the principles and implementation manners of the present application are described by applying specific examples; the above embodiment description is only for helping to understand the method of the present application and its core idea; meanwhile, for the general technical personnel in the art, according to the idea of the present application, the specific implementation manner and application range will have changes; and in view of the above, the content of the specification should not be understood as the limitation of the present application.

Claims

1. A charging demand adaptation method applied to a first device, characterized in that, The method comprises: receiving a charging data packet sent by a second device, the charging data packet comprising: charging requirement information, charging protocol version information and charging data packet type; determining whether the first device can meet the charging requirement of the second device according to the charging requirement information; when the first device cannot meet the charging requirement of the second device, determining whether the charging protocol version information is first preset version information and whether the charging data packet type is a first type; when the charging protocol version information is the first preset version information and the charging data packet type is the first type, updating an original broadcast data packet to a broadcast data packet corresponding to a second type of the charging data packet to obtain a target broadcast data packet, the target broadcast data packet being used for the second device to update the charging data packet.

2. The method of claim 1, wherein the first device is a power adapter, and before the determining whether the first device can meet the charging requirement of the second device, the method further comprises: obtaining flag bit information; when the flag bit information indicates a first state, determining that a broadcast data packet corresponding to the first type of charging data packet is the original broadcast data packet; when the flag bit information indicates a second state, determining that a broadcast data packet corresponding to the second type of charging data packet is the original broadcast data packet; sending the original broadcast data packet to the second device. After the updating the original broadcast data packet to the broadcast data packet corresponding to the second type of the charging data packet to obtain the target broadcast data packet when the charging protocol version information is the first preset version information and the charging data packet type is the first type, the method further comprises:

3. The method of claim 2, wherein, updating the flag bit information according to the target broadcast data packet. The determining whether the first device can meet the charging requirement of the second device according to the charging requirement information comprises:

4. The method according to any one of claims 1 to 3, characterized in that, obtaining a target voltage and a target current required by the second device according to the charging requirement information; obtaining an output voltage and an output current corresponding to the first device; when the output voltage and the target voltage satisfy a first preset relationship and the output current and the target current satisfy a second preset relationship, determining that the first device meets the charging requirement of the second device. The first preset relationship is:

5. The method of claim 4, wherein, The second preset relationship is: U o =U t ×(1+I t / I o )×P; The determining whether the charging protocol version information is first preset version information and whether the charging data packet type is a first type comprises: I o =I t ×(1+U t / U o )×P; where U t is the target voltage, U o is the output voltage, I t is the target current, I o is the output current, and P is a circuit impact factor of the first device circuit.

6. The method according to any one of claims 1 to 3, characterized in that, when the charging protocol version information is not the first preset version information and / or the charging data packet type is not the first type, updating the original broadcast data packet according to the charging requirement information to obtain the target broadcast data packet. The apparatus comprises a receiving unit, a determining unit and an updating unit, wherein:

7. A charging demand adaptation apparatus applied to a first device, characterized in that, the receiving unit is configured to receive a charging data packet sent by a second device, the charging data packet comprising: charging requirement information, charging protocol version information and charging data packet type; ​ The judging unit is configured to judge whether the first device can meet the charging demand of the second device according to the charging demand information. The judging unit is further configured to judge whether the charging protocol version information is first preset version information and whether the charging data packet type is a first type when the first device cannot meet the charging demand of the second device. The updating unit is configured to update an original broadcast data packet into a broadcast data packet corresponding to a second type of the charging data packet to obtain a target broadcast data packet when the charging protocol version information is the first preset version information and the charging data packet type is the first type, the target broadcast data packet being used by the second device to update the charging data packet.

8. An electronic device, comprising: A computer program product comprising computer readable instructions which, when executed by a computer, cause the computer to carry out the method of any of claims 1-6.

9. A computer-readable storage medium, characterized in that, A computer program for causing a computer to carry out the method of any of claims 1-6.

10. A computer program product, characterised in that, A computer program product for causing a computer to carry out the method of any of claims 1-6.

Citation Information

Patent Citations

  • Charging demand adaptation method, electronic equipment and related products

    CN113328505A