Communication method and device, electronic equipment and storage medium

By dynamically adjusting the transmission and reception thresholds of the USB-C interface device, the problem of poor communication quality when the power is increased is solved, and stable and reliable communication is achieved during high-power transmission.

CN119853724APending Publication Date: 2025-04-18SHENZHEN LEGENDARY TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411827007.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-11
Publication Date
2025-04-18

AI Technical Summary

Technical Problem

In the prior art, when the power supply device and the receiving device are connected through a USB-C line, the transmission and reception thresholds will not change after initialization, resulting in the possibility of a protocol message not being received normally when the power increases, and the communication quality is poor.

Method used

By obtaining the current transmitted between the power supply device and the receiving device, the target threshold value group is determined, and the transmission and reception threshold values ​​of the power supply device and the receiving device are dynamically adjusted to adjust the potential difference.

Benefits of technology

Ensure that when the power transmitted between the power supply equipment and the receiving equipment increases, the receiving equipment can normally receive the protocol information sent by the power supply equipment, maintain the stability and reliability of communication, and significantly improve the communication quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119853724A_ABST
    Figure CN119853724A_ABST
Patent Text Reader

Abstract

The invention is suitable for the technical field of communication, and provides a communication method and device, electronic equipment and a storage medium, and the communication method provided by the embodiment of the invention comprises the steps: firstly obtaining a first current transmitted between power supply equipment and receiving equipment, and then determining a first target threshold group and a second target threshold group according to the first current. And finally, the sending threshold and the receiving threshold of the power supply equipment can be adjusted according to the first target threshold group, and the sending threshold and the receiving threshold of the receiving equipment can be adjusted according to the second target threshold group. Therefore, according to the embodiment provided by the invention, the respective sending threshold value and receiving threshold value of the power supply equipment and the receiving equipment can be dynamically adjusted according to the size of the first current, so that the potential difference is effectively adjusted. Therefore, when the transmission power between the power supply equipment and the receiving equipment is increased, the receiving equipment can normally receive the protocol information sent by the power supply equipment, so that the stability and the reliability of communication are kept during high-power transmission, and the communication quality is remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of communication technology, and in particular, relates to a communication method, device, electronic device and storage medium. Background Art

[0002] The USB-C port has become the standard interface for smart devices such as mobile phones, computers and their peripheral accessories. These devices also support the USB PD (Power Delivery) protocol. Through the communication between the USB-C port and the USB PD protocol chip, the power supply device can transmit high-power electrical energy to the receiving device to achieve fast charging. However, in the prior art, when the power supply device and the receiving device establish a connection through the USB-C cable, the receiving threshold and sending threshold of the power supply device and the receiving device will not change during the communication process after initialization. When the power transmitted between the power supply device and the receiving device increases, the terrain difference also increases, which may cause the protocol message sent by the power supply device to be unable to be normally received by the receiving device, resulting in poor communication quality. Summary of the invention

[0003] The embodiments of the present application provide a communication method, device, electronic device and storage medium, which can solve the problem in the prior art that when the power transmitted between the power supply device and the receiving device increases, the protocol message sent by the power supply device may not be normally received by the receiving device, resulting in poor communication quality.

[0004] In a first aspect, an embodiment of the present application provides a communication method, including:

[0005] Acquire a first current transmitted between a power supply device and a receiving device;

[0006] determining a first target threshold group and a second target threshold group according to the first current;

[0007] The sending threshold and the receiving threshold of the power supply device are adjusted according to the first target threshold group, and the sending threshold and the receiving threshold of the receiving device are adjusted according to the second target threshold group.

[0008] In a possible implementation manner of the first aspect, obtaining a first current transmitted between a power supply device and a receiving device includes:

[0009] Obtaining a first voltage between a first interface and ground; wherein the first interface is an interface connected to the power supply device or an interface connected to the receiving device;

[0010] The first current is obtained by calculating a quotient of the first voltage and a resistance value of a sampling resistor.

[0011] In a possible implementation manner of the first aspect, determining a first target threshold group and a second target threshold group according to the first current includes:

[0012] determining a target current interval according to the first current;

[0013] The first target threshold group and the second target threshold group are determined according to the target current interval.

[0014] In a possible implementation manner of the first aspect, the current interval includes a first current interval, a second current interval, and a third current interval, and determining the first target threshold group and the second target threshold group according to the target current interval includes:

[0015] When the first current is within the first current interval, determining the first threshold group as the first target threshold group, and determining the second threshold group as the second target threshold group;

[0016] When the first current is within the second current interval, determining the third threshold group as the first target threshold group, and determining the fourth threshold group as the second target threshold group;

[0017] When the first current is within the third current interval, the fifth threshold group is determined as the first target threshold group, and the sixth threshold group is determined as the second target threshold group.

[0018] In a possible implementation manner of the first aspect, the method further includes:

[0019] comparing the first current with a preset current;

[0020] If the first current is less than or equal to the preset current, determining a connection state between the power supply device and the receiving device;

[0021] If the first current is less than or equal to the preset current, and the power supply device and the receiving device are disconnected, the sending threshold of the power supply device is set to the first sending threshold, the receiving threshold of the power supply device is set to the first receiving threshold, the sending threshold of the receiving device is set to the second sending threshold, and the receiving threshold of the receiving device is set to the second receiving threshold;

[0022] If the first current is less than or equal to the preset current, and the power supply device and the receiving device are connected, the step of comparing the first current with the preset current is performed.

[0023] In a possible implementation manner of the first aspect, the method further includes:

[0024] monitoring a communication quality parameter between the power supply device and the receiving device;

[0025] When it is detected that the communication quality parameter is less than a preset value, the sending threshold and the receiving threshold of the power supply device are increased, and the sending threshold and the receiving threshold of the receiving device are decreased.

[0026] In a possible implementation manner of the first aspect, the method further includes:

[0027] Acquire a correspondence between the first current and the first target threshold group, and a correspondence between the first current and the second target threshold group;

[0028] The first current is associated with the first target threshold group and stored, and the first current is associated with the second target threshold group and stored.

[0029] In a second aspect, an embodiment of the present application provides a communication device, including:

[0030] An acquisition module, used to acquire a first current transmitted between a power supply device and a receiving device;

[0031] A determination module, configured to determine a first target threshold group and a second target threshold group according to the first current;

[0032] The adjustment module is used to adjust the sending threshold and receiving threshold of the power supply device according to the first target threshold group, and adjust the sending threshold and receiving threshold of the receiving device according to the second target threshold group.

[0033] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor implements a method as described in any one of the first aspects when executing the computer program.

[0034] 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, and when the computer program is executed by a processor, the method as described in any one of the first aspects is implemented.

[0035] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:

[0036] The communication method provided in the embodiment of the present application first obtains the first current transmitted between the power supply device and the receiving device, and then determines the first target threshold group and the second target threshold group according to the first current. Since the first target threshold group is used to indicate the sending threshold and receiving threshold of the power supply device, and the second target threshold group is used to indicate the sending threshold and receiving threshold of the receiving device. Therefore, the sending threshold and receiving threshold of the power supply device can be adjusted according to the first target threshold group, and the sending threshold and receiving threshold of the receiving device can be adjusted according to the second target threshold group. It can be seen that the embodiment provided by the present application can dynamically adjust the sending threshold and receiving threshold of each of the power supply device and the receiving device according to the size of the first current, thereby effectively adjusting the potential difference. It is ensured that when the power transmitted between the power supply device and the receiving device increases, the receiving device can normally receive the protocol information sent by the power supply device, thereby maintaining the stability and reliability of communication during high-power transmission, and significantly improving the communication quality. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art 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 drawings can be obtained based on these drawings without paying creative labor.

[0038] Figure 1 It is a flowchart of a communication method provided by an embodiment of the present application;

[0039] Figure 2 It is a hardware structure block diagram provided by an embodiment of the present application;

[0040] Figure 3 is a hardware structure block diagram provided by another embodiment of the present application;

[0041] Figure 4 is a hardware structure block diagram provided by another embodiment of the present application;

[0042] Figure 5 It is a schematic diagram of the workflow of the communication method provided in the embodiment of the present application;

[0043] Figure 6 is a schematic diagram of the structure of a communication device provided in an embodiment of the present application;

[0044] Figure 7 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0045] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0046] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.

[0047] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.

[0048] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0049] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0050] In the prior art, when the power supply device and the receiving device are connected via a USB-C cable, the receiving threshold and the sending threshold of the power supply device and the receiving device will not change during the communication process after initialization. When the power transmitted between the power supply device and the receiving device increases, the terrain difference also increases, which may cause the protocol message sent by the power supply device to be unable to be normally received by the receiving device, resulting in poor communication quality.

[0051] Based on the above problems, the communication method provided by the embodiment of the present application first obtains the first current transmitted between the power supply device and the receiving device, and then determines the first target threshold group and the second target threshold group according to the first current. Since the first target threshold group is used to indicate the sending threshold and receiving threshold of the power supply device, and the second target threshold group is used to indicate the sending threshold and receiving threshold of the receiving device. Therefore, the sending threshold and receiving threshold of the power supply device can be adjusted according to the first target threshold group, and the sending threshold and receiving threshold of the receiving device can be adjusted according to the second target threshold group. It can be seen that the embodiment provided by the present application can dynamically adjust the sending threshold and receiving threshold of each of the power supply device and the receiving device according to the size of the first current, thereby effectively adjusting the potential difference. It is ensured that when the power transmitted between the power supply device and the receiving device increases, the receiving device can normally receive the protocol information sent by the power supply device, thereby maintaining the stability and reliability of communication during high-power transmission, and significantly improving the communication quality.

[0052] In order to illustrate the technical solution described in this application, a specific embodiment is provided below for illustration.

[0053] Figure 1 FIG. 1 is a flow chart of a communication method provided by an embodiment of the present application. Figure 1 As shown, the communication method includes steps S101 to S103.

[0054] Step S101: obtaining a first current transmitted between a power supply device and a receiving device.

[0055] Specifically, when the power supply device and the receiving device are connected via the USB-C cable, the power supply device can transmit electrical energy to the receiving device, such as the power supply device can transmit voltage and current to the receiving device. The current (i.e., the first current) on the transmission line between the power supply device and the receiving device can be monitored in real time by a current sensor or other measuring devices and equipment, thereby ensuring the accuracy and reliability of the measuring device to obtain an accurate current value. Finally, the acquired first current is transmitted to a control module (such as a USB PD protocol chip) in the power supply device or the receiving device for subsequent adjustment of the sending threshold and the receiving threshold.

[0056] It should be noted that the acquired first current may be filtered, corrected, etc. again to eliminate noise and errors in the measurement process to ensure the reliability of the first current.

[0057] Step S101 may include step S1011 and step S1012.

[0058] Step S1011, obtaining a first voltage between a first interface and ground, wherein the first interface is an interface connected to a power supply device or an interface connected to a receiving device.

[0059] Specifically, Figure 2 As shown, a first sampling resistor with a first resistance value can be connected in series between the first interface (USB-C port) of the power supply end and the ground (GND). When the first current flows through the first sampling resistor, a voltage drop will be generated on the first sampling resistor. The voltage drop on the first sampling resistor is the first voltage. Figure 3 As shown, a second sampling resistor with a second resistance value can be connected in series between the first interface (USB-C port) of the power receiving end and the ground (GND). When the first current flows through the second sampling resistor, a voltage drop will be generated on the second sampling resistor. The voltage drop on the second sampling resistor is the first voltage. The first resistance value and the second resistance value can be the same or different. Figure 4 As shown, a first sampling resistor can be connected in series between the USB-C port of the power supply end and GND, and a second sampling resistor can be connected in series between the USB-C port of the power receiving end and GND. The use of two sampling resistors can independently measure the current of the power supply end and the power receiving end, avoiding the error that may be introduced by a single sampling resistor in long-distance transmission. At the same time, the two sampling resistors can provide redundant measurement, and the average value of the first sampling voltage generated on the first sampling resistor and the second sampling voltage generated on the second sampling resistor can be used as the above-mentioned first voltage, thereby improving the reliability of the first voltage, and if one of the sampling resistors fails, the other sampling resistor can still work normally, improving the reliability and stability of the system.

[0060] by Figure 4 For example, the three connecting lines between the two USB-C ports are CC channel, power line and ground line from top to bottom. The CC channel is between the USB-C port and the USB PD protocol chip, the CC channel and control communication line are between the USB PD protocol chip at the power supply end and the power access port, and the CC channel and power line are used between the power adapter and the power access port. The power access port and the first power module, the first power module and the first switch unit, the first power module and the USB PD protocol chip at the power supply end, the second power module and the second switch unit, the second power module and the USB PD protocol chip at the power receiving end, the first switch unit and the USB-C port at the power supply end, and the second switch unit and the USB-C port at the power receiving end are all power lines. The first switch unit and the USB PD protocol chip at the power supply end, and the second switch unit and the USB PD protocol chip at the power receiving end are control communication lines. The ground line is between the first sampling resistor and the USB-C port at the power supply end, the first sampling resistor and GND, the second sampling resistor and the USB-C port at the power receiving end, and the second sampling resistor and GND. The sampling communication lines are between the first sampling resistor and the USB PD protocol chip at the power supply end, and between the second sampling resistor and the USB PD protocol chip at the power receiving end.

[0061] It should be noted that a voltage measuring device (such as a voltmeter or a data acquisition system) can also be used to measure the first voltage between the first interface and the ground. At the same time, the obtained first voltage can be filtered, corrected, etc. again to eliminate noise and errors in the measurement process to ensure the reliability of the first voltage.

[0062] Step S1012, calculating the quotient of the first voltage and the resistance value of the sampling resistor to obtain a first current.

[0063] Specifically, since the first voltage has been acquired in step S1011 and the resistance of the sampling resistor is determined, according to Ohm's law, it can be obtained that the first current is equal to the first voltage divided by the resistance of the sampling resistor. The current thus measured has higher accuracy and reliability.

[0064] Step S102: determining a first target threshold group and a second target threshold group according to the first current.

[0065] Specifically, multiple first threshold groups and multiple second threshold groups can be preset according to actual conditions, and the current corresponding to each first threshold group and the current corresponding to each second threshold group can be preset. The USB PD protocol chip in the power supply device will determine one of the multiple first threshold groups that match the first current as the first target threshold group, and the USB PD protocol chip in the receiving device will determine one of the multiple second threshold groups that match the first current as the second target threshold group, thereby ensuring that the power supply device and the receiving device communicate in the best working state.

[0066] It should be noted that the number of the first threshold group and the number of the second threshold group can be the same or different, and the thresholds in the first threshold group and the second threshold group can be the same or different. The larger the first current, the larger the threshold in the first target threshold group, and the smaller the threshold in the second target threshold group.

[0067] Exemplarily, if there are two first threshold groups, namely (0.56V, 1.10V) and (0.68V, 1.15V), there are two second threshold groups, namely (0.56V, 1.10V) and (0.44V, 1.05V). If the first current is 2.95A, the first target threshold group can be determined to be (0.56V, 1.10V), and the second target threshold group can be determined to be (0.56V, 1.10V). If the first current is 3.15A, the first target threshold group can be determined to be (0.68V, 1.15V), and the second target threshold group can be determined to be (0.44V, 1.05V).

[0068] Step S102 may include step S1021 and step S1022.

[0069] Step S1021, determining a target current range according to the first current.

[0070] Specifically, multiple current judgment values ​​are pre-set in the power supply device and the receiving device, and each two adjacent current judgment values ​​constitute a current interval. Among them, the target current interval is an interval in the multiple current intervals that contains the first current. Specifically, after the first current is determined, the first current can be compared with the multiple current intervals. If the first current is greater than or equal to the minimum value in a certain current interval and less than the maximum value of the current interval, the current interval is determined as the target current interval. Among them, the multiple current judgment values ​​set by the power supply device are different from the multiple current judgment values ​​set by the receiving device, and the current interval set by the power supply device is different from the current interval set by the receiving device.

[0071] Exemplarily, if the first current is 2.95A, the power supply device sets four current judgment values, namely: 2.6A, 2.8A, 3.0A and 3.2A. Therefore, there are three current intervals in the power supply device, namely: (2.6-2.8), (2.8-3.0) and (3.0-3.2). The receiving device sets four current judgment values, namely: 2.7A, 2.9A, 3.1A and 3.3A. Therefore, there are three current intervals in the receiving device, namely: (2.7-2.9), (2.9-3.1) and (3.1-3.3). Since the first current is 2.95A, it can be determined that the first current is in the second current interval set by the power supply device, that is, the second current interval set by the power supply device is used as the target current interval of the power supply device. Similarly, the first current is in the second current interval set by the receiving device, that is, the second current interval set by the receiving device is used as the target current interval of the receiving device.

[0072] Step S1022: determining a first target threshold group and a second target threshold group according to the target current range.

[0073] Specifically, the first threshold group corresponding to each current interval in the power supply device and the second threshold group corresponding to each current interval in the receiving device can be pre-set. When the target current interval is determined, the first target threshold group and the second target threshold group can be determined according to the pre-set corresponding relationship. A neural network algorithm or a machine learning model can also be used, using the historical first current data and the corresponding threshold group as training data, and the first target threshold group and the second target threshold group can be determined through the machine learning model.

[0074] It should be noted that, in the case where the current interval includes the first current interval, the second current interval and the third current interval, when the first current is within the first current interval, the first threshold group is determined to be the first target threshold group, and the second threshold group is determined to be the second target threshold group; when the first current is within the second current interval, the third threshold group is determined to be the first target threshold group, and the fourth threshold group is determined to be the second target threshold group; when the first current is within the third current interval, the fifth threshold group is determined to be the first target threshold group, and the sixth threshold group is determined to be the second target threshold group. Specifically, after the first current is determined, the first current is compared with each current interval. If the first current is within the first current interval set by the power supply device and is also within the first current interval set by the receiving device, at this time, the power supply device uses the first threshold group corresponding to the first current interval as the first target threshold group, and the receiving device uses the second threshold group corresponding to the first current interval as the second target threshold group. Similarly, if the first current is within the second current interval, the third threshold group is determined to be the first target threshold group, and the fourth threshold group is determined to be the second target threshold group. The situation is similar to the situation where the first current is within the first current interval, and no further description will be given. The case where the first current is within the third current interval, the fifth threshold group is determined to be the first target threshold group, and the sixth threshold group is determined to be the second target threshold group is similar to the case where the first current is within the first current interval, and will not be repeated herein.

[0075] Exemplarily, there are three current intervals in the power supply device: the first current interval (2.6-2.8), the second current interval (2.8-3.0) and the third current interval (3.0-3.2), and the threshold groups corresponding to the three current intervals are: the first threshold group (0.50V, 1.05V), the third threshold group (0.56V, 1.10V) and the fifth threshold group (0.68V, 1.15V). There are three current intervals in the receiving device: the first current interval (2.7-2.9), the second current interval (2.9-3.1) and the third current interval (3.1-3.3), and the threshold groups corresponding to the three current intervals are: the second threshold group (0.61V, 1.15V), the fourth threshold group (0.56V, 1.10V) and the sixth threshold group (0.44V, 1.05V). If the first current is 2.95A, the first current is in the second current interval in the power supply device and the second current interval in the receiving device. Therefore, the third threshold group (0.56V, 1.10V) is determined as the first target threshold group, and the fourth threshold group (0.56V, 1.10V) is determined as the second target threshold group.

[0076] Step S103: adjusting the sending threshold and receiving threshold of the power supply device according to the first target threshold group, and adjusting the sending threshold and receiving threshold of the receiving device according to the second target threshold group.

[0077] Specifically, each threshold group includes two thresholds, namely a first threshold and a second threshold, wherein the first threshold is greater than the second threshold. After the power supply device determines the first target threshold group according to the magnitude of the first current, the larger first threshold in the first target threshold group is used as the sending threshold of the power supply device, and the smaller second threshold in the first target threshold is used as the receiving threshold of the power supply device. After the receiving device determines the second target threshold group according to the magnitude of the first current, the larger first threshold in the second target threshold group is used as the sending threshold of the receiving device, and the smaller second threshold in the first target threshold is used as the receiving threshold of the receiving device. Thus, the embodiment provided by the present application can dynamically adjust the sending threshold and receiving threshold of each of the power supply device and the receiving device according to the magnitude of the first current, thereby effectively adjusting the potential difference. It is ensured that when the power transmitted between the power supply device and the receiving device increases, the receiving device can normally receive the protocol information sent by the power supply device, thereby maintaining the stability and reliability of communication during high-power transmission, and significantly improving the communication quality.

[0078] In one embodiment of the present application, the communication method further includes steps S104 to S107.

[0079] Step S104: compare the first current with a preset current.

[0080] Specifically, after obtaining the first current, it is necessary to compare the first current with the preset current to determine whether it is necessary to adjust the sending threshold and the receiving threshold. Only when the first current is greater than the preset current will the problem of poor communication quality occur. At this time, the sending threshold and the receiving threshold of the power supply device are adjusted according to the above steps, as well as the sending threshold and the receiving threshold of the receiving device. If the first current is less than the preset current, execute step S105. It can be seen that by comparing the first current with the preset current, the first target threshold and the second target threshold can be determined more accurately, thereby correctly adjusting the sending threshold and the receiving threshold of the power supply device and the receiving device, ensuring that the power supply device and the receiving device communicate in the best working state, and improving the stability and efficiency of the system.

[0081] Step S105: if the first current is less than or equal to the preset current, determining the connection state between the power supply device and the receiving device.

[0082] Specifically, since the first current is less than or equal to the preset current, it may be caused by a poor connection or disconnection. Through this step, it is possible to confirm whether the connection between the power supply device and the receiving device is normal, thereby avoiding misjudgment. If the connection is poor or disconnected, the current may be lower than the preset value. By confirming the connection status, such physical connection problems can be ruled out, ensuring that subsequent threshold adjustments and system operations are based on the correct connection status, ensuring the accuracy of threshold adjustment. In addition, if a poor connection or disconnection is found when confirming the connection status, it can be repaired in time to avoid further fault diagnosis and processing. This helps to quickly restore the normal operation of the system.

[0083] Step S106, if the first current is less than or equal to the preset current and the power supply device and the receiving device are disconnected, the sending threshold of the power supply device is set to the first sending threshold, the receiving threshold of the power supply device is set to the first receiving threshold, the sending threshold of the receiving device is set to the second sending threshold, and the receiving threshold of the receiving device is set to the second receiving threshold.

[0084] Specifically, the first sending threshold and the first receiving threshold are the initial threshold group of the power supply device, and the second sending threshold and the second receiving threshold are the initial threshold group of the receiving device. When the first current is less than or equal to the preset current and the power supply device and the receiving device are disconnected, the sending threshold and the receiving threshold of the power supply device do not need to be adjusted, and they are still the thresholds in the initial threshold group of the power supply device, and the sending threshold and the receiving threshold of the receiving device do not need to be adjusted, and they are still the thresholds in the initial threshold group of the receiving device. This design can avoid unnecessary threshold adjustment operations and reduce the complexity of system management. In addition, maintaining the initial threshold can ensure that the system behaves consistently when disconnected, avoiding unpredictable behavior caused by threshold changes. This helps the system return to normal more easily when the connection is restored.

[0085] Step S107: If the first current is less than or equal to the preset current, and the power supply device is connected to the receiving device, execute step S104.

[0086] Specifically, when the first current is less than or equal to the preset current, and it is determined that the power supply device and the receiving device are in a connected state, at this time, the first current and the preset current are repeatedly compared. In this process, if the first current is always less than the preset current, the sending threshold and the receiving threshold of the power supply device and the receiving device do not need to be adjusted, and the thresholds in the initial threshold group are still maintained. Only when the first current is greater than the preset current are the above steps S102 to S103 executed. Therefore, by continuously monitoring the first current and the connection status between the power supply device and the receiving device, it can be ensured that the system can respond in a timely manner, avoid misjudgment due to threshold adjustment, and improve the reliability of the system.

[0087] It should be noted that the workflow diagram of the communication method provided in the embodiment of the present application is as follows Figure 5 As shown, Figure 5 In the figure, SRC is the power supply end (Source), SNK is the power receiving end (Sink), ADC is the analog-to-digital converter (Analog-to-Digital Converter), A1, A2 and A3 are three current judgment values, R1, R2, R3 and R4 are all receiving thresholds, T1, T2, T3 and T4 are all sending thresholds, R1 and T1 are a threshold group, R2 and T2 are a threshold group, R3 and T3 are a threshold group, and R4 and T4 are a threshold group. The specific process is explained as follows: First, SRC (SNK) is powered on and initialized, and the USB PD chip initializes the receiving threshold and sending threshold to R1 and T1. At this time, SRC (SNK) and SNK (SRC) establish a connection, and the USB PD chip detects the first current transmitted through ADC. Then the current value of the first current is compared with A1, A2 and A3 to determine the corresponding sending threshold and receiving threshold. Specifically, when the current value is less than or equal to A1, determine whether SRC (SNK) and SNK (SRC) are disconnected. If disconnected, execute the step of initializing the receiving threshold and sending threshold to R1 and T1 of the USB PD chip; if not disconnected, continue to determine the size of the current value and A1 until the current value is greater than A1. Next, continue to determine whether the current value is less than or equal to A2. If the current value is greater than A1 and less than or equal to A2, the USB PD chip sets the receiving threshold and sending threshold to R2 and T2. If the current value is greater than A2, then continue to determine whether the current value is less than or equal to A3. If the current value is greater than A2 and less than or equal to A3, the USB PD chip sets the receiving threshold and sending threshold to R3 and T3. If the current value is greater than A3, the USB PD chip sets the receiving threshold and sending threshold to R4 and T4.

[0088] In one embodiment of the present application, the communication method further includes steps S108 to S109.

[0089] Step S108: monitoring the communication quality parameters between the power supply device and the receiving device.

[0090] Specifically, communication quality parameters generally include signal strength, bit error rate, signal delay, etc. This application can ensure that the communication between the devices is stable and reliable by monitoring the communication quality parameters between the power supply device and the receiving device in real time. This helps to promptly discover and deal with potential communication problems and avoid data transmission errors or interruptions caused by poor communication quality.

[0091] Step S109: when it is detected that the communication quality parameter is less than a preset value, the sending threshold and the receiving threshold of the power supply device are increased, and the sending threshold and the receiving threshold of the receiving device are decreased.

[0092] Specifically, the preset value is used to determine whether the communication quality is within an acceptable range. Setting the preset value helps the system take measures before the communication quality drops to an unacceptable level. This can prevent the communication quality from further deteriorating and ensure that the system operates in a normal state. When the communication quality parameter is less than the preset value, it indicates that the communication quality is gradually decreasing. At this time, the sending threshold and receiving threshold of the power supply device are increased, and the sending threshold and receiving threshold of the receiving device are reduced at the same time, thereby effectively adjusting the potential difference. It ensures that when the power transmitted between the power supply device and the receiving device increases, the receiving device can normally receive the protocol information sent by the power supply device, thereby maintaining the stability and reliability of communication during high-power transmission, and significantly improving the communication quality.

[0093] In one embodiment of the present application, the communication method further includes step S110 to step S111.

[0094] Step S110, obtaining a correspondence between the first current and the first target threshold group, and a correspondence between the first current and the second target threshold group.

[0095] Specifically, the correspondence between the first current and the first target threshold value group and the second target threshold value group can be determined by experiments or predefined rules. For example, the first threshold value group and the second threshold value group under different current values ​​can be measured by experiments, so as to determine the first target threshold value group and the second target threshold value group according to the detected first current. Alternatively, the correspondence relationship can be defined according to the requirements of system design, which can be in the form of mathematical functions, tables or mapping tables.

[0096] Step S111 : associating and storing the first current with the first target threshold group, and associating and storing the first current with the second target threshold group.

[0097] Specifically, after the correspondence between the first current and the first target threshold group is obtained, the first current and the first target threshold group are associated and stored so that they can be quickly searched and applied in subsequent use. Similarly, after the correspondence between the first current and the second target threshold group is obtained, the first current and the second target threshold group are associated and stored so that they can be quickly searched and applied in subsequent use.

[0098] It should be noted that association and storage can be implemented in a variety of ways. It can be stored in a database, and the corresponding relationship can be obtained by querying the database to determine the first target threshold group and the second target threshold group. It can also be stored in a mapping table, using a dictionary or a hash table to store the corresponding relationship between the first current and the first target threshold group and the second target threshold group, so as to quickly search.

[0099] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0100] Figure 6 Schematic diagram of the structure of the communication device provided in the embodiment of the present application is shown. Figure 6 As shown, the communication device includes:

[0101] The acquisition module 61 is used to acquire a first current transmitted between the power supply device and the receiving device.

[0102] The determination module 62 is configured to determine a first target threshold group and a second target threshold group according to the first current.

[0103] The adjustment module 63 is used to adjust the sending threshold and the receiving threshold of the power supply device according to the first target threshold group, and adjust the sending threshold and the receiving threshold of the receiving device according to the second target threshold group.

[0104] In one embodiment of the present application, the acquisition module 61 is further used to:

[0105] Obtaining a first voltage between a first interface and ground; wherein the first interface is an interface connected to the power supply device or an interface connected to the receiving device;

[0106] The first current is obtained by calculating a quotient of the first voltage and a resistance value of a sampling resistor.

[0107] In one embodiment of the present application, the determination module 62 is further configured to:

[0108] determining a target current interval according to the first current;

[0109] The first target threshold group and the second target threshold group are determined according to the target current interval.

[0110] In one embodiment of the present application, the current interval includes a first current interval, a second current interval and a third current interval, and the determination module 62 is further used to:

[0111] When the first current is within the first current interval, determining the first threshold group as the first target threshold group, and determining the second threshold group as the second target threshold group;

[0112] When the first current is within the second current interval, determining the third threshold group as the first target threshold group, and determining the fourth threshold group as the second target threshold group;

[0113] When the first current is within the third current interval, the fifth threshold group is determined as the first target threshold group, and the sixth threshold group is determined as the second target threshold group.

[0114] In one embodiment of the present application, the communication device further includes:

[0115] A comparison module, used for comparing the first current with a preset current;

[0116] A first judgment module, used for determining a connection state between the power supply device and the receiving device when the first current is less than or equal to the preset current;

[0117] a threshold setting module, configured to set the sending threshold of the power supply device to a first sending threshold, the receiving threshold of the power supply device to a first receiving threshold, the sending threshold of the receiving device to a second sending threshold, and the receiving threshold of the receiving device to a second receiving threshold when the first current is less than or equal to the preset current and the power supply device and the receiving device are disconnected;

[0118] The second judgment module is used to perform the step of comparing the first current with the preset current when the first current is less than or equal to the preset current and the power supply device and the receiving device are connected.

[0119] In one embodiment of the present application, the communication device further includes:

[0120] A monitoring module, used to monitor the communication quality parameters between the power supply device and the receiving device;

[0121] The threshold adjustment module is used to increase the sending threshold and receiving threshold of the power supply device and reduce the sending threshold and receiving threshold of the receiving device when detecting that the communication quality parameter is less than a preset value.

[0122] In one embodiment of the present application, the communication device further includes:

[0123] a correspondence acquisition module, used to acquire a correspondence between the first current and the first target threshold group, and a correspondence between the first current and the second target threshold group;

[0124] A storage module is used to associate and store the first current with the first target threshold group, and to associate and store the first current with the second target threshold group.

[0125] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0126] like Figure 7 As shown, the electronic device 7 of this embodiment may include: at least one processor 70 ( Figure 7 Only one processor 70 is shown in the figure), a memory 71, and a computer program 72 stored in the memory 71 and executable on the at least one processor 70. When the processor 70 executes the computer program 72, the steps in any of the above-mentioned method embodiments are implemented, for example Figure 1 Steps S101 to S103 in the illustrated embodiment. Alternatively, when the processor 70 executes the computer program 72, the functions of each module / unit in the above-mentioned device embodiments are implemented, for example Figure 6 The functions of modules 61 to 63 are shown.

[0127] Exemplarily, the computer program 72 may be divided into one or more modules / units, which are stored in the memory 71 and executed by the processor 70 to implement the present invention. The one or more modules / units may be a series of computer program 72 instruction segments capable of implementing specific functions, which are used to describe the execution process of the computer program 72 in the electronic device 7.

[0128] The processor 70 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0129] In some embodiments, the memory 71 may be an internal storage unit of the electronic device 7, such as a hard disk or memory of the electronic device 7. In other embodiments, the memory 71 may also be an external storage device of the communication device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device 7. Further, the memory 71 may also include both an internal storage unit of the electronic device 7 and an external storage device. The memory 71 is used to store an operating system, an application program, a boot loader (Boot Loader), data and other programs, such as the program code of the computer program 72. The memory 71 may also be used to temporarily store data that has been output or is to be output.

[0130] The embodiment of the present application further provides a computer-readable storage medium, which stores a computer program 72. When the computer program 72 is executed by the processor 70, the steps in the above-mentioned method embodiments can be implemented.

[0131] An embodiment of the present application provides a computer program product. When the computer program product runs on a mobile terminal, the mobile terminal can implement the steps in the above-mentioned method embodiments when executing the computer program product.

[0132] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program 72, and the computer program 72 can be stored in a computer-readable storage medium. When the computer program 72 is executed by the processor 70, the steps of the above-mentioned various method embodiments can be implemented. Among them, the computer program 72 includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium can at least include: any entity or device that can carry the computer program code to the terminal device, a recording medium, a computer memory, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, RandomAccess Memory), an electric carrier signal, a telecommunication signal, and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.

[0133] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0134] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0135] In the embodiments provided in the present application, it should be understood that the disclosed devices / network equipment and methods can be implemented in other ways. For example, the device / network equipment embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0136] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0137] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A communication method, characterized in that: include: Acquire a first current transmitted between a power supply device and a receiving device; determining a first target threshold group and a second target threshold group according to the first current; The sending threshold and the receiving threshold of the power supply device are adjusted according to the first target threshold group, and the sending threshold and the receiving threshold of the receiving device are adjusted according to the second target threshold group.

2. The communication method according to claim 1, characterized in that: The obtaining of a first current transmitted between the power supply device and the receiving device includes: Obtaining a first voltage between a first interface and ground; wherein the first interface is an interface connected to the power supply device or an interface connected to the receiving device; The first current is obtained by calculating a quotient of the first voltage and a resistance value of a sampling resistor.

3. The communication method according to claim 1, characterized in that: The determining of a first target threshold group and a second target threshold group according to the first current includes: determining a target current interval according to the first current; The first target threshold group and the second target threshold group are determined according to the target current interval.

4. The communication method according to claim 3, characterized in that: The current interval includes a first current interval, a second current interval, and a third current interval, and the determining the first target threshold group and the second target threshold group according to the target current interval includes: When the first current is within the first current interval, determining the first threshold group as the first target threshold group, and determining the second threshold group as the second target threshold group; When the first current is within the second current interval, determining the third threshold group as the first target threshold group, and determining the fourth threshold group as the second target threshold group; When the first current is within the third current interval, the fifth threshold group is determined as the first target threshold group, and the sixth threshold group is determined as the second target threshold group.

5. The communication method according to claim 1, characterized in that: The method further comprises: comparing the first current with a preset current; If the first current is less than or equal to the preset current, determining a connection state between the power supply device and the receiving device; If the first current is less than or equal to the preset current, and the power supply device and the receiving device are disconnected, the sending threshold of the power supply device is set to the first sending threshold, the receiving threshold of the power supply device is set to the first receiving threshold, the sending threshold of the receiving device is set to the second sending threshold, and the receiving threshold of the receiving device is set to the second receiving threshold; If the first current is less than or equal to the preset current, and the power supply device and the receiving device are connected, the step of comparing the first current with the preset current is performed.

6. The communication method according to claim 1, characterized in that: The method further comprises: monitoring a communication quality parameter between the power supply device and the receiving device; When it is detected that the communication quality parameter is less than a preset value, the sending threshold and the receiving threshold of the power supply device are increased, and the sending threshold and the receiving threshold of the receiving device are decreased.

7. The communication method according to any one of claims 1 to 6, characterized in that: The method further comprises: Acquire a correspondence between the first current and the first target threshold group, and a correspondence between the first current and the second target threshold group; The first current is associated with the first target threshold group and stored, and the first current is associated with the second target threshold group and stored.

8. A communication device, characterized in that: include: An acquisition module, used to acquire a first current transmitted between a power supply device and a receiving device; A determination module, configured to determine a first target threshold group and a second target threshold group according to the first current; The adjustment module is used to adjust the sending threshold and receiving threshold of the power supply device according to the first target threshold group, and adjust the sending threshold and receiving threshold of the receiving device according to the second target threshold group.

9. An electronic device comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.