Charging method and device, data line, readable storage medium and program product

By detecting the power difference between the power supported by the data cable and the first-charge device, dynamically adjusting the charging power, and prioritizing the charging of the first-charge device, solving the problem of low charging efficiency of multi-port data cables, achieving faster charging speed and higher Overall charging efficiency.

CN119275961APending Publication Date: 2025-01-07SHENZHEN ROMOSS TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411128833.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-16
Publication Date
2025-01-07

AI Technical Summary

Technical Problem

The charging rate of multi-port data cables is low, especially when charging multiple different devices at the same time, the charging efficiency is not high.

Method used

By detecting the charging power difference between the first charging device and the last charging device, dynamically adjust the charging power, prioritize the charging device for the first charging device, and increase the charging power of the post-charging device when appropriate to improve the overall charging efficiency.

Benefits of technology

It improves the charging speed and overall charging efficiency of the data cable, reduces power loss, and adjusts the charging power distribution in accordance with the access sequence of different devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119275961A_ABST
    Figure CN119275961A_ABST
Patent Text Reader

Abstract

The invention relates to a charging method and device, a data line, a computer readable storage medium and a computer program product. The method comprises the following steps: detecting the charging power of pre-charging equipment to obtain the pre-charging power; determining post-charging power according to the power difference between the power supported by the data line and the pre-charging power; charging post-charging equipment through the data line according to the post-charging power; the pre-charging device is charged before the post-charging device, and the pre-charging device and the post-charging device are charged through different ports of the data line. By adopting the method, the charging efficiency can be guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of data lines, and in particular to a charging method, a device, a data line, a readable storage medium and a program product. Background Art

[0002] With the continuous development of data cables, data cables with multiple ports, i.e., multi-port data cables, have emerged. There are relatively many types of multi-port data cables, which seem practical, but have a low charging rate, especially when plugged into multiple different devices to be charged, and not much power can be charged in several hours.

[0003] In this case, how to increase the charging speed of the data cable is an issue worth considering. Summary of the invention

[0004] Based on this, it is necessary to provide a charging method, device, data cable, readable storage medium and computer program product to address the above technical problems.

[0005] In a first aspect, the present application provides a charging method, comprising:

[0006] Detecting the charging power of the first-charged device to obtain the first-charged power;

[0007] Determining a post-charging power according to a power difference between a power supported by the data line and the pre-charging power;

[0008] The post-charged device is charged via the data line according to the post-charged power; the first-charged device is charged before the post-charged device, and the first-charged device and the post-charged device are charged via different ports of the data line.

[0009] In one embodiment, determining the post-charging power according to the power difference between the power supported by the data line and the pre-charging power includes:

[0010] Determining the remaining power for the first charge according to the power difference between the power supported by the data line and the first charge power;

[0011] Detecting the charging power of the post-charging device to obtain the post-charging required power;

[0012] In a case where the pre-charging remaining power is greater than the post-charging required power, the post-charging power is determined according to the post-charging required power.

[0013] In one embodiment, the post-charging device includes a first post-charging device and a second post-charging device, the first post-charging device is connected to the data line before the second post-charging device, and the first post-charging device and the second post-charging device are charged through different ports of the data line;

[0014] The detecting the charging power of the post-charging device to obtain the post-charging required power includes:

[0015] Detecting the charging power of the first post-charging device to obtain a first post-charging required power;

[0016] The determining the post-charging power according to the post-charging required power includes:

[0017] determining the post-charging remaining power according to a power difference between the first-charging remaining power and the first post-charging required power;

[0018] In the case where the post-charging remaining power is greater than the first post-charging required power, determining the post-charging power of the first post-charging device according to the first post-charging required power, and detecting whether the data line is connected to the second post-charging device;

[0019] If the data cable is connected to the second post-charging device, the post-charging power of the second post-charging device is determined based on the power difference between the post-charging remaining power and the first post-charging required power.

[0020] In one embodiment, determining the post-charging power of the second post-charging device based on the power difference between the post-charging remaining power and the first post-charging required power includes:

[0021] Detecting the charging power of the second post-charging device to obtain a second post-charging required power;

[0022] When the post-charging remaining power is greater than the second post-charging required power, determining the post-charging power of the second post-charging device according to the second post-charging required power;

[0023] When the post-charging remaining power is less than or equal to the second post-charging required power, the post-charging power of the second post-charging device is determined according to the post-charging remaining power.

[0024] In one embodiment, the charging method further comprises:

[0025] When the first-charge remaining power is less than the post-charge required power, the post-charge power is determined according to the first-charge remaining power, until the first-charge remaining power is greater than the post-charge required power, and the post-charge power is determined according to the post-charge required power.

[0026] In one embodiment, determining the post-charging power according to the power difference between the power supported by the data line and the pre-charging power includes:

[0027] If the first-charge power is less than the power supported by the data line, determining the second-charge power according to the power difference between the power supported by the data line and the first-charge power;

[0028] The charging method further comprises:

[0029] If the pre-charging power is equal to the maximum power supported by the data line, the pre-charging power is maintained according to the power supported by the data line.

[0030] In a second aspect, the present application further provides a charging device, the device comprising:

[0031] The first charging power determination module is used to detect the charging power of the first charging device when charging the first charging device through the data line to obtain the first charging power;

[0032] A post-charging power determination module, used to determine the post-charging power according to the power difference between the power supported by the data line and the pre-charging power;

[0033] The post-charging device charging module is used to charge the post-charging device through the data line according to the post-charging power; the first-charging device is charged before the post-charging device, and the first-charging device and the post-charging device are charged through different ports of the data line.

[0034] In a third aspect, the present application further provides a data cable, including a controller and a charging cable, wherein the controller implements the steps of the charging method in any of the above embodiments when executing a computer program.

[0035] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the charging method in any of the above embodiments are implemented.

[0036] In a fifth aspect, the present application further provides a computer program product, wherein the computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the charging method in any of the above embodiments are implemented.

[0037] The above charging method, device, computer equipment, data line and computer program product refine the charging power related to the data line into at least two dimensions: the first charging power and the second charging power. Therefore, the charging power of the first charging device is detected to obtain the first charging power, so that the power of the first charging device and the overall charging power of the data line form two independent parts; and then, regardless of whether the second charging device is connected to the data line, the second charging power is determined according to the power difference between the power supported by the data line and the first charging power, so that the charging power of the data line has the dimension of the second charging power, and can also dynamically adjust the second charging power at an appropriate time according to the dynamic change of the first charging power, so as to increase the second charging power when the first charging power decreases. In this case, charging the second charging device through the data line according to the second charging power can make the electric energy transmitted by the data line output to the first charging device first, which not only improves the charging efficiency of the first charging device, but also improves the overall charging efficiency by reducing the electric energy loss through a larger power, and can also dynamically adjust the second charging power according to the dynamic change of the first charging power, so as to ensure the charging speed of the data line. In addition, the relative relationship between the first-charged device and the later-charged device can be adaptively adjusted by the order in which different devices are connected to the data lines, so as to adaptively adjust the charging power of the devices. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0039] Figure 1 is a schematic diagram of the structure of a data line in one embodiment;

[0040] Figure 2 is a schematic flow chart of a charging method in one embodiment;

[0041] Figure 3 A schematic diagram of a process for determining a post-charging power in one embodiment;

[0042] Figure 4 A schematic diagram of a charging method flow chart in which different post-charging devices are present in one embodiment;

[0043] Figure 5 is a schematic flow chart of a charging method in different situations in an embodiment;

[0044] Figure 6 This is a schematic diagram of the structure of a one-to-two data line in an embodiment;

[0045] Figure 7A schematic diagram of a flow chart of a charging method executed by two devices in one embodiment;

[0046] Figure 8 is a structural block diagram of a charging device in one embodiment;

[0047] Fig. 9 is an internal structure diagram of a computer device in one embodiment;

[0048] Fig.10 is a diagram of the internal structure of a computer-readable storage medium in one embodiment;

[0049] Fig.11 A structural block diagram of a computer program product in one embodiment.

[0050] 101-input power port; 102-output charging terminal; 910-processor; 920-memory; 930-input / output interface; 940-communication interface; 950-display unit; 960-input device; 970-system bus; 921-non-volatile storage medium; 922-internal memory; 9211-operating system; 9212-computer program; 1000-computer readable storage medium; 1001-processor; 1002-memory; 1100-computer program product. DETAILED DESCRIPTION

[0051] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. 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.

[0052] With the popularity of one-to-many data cables, it is necessary to optimize the multi-port intelligent fast full allocation strategy. Compared with the prior art, this application proposes a new multi-port intelligent fast full allocation strategy, so that one-to-many data cables can achieve intelligent power allocation when charging. When users use one-to-many data cables to charge multiple devices to be charged, they can charge the connected devices to be charged according to the order in which the devices are connected.

[0053] The charging method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown, the data line is a multi-port data line; optionally, the data line can be a 1-to-N data line, that is, 1 input electrical port 101 and N output charging terminals 102; the microcontroller unit (MCU) controls the N output charging terminals 102 at the back end at the 1 input port 101.

[0054] In an exemplary embodiment, Figure 2 As shown, a charging method is provided, which is applied to Figure 1The data line in FIG. 2 is taken as an example to illustrate, and the method includes the following steps 201 to 203. Among them:

[0055] Step 201, detecting the charging power of the first charging device to obtain the first charging power.

[0056] The first-charged device is a device that is connected to the port of the data line and is charged before the second-charged device; correspondingly, the second-charged device is a device that is charged through the port of the data line and is charged after the first-charged device. Exemplarily, the data line connects the first device, the second device, and the third device in chronological order; relative to the first device, the second device and the third device are both second-charged devices; relative to the second device, the first device is the first-charged device and the third device is the second-charged device; relative to the third device, the first device and the second device are both first-charged devices, and so on.

[0057] According to whether the post-charging device is connected to the data line, at least two types of post-charging devices can be determined, one of which is a post-charging device that has not been connected to the data line, and the other type is a post-charging device that is connected to the data line. Exemplarily, when the data line is connected to the first device and the first device is charged, the device that is electrically connected to the data line and not recognized by the data line is a post-charging device relative to the first device; and in the same case, the device that is electrically connected to the data line and has been recognized by the data line is another post-charging device relative to the first device.

[0058] The data line has different ports, and the sum of the number of devices charged first and the number of devices charged later is less than or equal to the number of ports of the data line. Since there is a first-charge power when the device charged first is charged through the data line, the device charged first has a charging protocol that is compatible with the data line. Since the device charged later may not have been connected to the data line, the device charged later may not have a charging protocol that is compatible with the data line.

[0059] Charging power detection refers to the detection of the charging power of the first-charged device according to the charging protocol supported by the device to obtain the first-charged power. The first-charged power is the charging power used by the data line to charge the first-charged device. Since the first-charged device is charged according to the first-charged power, the data line gives priority to charging the first-charged device. When the first-charged power is less than or equal to the power supported by the data line, the data line can be charged according to the maximum power supported by the first-charged device regardless of whether the data line is connected to the later-charged device. When the first-charged power is greater than the power supported by the data line, the data line is charged according to the maximum power supported by the data line regardless of whether the data line is connected to the later-charged device.

[0060] In an optional embodiment, the charging power of the first-charged device is detected to obtain the first-charged power, including: performing numerical detection on the charging parameters of the first-charged device at a preset frequency to obtain the charging parameter value; the charging parameters of the first-charged device are adapted to the charging protocol of the first-charged device; and the first-charged power is determined according to the charging parameter value. Optionally, the preset frequency may be 60 seconds / time, or other frequencies; the charging parameter value includes but is not limited to the voltage and current values ​​set according to each charging protocol, and the first-charged power is determined within a fixed range of the charging parameter value.

[0061] In an optional embodiment, the first charging power is determined according to the charging parameter value, including: obtaining the real-time voltage and current of charging the first charging device; averaging the real-time voltage and current obtained by a preset number of detections to obtain a voltage average and a current average; and determining the first charging power according to the voltage average and the current average.

[0062] In another optional embodiment, the charging power of the first-charged device is detected to obtain the first-charged power, including: when the first-charged device is identified, determining a protocol adapted between the data line and the first-charged device; determining the first-charged power according to the protocol so as to distribute power to the later-charged device connected to the data line.

[0063] Step 202: determine the post-charging power according to the power difference between the power supported by the data line and the pre-charging power.

[0064] The power supported by the data cable is the power that the data cable can carry. The power supported by the data cable is at least related to the material and specifications of the data cable itself. On this basis, the power supported by the data cable is also related to the protocol that the data cable can support. Exemplarily, the material and specifications of the data cable itself make the power supported by the data cable 120 watts, and the maximum power supported by the data cable in the fast charging protocol is 100 watts, then the power supported by the data cable is 100 watts, and the maximum power that the data cable can charge the same device is 100 watts.

[0065] The power difference is the power difference between different powers, which is the power difference between different powers.

[0066] Optionally, for the power difference between the power supported by the data line and the first-charge power, the power difference may be a difference or ratio between the power supported by the data line and the first-charge power, or may be a difference or ratio between the power supported by the data line and the first-charge power when the change value of the first-charge power exceeds a range threshold. The range threshold may be determined based on a filtering parameter or other relevant values.

[0067] The post-charging power is the charging power determined based on the power difference. When there is only one post-charging device, the post-charging power is used to charge the post-charging device; when there are only multiple post-charging devices, the post-charging power is the power allocated to multiple post-charging devices when charging multiple post-charging devices. Since the first-charging power and the post-charging power are the powers output by the data line at different ports, the sum of the first-charging power and the post-charging power is less than or equal to the power supported by the data line.

[0068] In an optional embodiment, determining the post-charging power according to the power difference between the power supported by the data line and the pre-charging power includes: determining the power difference between the power supported by the data line and the pre-charging power; and using the power difference as the post-charging power.

[0069] In another optional embodiment, the post-charging power is determined according to the power difference between the power supported by the data line and the pre-charging power, including: determining the power difference between the power supported by the data line and the pre-charging power; and mapping according to the interval where the power difference is located to obtain the post-charging power.

[0070] In yet another optional embodiment, determining the post-charging power according to the power difference between the power supported by the data line and the pre-charging power includes: the data line determines the post-charging power according to the power difference between the power supported by the data line itself and the pre-charging power.

[0071] Based on this, if the charging power of the first-charged device decreases, the first-charged power can be reduced, so that the power difference between the power supported by the data line and the first-charged power increases, thereby increasing the second-charged power. Therefore, for the second-charged device that has not reached the maximum charging power, its charging power can be increased. That is, the second-charged power can be dynamically adjusted according to the dynamic changes of the first-charged power.

[0072] Step 203, charging the later-charged device through the data line according to the later-charged power; the first-charged device is charged before the later-charged device, and the first-charged device and the later-charged device are charged through different ports of the data line.

[0073] In an optional embodiment, the post-charging device is charged according to the post-charging power via the data line, including: if there is post-charging power and it is recognized that the post-charging device is connected to the data line, the post-charging device is charged according to the post-charging power via the data line.

[0074] In another optional embodiment, charging the post-charging device according to the post-charging power through the data line includes: allocating the post-charging power to different ports of the data line, and charging the post-charging devices at different ports through the power allocated to different ports. Wherein, when one port of the data line is connected to the post-charging device, the post-charging power is used to charge the post-charging device; when multiple ports of the data line are respectively connected to the post-charging devices, the post-charging power is allocated according to the order in which the post-charging devices are connected to the ports, and the post-charging device is charged based on the power allocated to each port.

[0075] In the above charging method, the charging power related to the data line is refined into at least two dimensions: the first charging power and the second charging power. Therefore, the charging power of the first charging device is detected to obtain the first charging power, so that the power of the first charging device and the overall charging power of the data line form two independent parts; and then, regardless of whether the second charging device is connected to the data line, the second charging power is determined according to the power difference between the power supported by the data line and the first charging power, so that the charging power of the data line has the dimension of the second charging power, and the second charging power can be dynamically adjusted at an appropriate time according to the dynamic change of the first charging power, so as to increase the second charging power when the first charging power is reduced. In this case, the second charging device is charged through the data line according to the second charging power, so that the electric energy transmitted by the data line can be output to the first charging device first, which not only improves the charging efficiency of the first charging device, but also improves the overall charging efficiency by reducing the electric energy loss through a larger power, and can also dynamically adjust the second charging power according to the dynamic change of the first charging power, so as to ensure that the charging speed of the data line is high. In addition, the relative relationship between the first charging device and the second charging device can be adaptively adjusted in the order in which different devices are connected to the data line to adaptively adjust the charging power of the device.

[0076] In an exemplary embodiment, Figure 3 As shown, the post-charging power is determined according to the power difference between the power supported by the data line and the pre-charging power, including:

[0077] Step 301, determining the remaining power for the first charge according to the power difference between the power supported by the data line and the first charge power.

[0078] The first charge remaining power is the remaining power of the data line that can be used to charge the later-charged device when the first-charged device is charged first. Optionally, the power difference between the power supported by the data line and the first-charged power can be used as the first-charge remaining power; filtering can be performed based on the power difference between the power supported by the data line and the first-charged power to obtain the first-charge remaining power.

[0079] In an optional embodiment, the remaining power of the first charge is determined according to the power difference between the power supported by the data line and the first charge power, including: accumulating the first charge power of each first charge device to obtain the total power of the first charge device; and determining the remaining power of the first charge according to the difference between the power supported by the data line and the total power of the first charge device.

[0080] Step 302: Detect the charging power of the post-charging device to obtain the post-charging required power.

[0081] The post-charging required power is the power set according to the charging requirements of the post-charging device. When charging according to the post-charging required power, the charging efficiency of the post-charging device is relatively high, which is conducive to fast charging. Optionally, the post-charging required power is the maximum charging power of the post-charging device.

[0082] Since the power supported by the data line is limited and the number of devices to be charged first is uncertain, it is necessary to compare the relationship between the remaining power of the first charge and the power required for the later charge.

[0083] In an optional embodiment, the charging power of the post-charging device is detected to obtain the post-charging required power, including: detecting the charging protocol of the post-charging device, and numerically calculating the charging parameters of the post-charging device according to the charging protocol of the post-charging device to obtain the post-charging required power.

[0084] In another optional embodiment, the charging power of the post-charging device is detected to obtain the post-charging required power, including: numerically detecting the charging parameters of the post-charging device at a preset frequency to obtain the charging parameter values; the charging parameters of the post-charging device are adapted to the charging protocol of the post-charging device; and the post-charging required power is determined according to the charging parameter values. The preset frequency may be 60 seconds / time or other frequencies; the charging parameter values ​​include but are not limited to the voltage and current values ​​set according to each charging protocol, and the first charging power is determined within a fixed range of the charging parameter values. In the case where the charging parameter values ​​are the real-time voltage and current of the post-charging device, the real-time voltage and current of the preset detection times are respectively averaged to obtain the voltage mean and the current mean; the post-charging power is determined according to the voltage mean and the current mean.

[0085] Step 303: When the remaining power of the first charge is greater than the required power of the second charge, the second charge power is determined according to the required power of the second charge.

[0086] Optionally, when the value of the first-charge remaining power is greater than the value of the post-charge required power, the data line is in a situation where the first-charge remaining power is greater than the post-charge required power; or, when the difference between the first-charge remaining power and the post-charge required power is greater than a certain threshold, the data line is in a situation where the first-charge remaining power is greater than the post-charge required power.

[0087] In an optional embodiment, determining the post-charging power according to the post-charging required power includes: using the post-charging required power as the post-charging power.

[0088] In another optional embodiment, the post-charging power is determined according to the post-charging required power, including: allocating the data line post-charging required power to different post-charging devices to obtain the post-charging power of each post-charging device.

[0089] In this embodiment, the remaining power of the first charge is determined based on the power difference between the power supported by the data line and the power of the first charge, so as to clarify the maximum power that the later charge device can use; then the charging power of the later charge device is detected to obtain the required power of the later charge, so as to determine the power at which the later charge device can charge the fastest, so that the remaining power of the first charge and the required power of the later charge can be compared. Then, when the remaining power of the first charge is greater than the required power of the later charge, the later charge power is determined according to the required power of the later charge, so that the charging efficiency of the later charge device is improved.

[0090] In an optional embodiment, the method further includes: when the remaining power of the first charge is less than the required power of the post charge, determining the post charge power according to the remaining power of the first charge, until the remaining power of the first charge is greater than the required power of the post charge, and determining the post charge power according to the required power of the post charge.

[0091] In an optional embodiment, when the remaining power of first charging is less than the required power of later charging, determining the later charging power according to the remaining power of first charging includes: when the remaining power of first charging is less than the required power of later charging, using the remaining power of first charging as the later charging power.

[0092] In another optional embodiment, when the remaining power of first charging is less than the required power of post-charging, the post-charging power is determined according to the remaining power of first charging, including: when the remaining power of first charging is less than the required power of post-charging, charging the first post-charging device according to the remaining power of first charging, and not charging the second post-charging device.

[0093] In an optional embodiment, determining the post-charging power according to the post-charging required power includes: using the post-charging required power as the post-charging power.

[0094] In another optional embodiment, determining the post-charging power according to the post-charging required power includes: allocating the data line post-charging required power to the post-charging device to obtain the post-charging power of the post-charging device.

[0095] In this embodiment, when the remaining power of the first charge is less than the required power of the second charge, the power of the second charge is determined according to the remaining power of the first charge, so that the second charge device can be charged and the charging capacity supported by the data line can be fully utilized. Until the remaining power of the first charge is greater than the required power of the second charge, the power of the second charge is determined according to the required power of the second charge, so as to determine the power at which the second charge device can charge the fastest, and dynamically switch the charging mode to the power at which the second charge device can charge the fastest, so as to ensure the charging efficiency. Therefore, according to the real-time power demand of the device, the power distribution is dynamically adjusted to maintain the charging efficiency of the second charge device.

[0096] In an optional embodiment, the post-charging device includes a first post-charging device and a second post-charging device, the first post-charging device is connected to the data line before the second post-charging device, and the first post-charging device and the second post-charging device are charged through different ports of the data line.

[0097] The first post-charging device and the second post-charging device are both post-charging devices, and the first post-charging device is connected to the data line before the second post-charging device. Therefore, the first post-charging device is a post-charging device connected to the data line, and the second post-charging device may be a post-charging device that has not yet been connected to the data line, or may be a post-charging device connected to the data line.

[0098] Exemplarily, when the second post-charging device is not connected to the data line, and the data line has been connected to N devices in chronological order, the first N-1 devices are all first-charging devices, the Nth device is the first post-charging device, and the N+1th device to be connected to the data line is the second post-charging device; wherein N is a positive integer greater than 2.

[0099] Exemplarily, when the first post-charging device and the second post-charging device are both connected to the data line, and the data line has been connected to M devices in chronological order, the first M-2 devices are the first charging devices, the M-1th device is the first post-charging device, and the Mth device to be connected to the data line is the second post-charging device; wherein M is a positive integer greater than 3.

[0100] Among them, detecting the charging power of the post-charging device to obtain the post-charging required power includes step 401; determining the post-charging power according to the post-charging required power includes steps 402, 403 and 404, wherein:

[0101] Step 401, detecting the charging power of the first post-charging device to obtain the first post-charging required power.

[0102] The first post-charging required power is a power set according to the charging requirement of the first post-charging device. When charging according to the charging requirement of the first post-charging device, the charging efficiency of the first post-charging device is relatively high, which is conducive to fast charging. Optionally, the first post-charging required power is the maximum charging power of the first post-charging device.

[0103] When charging according to the first post-charge required power, the charging efficiency of the first post-charged device is relatively high, which is conducive to fast charging. Since the power supported by the data line is limited and the number of first-charged devices is uncertain, the first-charged remaining power is compared with the first post-charged required power to use the appropriate power to charge the first post-charged device.

[0104] In an optional embodiment, the charging power of the first post-charging device is detected to obtain the first post-charging required power, including: detecting the charging protocol of the first post-charging device, and numerically calculating the charging parameters of the first post-charging device according to the charging protocol of the first post-charging device to obtain the first post-charging required power.

[0105] In another optional embodiment, the charging power of the first post-charging device is detected to obtain the first post-charging required power, including: numerically detecting the charging parameters of the first post-charging device at a preset frequency to obtain the charging parameter values; the charging parameters of the first post-charging device are adapted to the charging protocol of the first post-charging device; and the first post-charging required power is determined according to the charging parameter values. The preset frequency may be 60 seconds / time or other frequencies; the charging parameter values ​​include but are not limited to the voltage and current values ​​set according to each charging protocol, and the first post-charging required power is determined within a fixed range of the charging parameter values. In the case where the charging parameter values ​​are the real-time voltage and current of the first post-charging device, the real-time voltage and current of the preset detection times are respectively averaged to obtain the voltage mean and the current mean; the first post-charging required power is determined according to the voltage mean and the current mean.

[0106] Optionally, when the first post-charging required power is determined by a charging parameter value, there is no need to perform calculations based on a protocol adapted by the first post-charging device, which helps to improve timeliness.

[0107] Step 402: determining the post-charging remaining power according to the power difference between the pre-charging remaining power and the first post-charging required power.

[0108] For the power difference between the first charge remaining power and the first post charge required power, the power difference may be the difference or ratio between the first charge remaining power and the first post charge required power, or the difference or ratio between the first charge remaining power and the first post charge required power when the change value of the first post charge required power exceeds the range threshold. The range threshold may be determined based on the filtered parameter or other relevant values.

[0109] The post-charge remaining power is the remaining power of the data line that can be used to charge the second post-charged device when the first-charged device is charged first and the first post-charged device is charged second. Optionally, the power difference between the first-charge remaining power and the first post-charge required power can be used as the post-charge remaining power; filtering can be performed based on the power difference between the first-charge remaining power and the first post-charge required power to obtain the post-charge remaining power.

[0110] Step 403, when the remaining power of the first charging is greater than the first required power of the post-charging, the post-charging power of the first post-charging device is determined according to the first required power of the post-charging, and it is detected whether the data line is connected to the second post-charging device.

[0111] The post-charging power of the first post-charging device refers to the charging power allocated to the first post-charging device in the remaining power of the first charging. The post-charging power of the first post-charging device belongs to the actual charging power of the first post-charging device.

[0112] Optionally, when the value of the first-charge remaining power is greater than the value of the first post-charge required power, the data line is in a situation where the first-charge remaining power is greater than the first post-charge required power; or, when the difference between the first-charge remaining power and the first post-charge required power is greater than a certain threshold, the data line is in a situation where the first-charge remaining power is greater than the first post-charge required power.

[0113] In an optional embodiment, determining the post-charging power of the first post-charging device according to the first post-charging required power includes: using the first post-charging required power as the post-charging power of the first post-charging device.

[0114] In another optional embodiment, determining the post-charging power of the first post-charging device according to the first post-charging required power includes: adjusting the post-charging power of the first post-charging device in real time according to the real-time changing first post-charging required power.

[0115] In an optional embodiment, detecting whether the data cable is connected to a second post-charging device includes: detecting whether there is a device connected to the data cable after the first post-charging device according to a protocol supported by the data cable; if so, the data cable is connected to the second post-charging device; if not, the second post-charging device does not exist.

[0116] In another optional embodiment, detecting whether the data cable is connected to a second post-charging device includes: detecting whether there is a device connected to the data cable after the first post-charging device according to changes in power parameters supported by the data cable; if so, the data cable is connected to the second post-charging device.

[0117] Therefore, when the remaining power of the first charging is greater than the required power of the first post-charging, on the one hand, the post-charging power of the first post-charging device is determined, and on the other hand, it is detected whether the data line is connected to the second post-charging device, so that the detection scenario of the second post-charging device can be narrowed and the detection frequency of the second post-charging device can be reduced.

[0118] Step 404: If the data line is connected to a second post-charging device, the post-charging power of the second post-charging device is determined based on the power difference between the post-charging remaining power and the first post-charging required power.

[0119] For the power difference between the post-charging remaining power and the first post-charging required power, the power difference may be the difference or ratio between the post-charging remaining power and the first post-charging required power, or the difference or ratio between the post-charging remaining power and the first post-charging required power when the change value of the first post-charging required power exceeds the range threshold. The range threshold may be determined based on the filtered parameters or other relevant values.

[0120] The post-charging power of the second post-charging device is the power used to charge the second post-charging device through the data line while ensuring that the first charging device and the first post-charging device can be charged at their respective required powers.

[0121] In an optional embodiment, based on the power difference between the post-charging remaining power and the first post-charging required power, the post-charging power of the second post-charging device is determined, including: judging the charging status of the second post-charging device based on the power difference between the post-charging remaining power and the first post-charging required power; determining a calculation method for the post-charging power of the second post-charging device according to the charging status; and determining the post-charging power of the second post-charging device according to the calculation method for the post-charging power of the second post-charging device.

[0122] In this embodiment, from the perspective of the post-charging device, the charging power of the data line is refined, and the charging power of the first post-charging device is detected to obtain the first post-charging required power to determine the charging status of the first post-charging device; on this basis, the post-charging remaining power is determined according to the power difference between the first charging remaining power and the first post-charging required power, so that the remaining power for the post-charging device can be further refined; in the case where the post-charging remaining power is greater than the first post-charging required power, the post-charging power of the first post-charging device is determined according to the first post-charging required power to ensure charging efficiency, and this situation is used as a condition for detecting the second post-charging device, so that the detection scenario of the second post-charging device can be narrowed and the detection frequency of the second post-charging device can be reduced. In the case where it is detected that the data line is connected to the second post-charging device, the post-charging power of the second post-charging device is determined based on the power difference between the post-charging remaining power and the first post-charging required power, so that the first post-charging device can be charged before the second post-charging device.

[0123] In an optional embodiment, based on the power difference between the post-charging remaining power and the first post-charging required power, the post-charging power of the second post-charging device is determined, including: detecting the charging power of the second post-charging device to obtain the second post-charging required power; when the post-charging remaining power is greater than the second post-charging required power, determining the post-charging power of the second post-charging device according to the second post-charging required power; when the post-charging remaining power is less than or equal to the second post-charging required power, determining the post-charging power of the second post-charging device according to the post-charging remaining power.

[0124] The second post-charging required power is the power set according to the charging requirement of the second post-charging device. When charging according to the charging requirement of the second post-charging device, the charging efficiency of the second post-charging device is relatively high, which is conducive to fast charging. Optionally, the second post-charging required power is the maximum charging power of the second post-charging device.

[0125] When charging according to the second post-charging required power, the charging efficiency of the second post-charging device is relatively high, which is conducive to fast charging. Since the power supported by the data line is limited and the number of first-charged devices is uncertain, the charging power of the first post-charging device is uncertain, so the size between the post-charging remaining power and the second post-charging required power is compared to use the appropriate power to charge the second post-charging device.

[0126] In an optional embodiment, the charging power of the second post-charging device is detected to obtain the second post-charging required power, including: detecting the charging protocol of the second post-charging device, and numerically calculating the charging parameters of the second post-charging device according to the charging protocol of the second post-charging device to obtain the second post-charging required power.

[0127] In another optional embodiment, the charging power of the second post-charging device is detected to obtain the second post-charging required power, including: performing numerical detection on the charging parameters of the second post-charging device at a preset frequency to obtain the charging parameter value; the charging parameters of the second post-charging device are adapted to the charging protocol of the second post-charging device; and determining the second post-charging required power according to the charging parameter value. Wherein, the preset frequency may be 60 seconds / time or other frequencies; the charging parameter value includes but is not limited to the voltage and current values ​​set according to each charging protocol, and the second post-charging required power is determined within a fixed range of the charging parameter value. Wherein, in the case where the charging parameter value is the real-time voltage and current of the second post-charging device, the real-time voltage and current of the preset detection times are respectively averaged to obtain the voltage mean and the current mean; and the second post-charging required power is determined according to the voltage mean and the current mean. Optionally, in the case where the second post-charging required power is determined by the charging parameter value, there is no need to calculate based on the protocol adapted by the second post-charging device, which helps to improve timeliness.

[0128] Optionally, if the value of the post-charging remaining power is greater than the value of the second post-charging required power, the data line is in a situation where the post-charging remaining power is greater than the second post-charging required power; otherwise, the data line is in a situation where the post-charging remaining power is less than or equal to the second post-charging required power.

[0129] Optionally, if the difference between the post-charging remaining power and the second post-charging required power is greater than a certain threshold, the data line is in a situation where the post-charging remaining power is greater than the second post-charging required power; otherwise, the data line is in a situation where the post-charging remaining power is less than or equal to the second post-charging required power.

[0130] In an optional embodiment, determining the post-charging power of the second post-charging device according to the second post-charging required power includes: using the second post-charging required power as the post-charging power of the second post-charging device.

[0131] In another optional embodiment, determining the post-charging power of the second post-charging device according to the second post-charging required power includes: adjusting the post-charging power of the second post-charging device in real time according to the real-time changing second post-charging required power.

[0132] In an optional embodiment, determining the post-charging power of the second post-charging device according to the post-charging remaining power includes: using the post-charging remaining power as the post-charging power of the second post-charging device.

[0133] In another optional embodiment, the post-charging power of the second post-charging device is determined according to the post-charging residual power, including: charging the second post-charging device according to the post-charging residual power, and not charging subsequent devices of the second post-charging device; the subsequent devices of the second post-charging device refer to devices that are connected to the data line after the second post-charging device.

[0134] In this embodiment, the types of charging power involved in the post-charging device are further refined to form a second post-charging required power. The charging power of the second post-charging device is detected to obtain the second post-charging required power to determine the charging status of the second post-charging device; on this basis, the charging power of the second post-charging device is adaptively adjusted according to the difference between the post-charging remaining power and the second post-charging required power. In this way, the charging efficiency of the first charging device and the first post-charging device can be improved.

[0135] In one embodiment, determining the post-charging power according to the power difference between the power supported by the data line and the pre-charging power includes step 501, and the method also includes step 502, wherein:

[0136] Step 501: If the first charging power is less than the power supported by the data line, the second charging power is determined according to the power difference between the power supported by the data line and the first charging power.

[0137] Optionally, the first charging power can be compared with the power supported by the data line to determine whether the first charging power is less than the power supported by the data line. That is, when the first charging power is less than the power supported by the data line, the first charging power is less than the power supported by the data line; when the first charging power is equal to or greater than the power supported by the data line, the first charging power is not less than the power supported by the data line.

[0138] Optionally, the power corresponding to the charging protocol supported by the first-charged device and the power corresponding to the charging protocol supported by the data line can be compared to determine whether the first-charged power is less than the power supported by the data line. That is, when the power corresponding to the charging protocol supported by the first-charged device is less than the power corresponding to the charging protocol supported by the data line, the first-charged power is less than the power supported by the data line; when the power corresponding to the charging protocol supported by the first-charged device is equal to or greater than the power corresponding to the charging protocol supported by the data line, the first-charged power is not less than the power supported by the data line.

[0139] Step 502: If the pre-charge power is equal to the maximum power supported by the data line, the pre-charge power is maintained according to the power supported by the data line.

[0140] Optionally, in the case where the first-charge power is equal to the maximum power supported by the data line, the first-charge power and the maximum power supported by the data line may have the same or similar value; or, the first-charge power is greater than the power supported by the data line. When the first-charge power is greater than the power supported by the data line, the data line may be abnormal. To ensure safety, the power supported by the data line is used as the first-charge power, and the first-charged device is charged.

[0141] In an optional embodiment, maintaining the first-charge power according to the power supported by the data line includes: charging the first-charge device according to the maximum power supported by the data line, and the subsequent-charge power is 0.

[0142] In an optional embodiment, maintaining the first-charge power according to the power supported by the data line includes: charging the first-charge device according to the maximum power supported by the data line under the protocol, and the subsequent charging power is 0.

[0143] In this embodiment, if the first-charge power is less than the power supported by the data line, the post-charge power is determined according to the power difference between the power supported by the data line and the first-charge power, so that the later-charged device can be charged under the premise of ensuring that the first-charged device has a higher charging efficiency; if the first-charge power is equal to the power supported by the data line, the first-charge power is maintained according to the power supported by the data line, so that the charging efficiency of the first-charged device is high.

[0144] In a specific embodiment, Figure 6 The one-to-two data lines shown are executed as follows Figure 7The method shown has only a first device and a second device. Relative to the first device, the second device is a later-charged device; relative to the second device, the first device is a first-charged device.

[0145] In this case, step 201 includes: step 701, the controller of the data line recognizes that the first device is connected; step 702, determines whether the charging power of the first device reaches the maximum power supported by the data line, wherein the charging power of the first device refers to the power required by the first device, that is, the maximum initial charging power, and the maximum power supported by the data line refers to the maximum power that the data line can output.

[0146] In this case, step 202 includes: step 703, if the charging power of the first device reaches the maximum power supported by the data line, the maximum power that the data line can output is provided to the first device to ensure full power charging of the first device until the power demand changes during the charging process of the device.

[0147] In this case, step 203 includes: if the charging power of the first device cannot reach the maximum power supported by this data line, execute step 704, the controller of the data line determines whether there is a second device connected, if so, execute step 705, and allocate the remaining power that this data line can provide to the second device.

[0148] In this case, the method further includes: if the controller of the data line determines that the second device is not connected, continuing to ensure full power output of the first device;

[0149] Among them, step 201 may include: step 706, real-time judgment on whether the power demand of the device changes during charging. Correspondingly, step 201 also includes: step 707, dynamically adjusting the power distribution according to the real-time power demand of the first-charged device until charging is completed. In this process, the maximum fast charging power supported by the device is determined, and dynamic allocation is made based on the total input power. For example: first meet the maximum power supported by the first device, and the rest is allocated to the second device. When the power of the first device decreases, it is adjusted to the second device in real time. Thus, as the charging of the first device gradually changes, its first-charge power slowly decreases, and more power can be allocated to the second device at this time.

[0150] In a specific embodiment, when the data line is a one-to-three data line, the first post-charging device is the second device, and the second post-charging device is the third device. At this time, the method also includes: when it is detected that a second device is connected, it is necessary to determine whether the pre-charging residual power that can be provided by this data line is less than the required power of the second device. If the pre-charging residual power that can be provided by this data line is less than the required power of the second device, the pre-charging residual power that can be output by this data line is provided to the second device to ensure full power charging of the second device, and whether the third device is connected is not detected; if the pre-charging residual power that can be provided by this data line is greater than the required power of the second device, the second device is charged according to the required power of the second device, and it is detected whether the third device is connected. If the charging power of the first device or the second device decreases, the charging power of the third post-charging device is increased.

[0151] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0152] Based on the same inventive concept, the embodiment of the present application also provides a charging device for implementing the above-mentioned charging method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above-mentioned method, so the specific limitations in one or more charging device embodiments provided below can refer to the limitations on the charging method above, and will not be repeated here.

[0153] In an exemplary embodiment, Figure 8 As shown, a charging device is provided, comprising:

[0154] The first charging power determination module 801 is used to detect the charging power of the first charging device when charging the first charging device through the data line to obtain the first charging power;

[0155] A post-charging power determination module 802, configured to determine a post-charging power according to a power difference between a power supported by the data line and the pre-charging power;

[0156] The later-charged device charging module 803 is used to charge the later-charged device through the data line according to the later-charged power; the first-charged device is charged before the later-charged device, and the first-charged device and the later-charged device are charged through different ports of the data line.

[0157] In one embodiment, the post-charging power determination module 802 is used to:

[0158] Determining the remaining power for the first charge according to the power difference between the power supported by the data line and the first charge power;

[0159] Detecting the charging power of the post-charging device to obtain the post-charging required power;

[0160] In a case where the pre-charging remaining power is greater than the post-charging required power, the post-charging power is determined according to the post-charging required power.

[0161] In one embodiment, the post-charging device includes a first post-charging device and a second post-charging device, the first post-charging device is connected to the data line before the second post-charging device, and the first post-charging device and the second post-charging device are charged through different ports of the data line;

[0162] The post-charging power determination module 802 is used to:

[0163] Detecting the charging power of the first post-charging device to obtain a first post-charging required power;

[0164] determining the post-charging remaining power according to a power difference between the first-charging remaining power and the first post-charging required power;

[0165] In the case where the post-charging remaining power is greater than the first post-charging required power, determining the post-charging power of the first post-charging device according to the first post-charging required power, and detecting whether the data line is connected to the second post-charging device;

[0166] If the data cable is connected to the second post-charging device, the post-charging power of the second post-charging device is determined based on the power difference between the post-charging remaining power and the first post-charging required power.

[0167] In one embodiment, the post-charging power determination module 802 is used to:

[0168] Detecting the charging power of the second post-charging device to obtain a second post-charging required power;

[0169] When the post-charging remaining power is greater than the second post-charging required power, determining the post-charging power of the second post-charging device according to the second post-charging required power;

[0170] When the post-charging remaining power is less than or equal to the second post-charging required power, the post-charging power of the second post-charging device is determined according to the post-charging remaining power.

[0171] In one embodiment, the post-charging power determination module 802 is used to:

[0172] When the first-charge remaining power is less than the post-charge required power, the post-charge power is determined according to the first-charge remaining power, until the first-charge remaining power is greater than the post-charge required power, and the post-charge power is determined according to the post-charge required power.

[0173] In one embodiment, the first charging power determination module 801 is used to:

[0174] If the first-charge power is less than the power supported by the data line, determining the post-charge power according to the power difference between the power supported by the data line and the first-charge power;

[0175] If the pre-charging power is equal to the maximum power supported by the data line, the pre-charging power is maintained according to the power supported by the data line.

[0176] Each module in the above charging device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each module.

[0177] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Fig. 9As shown. The computer device includes a processor 910, a memory 920, an input / output interface 930, a communication interface 940, a display unit 950 and an input device 960. The processor 910, the memory 920 and the input / output interface 930 are connected via a system bus 970, and the communication interface 940, the display unit 950 and the input device 960 are connected to the system bus 970 via the input / output interface 930. The processor 910 of the computer device is used to provide computing and control capabilities. The memory 920 of the computer device includes a non-volatile storage medium 921 and an internal memory 922. The non-volatile storage medium 921 stores an operating system 9211 and a computer program 9212. The internal memory 922 provides an environment for the operation of the operating system 9211 and the computer program 9212 in the non-volatile storage medium 921. The input / output interface 930 of the computer device is used to exchange information between the processor 910 and an external device. The communication interface 940 of the computer device is used to communicate with an external terminal in a wired or wireless manner. The wireless manner can be implemented through WIFI, mobile cellular network, near field communication (NFC) or other technologies. When the computer program 9212 is executed by the processor 910, a charging method is implemented. The display unit 950 of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device 960 of the computer device can be a touch layer covered on the display screen, or a key, trackball or touchpad provided on the housing of the computer device, or an external keyboard, touchpad or mouse.

[0178] Those skilled in the art will understand that Fig. 9 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0179] In one embodiment, Figure 3 As shown, a data line is also provided, including a controller and a charging line. When the controller executes a computer program, the steps in the above method embodiments are implemented. The charging line includes an input power port 101 and an output charging terminal 102.

[0180] In one embodiment, Fig.10 As shown, a computer-readable storage medium 1000 is provided, on which a computer program 1001 is stored. When the computer program 1001 is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0181] In one embodiment, Fig.11 As shown, a computer program product 1100 is provided, including a computer program, which implements the steps in the above-mentioned method embodiments when executed by a processor.

[0182] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0183] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0184] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0185] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A charging method, characterized in that: The charging method comprises: Detecting the charging power of the first-charged device to obtain the first-charged power; Determining a post-charging power according to a power difference between a power supported by the data line and the pre-charging power; The post-charged device is charged via the data line according to the post-charged power; the first-charged device is charged before the post-charged device, and the first-charged device and the post-charged device are charged via different ports of the data line.

2. The charging method according to claim 1, characterized in that: The determining the post-charging power according to the power difference between the power supported by the data line and the pre-charging power includes: Determining the remaining power for the first charge according to the power difference between the power supported by the data line and the first charge power; Detecting the charging power of the post-charging device to obtain the post-charging required power; In a case where the pre-charging remaining power is greater than the post-charging required power, the post-charging power is determined according to the post-charging required power.

3. The charging method according to claim 2, characterized in that: The post-charging device includes a first post-charging device and a second post-charging device, the first post-charging device is connected to the data line before the second post-charging device, and the first post-charging device and the second post-charging device are charged through different ports of the data line; The detecting the charging power of the post-charging device to obtain the post-charging required power includes: Detecting the charging power of the first post-charging device to obtain a first post-charging required power; The determining the post-charging power according to the post-charging required power includes: determining the post-charging remaining power according to a power difference between the first-charging remaining power and the first post-charging required power; In the case where the post-charging remaining power is greater than the first post-charging required power, determining the post-charging power of the first post-charging device according to the first post-charging required power, and detecting whether the data line is connected to the second post-charging device; If the data cable is connected to the second post-charging device, the post-charging power of the second post-charging device is determined based on the power difference between the post-charging remaining power and the first post-charging required power.

4. The charging method according to claim 3, characterized in that: The determining the post-charging power of the second post-charging device based on the power difference between the post-charging remaining power and the first post-charging required power includes: Detecting the charging power of the second post-charging device to obtain a second post-charging required power; When the post-charging remaining power is greater than the second post-charging required power, determining the post-charging power of the second post-charging device according to the second post-charging required power; When the post-charging remaining power is less than or equal to the second post-charging required power, the post-charging power of the second post-charging device is determined according to the post-charging remaining power.

5. The charging method according to claim 2, characterized in that: The charging method further comprises: When the first-charge remaining power is less than the post-charge required power, the post-charge power is determined according to the first-charge remaining power, until the first-charge remaining power is greater than the post-charge required power, and the post-charge power is determined according to the post-charge required power.

6. The charging method according to claim 1, characterized in that: The determining the post-charging power according to the power difference between the power supported by the data line and the pre-charging power includes: If the first-charge power is less than the power supported by the data line, determining the second-charge power according to the power difference between the power supported by the data line and the first-charge power; The charging method further comprises: If the pre-charging power is equal to the maximum power supported by the data line, the pre-charging power is maintained according to the power supported by the data line.

7. A charging device, characterized in that: The charging device comprises: The first charging power determination module is used to detect the charging power of the first charging device when charging the first charging device through the data line to obtain the first charging power; A post-charging power determination module, used to determine the post-charging power according to the power difference between the power supported by the data line and the pre-charging power; The post-charging device charging module is used to charge the post-charging device through the data line according to the post-charging power; the first-charging device is charged before the post-charging device, and the first-charging device and the post-charging device are charged through different ports of the data line.

8. A data cable, comprising a controller and a charging cable, characterized in that: When the controller executes the computer program, the steps of the charging method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the charging method according to any one of claims 1 to 6 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the charging method according to any one of claims 1 to 6 are implemented.