Data transmission method and electronic device based on charging cable

By implementing duplex transmission and active reporting functions on the data signal line in the charging cable, the problems of low data transmission efficiency and insufficient security in the existing fast charging protocol are solved, and charging efficiency and safety are improved.

CN115864582BActive Publication Date: 2024-10-29HUAWEI TECH CO LTD

Patent Information

Application Number
CN202211602263.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-15
Publication Date
2024-10-29
Estimated Expiration
2041-07-15

AI Technical Summary

Technical Problem

In the existing fast charging protocol, the charging data transmission efficiency based on D+/D- channel is low, resulting in information transmission delay during the charging process, affecting the safety of the charging system, and the USB PD fast charging protocol cannot be applied to non-Type-C interface scenarios , limiting charging power and flexibility.

Method used

By using different data signal lines in the charging cable to send and receive messages, duplex transmission on the data signal lines is achieved, allowing electronic devices to send messages without waiting for the peer to complete sending, and proactively report in abnormal situations. Improve the safety and efficiency of the charging process.

Benefits of technology

It improves charging data transmission efficiency, shortens the handshake time in fast charging mode, improves the charging experience, and enhances the safety and flexibility of the charging system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115864582B_ABST
    Figure CN115864582B_ABST
Patent Text Reader

Abstract

The present application discloses a data transmission method based on a charging cable and an electronic device, wherein a first electronic device is connected to a second electronic device via a third electronic device, wherein the third electronic device includes a first data signal line and a second data signal line. When the method is applied to the first electronic device, the connection with the second electronic device can be detected; a first message is sent via a first pin; the first pin is connected to the first data signal line; a second message is received via a second pin; the second pin is connected to the second data signal line; the first message and the second message are used to set the charging of the first electronic device.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application. The application number of the original application is 202180003825.7, and the original application date is July 15, 2021. The entire contents of the original application are incorporated into this application by reference. Technical Field

[0002] The present application relates to the field of charging technology, and in particular to a data transmission method and electronic device based on a charging cable. Background Art

[0003] As smart terminals become more diversified and larger in screen size, power consumption and battery capacity are increasing, and smart terminal devices have a growing demand for fast charging. In recent years, a variety of fast charging protocols have emerged in the industry.

[0004] One type of fast charging protocol is the single-line communication (Configuration Channel, CC) fast charging protocol. The representative based on the CC communication protocol is USB PD. The terminal products in USB PD can support the USB Type C interface defined by the USB Association, referred to as the Type-C interface. The advantages of the USB Type-C interface are: support for double-sided insertion of the USB interface, a slimmer and simpler design, and a more powerful circuit transmission (maximum 100W). Due to these advantages, the terminal products can be quickly charged to meet the charging needs of customers. However, the USB PD fast charging protocol cannot be applied to other charging scenarios except the Type-C to Type-C interface, such as Type A to Type B interface scenarios, and the USB PD protocol has greater restrictions on charging power and specifications, and is more complex to implement and has higher costs.

[0005] Another type of fast charging protocol is a fast charging protocol based on D+ / D- (Data+ / Data-) channel communication, such as Huawei SCP, OPPO VOOC, QC, Samsung AFC, etc. However, in the existing charging process based on D+ / D- (Data+ / Data-) channel communication, the transmission efficiency of charging data or instructions is very low. During the charging process of the terminal product, the charging status of the terminal or power supply equipment or the transmission of sudden faults waiting to be transmitted may be delayed, resulting in an impact on the safety of the charging system. Summary of the invention

[0006] The present application provides a data transmission method and electronic device based on a charging cable, which are used to improve the data transmission efficiency of a D+ / D- channel during a charging process.

[0007] In a first aspect, the present application provides a data transmission method based on a charging cable, which is applied to a first electronic device, wherein the first electronic device is connected to a second electronic device via a third electronic device, wherein the third electronic device includes a first data signal line and a second data signal line, and the method includes: detecting a connection with the second electronic device; sending a first message via a first pin; the first pin is connected to the first data signal line; receiving a second message via a second pin; the second pin is connected to the second data signal line; the first message and the second message are used to set the charging of the first electronic device.

[0008] Different from the prior art, in which the messages between the first electronic device and the second electronic device can only be sent and received through the D-data signal line. Through the above method, it is possible to send and receive messages on different data signal lines, so that electronic devices do not need to wait for the other end to send messages before sending messages to each other, thereby effectively improving the transmission efficiency of data on the data signal line. In addition, compared with the second electronic device as a device to be charged and the second electronic device as a power supply device, in the prior art, only the first electronic device can actively send messages to the second electronic device, and the second electronic device passively responds. In this application, the first electronic device can also receive messages actively sent by the second electronic device or the third electronic device, especially when the second electronic device or the third electronic device is abnormal and needs to be actively reported, which can effectively improve the safety of the charging process.

[0009] In a possible implementation manner, the first pin is a pin connected to a negative signal data line; and the second pin is a pin connected to a positive signal data line.

[0010] In a possible implementation manner, the first pin is a pin connected to a positive signal data line; and the second pin is a pin connected to a negative signal data line.

[0011] Through the above method, the pin of the positive signal data line (for example, D+) can be set to the first pin, and the pin of the negative signal data line (for example, D-) can be set to the second pin. The pin of the positive signal data line (for example, D+) can be set to the second pin, and the pin of the negative signal data line (for example, D-) can be set to the first pin, so as to realize independent sending or receiving of signals on different data lines, realize duplex transmission on the signal data lines, and different duplex transmission modes can be set as needed, thereby effectively improving the data transmission efficiency and data transmission flexibility.

[0012] A possible implementation method is to detect the connection with the second electronic device through the first pin or the second pin to determine that the second electronic device is a dedicated charging interface DCP device; send a first pulse signal through the first pin; detect the electrical signal of the second electronic device through the second pin to confirm that the second electronic device supports the fast charging mode.

[0013] Taking into account that the handshake process of the communication protocol in the prior art is time-consuming, the above-mentioned method of sending the first pulse signal is used to implement a handshake protocol in which the first electronic device and the second electronic device support charging the battery of the first electronic device through the fast charging mode. The second electronic device can quickly detect the first pulse signal, thereby shortening the time to enter the fast charging mode, especially when the battery of the first electronic device is too low, it can quickly enter the fast charging mode to improve the charging experience.

[0014] In a possible implementation manner, the second pin is a pin connected to a positive signal data line, and the electrical signal is a high-level signal.

[0015] By the above method, when the second pin is a pin connected to the positive signal data line, considering that the first electronic device sends the first pulse signal through the first pin, at this time, the first pin is a negative signal data line, which is at a low level in the idle state. Therefore, the electrical signal of the second electronic device can be a high-level signal, for example, the high-level signal can be a high-level pulse signal. Thus, the first electronic device can quickly confirm the completion of the handshake by detecting the high-level signal, further shortening the time to enter the fast charging mode.

[0016] In a possible implementation manner, the second pin is a pin connected to a negative signal data line, and the electrical signal is a low level signal.

[0017] Through the above method, when the second pin is a pin connected to the negative signal data line, considering that the first electronic device sends the first pulse signal through the first pin, at this time, the first pin is a positive signal data line, which is at a high level in the idle state. Therefore, the electrical signal of the second electronic device can be a low-level signal, for example, the low-level signal can be a low-level pulse signal. Thus, the first electronic device can quickly confirm the completion of the handshake by detecting the low-level signal, further shortening the time to enter the fast charging mode.

[0018] In a possible implementation, the first message includes: a first identifier; the first identifier is used to indicate a recipient of the first message; the second message includes: a second identifier; the second identifier is used to indicate a recipient of the second message.

[0019] In one possible implementation, the recipient of the first message is the chip of the third electronic device, and the recipient of the second message is the first electronic device; in one possible implementation, the recipient of the first message is the second electronic device; and the recipient of the second message is the first electronic device.

[0020] Taking into account that a third electronic device may also participate in data transmission, the above method may be used to set an identifier for the recipient of the message, thereby distinguishing the recipient of the message in the data transmission system, avoiding misprocessing of the message, and improving the reliability of message transmission.

[0021] In a possible implementation, before sending the first message through the first pin, the method further includes: sending a first signal through the first pin; the frequency of the first signal is a first frequency; and the first signal is used to indicate that the frequency of the first message is the first frequency.

[0022] Through the above method, the first electronic device can send a first signal, thereby negotiating with the second electronic device to determine the frequency of sending the first signal, so that the frequency of the signal for data transmission between the first electronic device and the second electronic device can be negotiated and adjusted as needed, thereby improving the flexibility of data transmission. In addition, by adjusting the frequency of the signal, the anti-interference ability of data transmission can be achieved, the reliability of data signal transmission can be improved, and the performance of data transmission can be improved.

[0023] In a possible implementation, a second signal is received through the second pin; a frequency of the second signal is a second frequency; and the second signal is used to indicate that a frequency of the second message is the second frequency.

[0024] Through the above method, the first electronic device can receive the second signal sent by the second electronic device to determine that the frequency of sending the first signal is the second frequency as determined by negotiation with the second electronic device.

[0025] In a possible implementation, the first message includes at least one data frame; the data frame is any one of the following: data packet header information, data information, control information, and cyclic redundancy check; wherein a data frame includes: a start field, a data field, and an end field.

[0026] Through the above method, the first electronic device can determine the content of the message sent to the second electronic device as needed, thereby improving the flexibility of sending the first message. Through the start field and the end field of the sent data frame, the second electronic device can accurately receive the first message. In addition, the reliability of data transmission can be improved through the cyclic redundancy check field. Similarly, the second electronic device or the third device can also determine the content of the second message sent to the first electronic device as needed, thereby improving the flexibility of sending the second message.

[0027] In a possible implementation manner, the data packet header information includes the first identifier.

[0028] Through the above method, after the receiving end (for example, the second electronic device or the third electronic device) receives the first message, it can first determine the first identifier included in the data packet header information, thereby determining whether the first message is a message sent to itself. After confirming that the first message is a message sent to itself, the remaining fields are parsed to avoid unnecessary message processing at the receiving end and save power consumption.

[0029] In a possible implementation, before sending the first message through the first pin, the method further includes: sending a start signal; the start signal is a high level signal; after sending the first message through the first pin, the method further includes: sending an end signal; the end signal is a low level signal;

[0030] Alternatively, before sending the first message through the first pin, the method further includes: sending a start signal; the start signal is a low-level signal; after sending the first message through the first pin, the method further includes: sending an end signal; the end signal is a high-level signal.

[0031] Through the above method, a start signal can be sent so that the receiving end determines the start of the message, thereby improving the efficiency of message reception. And an end signal can be sent so that the receiving end determines the end of the message, thereby avoiding the receiving end from receiving the message incorrectly, thereby improving the efficiency of message reception.

[0032] In a possible implementation, before receiving the second message through the second pin, the method further includes: receiving a start signal; the start signal is a high level signal; after receiving the second message through the second pin, the method further includes: receiving an end signal; the end signal is a low level signal;

[0033] Alternatively, before receiving the second message through the second pin, the method further includes: receiving a start signal; the start signal is a low level signal; after receiving the second message through the second pin, the method further includes: receiving an end signal; the end signal is a high level signal.

[0034] Through the above method, the start of the received message can be determined by the received start signal, thereby improving the efficiency of message reception, and the end of the received message can be determined by the received end signal, thereby avoiding erroneous reception of the message and improving the efficiency of message reception.

[0035] In a possible implementation, a first reset signal is sent through the first pin; the first reset signal is used to instruct a receiver of the first reset signal to reset; and a pulse width of the first reset signal is associated with the receiver.

[0036] Through the above method, when it is confirmed that the data transmission is abnormal, or other abnormal conditions occur, a first reset signal can be sent to the second electronic device or the third electronic device, so that the receiving party can confirm that the current data transmission is abnormal based on the received first reset signal, and can stop the loss in time to avoid abnormal charging behavior from causing damage to the device, thereby improving the safety of charging. In addition, in order to distinguish the first reset signals sent to different receiving parties, the pulse width of the first reset signal can also be associated with the receiving party, thereby avoiding erroneous reset.

[0037] In a second aspect, the present application provides a data transmission method based on a charging cable, which is applied to a second electronic device, wherein the second electronic device is connected to a first electronic device via a third electronic device, wherein the third electronic device includes a first data signal line and a second data signal line, and the method includes: determining a connection with the first electronic device; receiving a first message via a first pin; connecting the first pin to the first data signal line; sending a second message via a second pin; connecting the second pin to the second data signal line; and the first message and the second message are used to set the charging of the first electronic device.

[0038] Different from the prior art, in which messages between the first electronic device and the second electronic device can only be sent and received through the D-data signal line. Through the above method, it is possible to send and receive messages on different data signal lines, so that electronic devices do not need to wait for the other end to send messages before sending messages to each other. In addition, compared with the solution in the prior art that can only respond passively when the second electronic device is used as a charging device, the second electronic device in this application can also actively send messages to the first electronic device or the third electronic device, thereby effectively improving the transmission efficiency of data on the data signal line. Especially in the scenario where the second electronic device or the third electronic device is abnormal and needs to be actively reported, the safety of the charging process can be effectively improved.

[0039] In a possible implementation manner, the first pin is a pin connected to a negative signal data line; and the second pin is a pin connected to a positive signal data line.

[0040] In a possible implementation manner, the first pin is a pin connected to a positive signal data line; and the second pin is a pin connected to a negative signal data line.

[0041] Through the above method, the pin of the positive signal data line (for example, D+) can be set to the first pin, and the pin of the negative signal data line (for example, D-) can be set to the second pin. The pin of the positive signal data line (for example, D+) can be set to the second pin, and the pin of the negative signal data line (for example, D-) can be set to the first pin, so as to realize independent sending or receiving of signals on different data lines, realize duplex transmission on the signal data lines, and different duplex transmission modes can be set as needed, thereby effectively improving the data transmission efficiency and data transmission flexibility.

[0042] In a possible implementation, a detection signal from the first electronic device is received through the first pin or the second pin, where the detection signal is used by the first electronic device to determine that the second electronic device is a dedicated charging interface DCP device;

[0043] A first pulse signal is received from the first electronic device through the first pin; and an electrical signal is sent to the first electronic device through the second pin to confirm that the battery of the first electronic device is charged in a fast charging mode.

[0044] Taking into account that the handshake process of the communication protocol in the prior art is time-consuming, the method of the first electronic device sending the first pulse signal is implemented through the first electronic device and the second electronic device to support the handshake protocol for charging the battery of the first electronic device through the fast charging mode. The second electronic device can quickly detect the first pulse signal, thereby shortening the time to enter the fast charging mode. Especially when the battery of the first electronic device is too low, it can quickly enter the fast charging mode to improve the charging experience.

[0045] In a possible implementation, the second pin is a pin connected to a positive signal data line, and the electrical signal is a high-level signal; the second pin is a pin connected to a negative signal data line, and the electrical signal is a low-level signal.

[0046] By the above method, when the second pin is a pin connected to the positive signal data line, considering that the first electronic device sends the first pulse signal through the first pin, the first pin is a negative signal data line, which is at a low level in the idle state. Therefore, the electrical signal of the second electronic device can be a high-level signal. Thus, the first electronic device can quickly confirm the completion of the handshake by detecting the high-level pulse signal, further shortening the time to enter the fast charging mode.

[0047] When the second pin is a pin connected to the negative signal data line, considering that the first electronic device sends the first pulse signal through the first pin, at this time, the first pin is a positive signal data line, which is at a high level in the idle state. Therefore, the electrical signal of the second electronic device can be a low-level signal. Thus, the first electronic device can quickly confirm that the handshake is completed by detecting the low-level signal, further shortening the time to enter the fast charging mode.

[0048] In a possible implementation, the first message includes: a first identifier; the first identifier is used to indicate a recipient of the first message; the second message includes: a second identifier; the second identifier is used to indicate a recipient of the second message.

[0049] Taking into account that a third electronic device may also participate in data transmission, the above method may be used to set an identifier for the recipient of the message, thereby distinguishing the recipient of the message in the data transmission system, avoiding misprocessing of the message, and improving the reliability of message transmission.

[0050] In a possible implementation manner, the recipient of the first message is the second electronic device; and the recipient of the second message is the first electronic device.

[0051] In a possible implementation manner, when the recipient of the first message is the chip of the third electronic device, the second message is not sent to the first electronic device.

[0052] The above method can avoid conflicts caused by the second electronic device actively sending a message to the first electronic device when the first electronic device transmits a message to the third electronic device, thereby improving the reliability of message transmission.

[0053] In a possible implementation, before sending the second message through the second pin, the method further includes: sending a start signal; the start signal is a high level signal; after sending the second message through the second pin, the method further includes: sending an end signal; the end signal is a low level signal;

[0054] Alternatively, before sending the second message through the second pin, the method further includes: sending a second signal through the second pin; the frequency of the second signal is a second frequency; and the second signal is used to indicate that the frequency of the second message is the second frequency.

[0055] Through the above method, the second electronic device can send the second signal to the first device, so that the first device determines to negotiate with the second electronic device to determine that the frequency of the first electronic device sending the first signal is the second frequency. The frequency of the signal for data transmission between the first electronic device and the second electronic device can be negotiated and adjusted as needed, thereby improving the flexibility of data transmission. In addition, by adjusting the frequency of the signal, the anti-interference ability of data transmission can be achieved, the reliability of data signal transmission can be improved, and the performance of data transmission can be improved.

[0056] In a possible implementation, a first signal is received through the first pin; a frequency of the first signal is a first frequency; and the first signal is used to indicate that a frequency of the first message is the first frequency.

[0057] Through the above method, the first electronic device can send the first signal, thereby negotiating with the second electronic device to determine the frequency of sending the first signal, so that the frequency of the signal for data transmission between the first electronic device and the second electronic device can be negotiated and adjusted as needed, thereby improving the flexibility of data transmission. In addition, by adjusting the frequency of the signal, the anti-interference ability of data transmission can be achieved, the reliability of data signal transmission can be improved, and the performance of data transmission can be improved.

[0058] In a possible implementation, the first message includes at least one data frame; the data frame is any one of the following: data packet header information, data information, control information, and cyclic redundancy check; wherein a data frame includes: a start field, a data field, and an end field.

[0059] Through the above method, the first electronic device can determine the content of the message sent to the second electronic device as needed, thereby improving the flexibility of sending the first message. Through the start field and the end field of the sent data frame, the second electronic device can accurately receive the first message. In addition, the reliability of data transmission can be improved through the cyclic redundancy check field. Similarly, the second electronic device can also determine the content of the second message sent to the first electronic device as needed, thereby improving the flexibility of sending the second message.

[0060] In a possible implementation, before sending the second message through the second pin, the method further includes: sending a start signal; the start signal is a high level signal; after sending the second message through the second pin, the method further includes: sending an end signal; the end signal is a low level signal;

[0061] Alternatively, before sending the second message through the second pin, the method further includes: sending a start signal; the start signal is a low level signal; after sending the second message through the second pin, the method further includes: sending an end signal; the end signal is a high level signal.

[0062] Through the above method, a start signal can be sent so that the receiving end determines the start of the message, thereby improving the efficiency of message reception. And an end signal can be sent so that the receiving end determines the end of the message, thereby avoiding the receiving end from receiving the message incorrectly, thereby improving the efficiency of message reception.

[0063] In a possible implementation, before receiving the first message through the first pin, the method further includes: receiving a start signal; the start signal is a high level signal; after receiving the first message through the first pin, the method further includes: receiving an end signal; the end signal is a low level signal;

[0064] Alternatively, before receiving the first message through the first pin, the method further includes: receiving a start signal; the start signal is a low level signal; after receiving the first message through the first pin, the method further includes: receiving an end signal; the end signal is a high level signal.

[0065] Through the above method, the start of the received message can be determined by the received start signal, thereby improving the efficiency of message reception, and the end of the received message can be determined by the received end signal, thereby avoiding erroneous reception of the message and improving the efficiency of message reception.

[0066] In a possible implementation, a first reset signal is received through the first pin; a pulse width of the first reset signal is associated with the second electronic device; and the second electronic device is reset according to the first reset signal.

[0067] Through the above method, when the first electronic device confirms that data transmission is abnormal, or other abnormal situations occur, it can send a first reset signal to the second electronic device, so that the second electronic device can confirm that the current data transmission is abnormal based on the first reset signal sent by the first electronic device, and can stop the loss in time to avoid abnormal charging behavior from causing damage to various electronic devices, thereby improving the safety of charging.

[0068] In a possible implementation, a second reset signal is received through the first pin; a pulse width of the second reset signal is associated with the third electronic device; and the second reset signal is ignored.

[0069] Through the above method, the first reset signal sent by the first electronic device to other recipients can be distinguished, thereby preventing the second electronic device from being reset incorrectly according to the second reset signal.

[0070] In a third aspect, the present application provides a data transmission method based on a charging cable, which is applied to a third electronic device, wherein the third electronic device is used to connect a second electronic device with a first electronic device, and the third electronic device includes a first data signal line and a second data signal line. The method includes: receiving a first message through a first pin; connecting the first pin to the first data signal line; sending a second message through a second pin; connecting the second pin to the second data signal line; the first message and the second message are used to set the charging of the first electronic device.

[0071] Different from the prior art, in which the messages between the first electronic device and the second electronic device can only be sent and received through the D-data signal line. Through the above method, it is possible to send and receive messages on different data signal lines, so that electronic devices do not need to wait for the other end to send messages before sending messages to each other, thereby effectively improving the transmission efficiency of data on the data signal line. In addition, compared with the second electronic device as a device to be charged and the second electronic device as a power supply device, in the prior art, only the first electronic device can actively send messages to the second electronic device, and the second electronic device passively responds. In this application, the first electronic device can also receive messages actively sent by the second electronic device or the third electronic device, especially when the second electronic device or the third electronic device is abnormal and needs to be actively reported, which can effectively improve the safety of the charging process.

[0072] In a possible implementation manner, the first pin is a pin connected to a negative signal data line; and the second pin is a pin connected to a positive signal data line.

[0073] In a possible implementation manner, the first pin is a pin connected to a positive signal data line; and the second pin is a pin connected to a negative signal data line.

[0074] Through the above method, the pin of the positive signal data line (for example, D+) can be set to the first pin, and the pin of the negative signal data line (for example, D-) can be set to the second pin. The pin of the positive signal data line (for example, D+) can be set to the second pin, and the pin of the negative signal data line (for example, D-) can be set to the first pin, so as to realize independent sending or receiving of signals on different data lines, realize duplex transmission on the signal data lines, and different duplex transmission modes can be set as needed, thereby effectively improving the data transmission efficiency and data transmission flexibility.

[0075] In a possible implementation, the first message includes: a first identifier; the first identifier is used to indicate a recipient of the first message; the second message includes: a second identifier; the second identifier is used to indicate a recipient of the second message.

[0076] Considering that a third electronic device may also participate in data transmission, for example, in one possible implementation, the recipient of the first message is the third electronic device; the recipient of the second message is the first electronic device. Through the above method, an identifier can be set for the recipient of the message, thereby distinguishing the recipient of the message in the data transmission system, avoiding mishandling of the message, and improving the reliability of message transmission.

[0077] In a possible implementation manner, when the recipient of the first message is the second electronic device, the second message is not sent to the first electronic device.

[0078] The above method can avoid conflicts caused by the second electronic device actively sending a message to the first electronic device when the first electronic device transmits a message to the third electronic device, thereby improving the reliability of message transmission.

[0079] In a possible implementation, a first signal is received through the first pin; a frequency of the first signal is a first frequency; the first signal is used to indicate that a frequency of the first message is the first frequency;

[0080] Before sending the second message through the second pin, the method further includes: sending a first signal through the second pin; the frequency of the first signal is a second frequency; and the first signal is used to indicate that the frequency of the first message is the second frequency.

[0081] Through the above method, the third electronic device can send the second signal to the first device, so that the first device determines to negotiate with the third electronic device to determine that the frequency of the first electronic device sending the first signal is the second frequency. The frequency of the signal for data transmission between the first electronic device and the third electronic device can be negotiated and adjusted as needed, thereby improving the flexibility of data transmission. In addition, by adjusting the frequency of the signal, the anti-interference ability of data transmission can be achieved, the reliability of data signal transmission can be improved, and the performance of data transmission can be improved.

[0082] In a possible implementation, the first message includes at least one data frame; the data frame is any one of the following: data packet header information, data information, control information, and cyclic redundancy check; wherein a data frame includes: a start field, a data field, and an end field.

[0083] Through the above method, the first electronic device can determine the content of the message sent to the third electronic device as needed, thereby improving the flexibility of sending the first message. Through the start field and end field of the sent data frame, the third electronic device can accurately receive the first message. In addition, the reliability of data transmission can be improved through the cyclic redundancy check field. Similarly, the third device can also determine the content of the second message sent to the first electronic device as needed, thereby improving the flexibility of sending the second message.

[0084] In a possible implementation, before sending the second message through the second pin, the method further includes: sending a start signal; the start signal is a high level signal; after sending the second message through the second pin, the method further includes: sending an end signal; the end signal is a low level signal;

[0085] Alternatively, before sending the second message through the second pin, the method further includes: sending a start signal; the start signal is a low level signal; after sending the second message through the second pin, the method further includes: sending an end signal; the end signal is a high level signal.

[0086] Through the above method, a start signal can be sent so that the receiving end determines the start of the message, thereby improving the efficiency of message reception. And an end signal can be sent so that the receiving end determines the end of the message, thereby avoiding the receiving end from receiving the message incorrectly, thereby improving the efficiency of message reception.

[0087] In a possible implementation, before receiving the first message through the first pin, the method further includes: receiving a start signal; the start signal is a high level signal; after receiving the first message through the first pin, the method further includes: receiving an end signal; the end signal is a low level signal;

[0088] Alternatively, before receiving the first message through the first pin, the method further includes: receiving a start signal; the start signal is a low level signal; after receiving the first message through the first pin, the method further includes: receiving an end signal; the end signal is a high level signal.

[0089] Through the above method, the start of the received message can be determined by the received start signal, thereby improving the efficiency of message reception, and the end of the received message can be determined by the received end signal, thereby avoiding erroneous reception of the message and improving the efficiency of message reception.

[0090] In a possible implementation, a second reset signal is received through the first pin; a pulse width of the second reset signal is associated with the third electronic device; and resetting is performed according to the second reset signal.

[0091] Through the above method, when the first electronic device confirms that data transmission is abnormal, or other abnormal situations occur, a second reset signal can be sent to the third electronic device, so that the third electronic device can confirm that the current data transmission is abnormal based on the received second reset signal, and can stop the loss in time to avoid abnormal charging behavior from causing damage to various electronic devices, thereby improving the safety of charging.

[0092] In a possible implementation, a first reset signal is received through the first pin; a pulse width of the first reset signal is associated with the second electronic device; and the first reset signal is ignored.

[0093] Through the above method, the first reset signal sent by the first electronic device to other recipients can be distinguished, thereby preventing the third electronic device from being reset incorrectly according to the first reset signal.

[0094] In a fourth aspect, the present application provides a data transmission method based on a charging cable, which is applied to a first electronic device, wherein the first electronic device is connected to a second electronic device through a third electronic device, and the third electronic device includes a first data signal line and a second data signal line. The method includes: determining that the second pin is in a state of receiving a message and the first pin is in a state of sending a message; the first pin is connected to the first data signal line; the second pin is connected to the second data signal line; a third message is sent to the third electronic device through the first pin; the third message is used to obtain configuration information of the third electronic device, or the third message is used by the first electronic device to instruct the third electronic device to switch the receiving and sending status of the pin.

[0095] Through the above method, the first electronic device can determine that the second pin is in the state of receiving a message and the first pin is in the state of sending a message, thereby sending a third message to the third electronic device through the first pin to start the communication between the first electronic device and the third electronic device. During the communication process, the configuration information of the third electronic device can be obtained through the third message sent, or the third electronic device can be instructed to switch the transceiver state of the pin of the third electronic device based on needs, thereby realizing the scheduling and control of the transceiver state of the pin of the third electronic device, improving the flexibility and performance of communication between the first electronic device and the third electronic device. At the same time, it also prevents possible conflicts between the first electronic device, the second electronic device, and the third electronic device, and improves the communication performance and efficiency when communicating between multiple devices.

[0096] In a possible implementation, determining that the second pin is in a state of receiving a message and the first pin is in a state of sending a message includes: receiving a message from the second electronic device via the second pin, and determining that the second pin is in a state of receiving a message and the first pin is in a state of sending a message; or sending a message to the second electronic device via the first pin, and determining that the second pin is in a state of receiving a message and the first pin is in a state of sending a message.

[0097] Through the above method, the second pin can be determined to be in a state of receiving a message and the first pin to be in a state of sending a message by receiving a message from the second electronic device. It can also be set according to its own needs, and a message is sent to the second electronic device through the first pin to determine that the second pin is in a state of receiving a message and the first pin is in a state of sending a message. The flexibility of determining that the second pin is in a state of receiving a message and the first pin is in a state of sending a message is improved to adapt to more scenarios.

[0098] In a possible implementation manner, the method further includes: receiving a third response message from the third electronic device through the second pin, where the third response message is used to indicate configuration information of the third electronic device.

[0099] Through the above method, the configuration information of the third electronic device can be received through the second pin to complete the communication process between the first electronic device and the third electronic device, and prepare for the subsequent normal communication between the first electronic device and the second electronic device.

[0100] In a possible implementation manner, the third message includes: a third identifier; the third identifier is used to indicate that a recipient of the third message is the third electronic device.

[0101] Through the above method, by means of the third identifier, it is possible to indicate the recipient of the third message when there are multiple possible receiving modes, thereby improving the directionality of message transmission.

[0102] In a possible implementation, the method further includes: when it is determined that the configuration information reception of the third electronic device fails, sending an indication message to the second electronic device; the indication message is used to instruct the second electronic device to obtain the configuration information of the third electronic device.

[0103] By using the above method, when the first electronic device fails to obtain the configuration information of the third electronic device, the configuration information of the third electronic device can be obtained through the second electronic device, thereby improving the fault tolerance and robustness of obtaining the configuration information of the third electronic device.

[0104] In a possible implementation manner, the method further includes: receiving a notification message from the second electronic device; the notification message is used to notify the second electronic device that acquisition of the configuration information of the third electronic device fails.

[0105] Through the above method, after the second electronic device fails to obtain the configuration information of the third electronic device, the first electronic device obtains the configuration information of the third electronic device.

[0106] In a possible implementation manner, the method further includes: when a fourth message is received from the second electronic device through the second pin, determining that the communication with the third electronic device is terminated.

[0107] Through the above method, when it is determined that the fourth message from the second electronic device is received, it can be determined that the communication between the first electronic device and the second electronic device begins, and it can be determined that the communication between the first electronic device and the third electronic device ends, thereby stopping sending and receiving messages with the third electronic device, avoiding possible conflicts between the first electronic device, the second electronic device, and the third electronic device, and improving transmission performance.

[0108] In a possible implementation, the method further includes: sending a reset message to the third electronic device through the first pin; the reset message is used to indicate that the first pin of the third electronic device and the second pin of the third electronic device are in a state of receiving a message.

[0109] Through the above method, the first electronic device can send a reset message to the third electronic device when necessary. For example, when it is determined that the communication with the third electronic device is terminated, a reset message can be sent to the third electronic device. The first pin of the third electronic device and the second pin of the third electronic device are in a state of receiving a message, thereby avoiding possible conflicts between the first electronic device, the second electronic device, and the third electronic device, and improving transmission performance.

[0110] In a possible implementation, the method further includes: determining that the first pin is in a state of receiving a message and the second pin is in a state of sending a message; sending a fifth message to the third electronic device through the second pin; the fifth message is used to obtain configuration information of the third electronic device; receiving a fifth response message from the third electronic device through the first pin; the fifth response message is used to indicate the configuration information of the third electronic device.

[0111] Through the above method, after determining that the first pin is in a state of receiving a message and the second pin is in a state of sending a message, that is, after determining that the transceiver state of the pin is switched, the third electronic device can be directly instructed to switch the transceiver state of the pin by sending a fifth message, and at the same time, the configuration information of the third electronic device is obtained through the fifth message. While effectively saving signaling, the instruction to switch the transceiver state of the pin of the third electronic device is completed. In another possible scenario, the first electronic device can also send an instruction message through the second pin alone to indicate the switching of the transceiver state of the pin of the third electronic device.

[0112] In a possible implementation, the first pin is a pin connected to a negative signal data line; the second pin is a pin connected to a positive signal data line; or, the first pin is a pin connected to a positive signal data line; the second pin is a pin connected to a negative signal data line.

[0113] In a fifth aspect, the present application provides a data transmission method based on a charging cable, which is applied to a second electronic device, and is applied to the second electronic device. The second electronic device is connected to the first electronic device through a third electronic device, and the third electronic device includes a first data signal line and a second data signal line. The method includes: determining that the first pin is in a state of receiving a message and the second pin is in a state of sending a message; the first pin is connected to the first data signal line; the second pin is connected to the second data signal line; a third message is sent to the third electronic device through the second pin; the third message is used to obtain configuration information of the third electronic device, or the third message is used by the second electronic device to instruct the third electronic device to switch the receiving and sending status of the pin.

[0114] Through the above method, the second electronic device can determine that the first pin is in the state of receiving a message and the second pin is in the state of sending a message; thus, the third message is sent to the third electronic device through the second pin to start the communication between the second electronic device and the third electronic device. During the communication process, the configuration information of the third electronic device can be obtained through the third message sent, or the third electronic device can be instructed to switch the transceiver state of the pin of the third electronic device based on needs, thereby realizing the scheduling and control of the transceiver state of the pin of the third electronic device, improving the flexibility and performance of communication between the first electronic device and the third electronic device. At the same time, it also prevents possible conflicts between the first electronic device, the second electronic device, and the third electronic device, and improves the communication performance and efficiency when communicating between multiple devices.

[0115] In a possible implementation, determining that the first pin is in a state of receiving a message and the second pin is in a state of sending a message includes: receiving a message from the first electronic device via the first pin, and determining that the first pin is in a state of receiving a message and the second pin is in a state of sending a message; or sending a message to the first electronic device via the second pin, and determining that the first pin is in a state of receiving a message and the second pin is in a state of sending a message.

[0116] Through the above method, the first pin can be determined to be in a state of receiving a message and the second pin to be in a state of sending a message by receiving a message from the first electronic device, or it can be set according to its own needs, and a message is sent to the first electronic device through the second pin to determine the first pin to be in a state of receiving a message and the second pin to be in a state of sending a message. The flexibility of determining the first pin to be in a state of receiving a message and the second pin to be in a state of sending a message is improved to adapt to more scenarios.

[0117] In a possible implementation manner, the method further includes: receiving a third response message from the third electronic device through the first pin, where the third response message is used to indicate configuration information of the third electronic device.

[0118] Through the above method, the configuration information of the third electronic device can be received through the first pin to complete the communication process between the second electronic device and the third electronic device, and prepare for the subsequent normal communication between the first electronic device and the second electronic device.

[0119] In a possible implementation manner, the third message includes: a third identifier; the third identifier is used to indicate that a recipient of the third message is the third electronic device.

[0120] Through the above method, when there are multiple possible receiving modes, the recipient of the third message can be indicated by means of the third identifier, thereby improving the directionality of message transmission.

[0121] In a possible implementation, the method further includes: when it is determined that the configuration information of the third electronic device has failed to be received, sending a notification message to the first electronic device; the notification message is used to notify the second electronic device that the configuration information of the third electronic device has failed to be received.

[0122] By using the above method, when the second electronic device fails to obtain the configuration information of the third electronic device, the configuration information of the third electronic device can be obtained through the first electronic device, thereby improving the fault tolerance and robustness of obtaining the configuration information of the third electronic device.

[0123] In a possible implementation, before sending the third message to the third electronic device through the first pin, the method further includes: receiving an indication message from the first electronic device through the second pin; the indication message is used to instruct the second electronic device to obtain configuration information of the third electronic device.

[0124] Through the above method, after the first electronic device fails to obtain the configuration information of the third electronic device, the second electronic device may be instructed to obtain the configuration information of the third electronic device. Alternatively, the first electronic device determines that the second electronic device obtains the configuration information of the third electronic device as required, thereby instructing the second electronic device to obtain the configuration information of the third electronic device.

[0125] In a possible implementation manner, the method further includes: when a fourth message is received from the first electronic device through the second pin, determining that the communication with the third electronic device is terminated.

[0126] Through the above method, after determining that the communication between the second electronic device and the third electronic device is completed, or after determining that the communication between the first electronic device and the third electronic device is completed, a fourth message can be sent to the first electronic device to start the communication between the first electronic device and the second electronic device, and stop sending and receiving messages with the third electronic device, thereby avoiding possible conflicts among the first electronic device, the second electronic device, and the third electronic device and improving transmission performance.

[0127] In a possible implementation, the method further includes: sending a reset message to the third electronic device through the first pin; the reset message is used to indicate that the first pin of the third electronic device and the second pin of the third electronic device are in a state of receiving a message.

[0128] Through the above method, the second electronic device can send a reset message to the third electronic device when necessary. For example, when it is determined that the communication with the third electronic device is terminated, a reset message can be sent to the third electronic device. The first pin of the third electronic device and the second pin of the third electronic device are in a state of receiving a message, thereby avoiding possible conflicts between the first electronic device, the second electronic device, and the third electronic device, and improving transmission performance.

[0129] In a possible implementation, the method further includes: determining that the second pin is in a state of receiving a message and the first pin is in a state of sending a message; sending a fifth message to the third electronic device through the second pin; the fifth message is used to obtain configuration information of the third electronic device; receiving a fifth response message from the third electronic device through the second pin; the fifth response message is used to indicate the configuration information of the third electronic device.

[0130] Through the above method, after determining that the second pin is in a state of receiving a message and the first pin is in a state of sending a message, that is, after determining that the transceiver state of the pin has switched, the third electronic device can be directly instructed to switch the transceiver state of the pin by sending a fifth message, and at the same time, the configuration information of the third electronic device is obtained through the fifth message. While effectively saving signaling, the instruction to switch the transceiver state of the pin of the third electronic device is completed. In another possible scenario, the second electronic device can also send an instruction message through the first pin alone to indicate the switching of the transceiver state of the pin of the third electronic device.

[0131] In a possible implementation, the first pin is a pin connected to a negative signal data line; the second pin is a pin connected to a positive signal data line; or, the first pin is a pin connected to a positive signal data line; the second pin is a pin connected to a negative signal data line.

[0132] In a sixth aspect, the present application provides a data transmission method based on a charging cable, which is applied to a third electronic device, wherein the third electronic device is used to connect a second electronic device with a first electronic device, and the third electronic device includes a first data signal line and a second data signal line. The method includes: when a third message is received through a first pin, setting the first pin to a state of receiving a message and the second pin to a state of sending a message; the first pin is connected to the first data signal line; the second pin is connected to the second data signal line; the recipient of the third message is the third electronic device.

[0133] Through the above method, when a third message is received through the first pin, the first pin can be set to a state of receiving a message, and the second pin can be set to a state of sending a message; so as to start the communication between the electronic device corresponding to the third message and the third electronic device. Thus, the scheduling and control of the transceiver state of the pin of the third electronic device through the received third message is realized, and the flexibility and performance of communication between the first electronic device and the third electronic device are improved. At the same time, possible conflicts between the first electronic device, the second electronic device, and the third electronic device are prevented, and the performance and efficiency of communication when multiple devices are communicated are improved.

[0134] In a possible implementation manner, before the third message is received through the first pin, the method further includes: the first pin and the second pin are in a state of receiving a message.

[0135] Through the above method, before the communication with the first electronic device or the communication with the second electronic device begins, the first pin and the second pin are in the state of receiving messages. Therefore, the third electronic device can effectively receive the message from the first pin or the second pin, and thus switch the receiving and sending state of the pin according to the received message to realize the start of communication, thereby improving the communication efficiency and communication effect between the third electronic device and other electronic devices.

[0136] In a possible implementation manner, the third message further includes: a third identifier; the third identifier is used to indicate that a recipient of the third message is the third electronic device.

[0137] Through the above method, by means of the third identifier, it is possible to indicate the recipient of the third message when there are multiple possible receiving modes, thereby improving the directionality of message transmission.

[0138] In a possible implementation manner, the method further includes:

[0139] When a fourth message is received through the first pin, setting the first pin and the second pin to a state of receiving a message;

[0140] The recipient of the fourth message is the second electronic device or the first electronic device; or, the fourth message is used to indicate that the first pin of the third electronic device and the second pin of the third electronic device are in a state of receiving a message.

[0141] Through the above method, the fourth message of the first electronic device or the second electronic device can be received at the same time, so that, according to the fourth message, the first pin of the third electronic device and the second pin of the third electronic device are determined to be in the state of receiving the message, thereby stopping the state of actively sending messages to the first electronic device or the second electronic identity. Until the next message is received from the first electronic device or the second electronic device, the pin of the third electronic device is adjusted to turn on the sending function of the third electronic device. This prevents possible conflicts between the first electronic device, the second electronic device, and the third electronic device, and improves the communication performance and communication efficiency when communicating between multiple devices.

[0142] In a possible implementation manner, the method further includes:

[0143] When a fifth message is received through the second pin, the second pin is set to a state of receiving a message and the first pin is set to a state of sending a message; the recipient of the fifth message is the third electronic device.

[0144] The receiving and sending state of the switching pin can be determined by the received fifth message, that is, the second pin is set to a state of receiving messages and the first pin is set to a state of sending messages.

[0145] In a possible implementation manner, the third message and the fifth message are sent by the same electronic device; or, the third message is sent by the second electronic device, and the fifth message is sent by the first electronic device.

[0146] In one possible implementation, the third message and the fourth message are used by the first electronic device or the second electronic device to obtain configuration information of the third electronic device; or, the third message and the fourth message are used by the first electronic device or the second electronic device to indicate the receiving and transmitting status of the switching pin of the third electronic device.

[0147] In a possible implementation, the first pin is a pin connected to a negative signal data line; the second pin is a pin connected to a positive signal data line; or, the first pin is a pin connected to a positive signal data line; the second pin is a pin connected to a negative signal data line.

[0148] In a seventh aspect, the present application provides a data transmission method based on a charging cable, which is applied to a first electronic device, wherein the first electronic device is connected to a second electronic device via a third electronic device, and the third electronic device includes a first data signal line. The method includes: detecting a connection with the second electronic device; sending a first message via a first pin; or receiving a second message via the first pin; wherein the first message and the second message are messages encoded via Manchester encoding; the first pin is connected to the first data signal line; the first message and the second message are used to set the charging of the first electronic device.

[0149] Through the above method, the first electronic device can send the first message after Manchester encoding, and decode the received second message through Manchester encoding, without sending a synchronous clock signal in the message, thereby avoiding the problem in the prior art that the receiving end has difficulty in receiving continuous high-frequency signals, resulting in poor transmission performance and low transmission efficiency.

[0150] In a possible implementation manner, the first pin is a pin connected to a negative signal data line; or, the first pin is a pin connected to a positive signal data line.

[0151] Through the above method, the first pin used for transmitting the first message and the second message can be flexibly configured, making data transmission more flexible.

[0152] A possible implementation method is to detect the connection with the second electronic device through the first pin and the second pin to determine that the second electronic device is a dedicated charging interface DCP device; send a first pulse signal through the first pin; detect the electrical signal of the second electronic device through the second pin to confirm whether to charge the battery of the first electronic device through the fast charging mode.

[0153] Taking into account that the handshake process of the communication protocol in the prior art is time-consuming, the above-mentioned method of sending the first pulse signal is used to implement a handshake protocol in which the first electronic device and the second electronic device support charging the battery of the first electronic device through the fast charging mode, thereby shortening the time to enter the fast charging mode. In particular, when the battery of the first electronic device is too low, the fast charging mode can be quickly entered to improve the charging experience.

[0154] In a possible implementation manner, the second pin is a pin connected to a positive signal data line, and the electrical signal is a second pulse signal.

[0155] Through the above method, when the second pin is a pin connected to the positive signal data line, considering that the first electronic device sends the first pulse signal through the first pin, at this time, the first pin is a negative signal data line, which is at a low level in the idle state. Therefore, the electrical signal of the second electronic device can be a second pulse signal, for example, the second response signal can be a high-level pulse signal. Thus, the first electronic device can quickly confirm the completion of the handshake by detecting the second response signal, further shortening the time to enter the fast charging mode.

[0156] In a possible implementation manner, the second pin is a pin connected to a negative signal data line, and the electrical signal is a low level signal.

[0157] By the above method, when the second pin is a pin connected to the negative signal data line, considering that the first electronic device sends the first pulse signal through the first pin, at this time, the first pin is a positive signal data line, which is at a high level in the idle state. Therefore, the electrical signal of the second electronic device can be a low-level signal, so that the first electronic device can quickly confirm the completion of the handshake by detecting the first response signal, shortening the time to enter the fast charging mode and reducing the complexity of the handshake.

[0158] In a possible implementation, the first message includes: a first identifier; the first identifier is used to indicate a recipient of the first message and a sender of the first message; the second message includes: a second identifier; the second identifier is used to indicate a recipient of the second message and a sender of the second message; the recipient of the first message or the sender of the second message is any one of the following: the second electronic device, the third electronic device.

[0159] Taking into account that a third electronic device can also participate in data transmission, through the above method, identifiers can be set for the sender and receiver of the message respectively, thereby distinguishing the sender and receiver of the message in the data transmission system, avoiding misprocessing of the message, and improving the reliability of message transmission.

[0160] In a possible implementation, a first signal is sent through the first pin; a frequency of the first signal is a first frequency; and the first signal is used to negotiate that a communication frequency is the first frequency.

[0161] Through the above method, the first electronic device can send a first signal, thereby negotiating with the second electronic device to determine the frequency of sending the first signal, so that the frequency of the signal for data transmission between the first electronic device and the second electronic device can be negotiated and adjusted as needed, thereby improving the flexibility of data transmission. In addition, by adjusting the frequency of the signal, the anti-interference ability of data transmission can be achieved, the reliability of data signal transmission can be improved, and the performance of data transmission can be improved.

[0162] In a possible implementation, a second signal is received through the first pin; a frequency of the second signal is a first frequency; and the second signal is used to determine that a communication frequency is the first frequency.

[0163] Through the above method, the first electronic device can receive the second signal sent by the second electronic device to determine that the frequency of sending the first signal is the first frequency as determined by negotiation with the second electronic device.

[0164] In a possible implementation manner, the frequency of the first message and the second message is the first frequency.

[0165] Through the above method, the frequencies of messages sent and received by the first electronic device can be set to be consistent, thereby reducing the complexity of data transmission.

[0166] In a possible implementation, the first message includes at least one data frame; the data frame is any one of the following: data packet header information, data information, control information, cyclic redundancy check; wherein a data frame includes: a start field, a data field, and an end field. Alternatively, the first message includes at least one of the following: at least one data frame, a cyclic redundancy check field; wherein a data frame includes: a start field, an end field, a data packet header field, and a data field.

[0167] Through the above method, the first electronic device can determine the content of the message sent to the second electronic device or the third electronic device as needed, thereby improving the flexibility of sending the first message. Through the start field and the end field of the sent data frame, the second electronic device or the third electronic device can accurately receive the first message. In addition, the reliability of data transmission can be improved through the cyclic redundancy check field. Similarly, the second electronic device or the third device can also determine the content of the second message sent to the first electronic device as needed, thereby improving the flexibility of sending the second message.

[0168] In a possible implementation, after sending the first message through the first pin, the method further includes: within a first time window, the first data signal line is used for the first electronic device to receive a message.

[0169] Through the above method, a first time window can be set after the first electronic device sends the first message. Within the first time window, the sending permission of the first data signal line can be given to other electronic devices, thereby realizing a solution in which other electronic devices actively send messages, improving the flexibility of data transmission, and avoiding the possibility of data transmission conflicts.

[0170] In a possible implementation, after receiving the second message through the first pin, the method further includes: within a second time window, the first data signal line is used by the first electronic device to receive a message.

[0171] Through the above method, a second time window can be set after the first electronic device receives the second message. Within the second time window, the sending authority of the first data signal line can also be given to other electronic devices, thereby realizing a solution in which other electronic devices actively send messages, improving the flexibility of data transmission, and avoiding the possibility of data transmission conflicts.

[0172] In a possible implementation, after receiving the second message through the first pin, the method further includes: after determining that the current time exceeds the second time window, the first data signal line is used for the first electronic device to send a message.

[0173] Through the above method, a second time window can be set after the first electronic device receives the second message. After the second time window ends, the sending authority of the first data signal line returns to the first electronic device, thereby avoiding the possibility that the first electronic device cannot actively send messages for a long time, improving the transmission efficiency of data transmission, and avoiding the possibility of data transmission conflicts.

[0174] In a possible implementation, the method further includes: sending a first reset signal through the first pin; the first reset signal is used to instruct a receiver of the first reset signal to reset; and a pulse width of the first reset signal is associated with the receiver.

[0175] Through the above method, when the first electronic device confirms that the data transmission is abnormal, or other abnormal conditions occur, a second reset signal can be sent to the third electronic device, so that the third electronic device can confirm that the current data transmission is abnormal based on the received second reset signal, and can stop the loss in time, avoiding the abnormal charging behavior from causing damage to each electronic device, thereby improving the safety of charging. Furthermore, the first reset signal sent by the first electronic device to other recipients can be distinguished, thereby avoiding the second electronic device or the third electronic device from being reset incorrectly based on the first reset signal.

[0176] In an eighth aspect, the present application provides a data transmission method based on a charging cable, which is applied to a second electronic device, wherein the second electronic device is connected to a first electronic device via a third electronic device, and the third electronic device includes a first data signal line. The method includes: determining a connection with the first electronic device; sending a second message via a first pin; or receiving a first message via the first pin; the first pin is connected to the first data signal line; wherein the first message and the second message are messages encoded via Manchester encoding; the first message and the second message are used to set the charging of the first electronic device.

[0177] Through the above method, the second electronic device can send the second message after Manchester encoding, and decode the received first message through Manchester encoding, without sending a synchronous clock signal in the message, thereby avoiding the problem in the prior art that the receiving end has difficulty in receiving continuous high-frequency signals, resulting in poor transmission performance and low transmission efficiency.

[0178] In a possible implementation manner, the first pin is a pin connected to a negative signal data line; or, the first pin is a pin connected to a positive signal data line.

[0179] Through the above method, the first pin used for transmitting the first message and the second message can be flexibly configured, making data transmission more flexible.

[0180] A possible implementation method is to receive a detection from the first electronic device through the first pin and the second pin, wherein the detection is used by the first electronic device to determine that the second electronic device is a dedicated charging interface DCP device; receive a first pulse signal from the first electronic device through the first pin; and send an electrical signal to the first electronic device through the second pin to confirm whether to charge the battery of the first electronic device through the fast charging mode.

[0181] Taking into account that the handshake process of the communication protocol in the prior art is time-consuming, the above-mentioned method of sending the first pulse signal is used to implement a handshake protocol in which the first electronic device and the second electronic device support charging the battery of the first electronic device through the fast charging mode, thereby shortening the time to enter the fast charging mode. In particular, when the battery of the first electronic device is too low, the fast charging mode can be quickly entered to improve the charging experience.

[0182] In a possible implementation, the second pin is a pin connected to a positive signal data line, and the electrical signal is a second pulse signal; the second pin is a pin connected to a negative signal data line, and the electrical signal is a low level signal.

[0183] By the above method, when the second pin is a pin connected to the negative signal data line, considering that the first electronic device sends the first pulse signal through the first pin, at this time, the first pin is a positive signal data line, which is at a high level in the idle state. Therefore, the electrical signal of the second electronic device can be a low-level signal, so that the first electronic device can quickly confirm the completion of the handshake by detecting the first response signal, shortening the time to enter the fast charging mode and reducing the complexity of the handshake.

[0184] In a possible implementation, the first message includes: a first identifier; the first identifier is used to indicate a recipient of the first message and a sender of the first message; the second message includes: a second identifier; the second identifier is used to indicate a recipient of the second message and a sender of the second message; the sender of the first message or the recipient of the second message is any one of the following: the first electronic device, the third electronic device.

[0185] Taking into account that a third electronic device can also participate in data transmission, through the above method, identifiers can be set for the sender and receiver of the message respectively, thereby distinguishing the sender and receiver of the message in the data transmission system, avoiding misprocessing of the message, and improving the reliability of message transmission.

[0186] In a possible implementation, a first signal is received through the first pin; a frequency of the first signal is a first frequency; and the first signal is used to negotiate that a communication frequency is the first frequency.

[0187] Through the above method, the first electronic device can send a first signal, thereby negotiating with the second electronic device to determine the frequency of sending the first signal, so that the frequency of the signal for data transmission between the first electronic device and the second electronic device can be negotiated and adjusted as needed, thereby improving the flexibility of data transmission. In addition, by adjusting the frequency of the signal, the anti-interference ability of data transmission can be achieved, the reliability of data signal transmission can be improved, and the performance of data transmission can be improved.

[0188] In a possible implementation, a second signal is sent through the first pin; a frequency of the second signal is a first frequency; and the first signal is used to determine that a communication frequency is the first frequency.

[0189] Through the above method, the first electronic device can receive the second signal sent by the second electronic device to determine that the frequency of sending the first signal is the first frequency as determined by negotiation with the second electronic device.

[0190] In a possible implementation manner, the frequency of the first message and the second message is the first frequency.

[0191] Through the above method, the frequencies of messages sent and received by the second electronic device can be set to be consistent, thereby reducing the complexity of data transmission.

[0192] In a possible implementation, the first message includes at least one of the following: at least one data frame, a cyclic redundancy check field; wherein a data frame includes: a start field, an end field, a data packet header field, and a data field. Alternatively, the first message includes at least one data frame; wherein a data frame includes: a start field, an end field, and a data field. The data frame is any one of the following: data packet header information, data information, control information, and a cyclic redundancy check.

[0193] Through the above method, the first electronic device can determine the content of the message sent to the second electronic device as needed, thereby improving the flexibility of sending the first message. Through the start field and end field of the sent data frame, the second electronic device can accurately receive the first message. In addition, the reliability of data transmission can be improved through the cyclic redundancy check field. Similarly, the third device can also determine the content of the second message sent to the first electronic device as needed, thereby improving the flexibility of sending the second message.

[0194] In a possible implementation, after receiving the first message through the first pin, the method further includes: within a first time window, the first data signal line is used for the second electronic device or the third electronic device to send a message.

[0195] Through the above method, a first time window can be set after the first electronic device sends the first message. Within the first time window, the sending authority of the first data signal line can be the second electronic device or the third electronic device, thereby realizing a solution in which the second electronic device or the third electronic device actively sends messages, improving the flexibility of data transmission, and avoiding the possibility of data transmission conflicts.

[0196] In a possible implementation manner, after sending the second message through the first pin, the method further includes:

[0197] In the second time window, the first data signal line is used for the second electronic device or the third electronic device to send a message.

[0198] Through the above method, a second time window can be set after the first electronic device receives the second message. Within the second time window, the sending authority of the first data signal line can also be given to other electronic devices, thereby realizing a solution in which other electronic devices actively send messages, improving the flexibility of data transmission, and avoiding the possibility of data transmission conflicts.

[0199] In a possible implementation manner, after sending the second message through the first pin, the method further includes:

[0200] After determining that the current time exceeds the second time window, the first data signal line is used for the second electronic device or the third electronic device to receive a message.

[0201] Through the above method, a second time window can be set after the first electronic device receives the second message. After the second time window ends, the sending authority of the first data signal line returns to the first electronic device, thereby avoiding the possibility that the first electronic device cannot actively send messages for a long time, improving the transmission efficiency of data transmission, and avoiding the possibility of data transmission conflicts.

[0202] In a possible implementation, a first reset signal is received through the first pin; a pulse width of the first reset signal is associated with the second electronic device; and the charging mode is reset according to the first reset signal.

[0203] Through the above method, when the first electronic device confirms that data transmission is abnormal, or other abnormal situations occur, it can send a first reset signal to the second electronic device, so that the second electronic device can confirm that the current data transmission is abnormal based on the first reset signal sent by the first electronic device, and can stop the loss in time to avoid abnormal charging behavior from causing damage to various electronic devices, thereby improving the safety of charging.

[0204] In a possible implementation, a second reset signal is received through the first pin; a pulse width of the second reset signal is associated with the third electronic device; and the second reset signal is ignored.

[0205] Through the above method, the first reset signal sent by the first electronic device to other recipients can be distinguished, thereby preventing the second electronic device from being reset incorrectly according to the second reset signal.

[0206] In a ninth aspect, the present application provides a data transmission method based on a charging cable, which is applied to a third electronic device, wherein the third electronic device is used to connect a second electronic device with a first electronic device, and the third electronic device includes a first data signal line. The method includes: sending a second message through a first pin; or receiving a first message through the first pin; the first pin is connected to the first data signal line; wherein the first message and the second message are messages after Manchester encoding; the first message and the second message are used to set the charging of the first electronic device.

[0207] Through the above method, the third electronic device can send the second message after Manchester encoding, and decode the received first message through Manchester encoding, without sending a synchronous clock signal in the message, thereby avoiding the problem in the prior art that the receiving end has difficulty in receiving continuous high-frequency signals, resulting in poor transmission performance and low transmission efficiency.

[0208] In a possible implementation manner, the first pin is a pin connected to a negative signal data line; or, the first pin is a pin connected to a positive signal data line.

[0209] Through the above method, the first pin used for transmitting the first message and the second message can be flexibly configured, making data transmission more flexible.

[0210] In a possible implementation manner, the first message includes: a first identifier; the first identifier is used to indicate a receiver of the first message and a sender of the first message;

[0211] The second message includes: a second identifier; the second identifier is used to indicate a recipient of the second message and a sender of the second message; the sender of the first message or the recipient of the second message is any one of the following: the first electronic device, the third electronic device.

[0212] Taking into account the participation of a third electronic device in data transmission, the above method can be used to set identifiers for the sender and receiver of the message respectively, thereby distinguishing the sender and receiver of the message in the data transmission system, avoiding misprocessing of the message, and improving the reliability of message transmission.

[0213] In a possible implementation manner, the frequency of the first message and the second message is the first frequency.

[0214] Through the above method, the frequencies of messages sent and received by the second electronic device can be set to be consistent, thereby reducing the complexity of data transmission.

[0215] In a possible implementation, the first message includes at least one of the following: at least one data frame, a cyclic redundancy check field; wherein a data frame includes: a start field, an end field, a data packet header field, and a data field. Alternatively, the first message includes at least one data frame; the data frame is any one of the following: header information, data information, control information, and a cyclic redundancy check; wherein a data frame includes: a start field, a data field, and an end field.

[0216] Through the above method, the first electronic device can determine the content of the first message sent to the third electronic device as needed, thereby improving the flexibility of sending the first message. Through the start field and end field of the sent data frame, the second electronic device can accurately receive the first message. In addition, the reliability of data transmission can be improved through cyclic redundancy check information. Similarly, the third electronic device can also determine the content of the second message sent to the first electronic device as needed, thereby improving the flexibility of sending the second message.

[0217] In a possible implementation, after receiving the first message through the first pin, the method further includes: within a first time window, the first data signal line is used for the second electronic device or the third electronic device to send a message.

[0218] Through the above method, a first time window can be set after the first electronic device sends the first message. Within the first time window, the sending authority of the first data signal line can be the second electronic device or the third electronic device, thereby realizing a solution in which the second electronic device or the third electronic device actively sends a message, improving the flexibility of data transmission, and avoiding the possibility of data transmission conflicts.

[0219] In a possible implementation, after sending the second message through the first pin, the method further includes: within a second time window, the first data signal line is used for the second electronic device or the third electronic device to send a message.

[0220] Through the above method, a second time window can be set after the first electronic device receives the second message. Within the second time window, the sending authority of the first data signal line can also be for the second electronic device or the third electronic device, thereby realizing a solution in which the second electronic device or the third electronic device actively sends messages, improving the flexibility of data transmission, and avoiding the possibility of data transmission conflicts.

[0221] In a possible implementation, after sending the second message through the first pin, the method further includes: after determining that the current time exceeds the second time window, the first data signal line is used for the third electronic device or the second electronic device to receive the message.

[0222] Through the above method, a second time window can be set after the first electronic device receives the second message. After the second time window ends, the sending authority of the first data signal line returns to the first electronic device, thereby avoiding the possibility that the first electronic device cannot actively send messages for a long time, improving the transmission efficiency of data transmission, and avoiding the possibility of data transmission conflicts.

[0223] In a possible implementation, a second reset signal is received through the first pin; a pulse width of the second reset signal is associated with the third electronic device; and the charging mode is reset according to the second reset signal.

[0224] Through the above method, when the first electronic device confirms that data transmission is abnormal, or other abnormal situations occur, a second reset signal can be sent to the third electronic device, so that the third electronic device can confirm that the current data transmission is abnormal based on the second reset signal sent by the first electronic device, and can stop the loss in time to avoid abnormal charging behavior from causing damage to various electronic devices, thereby improving the safety of charging.

[0225] In a possible implementation, a first reset signal is received through the first pin; a pulse width of the first reset signal is associated with the second electronic device; and the first reset signal is ignored.

[0226] Through the above method, the first reset signal sent by the first electronic device to other recipients can be distinguished, thereby preventing the third electronic device from being reset incorrectly according to the first reset signal.

[0227] In the tenth aspect, the present application provides an electronic device comprising one or more processors, a memory, and one or more computer programs; wherein the one or more computer programs are stored in the memory, and the one or more computer programs include instructions, which, when executed by the electronic device, enable the electronic device to execute any possible design method provided in the first aspect, fourth aspect or seventh aspect of the embodiments of the present application.

[0228] In the eleventh aspect, the present application provides an electronic device comprising one or more processors, a memory, and one or more computer programs; wherein the one or more computer programs are stored in the memory, and the one or more computer programs include instructions, which, when executed by the electronic device, enable the electronic device to execute any possible design method provided in the second aspect, the fifth aspect or the eighth aspect of the embodiments of the present application.

[0229] In a twelfth aspect, the present application provides an electronic device, comprising one or more processors, a memory, and one or more computer programs; wherein the one or more computer programs are stored in the memory, and the one or more computer programs include instructions, and when the instructions are executed by the electronic device, the electronic device executes any possible design method provided in the third aspect, the sixth aspect, or the ninth aspect of the embodiment of the present application. Alternatively, the electronic device may not include a memory, for example, the processor may execute instructions stored in an external memory, so that the electronic device executes any possible design method provided in the third aspect, the sixth aspect, or the ninth aspect of the embodiment of the present application.

[0230] In the thirteenth aspect, an embodiment of the present application provides a data transmission system, including the electronic device described in the tenth aspect, the electronic device described in the eleventh aspect, and the electronic device described in the twelfth aspect.

[0231] In a fourteenth aspect, an embodiment of the present application provides a computer storage medium storing a program, which, when executed on an electronic device, enables the electronic device to execute any possible design method of the first to ninth aspects.

[0232] In a fifteenth aspect, an embodiment of the present application provides a computer program product, which, when executed on an electronic device, enables the electronic device to execute any possible design method of the first to ninth aspects. BRIEF DESCRIPTION OF THE DRAWINGS

[0233] Figure 1a A schematic diagram of the structure of a charging system provided in an embodiment of the present application;

[0234] Figure 1b A schematic diagram of the structure of a charging interface provided in an embodiment of the present application;

[0235] Figure 2 A schematic diagram of the structure of an electronic device;

[0236] Figure 3 A schematic diagram of the structure of a charging system provided in an embodiment of the present application;

[0237] Figure 4a It is a timing diagram of handshake in the prior art;

[0238] Figure 4b A flowchart of a protocol handshake method provided in an embodiment of the present application;

[0239] Figure 4c and Figure 4d A schematic diagram of a protocol handshake provided in an embodiment of the present application;

[0240] Figure 5a A flowchart of a protocol handshake method provided in an embodiment of the present application;

[0241] Figure 5b and Figure 5c A schematic diagram of a protocol handshake provided in an embodiment of the present application;

[0242] Figure 6a A coding schematic diagram of a data transmission method based on a charging cable provided in an embodiment of the present application;

[0243] Figure 6b A schematic diagram of the structure of encoding and decoding of a data transmission method based on a charging cable provided in an embodiment of the present application;

[0244] Figure 6c A schematic diagram of a data transmission method based on a charging cable provided in an embodiment of the present application;

[0245] Figure 6d A schematic diagram of a data transmission method based on a charging cable provided in an embodiment of the present application;

[0246] Figure 6e A schematic diagram of a data transmission method based on a charging cable provided in an embodiment of the present application;

[0247] Figure 6f A schematic diagram of signals in a data transmission method based on a charging cable provided in an embodiment of the present application;

[0248] Figure 7 A schematic diagram of a data transmission method based on a charging cable provided in an embodiment of the present application;

[0249] Figure 8a A timing diagram of a data transmission method based on a charging cable provided in an embodiment of the present application;

[0250] Figure 8b A schematic diagram of a data transmission method based on a charging cable provided in an embodiment of the present application;

[0251] Figure 8c A timing diagram of a data transmission method based on a charging cable provided in an embodiment of the present application;

[0252] Figure 8d and Figure 8e A schematic diagram of a data structure provided for an embodiment of the present application;

[0253] Figure 9a A schematic diagram of a data transmission method based on a charging cable provided in an embodiment of the present application;

[0254] Figure 9b-9d A schematic diagram of a data transmission method based on a charging cable provided in an embodiment of the present application;

[0255] Fig.9e A schematic diagram of signals in a data transmission method based on a charging cable provided in an embodiment of the present application;

[0256] Figure 9f A schematic diagram of a data structure provided for an embodiment of the present application;

[0257] Figure 9g A schematic diagram of pin states in a data transmission method based on a charging cable provided in an embodiment of the present application;

[0258] Figure 9h A schematic diagram of pin states in a data transmission method based on a charging cable provided in an embodiment of the present application;

[0259] Fig.10a A schematic diagram of a data transmission method based on a charging cable provided in an embodiment of the present application;

[0260] Fig.10b A schematic diagram of signals in a data transmission method based on a charging cable provided in an embodiment of the present application;

[0261] Fig.11a A schematic diagram of a data transmission method based on a charging cable provided in an embodiment of the present application;

[0262] Fig.11b A schematic diagram of a second reset signal provided in an embodiment of the present application;

[0263] Fig.12 A schematic diagram of the structure of a possible electronic device provided in an embodiment of the present application;

[0264] Fig.13 A schematic diagram of the structure of a possible electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0265] The present application will be further described in detail below in conjunction with the accompanying drawings. The specific operating method in the method embodiment can also be applied to the device embodiment or the system embodiment. It should be noted that in the description of the following embodiments of the present application, "at least one" refers to one or more, wherein multiple refers to two or more. In view of this, "multiple" can also be understood as "at least two" in the embodiments of the present invention. "And / or" describes the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / ", unless otherwise specified, generally indicates that the related objects before and after are in an "or" relationship. In addition, it should be understood that in the description of the present application, words such as "first" and "second" are only used for the purpose of distinguishing the description, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying order.

[0266] In addition, in the embodiments of the present application, the word "exemplary" is used to indicate an example, illustration or description. Any embodiment or design described as "exemplary" in the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of the word "exemplary" is intended to present concepts in a concrete way.

[0267] As smart terminals become more diversified and larger in size, power consumption and battery capacity are increasing. As battery capacity increases, smart terminal devices have a stronger demand for fast charging. As a result, a variety of fast charging protocols have emerged in the industry in recent years based on USB channels, such as USB PD2.0 / 3.0, Qualcomm QC2.0 / 3.0 / 4.0, OPPO VOOC, Samsung AFC, MediaTek PE and Huawei SCP. The current commercial charging power in the market ranges from 10W to 65W, which greatly shortens the charging time of terminal devices.

[0268] Among them, USB is a serial bus standard and also a technical specification for an input and output interface. There are currently three physical specifications of USB interfaces, namely USB Type-A, USB Type-B and USB Type-C. The following uses USB Type-C as an example to illustrate the pins in the USB interface. USB Type-C includes 24 pins. The pin diagram of the USB Type-C interface is as follows Figure 1aAs shown. It can be seen that USB Type-C includes 4 pairs of differential transmission line pins for realizing the TX / RX functions, including two pairs of differential transmission line pins (or differential data pins) for sending data signals: A2 (TX1+) and A3 (TX1-), B2 (TX2+) and B3 (TX2-); and two pairs of differential transmission line pins (or differential data pins) for receiving data signals: B11 (RX1+) and B10 (RX1-), A11 (RX2+) and A10 (RX2-). In the following, for the convenience of description, the data signals transmitted by the differential data pins are referred to as differential data signals. USB Type-C also includes 2 channel configuration (CC) signal pins for function negotiation. For example, it can be used to determine the direction of device insertion: forward or reverse insertion. It can also be used to negotiate the power supply function, replacement mode or peripheral mode on the interface. The peripheral mode supports the transmission of analog audio or debugging signals through the USB Type-C interface. The replacement mode supports the USB Type-C interface to transmit compressed or lossless video signals, such as data signals of the DP protocol. USB Type-C can also include pins for transmitting other signals, such as pins for sideband use (SBU) signals, as shown in Table 1.

[0269] Table 1

[0270]

[0271] Among them, TX / RX (TX1, TX2, RX1 and RX2) are differential data signals of USB3.1. It should be noted that TX1 is used to represent the differential data signal (TX1+ / -) transmitted by a pair of differential transmission line terminals, and RX1 is also used to represent RX1+ / -. The same description method is used for other differential signals. In USB3.1, when the insertion direction of an electronic device using a USB Type-C interface is positive insertion, A2, A3, B10, and B11 are used as differential transmission line terminals for USB3.1 data signals. When the insertion direction of the electronic device is reverse insertion, B2, B3, A10, and A11 are used as differential transmission line terminals for USB3.1 data signals. Regardless of whether the positive insertion direction or the reverse insertion direction is adopted, there will be two pairs of differential transmission line pins that are not used. USB Type-C can also be used to transmit digital video interface (displayport, DP) signals. In DP mode, the two pairs of differential signal line pins that are not used by USB3.1 can be used to transmit DP data signals (or data signals called DP protocol). Therefore, the USB Type-C interface can be used to implement USB3.1+DP signal transmission. In addition, if the receiving end only needs the DP signal and does not need the USB3.1 signal, the four pairs of differential signal line pins can all be used to send the DP data signal. USB Type-C also includes two pairs of differential transmission line pins (A6, A7 and B7, B7) for transmitting USB2.0 data signals, and the USB2.0 data signal is D+ / D-. A8 and B8 are reserved pins in the USB Type-C interface for transmitting SBU signals. In different application scenarios, the SBU signal has different uses. For example, the SBU signal can include a control signal or a data signal of the DP protocol. For example, A8 and B8 are used as audio transmission channels or microphone transmission channels to transmit audio data or video data. The control signal of the DP protocol can be an auxiliary (AUX) signal. The USB Type-C interface also supports the power delivery (PD) protocol, that is, it has a power supply function. See Figure 1a As shown, GND is a ground pin, Vbus is a power pin, and the four ground pins and four power pins in the USB Type-C interface constitute four pairs of power supply pins for power supply.

[0272] The following introduces a charging scenario to which this application is applicable. Figure 1ais a schematic diagram of a system provided according to the present application. In this example, a first electronic device 100 (e.g., an electronic device to be charged) can be connected to a second electronic device 200 (e.g., a power supply device such as a charger, an adapter, a reverse charging device, etc.) via a third electronic device 300 (e.g., a USB cable). The first electronic device can be a terminal device. The second electronic device 200 can be any suitable type of charging device, such as a charger, a travel adapter (TA), a rechargeable electronic device, a reverse charging device, etc. The first electronic device 100 may include a USB socket (not shown) that is physically connected to another USB socket on the second electronic device 200 through the third electronic device 300. Although in this example, the second electronic device 200 includes a USB socket, in other examples, the third electronic device 300 can also be directly welded to the second electronic device 200, thereby bypassing the need for a USB socket. In operation, when an alternating current (AC) signal (e.g., 220V or 110V) is received from a wall socket, the second electronic device 200 can convert the received AC signal into a direct current (DC) signal and feed the DC signal to the first electronic device 100. In some implementations, the second electronic device 200 or the computer 120 may support a battery charger communication protocol that can be used to negotiate voltage and / or current levels between the second electronic device 200 (or the computer 120) and the first electronic device 100.

[0273] During the specific charging process, when the processor of the first electronic device detects that the second electronic device (device to be charged) is connected and turned on to the first electronic device (power supply device) through a third electronic device (for example, a cable), it will send a charging start signal to the charging chip 14 of the first electronic device to control the charging chip to start charging.

[0274] The processor of the first electronic device detects whether the second electronic device is continuously connected, and the charging step is continuously performed while the second electronic device is continuously connected. Subsequently, while the second electronic device is continuously connected, the battery of the first electronic device is charged by the charging chip until the battery is fully charged. If the second electronic device is detected to be disconnected at any time during the continuous charging step, the charging is stopped, and when the second electronic device is subsequently reconnected, a charging start signal is sent from the reconnection of the execution circuit to control the charging chip to start charging, and the subsequent continuous charging step is re-executed.

[0275] According to the characteristics of the battery, the charging process of the battery from zero or low power to full power, for example, may include: trickle charging (providing a very small charging current to the battery at a low rate and in a constant manner), constant current charging (fixed charging current), constant voltage charging (fixed charging voltage) several stages, with the development of high current charging technology, the constant current stage may include multiple stages, each stage using a different current for charging.

[0276] It should be noted that the circuit structure and charging scenario described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided in the embodiments of the present application.

[0277] It should be noted that in the embodiments of the present application, "connection" means that the two interfaces are electrically connected, and the corresponding pins in the two interfaces are connected one by one, but the embodiments of the present application do not impose many restrictions on the specific connection method between the two interfaces. For example, the connection can be insertion, docking, etc. Taking insertion as an example, interface 1 is connected to interface 2, which can be either interface 1 plugged into interface 2 or interface 2 plugged into interface 1.

[0278] Below Figure 2 As shown, taking the first electronic device as an example, the structure of the electronic device is introduced. Figure 2It is a block diagram of an example of a first electronic device 100 according to various aspects of the present invention. The first electronic device 100 mentioned in the embodiment of the present application can be applied to various terminal devices including batteries, including but not limited to mobile phones, tablet computers, computers with wireless transceiver functions, virtual reality (VR) terminals, augmented reality (AR) terminals, wireless terminals in industrial control, wireless terminals in self-driving, wireless terminals in remote medical, wireless terminals in smart grids, wireless terminals in transportation safety, wireless terminals in smart cities, wireless terminals in smart homes, etc. The second electronic device provided in the embodiment of the present application can also be a terminal device including a battery. At this time, the second electronic device can not only be used to charge the battery inside the electronic device, but also use the battery as a power source to supply power to the outside, that is, reverse charging. The so-called reverse charging refers to that an electronic device (such as a mobile phone, a tablet computer, etc.) can charge another electronic device (such as another mobile phone) by using the power stored in its own battery through a wired / wireless method (for example, providing power through a wired or wireless method). When wired reverse charging is adopted, the device to be charged can be connected to the device on the go (OTG) via the universal serial bus (USB) to achieve wired reverse charging.

[0279] The terminal device mentioned in the embodiment of the present application may be a device that provides voice / data connectivity to users, for example, a handheld device or a vehicle-mounted device with a wireless connection function. At present, some examples of terminals are: mobile phones, tablet computers, laptop computers, PDAs, mobile internet devices (MID), wearable devices, virtual reality (VR) devices, augmented reality (AR) devices, wireless terminals in industrial control, wireless terminals in self-driving, wireless terminals in remote medical surgery, wireless terminals in smart grids, wireless terminals in transportation safety, wireless terminals in smart cities, wireless terminals in smart homes, cellular phones, cordless phones, session initiation protocol (SIP) phones, wireless local loop (WLL) stations, personal digital assistants (PDAs), handheld devices with wireless communication functions, computing devices or other processing devices connected to wireless modems, vehicle-mounted devices, wearable devices, terminal devices in 5G networks or future evolved public land mobile communication networks (public land mobile The embodiments of the present application do not limit this.

[0280] The terminal device can also be user equipment (UE), mobile station (MS), mobile terminal (MT), access terminal, user unit, user station, mobile station, mobile station, remote station, remote terminal, mobile device, user terminal, terminal, wireless communication equipment, user agent or user device, etc.

[0281] As an example but not limitation, in the embodiments of the present application, the terminal device may also be a wearable device. Wearable devices may also be referred to as wearable smart devices, which are a general term for wearable devices that are intelligently designed and developed using wearable technology for daily wear, such as glasses, gloves, watches, clothing, and shoes. A wearable device is a portable device that is worn directly on the body or integrated into the user's clothes or accessories. Wearable devices are not only hardware devices, but also powerful functions achieved through software support, data interaction, and cloud interaction. Broadly speaking, wearable smart devices include full-featured, large-sized, and fully or partially independent of smartphones, such as smart watches or smart glasses, as well as devices that only focus on a certain type of application function and need to be used in conjunction with other devices such as smartphones, such as various types of smart bracelets and smart jewelry for vital sign monitoring.

[0282] In addition, in the embodiments of the present application, the terminal device can also be a terminal device in the Internet of Things (IoT) system. IoT is an important part of the future development of information technology. Its main technical feature is to connect objects to the network through communication technology, so as to realize the intelligent network of human-machine interconnection and object-to-object interconnection. The terminal device of the present application can also be a vehicle-mounted module, a vehicle-mounted module, a vehicle-mounted component, a vehicle-mounted chip or a vehicle-mounted unit built into the vehicle as one or more components or units. The vehicle can implement the method of the present application through the built-in vehicle-mounted module, vehicle-mounted module, vehicle-mounted component, vehicle-mounted chip or vehicle-mounted unit. Therefore, the embodiments of the present application can be applied to the Internet of Vehicles, such as vehicle to everything (V2X), long-term evolution-vehicle (LTE-V), vehicle-to-vehicle (V2V), etc.

[0283] The first electronic device 100 may include a processor 201 , a charging unit 202 , a memory 221 , a USB interface 223 , a power manager integrated circuit (PMIC) 224 , and a battery 211 .

[0284] The processor 201 may include any suitable type of processing circuit, and the processor 201 may include an application processor (AP), such as a general-purpose processor (e.g., an ARM-based processor, an x86-based processor, a MIPS-based processor, etc.), a field programmable gate array (FPGA), and an application-specific integrated circuit (ASIC). A modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. In some implementations, the processor 201 may support computing processing functions, content reproduction functions in various formats (e.g., audio, image, video, etc.), a graphics engine, etc. The processor 201 may execute an operating system (OS), various functions, etc. In some implementations, the processor 201 may be constructed with one chip, with a large number of components on the chip. The component may include a logic core, a memory, a display system / controller, a multimedia encoding / decoding codec, a 2D / 3D accelerator engine, an image signal processor (ISP), a camera, an audio modem, various high-speed and low-speed serial / parallel connection interfaces, etc. In some implementations, the processor 201 may be implemented as a system on chip (SOC). The SOC may be used for processing instructions and processing data in computer software and other operations. Among them, different processing units may be independent devices or integrated in one or more processors. Among them, the controller may be the nerve center and command center of the first electronic device 100. The controller may generate an operation control signal according to the instruction opcode and the timing signal to complete the control of fetching and executing instructions. A memory may also be set in the processor 201 for storing instructions and data. In some embodiments, the memory in the processor 201 is a high-speed cache memory. The memory may store instructions or data that the processor 201 has just used or circulated. If the processor 201 needs to use the instruction or data again, it may be directly called from the memory. Repeated access is avoided, and the waiting time of the processor 201 is reduced, thereby improving the efficiency of the system.

[0285] The processor 201 can be connected to various modules in the first electronic device 100, for example, Figure 2As shown, the processor 201 may be connected to the charging unit 202 via an Inter-Integrated Circuit (I2C) bus. The processor 201 may transmit control instructions to the charging unit 202 and the like via the I2C bus.

[0286] The first electronic device 100 may further include a general processor, a mobile communication module 212, a wireless communication module (wireless connectivity, WC) 214, a front end module (front end module, FEM), a short-range communication unit, and a radio frequency integrated circuit (radio frequency integrated circuit, RFIC).

[0287] Among them, the general processor can be a processor for enabling voice communication and / or data transmission, which can be a separately set processor or integrated with the processor 201, which is not limited here. The general processor can also be used to compress voice data and image data, or can decompress compressed data. The communication processor may include a baseband modem, a baseband processor (BP), etc. The communication processor may be designed to operate by using one of the Global System for Mobile Communication (GSM) network, the Enhanced Data GSM Environment (EDGE) network, the Code Division Multiple Access (CDMA) network, the W-CDMA network, the Long Term Evolution (LTE) network, the Orthogonal Frequency Division Multiple Access (OFDMA) network, the Wireless Fidelity (Wi-Fi) network, the WiMax network, and the Bluetooth network.

[0288] The FEM may be used to control the transmission / reception of radio signals and may separate the transmission / reception signals. The FEM may be included in the mobile communication module 212 and the wireless communication module 214, or may be a separate module. The FEM may be used to filter and amplify signals, and may include a receiving side front-end module including a filter for filtering received signals and a transmitting side front-end module including a power amplifier module (PAM) for amplifying transmitted signals.

[0289] A radio frequency integrated circuit (eg, an RF transceiver) may receive radio frequencies from a base station and may modulate the received high frequency band into a low frequency band (ie, baseband) that may be processed in a module (eg, a communication processor).

[0290] The short-range communication unit may be implemented by including various communication functions not processed by the processor 201, such as WiFi, Bluetooth, Near Field Communication (NFC), Universal Serial Bus (USB), or Global Positioning System (GPS).

[0291] The memory 221 can be used to store computer executable program codes, which include instructions. The processor 201 executes various functional applications and data processing of the first electronic device 100 by running the instructions stored in the memory 221. The memory 221 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function, etc. The data storage area may store data (such as images, videos, etc.) created during the use of the first electronic device 100. In addition, the memory 221 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.

[0292] Although not shown, the first electronic device 100 may further include a speaker, a microphone, a camera, a display screen, a touch panel, a sensor module, an audio module, etc. The first electronic device 100 may further include a graphics processor or an audio processor. The graphics processor may perform image information processing, acceleration, signal conversion, screen output, etc. The audio processor may perform any appropriate type of audio processing.

[0293] The sensor module may include a pressure sensor A, a gyroscope sensor B, an air pressure sensor C, a magnetic sensor D, an acceleration sensor E, a distance sensor F, a proximity light sensor G, a fingerprint sensor H, a temperature sensor J, a touch sensor K, an ambient light sensor L, a bone conduction sensor M, and the like.

[0294] Among them, the touch sensor K is also called a "touch panel". The touch sensor K can be set on the display screen, and the touch sensor K and the display screen form a touch screen, also called a "touch screen". The touch sensor K is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen. In other embodiments, the touch sensor K can also be set on the surface of the first electronic device 100, which is different from the position of the display screen.

[0295] The display screen is used to display the display interface of the application in the first electronic device 100, such as the camera's viewfinder interface, WeChat's chat interface, etc., and can also display images and videos in the gallery. The display screen includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light emitting diode (QLED), etc. In some embodiments, the first electronic device 100 may include 1 or N display screens, where N is a positive integer greater than 1.

[0296] The camera is used to capture static images, dynamic images or videos. In some embodiments, the number of cameras in the first electronic device 100 may be at least two. Taking two as an example, one is a front camera and the other is a rear camera. The camera may include a photosensitive element such as a lens group and an image sensor, wherein the lens group includes a plurality of lenses (convex lenses or concave lenses) for collecting light signals reflected by the object to be photographed (such as a user's face, scenery, etc.), and transmitting the collected light signals to the image sensor. The image sensor generates an image of the object to be photographed based on the light signal.

[0297] In addition, the first electronic device 100 can implement audio functions through an audio module, a speaker A, a receiver B, a microphone C, a headphone jack D, and an application processor. For example, music playback, recording, etc. The first electronic device 100 can receive key inputs and generate key signal inputs related to user settings and function controls of the first electronic device 100. The first electronic device 100 can use a motor to generate vibration prompts (such as incoming call vibration prompts). The indicator in the first electronic device 100 can be an indicator light, which can be used to indicate the charging status, power changes, and can also be used to indicate messages, missed calls, notifications, etc. The SIM card interface in the first electronic device 100 is used to connect a SIM card. The SIM card can be inserted into the SIM card interface or pulled out from the SIM card interface to achieve contact and separation with the first electronic device 100.

[0298] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the first electronic device 100. In other embodiments of the present application, the first electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0299] The power manager module 224 may be used to adjust the power of the battery 211. For example, the processor 201 may send information, such as a load to be processed, to the power manager module 224. The power manager module 224 may adjust the core voltage to be supplied to the processor 201 by using the information provided from the processor 201.

[0300] The charging unit 202 can charge the battery 211. In some embodiments, the charging unit 202 can generate a signal for charging the battery 211. In some embodiments, the charging unit 202 can adjust (or otherwise adjust) the voltage or current fed to the battery. In addition or alternatively, the charging unit 202 can perform a constant current charging operation and a constant voltage charging operation. The charging unit 202 may include an external port that can be electrically connected to an external device (e.g., a travel adapter (TA) or a computer). When wired charging is required, for example, when the processor 201 detects that the charging interface is connected to an external charger, the processor 201 sends a wired charging control instruction to the charging unit 202, thereby instructing the charging unit 202 to convert the voltage input by the charging interface into a charging voltage for charging the battery. When wired reverse charging is required, for example, when the processor 201 detects a wired reverse charging request sent by an external device connected to the charging interface, the processor 201 sends a wired reverse charging control instruction to the charging unit 202, thereby instructing the charging unit 202 to convert the voltage provided by the battery into a charging voltage for charging the device connected to the charging interface.

[0301] The external port may be a USB port with a fast charging interface function.

[0302] Take the example of a fast charging interface working through a USB port and a cable, for example, a standard a USB port of a TA connected to a micro-B or micro-AB USB socket (i.e., a socket). In addition, the second electronic device 200 may be a device with a dedicated charging port (DCP).

[0303] When DCP is detected, fast charging detection can be started, and fast charging communication can be established after the detection is completed. The first electronic device 100 and the second electronic device 200 determine that a fast charging communication link can be established, so that the first electronic device 100 and the second electronic device 200 can communicate using a fast charging communication method. If the communication link is disconnected, the ports on both sides of the first electronic device 100 and the second electronic device 200 can be restored to the corresponding default values, for example, a normal charging communication method.

[0304] The fast charging interface may be composed of a physical layer, which allows data packets to be transmitted bidirectionally through D- or D+. In the embodiment of the present application, for the first electronic device 100, the second electronic device 200, and the third electronic device 300, data can be received through D+ or D-, and data can also be sent through D+ or D-, so that for any two electronic devices in the first electronic device 100, the second electronic device 200, and the third electronic device 300, sending data and receiving data can be independent of each other, thereby forming a bidirectional communication between electronic devices. It is also possible to send and receive data only through the D- line, or to send and receive data only through the D+ line. In the data transmission process of the first electronic device 100, the second electronic device 200, and the third electronic device 300, the physical layer can be used to send or receive multiple fields. Furthermore, during the data transmission process, the data may also include a check field, thereby improving the accuracy of the data packet.

[0305] In various exemplary embodiments of the present application, the electronic device to be charged may be referred to as a master device. In the embodiment of the present application, the master device may be the first electronic device 100. In some embodiments, the master device may be a leader and a power receiver in the communication protocol, for example, a terminal device. As a master device, the terminal device plays a leading role in the communication process and may send instructions and data through D+ or D-.

[0306] An electronic device that provides charging services may be referred to as a slave device. In an embodiment of the present application, the slave devices may be a second electronic device 200 and a third electronic device 300. In some embodiments, the slave device may be an electronic identification cable and a power supply device, and perform corresponding operations after receiving information sent by the master device. For example, the terminal sends an instruction to adjust the voltage to the power supply device, and after the power supply device receives the instruction to adjust the voltage, it performs a voltage adjustment operation according to the instruction to adjust the voltage. For another example, the terminal sends a command to read the cable current capacity to the cable, and the cable replies with current capacity information.

[0307] Optionally, the slave device can also be divided into a main slave device and a secondary slave device. In some embodiments, the main slave device can be an electronic device on the power output side in the data transmission system, such as a charger, adapter and other power supply devices, which needs to complete identification detection with the main device to communicate, thereby providing power output for the first electronic device. In some embodiments, the secondary slave device can be an electronic device without power output behavior in the data transmission system, such as the third electronic device in the embodiment of the present application. The third electronic device can be a cable with a special mark and does not need to provide power output for the first electronic device. In some embodiments, there is only one main device and one main slave device, and multiple secondary slave devices can be supported. When the main device sends information, it will specify the information recipient, and other non-specified recipients will not respond to the current information.

[0308] The fast charging protocol layer defines a corresponding negotiation method for the instructions transmitted from the master device. For example, to set the communication frequency for data transmission between the master and slave devices, the master device can send an electrical signal of the corresponding communication frequency to the slave device, so that the second electronic device 200 will return the same communication frequency as a response. If the data transmission of the communication frequency cannot be supported, all possible communication frequencies of the slave device can be attempted to be transmitted so that the master and slave devices can select a suitable communication frequency.

[0309] The fast charging protocol layer may also define corresponding fields for instructions transmitted from the master device. For specific implementation, please refer to the following embodiments.

[0310] According to the following Figure 3 The charging unit 202 is discussed further. Figure 3 1 is a schematic diagram illustrating the connection between the charging unit 202 of the first electronic device 100 and the second electronic device 200 provided by the present application. In this example, the second electronic device 200 is a charging device, which can be a charger, a computer and / or any other type of battery charger.

[0311] like Figure 3As shown, the second electronic device 200 may include an AC power input unit 300, an AC / DC conversion unit 310, a fast charging unit 320, and a communication interface 351. The communication interface 351 may be a USB port and / or any other type of port. During the charging process, the input unit 300 may receive an AC signal from a power outlet and feed the AC signal to the AC / DC conversion unit 310. The AC / DC conversion unit 310 may convert the AC signal into a DC signal. The AC / DC conversion unit 310 may then feed the DC signal to the fast charging unit 320. The communication interface corresponds to the 4 lines corresponding to the USB interface 223, and the 4 lines include: a VBUS line, a D- line, a D+ line, and a GND line. The VBUS line and the GND line can be used to provide a power supply voltage. The D- line and the D+ line can be used for data transmission between electronic devices.

[0312] In a possible implementation, the fast charging unit 320 may include a controller 321 and a switch. The controller 321 may be a protocol chip at the power supply end. It should be noted that the controller 321 may also control the power supply circuit and the communication line in other ways, and only the switch is used as an example here.

[0313] In some embodiments, the USB voltage can be controlled by the USB controller 321 to power the first electronic device 100 via the VBUS line and the GND line. For example, the GND line can be connected to the ground line (GND) of the charging unit 203 in the second electronic device 200. In some embodiments, the controller 321 can be used to control a switch, for example, to short the D- line and the D+ line when performing a protocol handshake. In other embodiments, the controller 321 can control the switch to pass a communication line or an electrical signal to receive or send data.

[0314] The charging unit 202 in the first electronic device 100 may include a communication interface 350, a fast charging unit 340 and a charging circuit (eg, Figure 3 ). The communication interface 350 may be a USB port and / or any other type of port.

[0315] In a possible implementation, the fast charging unit 340 may include a controller 341 and a switch. It should be noted that the controller 341 may also control the power supply circuit and the communication line in other ways, and only the switch is used as an example here. The controller 341 may be a protocol chip of the charging end.

[0316] In some embodiments, the controller 341 may provide a signal received through the Vbus line to the charging circuit. The charging circuit may generate one of a fixed voltage and a fixed current signal based on the received signal, and feed the generated signal to the battery 211. To prevent overvoltage or overcurrent from flowing into the charging circuit, a protection circuit may also be connected in front of the charging circuit. For example, the protection circuit may be an overvoltage protection (OVP). According to various aspects of the present application, OVP may be implemented with a switched capacitor. In some embodiments, the protection circuit may be located between the fast charging unit 202 and the charging circuit. In other embodiments, the protection circuit may be arranged between the communication interface 350 and the fast charging unit 202.

[0317] In some embodiments, the controller 341 may also control a switch to set whether to transmit received data to the processor 201 via the D- line or the D+ line, thereby enabling communication between the controller 341 of the second electronic device 200 and the first electronic device 100 .

[0318] For the third electronic device, a controller 361 may be included, which may be used to record relevant information of the cable, such as supported communication protocols, supported charging currents, charging voltages, and other information. In addition, other identification information of the cable may be recorded for the first electronic device or the second electronic device to verify the third electronic device, or to obtain capability information of the third electronic device. In other embodiments, the controller 361 may also be used to control the D- and D+ lines used for sending and receiving data. For example, it may be used to control the third electronic device to receive data through the D- line and send data through the D+ line. Alternatively, it may be used to control the third electronic device to receive data through the D+ line and send data through the D- line. Alternatively, it may be used to determine the D- and D+ lines used for sending and receiving data according to the received instructions.

[0319] The communication lines are D- and D+ lines. There are many ways to transmit data between electronic devices through D+ and D- lines. The following uses methods 1 to 4 as examples to illustrate the way of sending and receiving data between the first electronic device 100 and the second electronic device 200.

[0320] Mode 1: The D- line can be used to transmit and receive data between the first electronic device 100 and the second electronic device 200. The D+ line can be used to send a signal indicating whether the first electronic device 100 and the second electronic device 200 are connected.

[0321] Mode 2: The D+ line can be used to transmit and receive data between the first electronic device 100 and the second electronic device 200. The D- line can be used to send a signal indicating whether the first electronic device 100 and the second electronic device 200 are connected.

[0322] Mode 3: The D- line can be used for the first electronic device 100 to send data to the second electronic device 200. The D+ line can be used for the first electronic device 100 to receive data sent by the second electronic device 200.

[0323] Mode 4: The D+ line can be used for the first electronic device 100 to send data to the second electronic device 200. The D- line can be used for the first electronic device 100 to receive data sent by the second electronic device 200.

[0324] For example, the characteristics of the DC signal may be determined through communication data performed between the second electronic device 200 and the first electronic device 100. The characteristics may include voltage, current level and / or any other suitable type of characteristics. For example, the first electronic device 100 may send an input voltage-current indication information to the second electronic device 200. The fast charging interface 320 of the second electronic device 200 may send an output voltage-current indication information to the first electronic device 100, and output the selected voltage-current indication information to the charging unit 202. The indication information may be transmitted through the USB interface with the charging unit 202.

[0325] Considering that the handshake process of the communication protocol in the prior art takes a long time, for example, Figure 4a As shown, the handshake of the communication protocol requires the first electronic device to send a high level of up to 1 second to the second electronic device (for example, Figure 4a The handshake signal on the DP port or DM port shown in the figure) is used, so that after the second electronic device detects the high point level of 1s, it is confirmed that the communication protocol corresponding to the fast charging is adopted. The present application provides a handshake method for a communication protocol. Figure 4b It is a schematic diagram illustrating a handshake method according to a communication protocol provided in the present application. By performing a handshake on the communication protocol provided in the present application between a first electronic device and a second electronic device, a data transmission method based on a charging cable provided in the present application can be prepared. In this embodiment, the first electronic device is a device to be charged, the second electronic device is a power supply device, and the third electronic device is a charging cable. The handshake method may specifically include the following steps:

[0326] Step 401: After the first electronic device establishes a physical connection with the second electronic device through the third electronic device, it is determined that the second electronic device is a DCP device.

[0327] In some embodiments, the first electronic device and the second electronic device can perform USB BC1.2 protocol detection to determine that the second electronic device is a DCP device. Considering that the DCP device can better support the fast charging mode, after passing the USB BC1.2 protocol detection, the fast charging process of this application can be based on the DCP device to ensure better fast charging of the first electronic device. The following briefly introduces the steps of USB BC1.2 detection:

[0328] Step 4011: The first electronic device detects whether the Vbus line is connected.

[0329] Step 4012: The first electronic device starts a timer to determine whether data connectivity detection (DCD) is supported.

[0330] When the first electronic device is connected to a common USB interface (SDP device) or a USB interface supporting high current (CDP device), the next step is immediately entered without waiting for the timer to time out. When the first electronic device does not support DCD, the next step is executed after the waiting timer times out.

[0331] Step 4013: The first electronic device initiates the first detection.

[0332] The first electronic device applies a voltage VDP_SRC to D+, and the first electronic device starts to detect the voltage on D-.

[0333] The voltage VDP_SRC can make the voltage on the D+ line range from 0.5 to 0.7V.

[0334] When the voltage detected by the first electronic device on the D- line is greater than VDAT_REF (i.e., the voltage range measured on the D- line is 0.25~0.4V), it is determined that the second electronic device is a DCP device (during the first detection, the D+ line and the D- line will be short-circuited by the controller of the DCP device) or a CDP device (during the first detection, the D+ line and the D- line will be short-circuited by the controller of the CDP device).

[0335] Step 4014: The first electronic device performs a secondary detection to determine whether the second electronic device is a DCP device.

[0336] The first electronic device applies a voltage VDM_SRC (0.5-0.7V) to the D- line, and then detects the voltage on the D+ line.

[0337] When the voltage on the D+ line is greater than VDAT_REF (the voltage range measured on the D+ line is 0.25-0.4 V), it is determined that the second electronic device is a DCP device.

[0338] In some embodiments, the DCP device short-circuits the D+ line and the D- line during the first detection and the second detection. In other embodiments, the second electronic device is a power supply device that only supports BC1.2, and the D+ line and the D- line can be short-circuited directly with a resistor inside.

[0339] After determining that the second electronic device is a DCP device, the first electronic device and the second electronic device initiate a protocol handshake detection to detect whether the other party supports the data transmission protocol of the present application, so that the communication protocol of the present application can be better compatible with the third electronic device and the second electronic device with a USB interface.

[0340] Step 402: The first electronic device sends a first pulse signal to the second electronic device through a communication line (D+ line or D- line).

[0341] Mode a1: The first electronic device sends a first pulse on the D+ line.

[0342] The first pulse can be implemented in many ways. For example, the first pulse can be Figure 4c The pulse signal shown in (a) in FIG. 1 , wherein the duration of the high level is Tdet1 and Tdet3; the voltage value of the high level may be 3.3V, and the duration of the low level may be Tdet2. In some embodiments, Tdet1, Tdet2, and Tdet3 may be the same, all 1 ms, or may be set to different times, and may be set according to time requirements, which is not limited here.

[0343] For example, when t=0ms, the first electronic device enables the pull-up resistor RP, so that a high level is generated on the D+ line; taking Tdet1=Tdet2=Tdet3=1ms as an example, when t=1-2ms, the first electronic device pulls down the voltage of the D+ line, and after t=2ms, restores the high level of the D+ line, so that a first pulse of t=0-3ms is generated. Thus, the first electronic device sends the first pulse, and the second electronic device detects the first pulse.

[0344] Mode a2: The first electronic device sends a first pulse on the D-line.

[0345] The first pulse can be implemented in many ways. For example, the first pulse can be Figure 4d The pulse signal shown in (a) in FIG. 1 , wherein the duration of the low level is Tdet1 and Tdet3; the voltage value of the low level may be -3.3V, and the duration of the high level may be Tdet2. In some embodiments, Tdet1, Tdet2, and Tdet3 may be the same, all 1 ms, or may be set to different times, and may be set according to time requirements, which is not limited here.

[0346] For example, when t=0ms, the first electronic device enables the pull-down resistor, so that a low level (e.g., -3.3V) is generated on the D- line; taking Tdet1=Tdet2=Tdet3=1ms as an example, when t=1-2ms, the first electronic device pulls up the voltage of the D+ line (e.g., the voltage value is 0V), and after t=2ms, restores the low level of the D+ line (e.g., -3.3V), so that a first pulse of t=0-3ms is generated. Thus, the first electronic device sends the first pulse, and the second electronic device detects the first pulse.

[0347] Step 403: After detecting the first pulse, the second electronic device disconnects the D+ line and the D- line, and sends a first response signal through the communication line.

[0348] In combination with mode a1, the first response signal may be a high level signal, such as Figure 4c As shown in (b), in some embodiments, when the second electronic device detects the first pulse, since the D+ line and the D- line are in a short-circuit state, the first pulse can also be detected on the D- line. After the second electronic device detects the first pulse, the D+ line and the D- line can be disconnected, and the D- line can be pulled down to the ground state as a response signal sent by the second electronic device to the first electronic device, so that the first electronic device determines that the handshake is successful according to the D- line detection response signal.

[0349] In other embodiments, the first response signal may be a high-level pulse signal, and the duration for the second electronic device to pull the D-line down to the ground state may be Tdet5. For example, the time of Tdet5 is 1 ms. Thus, the first electronic device can determine whether the handshake is successful by only detecting the time of Tdet5, thereby improving the detection efficiency.

[0350] In combination with the example of mode a1 in step 402, the second electronic device can detect the first pulse at t=0-3ms. After the second electronic device detects the first pulse, for example, at t=3-4ms, the line between the D+ line and the D- line is disconnected, and the D- line is pulled down, so that after t=4ms, the level on the D- line is a low level.

[0351] In combination with mode a2, the first response signal may be a low level signal, such as Figure 4d As shown in (b), in some embodiments, after the second electronic device detects the first pulse, the D+ line and the D- line can be disconnected, and the D+ line can be pulled down to the ground state as a response signal sent by the second electronic device to the first electronic device, so that the first electronic device determines that the handshake is successful.

[0352] In other embodiments, the first response signal may be a low-level pulse signal, and the duration for the second electronic device to pull up the D+ line to the ground state may be Tdet5. Thus, the first electronic device can determine whether the handshake is successful by only detecting the Tdet5 time, thereby improving detection efficiency.

[0353] In combination with the example of method a2 in step 402, after the second electronic device detects the first pulse, for example, when t=3-4ms, the line between the D+ line and the D- line is disconnected, and the D+ line is pulled down so that after t=4ms, the level on the D+ line is low.

[0354] Step 404: The first electronic device detects a response signal on the communication line to confirm whether the handshake is successful. If so, execute step 406; otherwise, execute step 405.

[0355] In combination with method a1, in some embodiments, when the first electronic device detects that D- is at a low level, it can be confirmed that the protocol handshake is successful. In other embodiments, when the first electronic device detects that D- is at a low level and the duration of the low level is Tdet5, it can be confirmed that the protocol handshake is successful, thereby improving the detection efficiency. In combination with the example of method a1 in step 402, at t=2ms, the first electronic device starts the low level detection of the D- line.

[0356] In combination with mode a2, in some embodiments, when the first electronic device detects that D+ is at a low level, it can be confirmed that the protocol handshake is successful. In other embodiments, when the first electronic device detects that D- is at a low level and the duration of the low level is Tdet5, it can be confirmed that the protocol handshake is successful.

[0357] Step 405: The first electronic device determines whether the number of detections in step 402 exceeds 3 times. If so, step 402 is executed; otherwise, step 407 is executed.

[0358] Step 406: The first electronic device and the second electronic device complete protocol detection.

[0359] In combination with the example of the method a1 in step 402, at t=5 ms, the first electronic device turns off the low level detection of the D-line.

[0360] In combination with the example of mode a2 in step 402, at t=5 ms, the first electronic device turns off the low level detection of the D+ line.

[0361] When the first electronic device determines that the handshake fails, the first electronic device may initiate a retry of the handshake detection at t=5-10 ms.

[0362] Step 407: The first electronic device releases control over D+D− and determines that the handshake fails.

[0363] Through the handshake protocol, the second electronic device can be determined to be a DCP device before the protocol handshake protocol is detected, so that it can be better compatible with the charging protocol based on the USB interface in the current market.

[0364] Figure 5a A schematic diagram of a handshake method for another communication protocol provided in the present application. By performing a handshake on the communication protocol provided in the present application between a first electronic device and a second electronic device, a data transmission method based on a charging cable provided in the present application can be prepared. In this embodiment, the first electronic device is a device to be charged, the second electronic device is a power supply device, and the third electronic device is a charging cable. The handshake method may specifically include the following steps:

[0365] Step 501: After a first electronic device establishes a physical connection with a second electronic device through a third electronic device, the second electronic device is determined to be a DCP device.

[0366] The specific implementation method can refer to the method in step 401, which will not be described in detail here.

[0367] Step 502: The first electronic device sends a second pulse signal to the second electronic device through the communication line (D+ line or D- line).

[0368] Mode b1: The first electronic device sends a second pulse on the D-line.

[0369] The second pulse can be implemented in many ways. For example, the second pulse can be Figure 5b The pulse signal shown in (a) in FIG. 1 , wherein the duration of the high level is Tdet1 and Tdet3; the voltage value of the high level can be 3.3V, and the duration of the low level can be Tdet2. In some embodiments, Tdet1, Tdet2, and Tdet3 can be the same, all 1ms, or can be set to different times, which can be set according to time requirements and are not limited here.

[0370] For example, when t=0ms, the first electronic device enables the pull-up resistor, so that a high level is generated on the D-line; taking Tdet1=Tdet2=Tdet3=1ms as an example, when t=1-2ms, the first electronic device pulls up the voltage of the D-line, and after t=2ms, restores the low level of the D-line, so that a second pulse of t=0-3ms is generated. Thus, the first electronic device sends the second pulse, and the second electronic device detects the second pulse.

[0371] Mode b2: The first electronic device sends a second pulse on the D+ line.

[0372] The second pulse can be implemented in many ways. For example, the second pulse can be Figure 5b The pulse signal shown in (a) in FIG. 1 , wherein the duration of the low level is Tdet1 and Tdet3; the voltage value of the low level may be -3.3V, and the duration of the low level may be Tdet2. In some embodiments, Tdet1, Tdet2, and Tdet3 may be the same, all 1 ms, or may be set to different times, and may be set according to time requirements, which is not limited here.

[0373] For example, when t=0ms, the first electronic device enables the pull-down resistor, so that a low level (e.g., -3.3V) is generated on the D-line; taking Tdet1=Tdet2=Tdet3=1ms as an example, when t=1-2ms, the first electronic device pulls up the voltage of the D-line (e.g., the voltage value is 0V), and after t=2ms, restores the low level of the D-line (e.g., -3.3V), so that a second pulse of t=0-3ms is generated. Thus, the first electronic device sends the second pulse, so that the second electronic device detects the second pulse.

[0374] Step 503: After detecting the second pulse signal, the second electronic device sends a second response signal.

[0375] Combination method b1, such as Figure 5b As shown in (b), in some embodiments, when the second electronic device detects the second pulse, since the D+ line and the D- line are in a short-circuit state, the second pulse can also be detected on the D+ line. After the second electronic device detects the second pulse, the D+ line and the D- line can be disconnected, and the D+ line can be pulled down to the ground state, and after Tdet4, the pull-down of the D+ line is released to restore the high level of the D+ line. Thus, the electrical signal of the D+ line that lasts Tdet4 is sent by the second electronic device to the first electronic device as the second response signal, so that the first electronic device detects the second response signal according to the D+ line and determines that the handshake is successful.

[0376] In combination with the example of mode b1 in step 502, the second electronic device can detect the second pulse at t=0-3ms. After the second electronic device detects the second pulse, for example, at t=3-4ms, the line between the D+ line and the D- line is disconnected, and the D+ line is pulled down for 1ms, so that at t=4-5ms, the level on the D+ line is a low level.

[0377] Combination method b2, such as Figure 5cAs shown in (b), in some embodiments, when the second electronic device detects the second pulse, since the D+ line and the D- line are in a short-circuit state, the second pulse can also be detected on the D- line. After the second electronic device detects the second pulse, the D+ line and the D- line can be disconnected, and the D- line can be pulled down to the ground state, and after Tdet4, the pull-down of the D- line is released to restore the low level of the D- line. Thus, the electrical signal lasting Tdet4 is sent by the second electronic device to the first electronic device as the second response signal, so that the first electronic device detects the second response signal according to the D- line and determines that the handshake is successful.

[0378] In combination with the example of mode b2 in step 502, the second electronic device can detect the second pulse at t=0-3ms. After the second electronic device detects the second pulse, for example, at t=3-4ms, the line between the D+ line and the D- line is disconnected, and the D- line is pulled down for 1ms, so that at t=4-5ms, the level on the D- line is a low level.

[0379] Step 504: The first electronic device detects the second response signal on the communication line to confirm whether the handshake is successful. If so, execute step 506; otherwise, execute step 505.

[0380] In combination with mode b1, the first electronic device detects a low level on the D- line, and the duration of the low level is Tdet4, then the protocol handshake is confirmed to be successful. In combination with the example of mode b1 in step 502, the first electronic device can start the low level detection of the D+ line at t=2ms.

[0381] In combination with mode b2, the first electronic device detects a low level on the D+ line, and the duration of the low level is Tdet4, then the protocol handshake is confirmed to be successful. In combination with the example of mode b2 in step 502, the first electronic device can start the low level detection of the D- line at t=2ms.

[0382] Step 505: The first electronic device determines whether the detection times of step 502 are more than 3 times. If yes, step 502 is executed; otherwise, step 507 is executed.

[0383] In combination with the example of mode b1 in step 502, at t=5 ms, the first electronic device turns off the low level detection of the D+ line.

[0384] In combination with the example of mode b2 in step 502, at t=5 ms, the first electronic device turns off the low level detection of the D-line.

[0385] Step 506: Complete the protocol handshake detection.

[0386] Step 507: The first electronic device releases control over D+D− and determines that the handshake fails.

[0387] For example, combining Figure 5b When the first electronic device determines that the handshake fails, the first electronic device may initiate a retry of the handshake detection at t=5-10ms.

[0388] pass Figure 4a or Figure 5a The protocol handshake detection method can realize fast protocol handshake. After the master device and the slave device (the second electronic device or the third electronic device) are connected, the detection can be completed within tens of milliseconds, thereby starting data transmission between the electronic devices, so that the master device and the slave device can quickly enter the fast charging state, thereby improving the charging efficiency.

[0389] The present application provides a data transmission method based on a charging cable, which is a data transmission method based on the D+ / D- data channel of a USB interface. Figure 1a to Figure 1b , Figures 2 to 3 The data transmission method can be applied to the scenario where the second electronic device 200 quickly charges the first electronic device 100 through the third electronic device 300. In this embodiment, the devices communicate with each other in half-duplex mode, and send and receive data through the first data signal line in the communication line.

[0390] Question 1: Considering that in the prior art, binary data is directly used for data transmission on the D-bus. For example, Figure 6a As shown, taking the case where the first electronic device sends data to the second electronic device as an example, when the data is continuous "0" or "1", the level does not change during the entire code element time. Therefore, the second electronic device cannot determine the number of continuous 0s or continuous 1s in the data sent by the first electronic device when the communication frequency is high, and thus cannot achieve clock synchronization between the first electronic device and the second electronic device. An additional transmission line may be required to transmit the clock signal or an additional clock signal may be sent to achieve clock synchronization between the first electronic device and the second electronic device. Therefore, only data with a lower communication frequency can be sent, or continuous "0" or "1" data cannot be sent, resulting in a slow communication rate.

[0391] Based on the above problem 1, in order to ensure the stability of data transmission and improve the communication rate, in some embodiments, such as Figure 6b As shown, the present application can send data based on the Manchester encoding method and receive data through the Manchester decoding method. Figure 6aAs shown, based on the data after Manchester encoding, the transition of the code element at the middle moment can be represented as a clock or data. For example, a positive transition (from low to high) can represent 1, and a negative transition (from high to low) can represent 0. Alternatively, a positive transition can represent 0, and a negative transition can represent 1. In other embodiments, such as Figure 6a As shown, differential Manchester encoding can also be used. In the electrical signal generated by differential Manchester encoding, the jump only represents the clock, and the change in the level at the beginning of the code element represents the data. For example, a change represents 0, and no change represents 1. The following takes the transmission of data between the first electronic device and the second electronic device as an example to introduce a data transmission method based on a charging cable provided by this embodiment, such as Figure 6c As shown, it may specifically include:

[0392] Step 601: The first electronic device detects a connection with the second electronic device;

[0393] It should be noted that, if the data is transmitted between the first electronic device and the third electronic device, then in step 601, the first electronic device detects the connection with the third electronic device.

[0394] The first electronic device is connected to the second electronic device through a third electronic device, and the third electronic device may include a first data signal line and a second data signal line.

[0395] The first data signal line may be a D+ line or a D- line, and the second data signal line may be a D- line or a D+ line.

[0396] Step 602a: Send a first message via a first pin.

[0397] The first message is a message encoded by Manchester, and the first pin is connected to a first data signal line.

[0398] Step 602b: Receive a second message through the first pin.

[0399] The second message is a message encoded by Manchester.

[0400] In this embodiment, the devices communicate in half-duplex mode, and data is sent and received via the first data signal line. After the protocol handshake detection is successful, the connection status between the devices can be determined by maintaining the level state on the second data signal line and monitoring the level state of the second data signal line.

[0401] Method c1, combined Figure 6d As shown, the second data signal line is a D+ signal line, and the first data signal line is a D- signal line.

[0402] For example, the first electronic device can pull up the D+ signal line to 3.3V and maintain this state to monitor the connection status between the first electronic device, the second electronic device and the third electronic device; for example, when the connection between the first electronic device and the second electronic device fails, the level on the D+ signal line received by the second electronic device is not 3.3V, so it can be determined that the connection between the first electronic device and the second electronic device fails. When the connection between the first electronic device and the third electronic device fails, the level on the D+ signal line received by the third electronic device is not 3.3V, so it can be determined that the connection between the first electronic device and the third electronic device fails.

[0403] The first electronic device can send data to the second electronic device and the third electronic device through the first pin on the D+ data signal line. The second electronic device or the third electronic device can also send data to the first electronic device through the first pin on the D+ data signal line, thereby realizing data transmission between devices.

[0404] Method c2, combined Figure 6e As shown, the first data signal line is a D+ signal line, and the second data signal line is a D- signal line.

[0405] For example, the first electronic device can pull down the D- signal line to -3.3V and maintain this state to monitor the connection status between the first electronic device, the second electronic device and the third electronic device; for example, when the connection between the first electronic device and the second electronic device fails, the level on the D+ signal line received by the second electronic device is not -3.3V, so it can be determined that the connection between the first electronic device and the second electronic device fails. When the connection between the first electronic device and the third electronic device fails, the level on the D+ signal line received by the third electronic device is not -3.3V, so it can be determined that the connection between the first electronic device and the third electronic device fails.

[0406] The first electronic device can send data to the second electronic device and the third electronic device through the first pin on the D-data signal line. The second electronic device or the third electronic device can also send data to the first electronic device through the first pin on the D-data signal line, thereby realizing data transmission between devices.

[0407] The following example illustrates the data structure of the first message and the second message.

[0408] Example 1

[0409] The first message and the second message may include a start field and an end field of a data packet.

[0410] like Figure 6fAs shown in (a) of FIG. 1 , combined with method c1, in some embodiments, the start field of a data packet may be a high-level pulse of a continuous time length. The end field of a data packet may be a high-level pulse of a continuous time length. For example, the start field (SOF) of a data packet may be a high-level pulse of 8 UIs. For example, the end field (EOF) of a data packet may be a high-level pulse of 4 UIs.

[0411] like Figure 6f As shown in (b), combined with method c2, in some embodiments, the start field of the data packet can be a low-level pulse of a continuous time length. The end field of the data packet can be a low-level pulse of a continuous time length. For example, the start field (SOF) of the data packet can be a low-level pulse of 8 UI (wherein UI can be the time length required for the bus to transmit a data bit, that is, UI is related to the frequency f of communication between the first electronic device and the second electronic device, UI = T = 1 / f). For example, the end field (EOF) of the data packet can be a low-level pulse of 4 UI.

[0412] Question 2: Considering that in the prior art, data is transmitted on the D-bus at a fixed communication frequency, when there is interference in the data transmission, the robustness of the data transmission is low and the communication performance is poor.

[0413] Based on the above question 2, combined with Figure 6c In the embodiment of the present invention, the first electronic device can select the required communication frequency according to actual needs. Figure 7 As shown, the following specifically introduces a method for configuring the communication frequency between the first electronic device and the second electronic device. Specifically comprising:

[0414] Step 701: a first electronic device sends a first signal through the first pin.

[0415] The frequency of the first signal is the first frequency; the first signal is used to negotiate that the communication frequency is the first frequency.

[0416] The first frequency can be determined by the first signal sent. For example, the first signal can be a 1010 1010 1010 1010 sequence sent on the D-channel with a period T; thus, the first frequency of the first signal can be determined to be 1 / T. After the sequence, a high-level pulse can also be included, and the high-level pulse serves as the end bit of the first signal.

[0417] Step 702: After receiving the first signal through the first pin, the second electronic device sends a second signal through the first pin.

[0418] The frequency of the second signal is the first frequency; the second signal is used to determine that the communication frequency is the first frequency.

[0419] In combination with the example in step 701, after receiving the sequence, the second electronic device sends the second signal to the first electronic device with the same frequency and the same sequence, so as to notify the first electronic device that the first signal is received and the second electronic device supports the communication frequency corresponding to the first signal;

[0420] Step 703: the first electronic device receives the second signal through the first pin, and determines whether the second signal is received within a preset time window; if so, execute step 704; if not, execute step 705;

[0421] Step 704: Determine that the communication frequency between the first electronic device and the second electronic device is a first frequency.

[0422] Step 705: Update the first frequency by the second frequency, and repeat steps 701 to 705.

[0423] It should be noted that the determination of the first frequency and the second frequency can be determined based on multiple pre-set frequencies. For example, four gears of communication frequencies f1, f2, f3, and f4 can be pre-set. When the configuration of communication frequency f1 fails, communication frequencies of other gears can be selected to initiate the configuration of the communication frequency.

[0424] In some embodiments, considering that the amount of communication data between the third electronic device and the first electronic device is small, it is mainly used to send the capability information of the third electronic device to the first electronic device. Therefore, in this embodiment, the third electronic device may not configure the communication frequency, and only select the default communication frequency to communicate with the first electronic device. For example, the default communication frequency may be the lowest communication frequency among the optional frequencies. Of course, it can also be set to other communication frequencies, which are not limited here.

[0425] Through the above method, the first electronic device can send a first signal. After receiving the first signal, the second electronic device and the third electronic device determine to communicate at the first frequency of the first signal to prepare for subsequent data transmission.

[0426] Question 3: Considering that the prior art can only support point-to-point communication between the first electronic device and the second electronic device on the D-line, it cannot support communication between multiple devices and cannot adapt to the scenario where there is a third electronic device in the system and the first electronic device, the second electronic device and the third electronic device need to communicate.

[0427] Based on the above problems, in an embodiment of the present application, the identifiers of different electronic devices can be defined, and when sending the first message or the second message, the identifier of the corresponding electronic device can be carried to realize data transmission between multiple devices.

[0428] Considering that in this embodiment, data is only sent and received via the first data signal line, it is necessary to carry the identifiers of the sender and the receiver in the first message and the second message to distinguish between multiple electronic devices.

[0429] In some embodiments, the identifications of different electronic devices may be represented by role coding information. The role coding information may be carried by physical packet header information.

[0430] In a possible implementation, a first message includes: a first identifier; the first identifier is used to indicate a recipient of the first message and a sender of the first message; a second message includes: a second identifier; the second identifier is used to indicate a recipient of the second message and a sender of the second message; the recipient of the first message or the sender of the second message is any one of the following: a second electronic device, a third electronic device.

[0431] For example, the role code may be composed of 8 bits, the upper four bits identify the role of the data sender, and the lower four bits identify the role of the data receiver. See Table 2 for details.

[0432] Table 2

[0433]

[0434] For another example, the number of fields occupied by the role code can be determined based on the multiple electronic devices connected to the communication system. For example, in order to save the number of fields, the number of fields occupied by the role code can be set to 4 bits. The upper 2 bits identify the data sender role, and the lower 2 bits identify the data receiver role. Alternatively, the lower 2 bits identify the data sender role, and the upper 2 bits identify the data receiver role. Taking the upper 2 bits identifying the data sender role and the lower 2 bits identifying the data receiver role as an example, it can be expressed as shown in Table 3.

[0435] Table 3

[0436]

[0437]

[0438] Take the example that the first message is sent to the second electronic device, and the second message is a message fed back by the second electronic device to the first electronic device. By adding the first identifier in the first message, the second electronic device can determine that the recipient of the first message is itself, and according to the sender in the first identifier, determine that when the subsequent feedback is given to the sender, the identifier carried in the second message sent is the identifier of the first electronic device, that is, the second identifier is included in the second message sent, so that the first electronic device can determine that the recipient of the second message is the first electronic device, and according to the sender in the second identifier, determine that when the subsequent feedback is given to the sender, the identifier carried in the message sent is the identifier of the second electronic device, which ensures that non-specified electronic devices (for example, third electronic devices) do not respond to the first message, and non-specified electronic devices (for example, third electronic devices) do not respond to the second message, and realize the communication of multiple electronic devices on a single bus.

[0439] In other embodiments, relevant information of the role encoding can be sent through the physical layer before sending the first message or the second message, so that the first electronic device, the second electronic device, and the third electronic device determine the identifiers corresponding to the data sender role and the receiver role, so as to subsequently send and receive the first message and the second message, thereby realizing multi-device communication on a single bus.

[0440] Question 4: Considering that in the prior art, the communication method follows the method of the master device asking the slave device (the second electronic device or the third electronic device) and answering, the slave device (the second electronic device or the third electronic device) can only respond to the master device and cannot actively communicate. That is, only after the first electronic device sends a message to the second electronic device, the second electronic device can feedback the corresponding message. In the scenario where the second electronic device has an abnormality and needs to actively report relevant information, it may cause the first electronic device to be unable to be notified in time, resulting in abnormal charging of the first electronic device, and even damage to the corresponding device of the first electronic device. Based on question 4, in the embodiment of the present application, the slave device is allowed to actively send messages. Data transmission is realized between multiple electronic devices through D+ or D-, which is used for sending commands, reporting and obtaining information between devices. Considering the problem of sharing the first data signal line to send messages between multiple electronic devices. Multiple devices in the system may apply for the right to use the bus at the same time. In order to avoid bus conflicts, it is necessary to reasonably control and manage the applicants who need to occupy the bus in the system. Considering that the first electronic device is also a master device, the priority of the first electronic device to send data using the first data signal line can be set to high, the priority of the second electronic device to send data using the first data signal line can be set to medium, and the priority of the third electronic device to send data using the first data signal line can be set to low. The present application provides an arbitration method for data transmission. Figure 8a Give an example.

[0441] like Figure 8a As shown in (a), in some embodiments, after the first electronic device sends the first message through the first pin, within the first time window, the first data signal line is used for the first electronic device to receive the message.

[0442] It should be noted that the slave device (the second electronic device or the third electronic device) can determine that the first message is sent when receiving the end field of the first message sent by the first electronic device. That is, after the first electronic device sends the first message, the slave device can occupy the first data signal line by initiating communication.

[0443] like Figure 8a As shown in (b), in some embodiments, after the first electronic device receives the second message through the first pin, within a second time window, the first data signal line is used for the electronic device to receive the message.

[0444] like Figure 8a As shown in (c), after the first electronic device determines that the current time exceeds the second time window, the first data signal line is used for the electronic device to send a message. That is, if the slave device (the second electronic device or the third electronic device) does not use the first data signal line within the second time window, the ownership of the first data signal line will return to the first electronic device.

[0445] It should be noted that, in some embodiments, in order to avoid excessive delay, after the second time window times out, regardless of whether the data from the device (the second electronic device or the third electronic device) is completely sent, the slave device stops sending messages, and the ownership of the first data signal line returns to the first electronic device. In other embodiments, when it is determined that the data from the device (the second electronic device or the third electronic device) is not completely sent, a third time window can be set accordingly, and the window length of the third time window is greater than the second time window, so as to ensure that the data from the device can be sent as much as possible.

[0446] Furthermore, considering that in some application scenarios, when the state of the slave device (the second electronic device or the third electronic device) changes and the state information of the slave device (the second electronic device or the third electronic device) needs to be reported in time, if the first electronic device currently has the right to use the first data signal line, the state of the slave device (the second electronic device or the third electronic device) may not be reported to the first electronic device in time. Therefore, in an embodiment of the present application, a data transmission method based on a charging cable can also be provided, such as Figure 8b As shown, specifically including:

[0447] Step 801: the second electronic device or the third electronic device sends a first interrupt signal when the first data signal line is idle.

[0448] When an error event or an abnormal event occurs in the second electronic device or the third electronic device, for example, excessive current, poor contact, voltage fluctuation, etc. occurs on the second electronic device, at this time, the second electronic device needs to send the current status information of the second electronic device to the first electronic device in a timely manner, and can send a first interrupt signal to trigger the process of interrupting the first electronic device from sending data.

[0449] In some embodiments, the first interrupt signal may be a pulse, and the pulse width may be a pulse width that is different from other messages, so that the first electronic device can distinguish the first interrupt signal from signals of normal communication messages through the pulse width.

[0450] Step 802: After receiving the first interrupt signal, the first electronic device receives a third message reported by the second electronic device or the third electronic device.

[0451] In some embodiments, step 802a: after receiving the first interrupt signal, the first electronic device can send a query message to the second electronic device or the third electronic device, where the query message is used to query the current status information of the second electronic device or the third electronic device to obtain abnormal events or error events of the second electronic device or the third electronic device.

[0452] In other embodiments, after the second electronic device or the third electronic device sends the first interrupt signal, a third message can be sent directly to the second electronic device or the third electronic device, so that the first device obtains abnormal events or error events of the second electronic device or the third electronic device based on the sent third message.

[0453] Through the above method, the second electronic device and the third electronic device can actively report their respective status information, avoiding the passive mode in the prior art where the slave device (the second electronic device or the third electronic device) only responds to the master device, thereby improving the flexibility of charging control and charging safety.

[0454] Considering that when an abnormality occurs in the first data signal line, for example, when charging with a large current, the first electronic device is disconnected from the second electronic device. At this time, the large current may cause irreversible damage to the first electronic device and the second electronic device. At this time, the second electronic device can detect the unplugging action of the third electronic device within microseconds, quickly close the energy output path, and stop the fast charging mode. Therefore, correspondingly, the data transmission mode also needs to be restored to the data transmission mode under the normal charging mode. In an embodiment of the present application, a reset signal can be sent by the first electronic device to achieve the reset of the communication mode of the second electronic device and the third electronic device.

[0455] like Figure 8cAs shown, a timing diagram of a first reset signal (T_RESET) sent by a first electronic device. The first electronic device can send a first reset signal through the first pin; the first reset signal is used to instruct a receiver of the first reset signal to reset; and the pulse width of the first reset signal is associated with the receiver.

[0456] In some embodiments, the first reset signal may be a reset pulse; the reset pulse may be a pulse signal that drives the first data signal line to a high level within a preset time. The preset time may be much longer than the time length occupied by the data signal or time window involved in the present application. For example, the preset time may be 1 second.

[0457] After the second electronic device receives the first reset signal, the second electronic device restores the state of the second electronic device to the default state according to the reset protocol. After the third electronic device receives the first reset signal, the third electronic device restores the state of the third electronic device to the default state according to the reset protocol.

[0458] To improve the quality of data transmission on the communication link, in the embodiment of the present application, the data packet may further include a communication data error check. The communication data error check may be a cyclic redundancy check. The CRC may be generated and checked by the physical layer or the protocol layer.

[0459] In some embodiments, the first message includes at least one data frame; the data frame is any one of the following: data packet header information, data information, control information, cyclic redundancy check; wherein a data frame includes: a start field, a data field, and an end field.

[0460] For example, if Figure 8d As shown, it includes 3 data frames, the first data frame includes a data frame of data packet header information, the second data frame includes a data frame of control information, and the third data frame is a data frame of cyclic redundancy check. The structure of each data frame can also include a start field (marked as SOF in the figure) and an end field (marked as EOF in the figure). The sender transmits all data with a length of 8 bits (one field) and automatically counts it, and also adds a parity bit to the end of each field. Therefore, the data transmitter counts the cyclic redundancy check (CRC) and adds it to the end of each data packet transmitted on this protocol.

[0461] In some embodiments, a cyclic redundancy check field may be added to all data transmitted from the first electronic device to the second electronic device, and from the second electronic device to the first electronic device.

[0462] In other embodiments, Figure 8eAs shown, it includes N+3 data frames, the first data frame includes a data frame of data packet header information, the second data frame includes a data frame of data description information, the third to N+2 data frames are data content; the N+3 data frame is a data frame of cyclic redundancy check. The structure of each data frame can also include a start field (marked as SOF in the figure) and an end field (marked as EOF in the figure). Among them, the second data frame to the N+2 data frame are data frames including data information. Cyclic redundancy check (CRC) can be performed only on the data field, excluding the parity check bit. The data transmitter counts the cyclic redundancy check (CRC) and adds it to the end of the data packet. The receiving end needs to calculate the cyclic redundancy check (CRC) of the received data and compare it with the cyclic redundancy check (CRC) field received by the data packet to realize data verification.

[0463] Based on the above problem 1, the present application provides a data transmission method based on a charging cable, which is a data transmission method based on the D+ / D- data channel of a USB interface. Figure 1a to Figure 1b , Figures 2 to 3 The data transmission method can be applied to the scenario where the second electronic device 200 quickly charges the first electronic device 100 through the third electronic device 300. The communication mode between the devices is full-duplex communication. In the embodiment of the present application, the full-duplex communication mode is adopted to avoid the problem of clock synchronization when the first electronic device sends data to the second electronic device. Figure 9a As shown, the specific steps may include:

[0464] Step 901: Detecting connection with a second electronic device and / or a third electronic device;

[0465] The first electronic device is connected to the second electronic device through a third electronic device, and the third electronic device may include a first data signal line and a second data signal line. The first data signal line may be a D+ line or a D- line. The second data signal line may be a D- line or a D+ line.

[0466] In some embodiments, there are multiple ways to determine whether the first electronic device uses the D+ line or the D- line as the first data signal line to send data. The following uses ways d1-d3 as examples to illustrate the communication between the first electronic device and the second electronic device.

[0467] Mode d1, the first electronic device and the second electronic device determine that the first data signal line is the D+ line or the D- line through a preset method. For example, in the communication protocol of fast charging, the default communication mode is determined, that is, the first data signal line of the electronic device to be charged (the first electronic device) is the D- line, and the second data signal line of the electronic device to be charged (the first electronic device) is the D+ line. Correspondingly, the first data signal line of the power supply device is the D+ line. The second data signal line of the power supply device is the D- line.

[0468] In some other possible implementations, the first electronic device may receive a message from the second electronic device through the second pin, and determine that the second pin is in a message receiving state and the first pin is in a message sending state; or the first electronic device may send a message to the second electronic device through the first pin, and determine that the second pin is in a message receiving state and the first pin is in a message sending state. Modes d2 and d3 are used as examples to illustrate that the message may be a negotiation instruction, a negotiation response, a line switching instruction, or a switching response.

[0469] In mode d2, the first electronic device and the second electronic device may determine the first data signal line and the second data signal line corresponding to the first electronic device by negotiation before communication, thereby correspondingly determining the first data signal line and the second data signal line corresponding to the second electronic device.

[0470] In some embodiments, after the protocol handshake is completed, the first electronic device may first determine that the first data signal line is the D+ line or the D- line. Thus, through the determined first data signal line (D+ line or D- line), a negotiation instruction is sent to the second electronic device. After receiving the negotiation instruction, the second electronic device determines that the data signal line is the data signal line for receiving the first electronic device, that is, determines that the data signal line is the second data signal line of the second electronic device. At this time, the first data signal line of the second electronic device can be determined through the second data signal line, and thus, a negotiation response is sent to the first electronic device through the first data signal line of the second electronic device to determine that the negotiation is completed. In other embodiments, the second electronic device may initiate a negotiation instruction, and thus, through the negotiation response fed back by the first electronic device, it is determined that the negotiation is completed, and thus, the respective first data signal lines and second data signal lines are determined according to the negotiation results.

[0471] It should be noted that, in some embodiments, the negotiation instruction may be data sent by the first electronic device to the second electronic device to reduce the sending of instructions. The negotiation instruction may also be an instruction used alone for negotiation, which is not limited here.

[0472] In mode d3, the first electronic device and the second electronic device may switch the first data signal line and the second data signal line during the communication process.

[0473] In some embodiments, it may be an instruction of switching lines initiated by the first electronic device to the second electronic device. Taking the current first data signal line of the first electronic device as the D-line as an example, the switching instruction can be sent to the second electronic device through the D-line. After receiving the switching instruction through the D-line, the second electronic device determines that the data signal line communicating with the first electronic device needs to be switched, thereby determining whether to switch the D-line to the second data signal line of the second electronic device as needed. When it is determined that the second electronic device can switch the D-line to the second data signal line of the second electronic device and the D+ line to the first data signal line of the second electronic device, the second electronic device can send a switching response to the first electronic device through the switched first data signal line (D+ line) of the second electronic device to determine that the switching is completed. When the second electronic device determines that it does not agree to switch the D-line to the second data signal line of the second electronic device, or does not support the switching of the D-line to the second data signal line of the second electronic device, the second electronic device can send a switching response to the first electronic device through the original first data signal line (D-line) of the second electronic device to indicate that it does not agree to switch, or that the switching fails. In subsequent communications, the second electronic device sends data through the D+ line and receives data through the D-line. The first electronic device sends data through the D- line and receives data through the D+ line first.

[0474] In other embodiments, when it is determined that the second electronic device can switch the D- line to the second data signal line of the second electronic device and the D+ line to the first data signal line of the second electronic device, the second electronic device sends a switching response to the first electronic device through the original first data signal line (D- line) of the second electronic device to determine that the switching is completed. In subsequent communications, the first electronic device sends data through the D+ line and receives data through the D- line. The second electronic device sends data through the D- line and receives data through the D+ line.

[0475] When the second electronic device determines that it does not agree to switch the D-line to the second data signal line of the second electronic device, or does not support switching the D-line to the second data signal line of the second electronic device, the second electronic device sends a switching response to the first electronic device through the first data signal line (D-line) of the original second electronic device to determine that the switching has failed.

[0476] In other embodiments, the second electronic device may also initiate a switching instruction, thereby determining that the switching is completed through a negotiation response fed back by the first electronic device, and thereby determining the respective first data signal lines and second data signal lines according to the switching result.

[0477] Regarding the communication between the first electronic device and the third electronic device, the following uses modes e1-e4 as examples to illustrate the communication between the first electronic device and the second electronic device.

[0478] Mode e1, the first electronic device and the third electronic device determine that the first data signal line of the first electronic device is the D+ line or the D- line, and the first data signal line of the third electronic device is the D- line or the D+ line through a preset method. For example, in the fast charging communication protocol, the default communication mode is determined, that is, the first data signal line of the electronic device to be charged (the first electronic device) is the D- line, and the second data signal line of the electronic device to be charged (the first electronic device) is the D+ line. Correspondingly, the first data signal line of the cable is the D+ line. The second data signal line of the cable is the D- line.

[0479] In mode e2, the first electronic device and the third electronic device can determine the first data signal line and the second data signal line corresponding to the first electronic device through negotiation before the first electronic device communicates with the third electronic device, thereby correspondingly determining the first data signal line and the second data signal line corresponding to the third electronic device.

[0480] In some embodiments, after the protocol handshake is completed, the first electronic device may first determine that the first data signal line is the D+ line or the D- line. Thus, through the determined first data signal line (D+ line or D- line), a negotiation instruction is sent to the third electronic device. After receiving the negotiation instruction, the third electronic device determines that the data signal line is the data signal line receiving the first electronic device, that is, determines that the data signal line is the second data signal line of the third electronic device. At this time, the first data signal line of the third electronic device can be determined through the second data signal line, thereby sending a negotiation response to the first electronic device through the first data signal line of the third electronic device to determine that the negotiation is completed.

[0481] In other embodiments, the third electronic device may initiate a negotiation instruction, thereby determining the completion of the negotiation through the negotiation response fed back by the first electronic device, and thereby determining the respective first data signal lines and second data signal lines according to the negotiation result.

[0482] It should be noted that the negotiation instruction may be an instruction sent by the first electronic device to the second electronic device to detect the third electronic device, so as to reduce the sending of instructions. The negotiation instruction may also be an instruction used alone for negotiation, which is not limited here.

[0483] In mode e3, the first electronic device and the third electronic device may determine the first data signal line and the second data signal line corresponding to the third electronic device through negotiation after the first electronic device and the second electronic device determine the first data signal line and the second data signal line.

[0484] In some embodiments, after the first electronic device determines the first data signal line and the second data signal line for communicating with the second electronic device, the first electronic device can send a negotiation instruction to the third electronic device through the determined first data signal line (D+ line or D- line). At this time, after receiving the negotiation instruction, the third electronic device determines that the data signal line is the data signal line for receiving the first electronic device.

[0485] Alternatively, after the second electronic device determines the first data signal line and the second data signal line for communicating with the first electronic device, the second electronic device can send a negotiation instruction to the third electronic device through the determined first data signal line (D+ line or D- line). At this time, after receiving the negotiation instruction, the third electronic device determines that the data signal line is the data signal line for receiving the second electronic device.

[0486] It should be noted that, in the above method, the communication mode between the third electronic device and the first electronic device can be independent of the communication mode between the third electronic device and the first electronic device. For example, the communication mode between the third electronic device and the first electronic device can be set before the communication between the third electronic device and the first electronic device. The communication mode between the third electronic device and the second electronic device can be set before the communication between the third electronic device and the second electronic device.

[0487] Alternatively, consider a scenario where there may be a conflict, for example, the first electronic device sends a first negotiation instruction to the third electronic device, and the second electronic device sends a second negotiation instruction to the third electronic device. The first negotiation instruction conflicts with the first data signal line of the third electronic device indicated by the second negotiation instruction. At this time, the third electronic device can determine a communication method to respond to the first and second electronic devices accordingly. For example, the third electronic device determines the first data signal line and the second data signal line in a manner corresponding to the first negotiation instruction. Then, the first electronic device can be replied with a successful negotiation, and the second electronic device can be replied with a failed negotiation. Thus, the first and second electronic devices are notified of the corresponding negotiation results.

[0488] Among them, the way in which the third electronic device determines the first data signal line and the second data signal line can be determined according to the priority of communication between the third electronic device and the first electronic device or the second electronic device. For example, when the communication priority between the first electronic device and the third electronic device is higher, it can be determined according to the first negotiation instruction of the first electronic device; when the communication priority between the second electronic device and the third electronic device is higher, it can be determined according to the second negotiation instruction of the second electronic device.

[0489] The priority of the third electronic device in communicating with the first electronic device or the second electronic device may be determined according to the electronic device with which the third electronic device currently communicates with priority, or may be a preset priority, which is not limited here.

[0490] Step 902a: Send a first message through a first pin; the first pin is connected to a first data signal line.

[0491] Step 902b: receiving a second message through a second pin; the second pin is connected to a second data signal line.

[0492] The first message and the second message are used to set the charging of the electronic device.

[0493] In combination with mode a1 or b1, a possible mode f1 is that the second data signal line is a D+ signal line and the first data signal line is a D- signal line. In this case, the first pin is a pin connected to the negative signal data line; the second pin is a pin connected to the positive signal data line. Figure 9b As shown, the first electronic device sends data on D- and receives data on D+; the second electronic device receives data on D- and sends data on D+.

[0494] In combination with mode a2 or b2, a possible mode f2 is that the first data signal line is a D- signal line, and the second data signal line is a D+ signal line. In this case, the first pin is a pin connected to the positive signal data line; the second pin is a pin connected to the negative signal data line. Fig.9c As shown, the first electronic device sends data on D+ and receives data on D-; the second electronic device receives data on D+ and sends data on D-.

[0495] For the third electronic device, the third electronic device can receive data on D- and send data on D+. Alternatively, the third electronic device receives data on D+ and sends data on D-.

[0496] Combination Figure 9d ,like Figure 9g As shown, before the third electronic device starts communicating with the first electronic device or the second electronic device and after the communication ends, the first pin and the second pin can be set to be in a state of receiving messages. When the third electronic device receives the third message from the first electronic device or the second electronic device, it determines the states of sending and receiving messages of the first pin and the second pin.

[0497] Taking the communication between the first electronic device and the third electronic device as an example, the first electronic device determines that the second pin of the first electronic device is in the state of receiving messages and the first pin is in the state of sending messages. Therefore, the first electronic device can send a third message to the third electronic device through the first pin.

[0498] In a possible implementation, the third message may include a third identifier; the third identifier is used to identify that the recipient of the third message is a third electronic device. The third identifier can be set in a manner similar to the first identifier in the first message described below, and will not be described in detail here.

[0499] The third message may be used to instruct the third electronic device to set the first pin to a state of receiving a message, and the second pin to a state of sending a message. Thus, when the third electronic device receives the third message, it may set the first pin to a state of receiving a message, and the second pin to a state of sending a message. Thus, the third electronic device may start to communicate with the first electronic device. In other embodiments, in order to save signaling overhead, the third message may also be a request message for obtaining configuration information of the third electronic device. When the third electronic device receives the third message, it may set the first pin to a state of receiving a message, and the second pin to a state of sending a message. At the same time, according to the third message, communication with the first electronic device is started directly.

[0500] After the communication is completed, in a possible implementation, the first electronic device may actively send a reset message to the third electronic device, and the reset message may be used to indicate that the first pin and the second pin of the third electronic device are in a state of receiving a message. Thus, when the third electronic device determines that the reset message is received, it confirms that the communication between the first electronic device and the third electronic device is completed, thereby restoring the first pin and the second pin of the third electronic device to a state of receiving a message. In another possible implementation, the third electronic device may also determine that the communication between the first electronic device and the third electronic device is completed by other means. For example, after the first electronic device determines that the communication with the third electronic device is completed, it communicates with the second electronic device, for example, the first electronic device sends a fourth message to the second electronic device, and the fourth message includes a second identifier; the second identifier is used to indicate that the recipient is the second electronic device. When the third electronic device receives the fourth message, it may determine that the communication between the first electronic device and the third electronic device is completed, and the third electronic device may set the first pin and the second pin of the third electronic device to a state of receiving a message.

[0501] In a possible scenario, when the first electronic device determines that the transceiver pin of the third electronic device needs to be switched, a fifth message can be sent to the third electronic device through the second pin, and the recipient of the fifth message is the third electronic device. The fifth message can be an instruction for instructing the third electronic device to switch the transceiver state of the pin. Thus, when the third electronic device receives the fifth message through the second pin, the second pin can be set to a state of receiving a message and the first pin to a state of sending a message, so as to switch the transceiver state of the first pin and the second pin.

[0502] It should be noted that the fifth message may be sent after the communication between the first electronic device and the third electronic device is completed, or may be sent during the communication between the first electronic device and the third electronic device, which is not limited here.

[0503] Combination Figure 9d ,like Figure 9h As shown, take the communication between the second electronic device and the third electronic device as an example. The second electronic device can determine that the second pin of the second electronic device is in the state of receiving a message, and the first pin is in the state of sending a message. The determination method can be determined after consultation with the first electronic device, or it can be a method indicated by the first electronic device. For example, the second electronic device receives a message from the first electronic device through the second pin, thereby determining that the second pin is in the state of receiving a message. Therefore, the second electronic device can send a third message to the third electronic device through the first pin.

[0504] In a possible implementation manner, the third message may include a third identifier; the third identifier is used to identify that the recipient of the third message is a third electronic device.

[0505] The third message may be used to instruct the third electronic device to set the first pin to a state of receiving a message, and the second pin to a state of sending a message. Thus, when the third electronic device receives the third message, it may set the first pin to a state of receiving a message, and the second pin to a state of sending a message. Thus, the third electronic device may start to communicate with the second electronic device. In other embodiments, in order to save signaling overhead, the third message may also be a request message for obtaining configuration information of the third electronic device. When the third electronic device receives the third message, it may set the first pin to a state of receiving a message, and the second pin to a state of sending a message. At the same time, according to the third message, communication with the second electronic device is directly started.

[0506] After the communication is completed, in a possible implementation, the second electronic device may actively send a reset message to the third electronic device, and the reset message may be used to indicate that the first pin and the second pin of the third electronic device are in a state of receiving a message. Thus, when the third electronic device determines that the reset message is received, it confirms that the communication between the second electronic device and the third electronic device is completed, thereby restoring the first pin and the second pin of the third electronic device to a state of receiving a message. In another possible implementation, the third electronic device may also determine that the communication between the second electronic device and the third electronic device is completed by other means. For example, after the second electronic device determines that the communication with the third electronic device is completed, it communicates with the first electronic device, for example, the second electronic device sends a fourth message to the first electronic device, and the fourth message includes a first identifier; the first identifier is used to indicate that the recipient is the first electronic device. When the third electronic device receives the fourth message, it may determine that the communication between the second electronic device and the third electronic device is completed, and the third electronic device may set the first pin and the second pin of the third electronic device to a state of receiving a message.

[0507] In a possible scenario, when the second electronic device determines that the transceiver pin of the third electronic device needs to be switched, a fifth message can be sent to the third electronic device through the second pin, and the recipient of the fifth message is the third electronic device. The fifth message can be an instruction for instructing the third electronic device to switch the transceiver state of the pin. Thus, when the third electronic device receives the fifth message through the second pin, it can set the second pin to a state of receiving a message and the first pin to a state of sending a message, so as to switch the transceiver state of the first pin and the second pin.

[0508] In another possible switching scenario, the third electronic device receives the fifth message sent by the first electronic device through the first pin, and the third electronic device also receives the third message sent by the second electronic device through the second pin; at this time, the third electronic device can determine to set the receiving and sending states of the first pin and the second pin according to the priority of the first electronic device and the second electronic device. For example, when the priority of the first electronic device is higher than that of the second electronic device, the third electronic device can set the second pin to the state of receiving messages and the first pin to the state of sending messages according to the fifth message sent by the first electronic device.

[0509] For example, in Figure 9bIn the embodiment, the third electronic device can receive data on D- and send data on D+. In some other embodiments, the third electronic device can also switch the communication mode of the third electronic device through the controller of the third electronic device. For example, the communication mode can be switched by setting a switch to switch the data sending pin of the third electronic device to the D+ line and the data receiving pin of the third electronic device to the D- line, thereby switching the communication mode of the third electronic device to receive data on D- and send data on D+. Fig.9c In some other embodiments, the third electronic device can also switch the communication mode of the third electronic device through the controller of the third electronic device. For example, the communication mode can be switched by setting a switch to switch the data sending pin of the third electronic device to the D- line and the data receiving pin of the third electronic device to the D+ line, thereby switching the communication mode of the third electronic device to receive data on D+ and send data on D-. Figure 9d In the third electronic device, by setting two data receiving modules RX1 and RX2, and two data sending modules TX1 and TX2, two receiving and sending modes can be switched. For example, it can be set to receive data on D+ and send data on D- through the receiving module RX1 and the sending module TX1. The setting method can be that after D- receives a control instruction, the D- data signal line is determined as the receiving line, thereby correspondingly setting the receiving module RX1 to be enabled and the sending module TX1 to be enabled. It can also be set to receive data on D- and send data on D+ through the receiving module RX2 and the sending module TX2. The setting method can be that after D+ receives a control instruction, D+ is determined as the data signal line as the receiving line, thereby correspondingly setting the receiving module RX2 to be enabled and the sending module TX2 to be enabled. (The switching method, for example, can be as follows Figure 9d The switch shown is used to achieve switching, and of course switching can also be achieved in other ways, which are not limited here).

[0510] In step 902a, combining method a1 or b1, such as Fig.9e As shown in (a), the first electronic device sends a logic "0" signal by pulling the first data signal line low, indicating the start of the transmission character. After the data transmission is completed, it sends a logic "1" signal to indicate the end of the transmission.

[0511] In some embodiments, the first electronic device can be in an idle state, the first data signal line is at a high level, and when it is confirmed that the first message is to be sent (the sending instruction is received), the time corresponding to the start field of the first data signal line is pulled low (for example, the time of one data bit) is used as the start field of the first message to start communication. Then the data in the first message is sent in sequence from low to high, and after the data in the first message is sent, the end field of the first message is sent. In some embodiments, the end field can be the time corresponding to the end field of the first data signal line is pulled high (for example, the time of one data bit) to determine that a data frame in the first message has been sent.

[0512] In step 902a, combining method a2 or b2, such as Fig.9e As shown in (b), the first electronic device sends a logic "0" signal by pulling the first data signal line high, indicating the start of the transmission character. After the data transmission is completed, it sends a logic "1" signal to indicate the end of the transmission.

[0513] In some embodiments, when the first data signal line is in an idle state, the first electronic device can be at a low level (e.g., -3.3V). After confirming that the first message has been sent (a sending instruction has been received), the first data signal line will be pulled up to 0V and the time corresponding to the start field (e.g., the time of one data bit) will be used as the start field of the first message to start communication. Then the data in the first message is sent in sequence from low to high, and after the data in the first message is sent, the end field of the first message is sent. In some embodiments, the end field can be the time corresponding to the end field of the first data signal line being pulled down (e.g., one data bit time) to determine that a data frame in the first message has been sent.

[0514] For example, a data frame may include a 1-bit start field, an 8-bit data field, and a 1-bit end field. When the first message includes only one data frame, it can be considered that the current first message has been sent completely. When the first message includes multiple data frames, each data frame in the first message may be sent in sequence until each data frame in the first message has been sent completely.

[0515] In step 902b, combined with method a1 or b1, in some embodiments, the first electronic device can be in an idle state, the second data signal line is at a high level, and when a falling edge is detected on the second data signal line, it can be determined that there is data transmission, and it can be determined that the second message is started to be received, and a frame of data in the second message is received in sequence from low to high. After determining that the data of the preset field has been received, it is determined that the second data signal line is at a high level, thereby determining that one data frame has been received.

[0516] In step 902b, in combination with method a2 or b2, the first electronic device can be in an idle state, the second data signal line is at a low level (for example, -3.3V), and when a rising edge is detected on the second data signal line, it can be determined that there is data transmission, and it can be determined that the second message is started to be received, and a frame of data in the second message is received in sequence from low to high. After determining that the data in the preset field has been received, it is determined that the second data signal line is at a low level, thereby determining that one data frame has been received.

[0517] In some embodiments, the first message includes at least one data frame; the data frame is any one of the following: data packet header information, data information, control information, cyclic redundancy check; wherein a data frame includes: a start field, a data field, and an end field.

[0518] Among them, Figure 9f As shown in the figure, the structure of a data frame may include a start field (marked as S in the figure), a data field and an end field (marked as E in the figure). The interval between different data is marked as I. For example, in a data link, a frame of data contains 10 bits (1 bit start field + 8 bits data field + 1 bit end field). At the protocol layer, according to different information commands, a data may include multiple 10-bit data frames.

[0519] For example, control commands can be Figure 9f As shown in (a), it includes 5 data frames. The data field of the first data frame is the communication frequency (training) field, the data field of the second data frame is the high-order message header field (i.e., data packet header information), the data field of the third data frame is the low-order message header field (i.e., data packet header information), the data field of the fourth data frame is the control command field (i.e., control information), and the data field of the fifth data frame is the CRC check field (i.e., CRC information).

[0520] Data commands can be Figure 9f As shown in (b), it includes 4+N data frames. The data field of the first data frame is the communication frequency field, the data field of the second data frame is the high-order message header field, the data field of the third data frame is the low-order message header field, the data fields of the fourth data frame to the third+Nth data frame are data fields (i.e., data information), and the data field of the fourth+Nth data frame is a CRC check field.

[0521] The data can also be a custom command, for example, Figure 9fAs shown in (c), it includes 6+N data frames. The data field of the first data frame is the communication frequency field, the data field of the second data frame is the high-order message header field, the data field of the third data frame is the low-order message header field, the data field of the fourth data frame is the high-order manufacturer information field, the data field of the fifth data frame is the low-order manufacturer information field, the data fields of the sixth data frame to the fifth+Nth data frame are data fields, and the data field of the sixth+Nth data frame is a CRC check field.

[0522] The format of the command field above is only an example. There may also be data frames corresponding to other fields in the data packet, which will not be described in detail here.

[0523] Based on the above-mentioned problem 2, considering that in the prior art, data is transmitted on the D-bus at a fixed communication frequency, when there is interference in the data transmission, the robustness of the data transmission is low and the communication performance is poor. Figure 9a In the embodiment of the present invention, the first electronic device can select the required communication frequency according to actual needs. Fig.10a As shown, the following specifically introduces a method for configuring the communication frequency between the first electronic device and the second electronic device. Specifically comprising:

[0524] Step 1001a: The first electronic device sends a first signal through the first pin and then sends a first message.

[0525] The frequency of the first signal is a first frequency.

[0526] The first frequency can be determined by the first signal sent. Fig.10b As shown, the first signal may be 0xAA or 0x55 data sent on the D-channel, and the communication frequency of the first signal is determined by receiving 0xAA or 0x55 data; after the data, a level pulse may also be included, and the level pulse serves as the end bit of the first signal.

[0527] Step 1002a: After receiving the first signal through the first pin, the second electronic device or the third electronic device receives the first message.

[0528] The communication frequency of the second message is determined to be the frequency of the second signal through the first signal.

[0529] Step 1001b: After the second electronic device or the third electronic device receives the second signal through the second pin, it sends a second message.

[0530] Through the second signal, the communication frequency of the second message is determined to be the frequency of the second signal.

[0531] Step 1002b: After receiving the second signal through the second pin, the first electronic device receives a second message.

[0532] Through the second signal, the communication frequency of the second message is determined to be the frequency of the second signal.

[0533] Through the above method, the first electronic device can send a first signal, and after receiving the first signal, the second electronic device and the third electronic device determine to communicate at the first frequency of the first signal.

[0534] Question 3: Considering that the prior art can only support point-to-point communication between the first electronic device and the second electronic device on the D-line, it cannot support communication between multiple devices and cannot adapt to the scenario where there is a third electronic device in the system and the first electronic device, the second electronic device and the third electronic device need to communicate.

[0535] Based on the above problems, in an embodiment of the present application, the identifiers of different electronic devices can be defined, and when sending the first message or the second message, the identifier of the corresponding electronic device can be carried to realize data transmission between multiple devices.

[0536] Considering that in this embodiment, taking the first electronic device as an example, the first message is sent via the first data signal line, and the second message is received via the second data signal line, it is only necessary to carry the identifier of the recipient in the first message and the second message to distinguish multiple electronic devices of the possible recipient.

[0537] In some embodiments, the identifications of different electronic devices may be represented by role coding information. The role coding information may be carried by physical packet header information.

[0538] In a possible implementation, a first message includes: a first identifier; the first identifier is used to indicate a recipient of the first message; a second message includes: a second identifier; the second identifier is used to indicate a recipient of the second message; the recipient of the first message is any one of the following: a second electronic device, a third electronic device.

[0539] For example, the role code may be composed of 4 bits, wherein the upper 2 bits identify the role of the data receiver, or the lower 2 bits identify the role of the data receiver.

[0540] For example, the high 2 bits identify the data receiver role. In a data packet, the first field is the data packet header information.

[0541] The identifier of the data receiver may be carried in the data packet header information, for example, as shown in Table 4.

[0542] Table 4

[0543] Role coding Bit Description 7:6 Data recipient identification Value Description First logo 01 Send to second electronic device First logo 10 Send to a third electronic device Second mark 11 Send to the first electronic device

[0544] Question 4: Considering that in the prior art, the communication method is carried out in the manner of the master device asking the slave device (the second electronic device or the third electronic device) and the slave device (the second electronic device or the third electronic device) can only respond to the master device and cannot actively communicate. That is, only after the first electronic device sends a message to the second electronic device, the second electronic device will feedback the corresponding message. In the scenario where the second electronic device has an abnormality and needs to actively report relevant information, it may cause the first electronic device to be unable to be notified in time, resulting in abnormal charging of the first electronic device, or even damage to the corresponding components of the first electronic device.

[0545] Based on question 4, combined Figure 9a The embodiments in the embodiment allow the slave device to actively send messages. Data transmission is realized between multiple electronic devices through D+ or D-, which is used for sending commands, reporting and obtaining information between devices. Considering the problem of sharing the first data signal line to send messages between multiple electronic devices. Data transmission between the third electronic device and the first electronic device can be performed first, and after determining that the data transmission between the third electronic device and the first electronic device is completed, only the data transmission between the first electronic device and the second electronic device is enabled. Fig.11a , the first electronic device actively initiates the acquisition of the configuration information of the third electronic device as an example for description. The second electronic device actively initiates the acquisition of the configuration information of the third electronic device can refer to this embodiment, which will not be repeated here.

[0546] Step 1101: After the handshake detection is completed, the first electronic device sends a detection instruction to the third electronic device.

[0547] It should be noted that the detection instruction sent by the first electronic device to the third electronic device can be the third message mentioned above to implement the pin setting of the third electronic device, and can also be used to obtain the configuration information of the third electronic device. The specific content can be referred to above and will not be repeated here. The method in which the second electronic device actively initiates the acquisition of the configuration information of the third electronic device can be a detection instruction (third message) sent by the second electronic device to the third electronic device after the handshake detection is completed.

[0548] Step 1102: Reset the counter.

[0549] Step 1103: The first electronic device determines whether the third electronic device exists, and if not, executes step 1112; if so, executes step 1104;

[0550] Step 1104: the first electronic device and the third electronic device start communication according to the set process, during which the second electronic device is prohibited from actively initiating communication.

[0551] For example, the first electronic device sends a third message to the third electronic device; the third message is used to obtain the configuration information of the electronic device. Correspondingly, the first electronic device receives a third response message from the third electronic device through the second pin, and the third response message is used to indicate the configuration information of the third electronic device.

[0552] Step 1105: The first electronic device determines whether the communication between the first electronic device and the third electronic device is completed; if so, execute step 1108; if not, execute step 1106;

[0553] Step 1106: the first electronic device determines whether the communication between the first electronic device and the third electronic device exceeds a preset time, if yes, execute step 1107; if no, execute step 1104;

[0554] Step 1107: Determine whether the counter is greater than a preset threshold (for example, the preset threshold is 3); if so, execute step 1108; if not, execute step 1109;

[0555] Step 1108: The first electronic device determines whether the configuration information of the third electronic device is successfully obtained. If yes, execute step 1112; if no, execute step 1110;

[0556] Step 1109: Increase the count of the counter.

[0557] By means of a counter, it can be ensured that the communication between the first electronic device and the third electronic device is completed within a preset threshold number of times and a preset time, and then the communication between the first electronic device and the second electronic device is carried out.

[0558] Step 1110: The first electronic device sends an indication message to the second electronic device.

[0559] Optionally, the first electronic device may send a reset message to the third electronic device before starting communication with the second electronic device; the reset message is used to indicate that the first pin of the third electronic device and the second pin of the third electronic device are in a state of receiving a message, so that the third electronic device determines to stop communicating with the first electronic device.

[0560] The first electronic device sends an instruction message to the second electronic device; the instruction message is used to instruct the second electronic device to obtain the configuration information of the third electronic device. Thus, the second electronic device can communicate with the third electronic device, thereby obtaining the configuration information of the third electronic device through the second electronic device.

[0561] It should be noted that the manner in which the second electronic device can communicate with the third electronic device can refer to the manner in which the first electronic device communicates with the third electronic device to obtain the configuration information of the third electronic device in steps 1101 to 1112, which will not be repeated here.

[0562] Step 1111: After the second electronic device communicates with the third electronic device to request configuration information of the third electronic device, the second electronic device may send a notification message of the third electronic device to the first electronic device.

[0563] In a possible scenario, the second electronic device successfully obtains the configuration information of the third electronic device. At this time, the notification message may include: the configuration information of the third electronic device. Optionally, the notification message may also be used to indicate that the second electronic device successfully obtains the configuration information of the third electronic device.

[0564] In another possible scenario, the second electronic device fails to successfully obtain the configuration information of the third electronic device. In this case, the notification message can be used to indicate that the second electronic device has failed to obtain the configuration information of the third electronic device.

[0565] Therefore, the first electronic device obtains the configuration information of the third electronic device by receiving the configuration information of the second electronic device, thereby determining whether to use the configuration information of the third electronic device for charging configuration.

[0566] Step 1112: The first electronic device initiates communication with the second electronic device.

[0567] Considering that when an abnormality occurs in the first data signal line or the second data signal line, for example, when charging with a large current, the first electronic device is disconnected from the second electronic device. At this time, the large current may cause irreversible damage to the first electronic device and the second electronic device. At this time, the second electronic device can detect the unplugging action of the third electronic device within microseconds, quickly close the energy output path, and stop the fast charging mode. Therefore, correspondingly, the data transmission mode also needs to be restored to the data transmission mode under the normal charging mode. In an embodiment of the present application, a reset signal can be sent by the first electronic device to achieve the reset of the communication mode of the second electronic device and the third electronic device.

[0568] like Fig.11b As shown, a timing diagram of a second reset signal sent by a first electronic device. The first electronic device can send a second reset signal through the first pin; the second reset signal is used to instruct the receiver of the second reset signal to reset; the pulse width of the second reset signal is associated with the receiver.

[0569] In some embodiments, the second reset signal may be a reset pulse; the reset pulse may be a pulse signal that drives the first data signal line to a low level within a preset time. For example, the preset time corresponding to the second electronic device may be 1 ms. The preset time may be much longer than the length of time occupied by the data signal or time window involved in the present application.

[0570] After the second electronic device receives the second reset signal, the second electronic device restores the state of the second electronic device to the default state according to the reset protocol. After the third electronic device receives the second reset signal, the third electronic device restores the state of the third electronic device to the default state according to the reset protocol.

[0571] When the power supply device executes a reset command, if the previous command sequence is running, the reset command will not be issued until the previous command sequence ends. For the second electronic device or the third electronic device, the pulse width of the second reset signal may be different. For example, the time length of the second reset signal of the third electronic device may be 1ms, and the time length of the second reset signal of the second electronic device may be 2ms. In another possible implementation, the second reset signal may also be determined based on the current communication frequency. For example, the time length of the second reset signal of the first electronic device may be N cycles (the period T corresponding to the communication frequency f between the first electronic device and the second electronic device), which is not limited here.

[0572] To improve the data transmission quality on the communication link, in the embodiment of the present application, the data packet may further include a communication data error check. The method may refer to the data error check method in the above embodiment, and will not be described in detail here.

[0573] like Fig.12 As shown, based on the same concept, Fig.12 An electronic device 1200 according to an embodiment of the present application is shown, and the electronic device 1200 includes: a processing module 1210 and a transceiver module 1220.

[0574] In a possible embodiment, the electronic device 1200 may be a first electronic device. The electronic device 1200 is connected to the second electronic device via a third electronic device, and the third electronic device includes a first data signal line and a second data signal line.

[0575] Among them, the processing module 1210 is used to detect the connection with the second electronic device through the transceiver module 1220; the processing module 1210 is used to send a first message through the first pin of the transceiver module 1220; the first pin is connected to the first data signal line; the second message is received through the second pin of the transceiver module 1220; the second pin is connected to the second data signal line; the first message and the second message are used to set the charging of the first electronic device.

[0576] In a possible implementation manner, the first pin is a pin connected to a negative signal data line; and the second pin is a pin connected to a positive signal data line.

[0577] In a possible implementation manner, the first pin is a pin connected to a positive signal data line; and the second pin is a pin connected to a negative signal data line.

[0578] In a possible implementation, the processing module 1210 is used to detect the connection with the second electronic device through the first pin or the second pin to determine that the second electronic device is a dedicated charging interface DCP device; send a first pulse signal through the first pin of the transceiver module 1220; detect the electrical signal of the second electronic device through the second pin to confirm that the second electronic device supports the fast charging mode.

[0579] In a possible implementation manner, the second pin is a pin connected to a positive signal data line, and the electrical signal is a high level signal;

[0580] In a possible implementation manner, the second pin is a pin connected to a negative signal data line, and the electrical signal is a low level signal.

[0581] In a possible implementation, the first message includes: a first identifier; the first identifier is used to indicate a recipient of the first message; the second message includes: a second identifier; the second identifier is used to indicate a recipient of the second message.

[0582] In a possible implementation manner, the recipient of the first message is a chip of the third electronic device, and the recipient of the second message is the first electronic device;

[0583] In a possible implementation manner, the recipient of the first message is the second electronic device; and the recipient of the second message is the first electronic device.

[0584] In a possible implementation, the processing module 1210 is used to send a first signal through the first pin of the transceiver module 1220 before sending a first message through the first pin; the frequency of the first signal is a first frequency; and the first signal is used to indicate that the frequency of the first message is the first frequency.

[0585] In a possible implementation, the processing module 1210 is used to receive a second signal through the second pin of the transceiver module 1220; the frequency of the second signal is a second frequency; and the second signal is used to indicate that the frequency of the second message is the second frequency.

[0586] In a possible implementation, the first message includes at least one data frame; the data frame is any one of the following: data packet header information, data information, control information, and cyclic redundancy check; wherein a data frame includes: a start field, a data field, and an end field.

[0587] In a possible implementation manner, the data packet header information includes the first identifier.

[0588] In a possible implementation, the processing module 1210 is used to send a start signal before sending the first message through the first pin of the transceiver module 1220; the start signal is a high level signal; the start signal is a low level signal; the processing module 1210 is used to send an end signal after sending the first message through the first pin of the transceiver module 1220; the end signal is a low level signal;

[0589] Alternatively, the processing module 1210 is used to send a start signal before sending the first message through the first pin of the transceiver module 1220; the start signal is a low-level signal; the processing module 1210 is used to send an end signal after sending the first message through the first pin of the transceiver module 1220; the end signal is a high-level signal.

[0590] In a possible implementation, the processing module 1210 is used to receive a start signal before receiving the second message through the second pin of the transceiver module 1220; the start signal is a high level signal; the processing module 1210 is used to receive an end signal after receiving the second message through the second pin of the transceiver module 1220; the end signal is a low level signal;

[0591] Alternatively, the processing module 1210 is used to receive a start signal before receiving the second message through the second pin of the transceiver module 1220; the start signal is a low-level signal; the processing module 1210 is used to receive an end signal after receiving the second message through the second pin of the transceiver module 1220; the end signal is a high-level signal.

[0592] In a possible implementation, the processing module 1210 is used to send a first reset signal through the first pin of the transceiver module 1220; the first reset signal is used to instruct a receiver of the first reset signal to reset; and the pulse width of the first reset signal is associated with the receiver.

[0593] In a possible embodiment, the electronic device 1200 may be a first electronic device.

[0594] In a possible implementation, the processing module 1210 is used to determine that the second pin is in a state of receiving a message and the first pin is in a state of sending a message; the first pin is connected to the first data signal line; the second pin is connected to the second data signal line; a third message is sent to the third electronic device through the first pin of the transceiver module 1220; the third message is used to obtain configuration information of the third electronic device, or the third message is used by the first electronic device to instruct the third electronic device to switch the transceiver status of the pin.

[0595] In one possible implementation, the processing module 1210 is used to receive a message from the second electronic device through the second pin of the transceiver module 1220, and determine that the second pin is in a state of receiving a message and the first pin is in a state of sending a message; or, send a message to the second electronic device through the first pin of the transceiver module 1220, and determine that the second pin is in a state of receiving a message and the first pin is in a state of sending a message.

[0596] In a possible implementation, the processing module 1210 is configured to receive a third response message from the third electronic device through the second pin of the transceiver module 1220, where the third response message is used to indicate configuration information of the third electronic device.

[0597] In a possible implementation manner, the third message includes: a third identifier; the third identifier is used to indicate that a recipient of the third message is the third electronic device.

[0598] In a possible implementation, the processing module 1210 is used to send an indication message to the second electronic device through the transceiver module 1220 when it is determined that the configuration information of the third electronic device has failed to be received; the indication message is used to instruct the second electronic device to obtain the configuration information of the third electronic device.

[0599] In a possible implementation, the processing module 1210 is used to receive a notification message from the second electronic device through the transceiver module 1220; the notification message is used to notify the second electronic device that the acquisition of the configuration information of the third electronic device has failed.

[0600] In a possible implementation, the processing module 1210 is configured to determine that the communication with the third electronic device is terminated when a fourth message is received from the second electronic device via the second pin of the transceiver module 1220 .

[0601] In a possible implementation, the processing module 1210 is used to send a reset message to the third electronic device through the first pin of the transceiver module 1220; the reset message is used to indicate that the first pin of the third electronic device and the second pin of the third electronic device are in a state of receiving a message.

[0602] In a possible implementation, the processing module 1210 is used to determine that the first pin is in a state of receiving a message and the second pin is in a state of sending a message; a fifth message is sent to the third electronic device through the second pin of the transceiver module 1220; the fifth message is used to obtain configuration information of the third electronic device; a fifth response message is received from the third electronic device through the first pin of the transceiver module 1220; the fifth response message is used to indicate the configuration information of the third electronic device.

[0603] In a possible implementation, the first pin is a pin connected to a negative signal data line; the second pin is a pin connected to a positive signal data line; or, the first pin is a pin connected to a positive signal data line; the second pin is a pin connected to a negative signal data line.

[0604] In a possible embodiment, the electronic device 1200 may be a first electronic device. The processing module 1210 is used to detect the connection with the second electronic device through the transceiver module 1220; send a first message through the first pin of the transceiver module 1220; or receive a second message through the first pin; wherein the first message and the second message are messages after Manchester encoding; the first pin is connected to the first data signal line; the first message and the second message are used to set the charging of the first electronic device.

[0605] In a possible implementation manner, the first pin is a pin connected to a negative signal data line; or, the first pin is a pin connected to a positive signal data line.

[0606] In a possible implementation, the processing module 1210 is used to detect the connection with the second electronic device through the first pin and the second pin of the transceiver module 1220, and determine that the second electronic device is a dedicated charging interface DCP device; the processing module 1210 is used to send a first pulse signal through the first pin of the transceiver module 1220; the processing module 1210 is used to detect the electrical signal of the second electronic device through the second pin of the transceiver module 1220, and confirm whether to charge the battery of the first electronic device through the fast charging mode.

[0607] In a possible implementation manner, the second pin is a pin connected to a positive signal data line, and the electrical signal is a high level signal;

[0608] In a possible implementation manner, the second pin is a pin connected to a negative signal data line, and the electrical signal is a low level signal.

[0609] In a possible implementation, the first message includes: a first identifier; the first identifier is used to indicate a recipient of the first message and a sender of the first message; the second message includes: a second identifier; the second identifier is used to indicate a recipient of the second message and a sender of the second message; the recipient of the first message or the sender of the second message is any one of the following: the second electronic device, the third electronic device.

[0610] In a possible implementation, the processing module 1210 is used to send a first signal through the first pin of the transceiver module 1220; the frequency of the first signal is a first frequency; and the first signal is used to negotiate that the communication frequency is the first frequency.

[0611] In a possible implementation, the processing module 1210 is used to receive a second signal through the first pin of the transceiver module 1220; the frequency of the second signal is the first frequency; and the second signal is used to determine that the communication frequency is the first frequency.

[0612] In a possible implementation manner, the frequency of the first message and the second message is the first frequency.

[0613] In a possible implementation, the first message includes at least one data frame; the data frame is any one of the following: data packet header information, data information, control information, and cyclic redundancy check; wherein a data frame includes: a start field, a data field, and an end field.

[0614] In a possible implementation, the processing module 1210 is used to send the first message through the first pin of the transceiver module 1220, and then, within a first time window, the first data signal line is used for the first electronic device to receive the message.

[0615] In a possible implementation, the processing module 1210 is used to determine, within a second time window, that the first data signal line is used for the first electronic device to receive a message after receiving the second message via the first pin of the transceiver module 1220.

[0616] In a possible implementation, the processing module 1210 is used to receive the second message through the first pin of the transceiver module 1220, and is also used to determine that after the current time exceeds the second time window, the first data signal line is used for the first electronic device to send a message.

[0617] In a possible implementation, the processing module 1210 is used to send a first reset signal through the first pin of the transceiver module 1220; the first reset signal is used to instruct a receiver of the first reset signal to reset; and the pulse width of the first reset signal is associated with the receiver.

[0618] In a possible embodiment, the electronic device 1200 may be a second electronic device. The second electronic device is connected to the first electronic device via a third electronic device, and the third electronic device includes a first data signal line and a second data signal line.

[0619] In a possible implementation, the processing module 1210 is used to determine the connection with the first electronic device through the transceiver module 1220; the processing module 1210 is used to receive a first message through a first pin of the transceiver module 1220; the first pin is connected to a first data signal line; the processing module 1210 is used to send a second message through a second pin of the transceiver module 1220; the second pin is connected to a second data signal line; the first message and the second message are used to set the charging of the first electronic device.

[0620] In a possible implementation manner, the first pin is a pin connected to a negative signal data line; and the second pin is a pin connected to a positive signal data line.

[0621] In a possible implementation manner, the first pin is a pin connected to a positive signal data line; and the second pin is a pin connected to a negative signal data line.

[0622] In a possible implementation, the processing module 1210 is used to receive a detection from the first electronic device through the first pin or the second pin of the transceiver module 1220, where the detection is used by the first electronic device to determine that the second electronic device is a dedicated charging interface DCP device;

[0623] The processing module 1210 is used to receive a first pulse signal from the first electronic device through the first pin of the transceiver module 1220; the processing module 1210 is used to send an electrical signal to the first electronic device through the second pin of the transceiver module 1220 to confirm that the battery of the first electronic device is charged through the fast charging mode.

[0624] In a possible implementation, the second pin is a pin connected to a positive signal data line, and the electrical signal is a high-level signal; the second pin is a pin connected to a negative signal data line, and the electrical signal is a low-level signal.

[0625] In a possible implementation, the first message includes: a first identifier; the first identifier is used to indicate a recipient of the first message; the second message includes: a second identifier; the second identifier is used to indicate a recipient of the second message.

[0626] In a possible implementation manner, the recipient of the first message is the second electronic device; and the recipient of the second message is the first electronic device.

[0627] In a possible implementation manner, when the recipient of the first message is the chip of the third electronic device, the second message is not sent to the first electronic device.

[0628] In a possible implementation, the processing module 1210 is used to send a second signal through the second pin of the transceiver module 1220 before sending the second message through the second pin; the frequency of the second signal is a second frequency; and the second signal is used to indicate that the frequency of the second message is the second frequency.

[0629] In a possible implementation, the processing module 1210 is used to receive a first signal through the first pin of the transceiver module 1220; the frequency of the first signal is a first frequency; and the first signal is used to indicate that the frequency of the first message is the first frequency.

[0630] In a possible implementation, the first message includes at least one data frame; the data frame is any one of the following: data packet header information, data information, control information, and cyclic redundancy check; wherein a data frame includes: a start field, a data field, and an end field.

[0631] In a possible implementation, the processing module 1210 is used to send a start signal before sending the second message through the second pin of the transceiver module 1220; the start signal is a low-level signal; the processing module 1210 is used to send an end signal after sending the second message through the second pin of the transceiver module 1220; the end signal is a high-level signal.

[0632] In a possible implementation, the processing module 1210 is used to receive a start signal before receiving the first message through the first pin of the transceiver module 1220; the start signal is a low-level signal; the processing module 1210 is used to receive an end signal after receiving the first message through the first pin of the transceiver module 1220; the end signal is a high-level signal.

[0633] In a possible implementation, the processing module 1210 is configured to receive a first reset signal through the first pin of the transceiver module 1220; a pulse width of the first reset signal is associated with the second electronic device;

[0634] The processing module 1210 is configured to reset the second electronic device according to the first reset signal.

[0635] In a possible implementation, the processing module 1210 is used to receive a second reset signal through the first pin of the transceiver module 1220; the pulse width of the second reset signal is associated with the third electronic device; the processing module 1210 is also used to ignore the second reset signal.

[0636] In a possible embodiment, the electronic device 1200 may be a second electronic device.

[0637] The processing module 1210 is used to determine that the first pin is in a state of receiving a message and the second pin is in a state of sending a message; the first pin is connected to the first data signal line; the second pin is connected to the second data signal line; the processing module 1210 is used to send a third message to the third electronic device through the second pin of the transceiver module 1220; the third message is used to obtain configuration information of the third electronic device, or the third message is used by the second electronic device to instruct the third electronic device to switch the transceiver state of the pin.

[0638] In one possible implementation, the processing module 1210 is used to receive a message from the first electronic device through the first pin of the transceiver module 1220, and determine that the first pin is in a state of receiving a message and the second pin is in a state of sending a message; or, the processing module 1210 is used to send a message to the first electronic device through the second pin of the transceiver module 1220, and determine that the first pin is in a state of receiving a message and the second pin is in a state of sending a message.

[0639] In a possible implementation, the processing module 1210 is used to receive a third response message from the third electronic device through the first pin of the transceiver module 1220, where the third response message is used to indicate configuration information of the third electronic device.

[0640] In a possible implementation manner, the third message includes: a third identifier; the third identifier is used to indicate that a recipient of the third message is the third electronic device.

[0641] In a possible implementation, the processing module 1210 is used to send a notification message to the first electronic device through the transceiver module 1220 when it is determined that the configuration information of the third electronic device has failed to be received; the notification message is used to notify the second electronic device that the configuration information of the third electronic device has failed to be received.

[0642] In a possible implementation, the processing module 1210 is used to receive an indication message from the first electronic device through the second pin of the transceiver module 1220 before sending a third message to the third electronic device through the first pin of the transceiver module 1220; the indication message is used to instruct the second electronic device to obtain the configuration information of the third electronic device.

[0643] In a possible implementation, the processing module 1210 is configured to determine that the communication with the third electronic device is terminated when a fourth message is received from the first electronic device via the second pin of the transceiver module 1220 .

[0644] In a possible implementation, the processing module 1210 is used to send a reset message to the third electronic device through the first pin of the transceiver module 1220; the reset message is used to indicate that the first pin of the third electronic device and the second pin of the third electronic device are in a state of receiving a message.

[0645] In a possible implementation, the processing module 1210 is used to determine that the second pin is in a state of receiving a message and the first pin is in a state of sending a message; the processing module 1210 is used to send a fifth message to the third electronic device through the second pin of the transceiver module 1220; the fifth message is used to obtain configuration information of the third electronic device; the processing module 1210 is used to receive a fifth response message from the third electronic device through the second pin of the transceiver module 1220; the fifth response message is used to indicate the configuration information of the third electronic device.

[0646] In a possible implementation, the first pin is a pin connected to a negative signal data line; the second pin is a pin connected to a positive signal data line; or, the first pin is a pin connected to a positive signal data line; the second pin is a pin connected to a negative signal data line.

[0647] In a possible embodiment, the electronic device 1200 may be a second electronic device. The processing module 1210 is used to determine the connection with the first electronic device through the transceiver module 1220; send the second message through the first pin of the transceiver module 1220; or receive the first message through the first pin of the transceiver module 1220; the first pin is connected to the first data signal line; wherein the first message and the second message are Manchester-encoded messages; the first message and the second message are used to set the charging of the first electronic device.

[0648] In a possible implementation manner, the first pin is a pin connected to a negative signal data line; or, the first pin is a pin connected to a positive signal data line.

[0649] In a possible implementation, the processing module 1210 is used to receive a detection from the first electronic device through the first pin and the second pin of the transceiver module 1220, wherein the detection is used by the first electronic device to determine that the second electronic device is a dedicated charging interface DCP device; receive a first pulse signal from the first electronic device through the first pin; and send an electrical signal to the first electronic device through the second pin to confirm whether to charge the battery of the first electronic device through the fast charging mode.

[0650] In a possible implementation manner, the second pin is a pin connected to a positive signal data line, and the electrical signal is a high level signal;

[0651] The second pin is a pin connected to a negative signal data line, and the electrical signal is a low level signal.

[0652] In a possible implementation manner, the first message includes: a first identifier; the first identifier is used to indicate a receiver of the first message and a sender of the first message;

[0653] The second message includes: a second identifier; the second identifier is used to indicate a recipient of the second message and a sender of the second message; the sender of the first message or the recipient of the second message is any one of the following: the first electronic device, the third electronic device.

[0654] In a possible implementation, the processing module 1210 is used to receive a first signal through a first pin of the transceiver module 1220; the frequency of the first signal is a first frequency; and the first signal is used to negotiate that the communication frequency is the first frequency.

[0655] In a possible implementation, the processing module 1210 is used to send a second signal through a first pin of the transceiver module 1220; the frequency of the second signal is a first frequency; and the first signal is used to determine that the communication frequency is the first frequency.

[0656] In a possible implementation manner, the frequency of the first message and the second message is the first frequency.

[0657] In a possible implementation, the first message includes at least one data frame; the data frame is any one of the following: data packet header information, data information, control information, and cyclic redundancy check; wherein a data frame includes: a start field, a data field, and an end field.

[0658] In a possible implementation, the processing module 1210 is used to confirm within a first time window that the first data signal line is used for the second electronic device or the third electronic device to send a message after receiving the first message through the first pin of the transceiver module 1220.

[0659] In a possible implementation, the processing module 1210 is used to confirm within a second time window that the first data signal line is used for the second electronic device or the third electronic device to send a message after sending the second message via the first pin of the transceiver module 1220.

[0660] In a possible implementation, the processing module 1210 is used to send the second message through the first pin of the transceiver module 1220, and is also used to determine that after the current time exceeds the second time window, the first data signal line is used for the second electronic device or the third electronic device to receive the message.

[0661] In a possible implementation, the processing module 1210 is used to receive a first reset signal through a first pin of the transceiver module 1220; the pulse width of the first reset signal is associated with the second electronic device; and the charging mode is reset according to the first reset signal.

[0662] In a possible implementation, the processing module 1210 is configured to receive a second reset signal through a first pin of the transceiver module 1220; a pulse width of the second reset signal is associated with the third electronic device; and the second reset signal is ignored.

[0663] In a possible embodiment, the electronic device 1200 may be a third electronic device. The third electronic device is used to connect the second electronic device and the first electronic device, and the third electronic device includes a first data signal line and a second data signal line.

[0664] In a possible implementation, the processing module 1210 is used to receive a first message through a first pin of the transceiver module 1220; the first pin is connected to a first data signal line; the processing module 1210 is used to send a second message through a second pin of the transceiver module 1220; the second pin is connected to a second data signal line; the first message and the second message are used to set the charging of the first electronic device.

[0665] In a possible implementation manner, the first pin is a pin connected to a negative signal data line; and the second pin is a pin connected to a positive signal data line.

[0666] In a possible implementation manner, the first pin is a pin connected to a positive signal data line; and the second pin is a pin connected to a negative signal data line.

[0667] In a possible implementation, the first message includes: a first identifier; the first identifier is used to indicate a recipient of the first message; the second message includes: a second identifier; the second identifier is used to indicate a recipient of the second message.

[0668] In a possible implementation manner, the recipient of the first message is the third electronic device; and the recipient of the second message is the first electronic device.

[0669] In a possible implementation, when the recipient of the first message is the second electronic device, the processing module 1210 is used to determine not to send the second message to the first electronic device.

[0670] In a possible implementation, the processing module 1210 is configured to receive a first signal through a first pin of the transceiver module 1220; the frequency of the first signal is a first frequency; and the first signal is used to indicate that the frequency of the first message is the first frequency;

[0671] The processing module 1210 is used to send a first signal through the second pin of the transceiver module 1220 before sending the second message through the second pin; the frequency of the first signal is the second frequency; the first signal is used to indicate that the frequency of the first message is the second frequency.

[0672] In a possible implementation, the first message includes at least one data frame; the data frame is any one of the following: data packet header information, data information, control information, and cyclic redundancy check; wherein a data frame includes: a start field, a data field, and an end field.

[0673] In a possible implementation, the processing module 1210 is used to send a start signal through the second pin of the transceiver module 1220 before sending the second message through the second pin; the start signal is a high level signal; the processing module 1210 is used to send an end signal after sending the second message through the second pin of the transceiver module 1220; the end signal is a low level signal;

[0674] Alternatively, the processing module 1210 is used to send a start signal before sending the second message through the second pin of the transceiver module 1220; the start signal is a low-level signal; the processing module 1210 is used to send an end signal after sending the second message through the second pin of the transceiver module 1220; the end signal is a high-level signal.

[0675] In a possible implementation, the processing module 1210 is used to receive a start signal before receiving the first message through the first pin of the transceiver module 1220; the start signal is a high level signal; the processing module 1210 is used to receive an end signal after receiving the first message through the first pin of the transceiver module 1220; the end signal is a low level signal;

[0676] Alternatively, the processing module 1210 is used to receive a start signal before receiving the first message through the first pin of the transceiver module 1220; the start signal is a low-level signal; the processing module 1210 is used to receive an end signal after receiving the first message through the first pin of the transceiver module 1220; the end signal is a high-level signal.

[0677] In a possible implementation, the processing module 1210 is configured to receive a second reset signal through a first pin of the transceiver module 1220; a pulse width of the second reset signal is associated with the third electronic device; and reset is performed according to the second reset signal.

[0678] In a possible implementation, the processing module 1210 is used to receive a first reset signal through the first pin of the transceiver module 1220; the pulse width of the first reset signal is associated with the second electronic device; the processing module 1210 is used to ignore the first reset signal.

[0679] In a possible embodiment, the electronic device 1200 may be a third electronic device. The electronic device 1200 connects the first electronic device and the second electronic device, and the electronic device 1200 includes a first data signal line and a second data signal line.

[0680] In a possible implementation, the processing module 1210 is used to send a second message through the first pin of the transceiver module 1220; or, receive a first message through the first pin of the transceiver module 1220; the first pin is connected to a first data signal line; wherein the first message and the second message are messages after Manchester encoding; the first message and the second message are used to set the charging of the first electronic device.

[0681] In a possible implementation manner, the first pin is a pin connected to a negative signal data line; or, the first pin is a pin connected to a positive signal data line.

[0682] In a possible implementation manner, the first message includes: a first identifier; the first identifier is used to indicate a receiver of the first message and a sender of the first message;

[0683] The second message includes: a second identifier; the second identifier is used to indicate a recipient of the second message and a sender of the second message; the sender of the first message or the recipient of the second message is any one of the following: the first electronic device, the third electronic device.

[0684] In a possible implementation manner, the frequency of the first message and the second message is the first frequency.

[0685] In a possible implementation, the first message includes at least one data frame; the data frame is any one of the following: data packet header information, data information, control information, and cyclic redundancy check; wherein a data frame includes: a start field, a data field, and an end field.

[0686] In a possible implementation, the processing module 1210 is used to confirm that the first data signal line is used for the second electronic device or the third electronic device to send a message within a first time window after receiving the first message through the first pin of the transceiver module 1220.

[0687] In a possible implementation, the processing module 1210 is used to confirm that the first data signal line is used for the second electronic device or the third electronic device to send a message within a second time window after sending the second message through the first pin of the transceiver module 1220.

[0688] In a possible implementation, the processing module 1210 is used to send the second message through the first pin of the transceiver module 1220, and is also used to determine that after the current time exceeds the second time window, the first data signal line is used for the third electronic device or the second electronic device to receive the message.

[0689] In a possible implementation, the processing module 1210 is used to receive a first reset signal through a first pin of the transceiver module 1220; the pulse width of the first reset signal is associated with the third electronic device; and the charging mode is reset according to the first reset signal.

[0690] In a possible implementation, the processing module 1210 is configured to receive a second reset signal through the first pin of the transceiver module 1220; a pulse width of the second reset signal is associated with the second electronic device; and the second reset signal is ignored.

[0691] In a possible embodiment, the electronic device 1200 may be a third electronic device.

[0692] In a possible implementation, the processing module 1210 is used to set the first pin of the transceiver module 1220 to a state of receiving a message and the second pin to a state of sending a message when a third message is received through the first pin of the transceiver module 1220; the first pin is connected to the first data signal line; the second pin is connected to the second data signal line; and the recipient of the third message is the third electronic device.

[0693] In a possible implementation, the processing module 1210 is configured to set the first pin and the second pin of the transceiver module 1220 to a state of receiving a message before receiving the third message through the first pin.

[0694] In a possible implementation manner, the third message further includes: a third identifier; the third identifier is used to indicate that a recipient of the third message is the third electronic device.

[0695] In a possible implementation, the processing module 1210 is used to set the first pin and the second pin to a state of receiving a message when a fourth message is received through the first pin of the transceiver module 1220; wherein the recipient of the fourth message is the second electronic device or the first electronic device; or, the fourth message is used to indicate that the first pin of the third electronic device and the second pin of the third electronic device are in a state of receiving a message.

[0696] In a possible implementation, the processing module 1210 is used to set the second pin of the transceiver module 1220 to a state of receiving a message and the first pin to a state of sending a message when the fifth message is received through the second pin of the transceiver module 1220; the recipient of the fifth message is the third electronic device.

[0697] In a possible implementation manner, the third message and the fifth message are sent by the same electronic device; or, the third message is sent by the second electronic device, and the fifth message is sent by the first electronic device.

[0698] In one possible implementation, the third message and the fourth message are used by the first electronic device or the second electronic device to obtain configuration information of the third electronic device; or, the third message and the fourth message are used by the first electronic device or the second electronic device to indicate the receiving and transmitting status of the switching pin of the third electronic device.

[0699] In a possible implementation, the first pin is a pin connected to a negative signal data line; the second pin is a pin connected to a positive signal data line; or, the first pin is a pin connected to a positive signal data line; the second pin is a pin connected to a negative signal data line.

[0700] In a possible embodiment, the electronic device 1200 may be a third electronic device.

[0701] In a possible implementation, the processing module 1210 is used to send a second message through a first pin of the transceiver module 1220; or, to receive a first message through the first pin; the first pin is connected to a first data signal line; wherein the first message and the second message are messages after Manchester encoding; the first message and the second message are used to set the charging of the first electronic device.

[0702] In a possible implementation manner, the first pin is a pin connected to a negative signal data line; or, the first pin is a pin connected to a positive signal data line.

[0703] In a possible implementation, the first message includes: a first identifier; the first identifier is used to indicate a recipient of the first message and a sender of the first message; the second message includes: a second identifier; the second identifier is used to indicate a recipient of the second message and a sender of the second message; the sender of the first message or the recipient of the second message is any one of the following: the first electronic device, the third electronic device.

[0704] In a possible implementation manner, the frequency of the first message and the second message is the first frequency.

[0705] In a possible implementation, the first message includes at least one data frame; the data frame is any one of the following: data packet header information, data information, control information, and cyclic redundancy check; wherein a data frame includes: a start field, a data field, and an end field.

[0706] In a possible implementation, after the processing module 1210 is used to receive a first message through a first pin of the transceiver module 1220, the first data signal line is used for the second electronic device or the third electronic device to send a message within a first time window.

[0707] In a possible implementation, after the processing module 1210 is used to send a second message through the first pin of the transceiver module 1220, within a second time window, the first data signal line is used for the second electronic device or the third electronic device to send a message.

[0708] In a possible implementation, the processing module 1210 is used to send the second message through the first pin of the transceiver module 1220, and the processing module 1210 is used to determine that the current time exceeds the second time window, and the first data signal line is used for the third electronic device or the second electronic device to receive the message.

[0709] In a possible implementation, the processing module 1210 is used to receive a second reset signal through the first pin of the transceiver module 1220; the pulse width of the second reset signal is associated with the third electronic device; and the charging mode is reset according to the second reset signal.

[0710] In a possible implementation, the processing module 1210 is used to receive a first reset signal through a first pin of the transceiver module 1220; a pulse width of the first reset signal is associated with the second electronic device; and the first reset signal is ignored.

[0711] Based on the same inventive concept, Fig.13 The figure is a schematic diagram of the structure of an electronic device provided by the present application.

[0712] In one possible embodiment, Fig.13The electronic device in may be a first electronic device. The first electronic device may include: a processor 1310 and a communication interface 1330. The processor 1310 may be a baseband processor, and the baseband processor may include one or more central processing units (CPUs). The first electronic device may also be a component having the functions of the first electronic device in the embodiment of the present application. For example, when it is a chip system, the communication interface 1330 may be an input and output interface of the chip system (such as a baseband chip), and the processor may be a processor of the chip system, which may include one or more central processing units. Optionally, a memory 1320 may also be included. Among them, the memory 1320 stores computer instructions or programs, and the processor 1310 may execute the computer instructions or programs stored in the memory 1320. When the computer instructions or programs stored in the memory 1320 are executed, the processor 1310 is used to perform other operations of the first electronic device in the embodiment of the present application except the transceiver operation, and the communication interface 1330 is used to perform the transceiver operation of the first electronic device in the embodiment of the present application. Alternatively, the first electronic device may not include the memory 1320. For example, the memory is located outside the first electronic device. When the computer instructions or programs stored in the external memory are executed, the processor 1310 is used to perform other operations of the first electronic device in the above-mentioned embodiment except for the sending and receiving operations, and the communication interface 1330 is used to perform the sending and receiving operations of the first electronic device in the embodiment of the present application.

[0713] In one possible embodiment, Fig.13The electronic device in may be a second electronic device. The second electronic device may include: a processor 1310 and a communication interface 1330. The processor 1310 may be a baseband processor, and the baseband processor may include one or more central processing units (CPUs). The second electronic device may also be a component having the function of the second electronic device in the embodiment of the present application. For example, when it is a chip system, the communication interface 1330 may be an input and output interface of the chip system (such as a baseband chip), and the processor may be a processor of the chip system, which may include one or more central processing units. Optionally, a memory 1320 may also be included. Among them, the memory 1320 stores computer instructions or programs, and the processor 1310 may execute the computer instructions or programs stored in the memory 1320. When the computer instructions or programs stored in the memory 1320 are executed, the processor 1310 is used to perform other operations of the second electronic device in the embodiment of the present application except for the transceiver operation, and the communication interface 1330 is used to perform the transceiver operation of the second electronic device in the embodiment of the present application. Alternatively, the second electronic device may not include the memory 1320. For example, the memory is located outside the second electronic device. When the computer instructions or programs stored in the external memory are executed, the processor 1310 is used to perform other operations of the second electronic device in the above-mentioned embodiment except for the sending and receiving operations, and the communication interface 1330 is used to perform the sending and receiving operations of the second electronic device in the embodiment of the present application.

[0714] In one possible embodiment, Fig.13The electronic device in may be a third electronic device. The third electronic device may include: a processor 1310 and a communication interface 1330. The processor 1310 may be a baseband processor, and the baseband processor may include one or more central processing units (CPUs). The third electronic device may also be a component having the functions of the third electronic device in the embodiment of the present application. For example, when it is a chip system, the communication interface 1330 may be an input and output interface of the chip system (such as a baseband chip), and the processor may be a processor of the chip system, which may include one or more central processing units. Optionally, a memory 1320 may also be included. Among them, the memory 1320 stores computer instructions or programs, and the processor 1310 may execute the computer instructions or programs stored in the memory 1320. When the computer instructions or programs stored in the memory 1320 are executed, the processor 1310 is used to perform other operations of the third electronic device in the embodiment of the present application except for the transceiver operation, and the communication interface 1330 is used to perform the transceiver operation of the third electronic device in the embodiment of the present application. Alternatively, the third electronic device may not include the memory 1320. For example, the memory is located outside the third electronic device. When the computer instructions or programs stored in the external memory are executed, the processor 1310 is used to perform other operations of the third electronic device in the above-mentioned embodiment except for the sending and receiving operations, and the communication interface 1330 is used to perform the sending and receiving operations of the third electronic device in the embodiment of the present application.

[0715] The embodiment of the present application also provides a computer storage medium, the computer readable storage medium is used to store a computer program, when the computer program is run on a computer, the computer executes the following Figure 4a-4d , Figure 4a-Figure 5c , Figure 6a-6f , Figure 7 , Figure 8a-8e , Figure 9a-9h , Figure 10a-Figure 10b , Fig.11a The method described in any possible implementation manner.

[0716] The present application also provides a computer program product including instructions, wherein the computer program product is used to store a computer program, and when the computer program is run on a computer, the computer executes Figure 4a-4d , Figure 4a-Figure 5c , Figure 6a-6f , Figure 7 , Figure 8a-8e , Figure 9a-9h , Figure 10a-Figure 10b , Fig.11a The method described in any possible implementation manner.

[0717] It should be understood that the processor mentioned in the embodiments of the present application may be a 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 the processor may also be any conventional processor, etc.

[0718] It should also be understood that the memory mentioned in the embodiments of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM).

[0719] It should be noted that when the processor is a general-purpose processor, DSP, ASIC, FPGA or other programmable logic device, discrete gate or transistor logic device, discrete hardware component, the memory (storage module) is integrated in the processor.

[0720] It should be noted that the memory described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0721] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes 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.

[0722] 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.

[0723] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0724] In the several emb...

Claims

1. A device to be charged, It is characterized in that The device to be charged includes a first pin and a second pin, and includes a memory and a processor, wherein the memory is used to store a computer program code, and the computer program code includes a computer instruction. When the computer instruction is executed by the processor, the device to be charged performs the following steps: After establishing a physical connection with the power supply device, determining that the power supply device is a dedicated charging interface DCP device; Sending a first pulse signal through the first pin; Detecting the electrical signal of the power supply device through the second pin to confirm that the fast charging protocol handshake with the power supply device is successful, wherein the electrical signal is a signal sent by the power supply device after detecting the first pulse signal; Sending a first message via the first pin; A second message is received through the second pin, wherein the second message is a response message to the first message, and the first message and the second message are used to set charging of the device to be charged.

2. The device to be charged according to claim 1, It is characterized in that The first pin is a pin connected to a negative data signal line, and the second pin is a pin connected to a positive data signal line.

3. The device to be charged according to claim 2, It is characterized in that The electrical signal is a high level signal.

4. The device to be charged according to claim 1, It is characterized in that The first message includes a first identifier, where the first identifier is used to indicate a recipient of the first message; The second message includes a second identifier, where the second identifier is used to indicate a recipient of the second message.

5. The device to be charged according to claim 4, It is characterized in that The recipient of the first message is the power supply device, and the recipient of the second message is the device to be charged.

6. The device to be charged according to any one of claims 1 to 5, It is characterized in that The steps also include: sending a first reset signal through the first pin, the first reset signal being used to instruct a receiver of the first reset signal to reset, and when the pulse width of the first reset signal is a first width, the first reset signal being used to reset the power supply device; When the pulse width of the first reset signal is the second width, the first reset signal is used to reset the charging cable, wherein the charging cable is used to connect the device to be charged and the power supply device.

7. The device to be charged according to claim 3, It is characterized in that The electrical signal is a signal sent by the power supply device after detecting the first pulse signal and disconnecting the negative data signal line and the positive data signal line.

8. The device to be charged according to claim 1, It is characterized in that The steps also include: Before sending the first message through the first pin, a first signal is sent through the first pin, the frequency of the first signal is a first frequency, and the first signal is used to determine the frequency of the first message.

9. The device to be charged according to claim 1, It is characterized in that The steps also include: Before receiving the second message through the second pin, a second signal is received through the second pin, the frequency of the second signal is a second frequency, and the second signal is used to determine the frequency of the second message.

10. The device to be charged according to claim 1, It is characterized in that The first message includes at least one data frame, and the data frame includes: a start field, a data field, and an end field; The data frame is any one of the following: data packet header information, data information, control information, and cyclic redundancy check.

11. The device to be charged according to claim 1, It is characterized in that The steps also include: Before sending the first message through the first pin, sending a start signal, wherein the start signal is a low level signal; After sending the first message through the first pin, an end signal is sent, and the end signal is a high level signal.

12. The device to be charged according to claim 1, It is characterized in that The steps also include: Before receiving the second message through the second pin, receiving a start signal, wherein the start signal is a low level signal; After receiving the second message through the second pin, an end signal is received, and the end signal is a high level signal.

13. The device to be charged according to claim 1, It is characterized in that The device to be charged performs full-duplex communication with the power supply device through the first pin and the second pin.

14. The device to be charged according to claim 1, It is characterized in that The steps also include: A third message is sent to the charging cable through the first pin, and the third message is used to obtain configuration information of the charging cable from the charging cable, or the third message is used by the device to be charged to indicate the receiving and sending status of the switching pin of the charging cable, wherein the charging cable is used to connect the device to be charged and the power supply device.

15. The device to be charged according to claim 14, It is characterized in that The steps also include: A third response message is received from the charging cable through the second pin, where the third response message is used to indicate configuration information of the charging cable.

16. The device to be charged according to claim 14, It is characterized in that The third message includes a third identifier, and the third identifier is used to indicate that a recipient of the third message is the charging cable.

17. The device to be charged according to claim 14, It is characterized in that The steps also include: After failing to obtain the configuration information of the charging cable, an instruction message is sent to the power supply device, where the instruction message is used to instruct the power supply device to obtain the configuration information of the charging cable.

18. The device to be charged according to claim 14, It is characterized in that The steps also include: When a fourth message from the power supply device is received through the second pin, it is determined that the communication with the charging cable is ended.

19. The device to be charged according to any one of claims 14 to 18, It is characterized in that The step further includes: sending a reset message to the charging cable through the first pin, where the reset message is used to indicate that two pins of the charging cable are in a state of receiving a message.

20. A power supply device, It is characterized in that The power supply device comprises a first pin and a second pin, and the power supply device comprises a memory and a processor, wherein the memory is used to store a computer program code, and the computer program code comprises a computer instruction, and when the computer instruction is executed by the processor, the power supply device performs the following steps: Receiving a detection from a device to be charged, the detection being used to determine that the power supply device is a dedicated charging interface DCP device; Receiving a first pulse signal from the device to be charged through the first pin; In response to detecting the first pulse signal, sending an electrical signal to the device to be charged through the second pin to confirm that the device to be charged is charged through a fast charging protocol; receiving a first message via the first pin; A second message is sent through the second pin, wherein the second message is a response message to the first message, and the first message and the second message are used to set charging of the device to be charged.

21. The power supply device according to claim 20, It is characterized in that The first pin is a pin connected to a negative data signal line, and the second pin is a pin connected to a positive data signal line.

22. The power supply device according to claim 21, It is characterized in that The electrical signal is a high level signal.

23. The power supply device according to claim 20, It is characterized in that The first message includes a first identifier, where the first identifier is used to indicate a recipient of the first message; The second message includes a second identifier, where the second identifier is used to indicate a recipient of the second message.

24. The power supply device according to claim 23, It is characterized in that The recipient of the first message is the power supply device, and the recipient of the second message is the device to be charged.

25. The power supply device according to any one of claims 20 to 24, It is characterized in that The steps also include: receiving a first reset signal through the first pin, wherein the pulse width of the first reset signal is a first pulse width, and the first reset signal is used to reset the power supply device; Resetting is performed according to the first reset signal.

26. The power supply device according to claim 21, It is characterized in that In response to detecting the first pulse signal, sending an electrical signal to the device to be charged through the second pin, comprising: In response to detecting the first pulse signal, the negative data signal line and the positive data signal line are disconnected, and the electrical signal is sent to the device to be charged through the second pin.

27. The power supply device according to claim 20, It is characterized in that The steps also include: Before receiving the first message through the first pin, a first signal is received through the first pin, the frequency of the first signal is a first frequency, and the first signal is used to determine the frequency of the first message.

28. The power supply device according to claim 20, It is characterized in that The steps also include: Before sending the second message through the second pin, a second signal is sent through the second pin, the frequency of the second signal is a second frequency, and the second signal is used to determine the frequency of the second message.

29. The power supply device according to claim 20, It is characterized in that The first message includes at least one data frame, and the data frame includes: a start field, a data field, and an end field; The data frame is any one of the following: data packet header information, data information, control information, and cyclic redundancy check.

30. The power supply device according to claim 20, It is characterized in that The steps also include: Before receiving the first message through the first pin, receiving a start signal, wherein the start signal is a low level signal; After receiving the first message through the first pin, an end signal is received, and the end signal is a high level signal.

31. The power supply device according to claim 20, It is characterized in that The steps also include: Before sending the second message through the second pin, sending a start signal, wherein the start signal is a low level signal; After sending the second message through the second pin, an end signal is sent, and the end signal is a high level signal.

32. The power supply device according to claim 20, It is characterized in that The power supply device performs full-duplex communication with the device to be charged through the first pin and the second pin.

33. The power supply device according to claim 20, It is characterized in that The steps also include: A third message is sent to the charging cable through the second pin, and the third message is used to obtain configuration information of the charging cable from the charging cable, or the third message is used by the power supply device to indicate the sending and receiving status of the switching pin of the charging cable, wherein the charging cable is used to connect the device to be charged and the power supply device.

34. The power supply device according to claim 33, It is characterized in that The steps also include: A third response message is received from the charging cable through the first pin, where the third response message is used to indicate configuration information of the charging cable.

35. The power supply device according to claim 33, It is characterized in that The third message includes a third identifier, and the third identifier is used to indicate that a recipient of the third message is the charging cable.

36. The power supply device according to claim 33, It is characterized in that The steps also include: Before sending the third message to the charging cable through the second pin, an indication message from the device to be charged is received through the second pin, where the indication message is used to instruct the power supply device to obtain configuration information of the charging cable.

37. The power supply device according to claim 33, It is characterized in that The steps also include: When a fourth message from the device to be charged is received through the second pin, it is determined that the communication with the charging cable is ended.

38. The power supply device according to any one of claims 33 to 37, It is characterized in that The steps also include: A reset message is sent to the charging cable through the second pin, where the reset message is used to indicate that two pins of the charging cable are in a state of receiving a message.

39. A charging cable, It is characterized in that The charging cable is used to connect a device to be charged and a power supply device, the charging cable includes a first pin and a second pin, and the charging cable includes a memory and a processor, wherein the memory is used to store a computer program code, and the computer program code includes a computer instruction, and when the computer instruction is executed by the processor, the charging cable performs the following steps: receiving a first message via the first pin; A second message is sent through the second pin, wherein the second message is a response message to the first message, and the first message and the second message are used to set charging of the device to be charged.

40. The charging cable according to claim 39, It is characterized in that The first pin is a pin connected to a negative data signal line, and the second pin is a pin connected to a positive data signal line.

41. The charging cable according to claim 39, It is characterized in that The first message includes a first identifier, where the first identifier is used to indicate a recipient of the first message; The second message includes a second identifier, where the second identifier is used to indicate a recipient of the second message.

42. The charging cable according to claim 39, It is characterized in that The recipient of the first message is the charging cable, and the recipient of the second message is the device to be charged.

43. The charging cable according to claim 39, It is characterized in that The steps also include: receiving a second reset signal through the first pin, wherein a pulse width of the second reset signal is a second pulse width, and the second reset signal is used to reset the charging cable; Resetting is performed according to the second reset signal.

44. The charging cable according to claim 39, It is characterized in that The steps also include: Before receiving the first message through the first pin, a first signal is received through the first pin, the frequency of the first signal is a first frequency, and the first signal is used to determine the frequency of the first message.

45. The charging cable according to claim 39, It is characterized in that The steps also include: Before sending the second message through the second pin, a first signal is sent through the second pin, the frequency of the first signal is a second frequency, and the first signal is used to determine the frequency of the second message.

46. ​​The charging cable according to claim 39, It is characterized in that The first message includes at least one data frame, and the data frame includes: a start field, a data field, and an end field; The data frame is any one of the following: data packet header information, data information, control information, and cyclic redundancy check.

47. The charging cable according to claim 39, It is characterized in that The steps also include: Before receiving the first message through the first pin, receiving a start signal, wherein the start signal is a low level signal; After receiving the first message through the first pin, an end signal is received, and the end signal is a high level signal.

48. The charging cable according to claim 39, It is characterized in that The steps also include: Before sending the second message through the second pin, sending a start signal, wherein the start signal is a low level signal; After sending the second message through the second pin, an end signal is sent, and the end signal is a high level signal.

49. The charging cable according to any one of claims 39 to 48, It is characterized in that The charging cable is used to connect the device to be charged and the power supply device to perform full-duplex communication.

50. The charging cable according to claim 39, It is characterized in that The steps also include: When a third message is received through the first pin, the first pin is set to a state of receiving a message and the second pin is set to a state of sending a message, wherein before the third message is received through the first pin, the first pin and the second pin are in a state of receiving a message.

51. The charging cable according to claim 50, It is characterized in that The third message also includes a third identifier, and the third identifier is used to indicate that the recipient of the third message is the charging cable.

52. The charging cable according to claim 50, It is characterized in that The steps also include: When a fourth message is received through the first pin, setting the first pin and the second pin to a state of receiving a message; The recipient of the fourth message is the power supply device or the device to be charged, or the fourth message is used to indicate that the first pin and the second pin of the charging cable are in a state of receiving a message.

53. The charging cable according to claim 50, It is characterized in that The steps also include: When a fifth message is received through the second pin, the second pin is set to a state of receiving a message and the first pin is set to a state of sending a message, and the recipient of the fifth message is the charging cable.

54. The charging cable according to claim 52, It is characterized in that The third message and the fourth message are used by the device to be charged or the power supply device to obtain configuration information of the charging cable, or the third message and the fourth message are used by the device to be charged or the power supply device to indicate the sending and receiving status of the charging cable switching pin.

55. The charging cable according to claim 53, It is characterized in that The third message and the fifth message are sent by the same electronic device, or the third message is sent by the power supply device, and the fifth message is sent by the device to be charged.

56. The charging cable according to claim 55, It is characterized in that When the third message is sent by the power supply device, and the fifth message is sent by the device to be charged, the steps further include: The charging cable sets the second pin to a message receiving state and the first pin to a message sending state according to the priorities of the device to be charged and the power supply device, wherein the priority of the device to be charged is higher than that of the power supply device.

57. The charging cable according to any one of claims 50 to 56, It is characterized in that The charging cable comprises two data receiving modules and two data sending modules, and the two data receiving modules and the two data sending modules are used to implement switching of the receiving and sending modes of the charging cable.

58. A data transmission system based on a charging cable, It is characterized in that It comprises a device to be charged as described in any one of claims 1-19, a power supply device as described in any one of claims 20-38, and a charging cable as described in any one of claims 39-57.

Citation Information

Patent Citations

  • Data transmission method based on charging cable and electronic equipment

    CN115912567A

Cited By

  • Data transmission method based on charging cable and electronic equipment

    CN115912567A