CN114297126B - Data transmission method based on charging cable and electronic equipment - Google Patents

Data transmission method based on charging cable and electronic equipment Download PDF

Info

Publication number
CN114297126B
CN114297126B CN202210012219.8A CN202210012219A CN114297126B CN 114297126 B CN114297126 B CN 114297126B CN 202210012219 A CN202210012219 A CN 202210012219A CN 114297126 B CN114297126 B CN 114297126B
Authority
CN
China
Prior art keywords
electronic device
message
pin
data
signal
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210012219.8A
Other languages
Chinese (zh)
Other versions
CN114297126A (en
Inventor
彭江
李宗健
王超
张明威
杨成军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Priority claimed from CN202011175402.7A external-priority patent/CN113949116A/en
Priority claimed from CN202011614749.7A external-priority patent/CN114490491A/en
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority claimed from PCT/CN2021/106599 external-priority patent/WO2022012644A1/en
Publication of CN114297126A publication Critical patent/CN114297126A/en
Application granted granted Critical
Publication of CN114297126B publication Critical patent/CN114297126B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The application discloses a data transmission method based on a charging cable and electronic equipment, wherein first electronic equipment is connected with second electronic equipment through third electronic equipment, the third electronic equipment comprises a first data signal line and a second data signal line, and when the method is applied to the first electronic equipment, the connection with the second electronic equipment can be detected; sending a first message through a first pin; the first pin is connected with a first data signal line; receiving a second message through a second pin; the second pin is connected with a second data signal line; the first message and the second message are used for setting charging of the first electronic device.

Description

Data transmission method based on charging cable and electronic equipment
The present application claims priority of chinese patent application having application number 202010682894.2 and application name "a data transmission method, apparatus and system" filed at 15/07/2020, the entire contents of which are incorporated herein by reference; the present application claims priority of chinese patent application having application number 202011167642.2 and application name "a cable identification method, apparatus and system" filed in the chinese patent office at 27/10/2020, which is incorporated herein by reference in its entirety; the present application claims priority of chinese patent application having application number 202011175402.7 and application name "a data transmission method and apparatus" filed in chinese patent office at 28/10/2020, the entire contents of which are incorporated herein by reference; the present application claims priority of chinese patent application having application number 202011614749.7, entitled "a charging cable based data transmission method and apparatus", filed by chinese patent office 30/12/2020, the entire contents of which are incorporated herein by reference.
Technical Field
The present application relates to the field of charging technologies, and in particular, to a data transmission method based on a charging cable and an electronic device.
Background
Along with the diversification and large screen trend of the functions of the intelligent terminal, the power consumption of the intelligent terminal is gradually increased, the capacity of a battery is gradually increased, and the intelligent terminal has stronger and stronger requirements on quick charging. The industry has evolved a variety of fast charging protocols in recent years.
One Type of fast charging protocol is a single-wire communication (CC) fast charging protocol, a representative of the CC communication protocol is a USB PD, and an end product in the USB PD can support a USB Type C interface defined by a USB association, referred to as a Type-C interface, where the USB Type-C interface has an advantage that: support USB interface two-sided to insert, have more slim, succinct design, have more bold circuit transmission (the biggest 100W), because these advantages can realize the quick charge to terminal product to satisfy customer's the demand of charging. However, the USB PD protocol cannot be applied to other charging scenarios except for the Type-C to Type-C interface, for example, interface scenarios such as Type a to Type B, and the USB PD protocol has great restrictions on charging power and specification, and is relatively complex to implement and relatively high in cost.
Another type of fast charging protocol is a fast charging protocol based on D +/D- (Data +/Data-) channel communication, such as, hua is 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, and in the charging process of a terminal product, the transmission of information waiting for transmission in the charging state of a terminal or a power supply device or sudden failure may be delayed, resulting in an impact on the safety of a charging system.
Disclosure of Invention
The application provides a data transmission method based on a charging cable and electronic equipment, which are used for improving the data transmission efficiency of a D +/D-channel in the charging process.
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, where the first electronic device is connected to a second electronic device through a third electronic device, where 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 through a first pin; the first pin is connected with a first data signal line; receiving a second message through a second pin; the second pin is connected with a second data signal line; the first message and the second message are used for setting charging of the first electronic device.
Unlike the prior art, the transmission and reception of messages between the first electronic device and the second electronic device can only be performed through the D-data signal line. By the method, the messages can be sent and received on different data signal lines, so that the electronic equipment can send the messages to the opposite terminal without waiting for the completion of the sending of the opposite terminal, and the transmission efficiency of the data on the data signal lines is effectively improved. In addition, compared with the case that the second electronic device is used as a device to be charged and the second electronic device is used as a power supply device, in the prior art, only the scheme that the first electronic device actively sends a message to the second electronic device and the second electronic device passively responds is available.
In a possible implementation manner, the first pin is a pin connected to a negative signal data line; the second pin is connected with a positive signal data line.
In a possible implementation manner, the first pin is a pin connected to a positive signal data line; the second pin is connected with the negative signal data line.
By the method, the pin of the positive signal data line (such as D +) can be set as the first pin, the pin of the negative signal data line (such as D-) can be set as the second pin, the pin of the positive signal data line (such as D +) can also be set as the second pin, and the pin of the negative signal data line (such as D-) can be set as the first pin, so that signals can be independently sent or received on different data lines, duplex transmission on the signal data line is realized, different duplex transmission modes can be set according to requirements, and therefore, the data transmission efficiency and the flexibility of data transmission are effectively improved.
In a possible implementation manner, the connection between the first pin or the second pin and a second electronic device is detected, and the second electronic device is determined to be a dedicated charging interface DCP device; sending a first pulse signal through the first pin; and detecting an electric signal of the second electronic equipment through the second pin to confirm that the second electronic equipment supports a quick charging mode.
In consideration of the fact that the time consumption of the communication protocol in the prior art is long, by the method for sending the first pulse signal, the first electronic device and the second electronic device support the handshake protocol for charging the battery of the first electronic device through the quick charging mode, and the second electronic device can quickly detect the first pulse signal, so that the time for entering the quick charging mode is shortened, and particularly when the electric quantity of the first electronic device is too low, the first electronic device can quickly enter the quick charging mode to improve the charging experience.
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.
By the method, when the second pin is a pin connected with the positive signal data line, it is considered that the first electronic device sends the first pulse signal through the first pin, and at this time, the first pin is a negative signal data line and is at a low level in an idle state. Thus, the electrical signal of the second electronic device may be a high level signal, for example, the high level signal may be a high level pulse signal. Therefore, the first electronic device can quickly confirm the completion of the handshake by detecting the high-level signal, and the time for entering the quick charging mode is further shortened.
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.
By the method, when the second pin is a pin connected with the negative signal data line, the first electronic device is considered to send the first pulse signal through the first pin, and at the moment, the first pin is a positive signal data line and is at a high level in an idle state. Thus, the electrical signal of the second electronic device may be a low level signal, for example, the low level signal may be a low level pulse signal. Therefore, the first electronic device can quickly confirm the completion of the handshake by detecting the low-level signal, and the time for entering the quick charge mode is further shortened.
In one possible implementation, the first message includes: a first identifier; the first identification is used for indicating a receiver of the first message; the second message includes: a second identifier; the second identifier is used for indicating a receiver of the second message.
In a possible implementation manner, a receiver of the first message is a chip of the third electronic device, and a receiver of the second message is the first electronic device; in a possible implementation manner, the receiver of the first message is the second electronic device; and the receiver of the second message is the first electronic equipment.
Considering that the third electronic device can also participate in data transmission, by the method, the identifier can be set for the receiver of the message, so that the receiver of the message in the data transmission system is distinguished, the message is prevented from being processed by mistake, and the reliability of message transmission is improved.
A possible implementation manner, before the sending the first message through the first pin, further includes: sending a first signal through the first pin; the frequency of the first signal is a first frequency; the first signal is used for indicating that the frequency of the first message is the first frequency.
By the method, the first electronic device can send the first signal, so that the frequency for sending the first signal is determined by negotiation with the second electronic device, the frequency of the signal for data transmission between the first electronic device and the second electronic device can be negotiated and adjusted as required, the flexibility of data transmission is improved, in addition, the anti-interference capability of data transmission can be realized by adjusting the frequency of the signal, the reliability of data signal transmission is improved, and the performance of data transmission is improved.
In a possible implementation manner, a second signal is received through the second pin; the frequency of the second signal is a second frequency; the second signal is used for indicating that the frequency of the second message is the second frequency.
Through the method, the first electronic device can receive the second signal sent by the second electronic device to determine that the frequency for sending the first signal is determined to be the second frequency through negotiation with the second electronic device.
In one possible implementation, the first message includes at least one data frame; the data frame is any one of: data packet header information, data information, control information and cyclic redundancy check; wherein one data frame includes: a start field, a data field, and an end field.
By the method, the first electronic equipment can determine the content of the message sent to the second electronic equipment according to the requirement, and the flexibility of sending the first message is improved. The second electronic device can accurately receive the first message through the start field and the end field of the transmitted data frame, and 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 may also determine the content of the second message sent to the first electronic device according to needs, so as to improve flexibility of sending the second message.
In a possible implementation manner, the data packet header information includes the first identifier.
By the method, after a receiving end (for example, a second electronic device or a third electronic device) receives the first message, the first identifier included in the header information of the data packet is determined, so that whether the first message is sent to the first message is determined, and after the first message is determined to be sent to the first message, the remaining fields are analyzed, so that unnecessary message processing at the receiving end is avoided, and power consumption is saved.
A possible implementation manner, before the sending the first message through the first pin, further includes: sending a starting signal; the starting signal is a high level signal; after the sending the first message through the first pin, the method further includes: sending an end signal; the ending signal is a low level signal;
Or before the sending the first message through the first pin, the method further includes: sending a starting signal; the starting signal is a low level signal; after the first message is sent through the first pin, the method further includes: sending an end signal; the end signal is a high level signal.
By the method, the starting signal sending mode can be adopted, so that the receiving end determines the starting of the message sending, and the message receiving efficiency is improved. And the receiving end determines the end of the message sending by the mode of sending the end signal, thereby avoiding the error receiving of the message by the receiving end and improving the message receiving efficiency.
A possible implementation manner, before the receiving the second message through the second pin, further includes: receiving a start signal; the starting signal is a high level signal; after receiving the second message through the second pin, the method further includes: receiving an end signal; the ending signal is a low level signal;
or before receiving the second message through the second pin, the method further includes: receiving a start signal; the starting 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.
By the method, the start of the received message can be determined through the received start signal, and the message receiving efficiency is improved. And the end of receiving the message is determined through the received end signal, thereby avoiding the false reception of the message and improving the efficiency of receiving the message.
In one possible implementation, a first reset signal is sent through the first pin; the first reset signal is used for indicating a receiver of the first reset signal to reset; the pulse width of the first reset signal has a correlation with a receiver.
By the method, when the data transmission is confirmed to be abnormal or under other abnormal conditions, the first reset signal can be sent to the second electronic device or the third electronic device, so that the receiver confirms that the current data transmission is abnormal according to the received first reset signal, loss can be stopped in time, damage to the device due to abnormal charging behaviors is avoided, and charging safety is improved. In addition, in order to distinguish the first reset signals sent to different receivers, the pulse width of the first reset signal and the receivers can be related, so that error reset is avoided.
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, where the second electronic device is connected to a 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, and the method includes: determining a connection with the first electronic device; receiving a first message through a first pin; the first pin is connected with a first data signal line; sending a second message through a second pin; the second pin is connected with a second data signal line; the first message and the second message are used for setting charging of the first electronic device.
Unlike the prior art, the transmission and reception of messages between the first electronic device and the second electronic device can only be performed through the D-data signal line. By the method, the messages can be sent and received on different data signal lines, so that the electronic equipment can send the messages to the opposite terminal without waiting for the completion of the sending of the opposite terminal. Especially, when the second electronic device or the third electronic device is abnormal, the situation that needs to be actively reported can effectively improve the safety of the charging process.
In a possible implementation manner, the first pin is a pin connected to a negative signal data line; the second pin is connected with the positive signal data line.
In a possible implementation manner, the first pin is a pin connected to a positive signal data line; the second pin is connected with the negative signal data line.
By the method, the pin of the positive signal data line (such as D +) can be set as the first pin, the pin of the negative signal data line (such as D-) can be set as the second pin, the pin of the positive signal data line (such as D +) can also be set as the second pin, and the pin of the negative signal data line (such as D-) can be set as the first pin, so that signals can be independently sent or received on different data lines, duplex transmission on the signal data line is realized, different duplex transmission modes can be set according to requirements, and therefore, the data transmission efficiency and the flexibility of data transmission are effectively improved.
In one possible implementation manner, a detection from the first electronic device is received through the first pin or the second pin, and the detection is used for the first electronic device to determine that the second electronic device is a dedicated charging interface DCP device;
receiving a first pulse signal from the first electronic device through the first pin; and sending an electric signal to the first electronic device through the second pin to confirm that the battery of the first electronic device is charged in a quick charging mode.
In consideration of the fact that the time consumption of the communication protocol in the prior art is long, the method for sending the first pulse signal by the first electronic device realizes that the first electronic device and the second electronic device support the handshake protocol for charging the battery of the first electronic device in the fast charging mode, and the second electronic device can quickly detect the first pulse signal, so that the time for entering the fast charging mode is shortened, and particularly when the electric quantity of the first electronic device is too low, the first electronic device can quickly enter the fast charging mode to improve the charging experience.
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; the second pin is connected with the negative signal data line, and the electric signal is a low level signal.
By the above method, when the second pin is a pin connected to the positive signal data line, it is considered that the first electronic device sends the first pulse signal through the first pin, and the first pin is a negative signal data line and is at a low level in an idle state. Thus, the electrical signal of the second electronic device may be a high level signal. Therefore, the first electronic device can quickly confirm the completion of the handshake by detecting the high-level pulse signal, and the time for entering the quick charge mode is further shortened.
When the second pin is a pin connected with 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 and is at a high level in an idle state. Thus, the electrical signal of the second electronic device may be a low level signal. Therefore, the first electronic device can quickly confirm the completion of the handshake by detecting the low-level signal, and the time for entering the quick charge mode is further shortened.
In one possible implementation, the first message includes: a first identifier; the first identification is used for indicating a receiver of the first message; the second message includes: a second identifier; the second identifier is used for indicating a receiver of the second message.
Considering that the third electronic device can also participate in data transmission, by the method, the identifier can be set for the receiver of the message, so that the receiver of the message in the data transmission system is distinguished, the message is prevented from being processed by mistake, and the reliability of message transmission is improved.
In a possible implementation manner, the receiver of the first message is the second electronic device; and the receiver of the second message is the first electronic equipment.
In a possible implementation manner, when the receiver of the first message is the chip of the third electronic device, the second message is not sent to the first electronic device.
By the method, the occurrence of conflict caused by the fact that the second electronic equipment actively sends the message to the first electronic equipment when the first electronic equipment and the third electronic equipment transmit the message can be avoided, and the reliability of message transmission is improved.
A possible implementation manner, before the sending the second message through the second pin, further includes: sending a starting signal; the starting signal is a high level signal; after the sending the second message through the second pin, the method further includes: sending an end signal; the ending signal is a low level signal;
Or, 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; the second signal is used for indicating that the frequency of the second message is the second frequency.
By the method, the second electronic device may 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 at which the first electronic device sends the first signal is the second frequency. The frequencies of the signals for data transmission of the first electronic device and the second electronic device can be negotiated and adjusted according to needs, and the flexibility of data transmission is improved. In addition, the anti-interference capability of data transmission can be realized by adjusting the frequency of the signal, the reliability of data signal transmission is improved, and the performance of data transmission is improved.
In a possible implementation manner, a first signal is received through the first pin; the frequency of the first signal is a first frequency; the first signal is used for indicating that the frequency of the first message is the first frequency.
By the method, the first electronic device can send the first signal, so that the frequency for sending the first signal is determined by negotiation with the second electronic device, the frequency of the signal for data transmission between the first electronic device and the second electronic device can be negotiated and adjusted according to needs, and the flexibility of data transmission is improved. In addition, the anti-interference capability of data transmission can be realized by adjusting the frequency of the signal, the reliability of data signal transmission is improved, and the performance of data transmission is improved.
In one possible implementation, the first message includes at least one data frame; the data frame is any one of: data packet header information, data information, control information and cyclic redundancy check; wherein one data frame includes: a start field, a data field, and an end field.
By the method, the first electronic equipment can determine the content of the message sent to the second electronic equipment according to the requirement, and the flexibility of sending the first message is improved. The second electronic device can accurately receive the first message through the start field and the end field of the transmitted data frame, and in addition, the reliability of data transmission can be improved through the cyclic redundancy check field. Similarly, the second electronic device may also determine the content of the second message sent to the first electronic device according to needs, so as to improve flexibility of sending the second message.
A possible implementation manner, before the sending the second message through the second pin, the method further includes: sending a starting signal; the starting signal is a high level signal; after the sending the second message through the second pin, the method further includes: sending an end signal; the ending signal is a low level signal;
Or before sending the second message through the second pin, the method further includes: sending a starting signal; the starting signal is a low level signal; after the sending the second message through the second pin, the method further includes: sending an end signal; the end signal is a high level signal.
By the method, the starting signal sending mode can be adopted, so that the receiving end determines the starting of the message sending, and the message receiving efficiency is improved. And the receiving end determines the end of sending the message by sending an end signal, thereby avoiding the false reception of the message by the receiving end and improving the efficiency of receiving the message.
A possible implementation manner, before the receiving the first message through the first pin, further includes: receiving a start signal; the starting signal is a high level signal; after the receiving the first message through the first pin, the method further includes: receiving an end signal; the ending signal is a low level signal;
or, before receiving the first message through the first pin, the method further includes: receiving a start signal; the starting 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.
By the method, the start of the received message can be determined through the received start signal, and the message receiving efficiency is improved. And the end of receiving the message is determined through the received end signal, thereby avoiding the false reception of the message and improving the efficiency of receiving the message.
In one possible implementation, a first reset signal is received through the first pin; the pulse width of the first reset signal is related to the second electronic equipment; and resetting the second electronic equipment according to the first reset signal.
By the method, when the first electronic device confirms that the data transmission is abnormal or under other abnormal conditions, the first reset signal can be sent to the second electronic device, so that the second electronic device confirms that the current data transmission is abnormal according to the received first reset signal sent by the first electronic device, loss can be stopped in time, damage to each electronic device caused by abnormal charging behaviors is avoided, and charging safety is improved.
In one possible implementation, a second reset signal is received through the first pin; the pulse width of the second reset signal is in a relationship with the third electronic device; ignoring the second reset signal.
By the method, the first reset signal sent by the first electronic device to other receivers can be distinguished, so that the second electronic device is prevented from being reset by mistake according to the second reset signal.
In a third aspect, the present application provides a data transmission method based on a charging cable, applied to a third electronic device, where the third electronic device is used to connect a second electronic device and a first electronic device, and the third electronic device includes a first data signal line and a second data signal line, and the method includes: receiving a first message through a first pin; the first pin is connected with a first data signal line; sending a second message through a second pin; the second pin is connected with a second data signal line; the first message and the second message are used to set charging of a first electronic device.
Unlike the prior art, the transmission and reception of messages between the first electronic device and the second electronic device can only be performed through the D-data signal line. By the method, the messages can be sent and received on different data signal lines, so that the electronic equipment can send the messages to the opposite terminal without waiting for the completion of the sending of the opposite terminal, and the transmission efficiency of the data on the data signal lines is effectively improved. In addition, compared with the case that the second electronic device is used as a device to be charged and the second electronic device is used as a power supply device, in the prior art, only the scheme that the first electronic device actively sends a message to the second electronic device and the second electronic device passively responds is available.
In a possible implementation manner, the first pin is a pin connected to a negative signal data line; the second pin is connected with the positive signal data line.
In a possible implementation manner, the first pin is a pin connected to a positive signal data line; the second pin is connected with the negative signal data line.
By the method, the pin of the positive signal data line (such as D +) can be set as the first pin, the pin of the negative signal data line (such as D-) can be set as the second pin, the pin of the positive signal data line (such as D +) can also be set as the second pin, and the pin of the negative signal data line (such as D-) can be set as the first pin, so that signals can be independently sent or received on different data lines, duplex transmission on the signal data line is realized, different duplex transmission modes can be set according to requirements, and therefore, the data transmission efficiency and the flexibility of data transmission are effectively improved.
In one possible implementation, the first message includes: a first identifier; the first identification is used for indicating a receiver of the first message; the second message includes: a second identifier; the second identification is used for indicating a receiver of the second message.
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; and the receiver of the second message is the first electronic equipment. By the method, the identifier can be set for the receiver of the message, so that the receiver of the message in the data transmission system is distinguished, the message is prevented from being processed by mistake, and the reliability of message transmission is improved.
In a possible implementation manner, when the receiver of the first message is the second electronic device, the second message is not sent to the first electronic device.
By the method, the occurrence of conflict caused by the fact that the second electronic equipment actively sends the message to the first electronic equipment when the first electronic equipment and the third electronic equipment transmit the message can be avoided, and the reliability of message transmission is improved.
In a possible implementation manner, a first signal is received through the first pin; the frequency of the first signal is a first frequency; the first signal is used for indicating that the frequency of the first message is the first frequency;
before the 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; the first signal is used for indicating that the frequency of the first message is the second frequency.
Through the method, the third electronic device may send the second signal to the first device, so that the first device determines that the frequency at which the first electronic device sends the first signal is determined to be the second frequency through negotiation with the third electronic device. The frequencies of the signals of the first electronic device and the third electronic device for data transmission can be negotiated and adjusted according to needs, and the flexibility of data transmission is improved. In addition, the anti-interference capability of data transmission can be realized by adjusting the frequency of the signal, the reliability of data signal transmission is improved, and the performance of data transmission is improved.
In one possible implementation, the first message includes at least one data frame; the data frame is any one of: data packet header information, data information, control information and cyclic redundancy check; wherein one data frame includes: a start field, a data field, and an end field.
By the method, the first electronic device can determine the content of the message sent to the third electronic device according to the requirement, and the flexibility of sending the first message is improved. The third electronic device can accurately receive the first message through the start field and the end field of the transmitted data frame, and in addition, the reliability of data transmission can be improved through the cyclic redundancy check field. Similarly, the third device may also determine the content of the second message sent to the first electronic device as needed, so as to improve the flexibility of sending the second message.
A possible implementation manner, before the sending the second message through the second pin, the method further includes: sending a starting signal; the starting signal is a high level signal; after the sending the second message through the second pin, the method further includes: sending an end signal; the ending signal is a low level signal;
or, before sending the second message through the second pin, the method further includes: sending a starting signal; the starting signal is a low level signal; after the sending the second message through the second pin, the method further includes: sending an end signal; the end signal is a high level signal.
By the method, the starting signal sending mode can be adopted, so that the receiving end determines the starting of the message sending, and the message receiving efficiency is improved. And the receiving end determines the end of the message sending by the mode of sending the end signal, thereby avoiding the error receiving of the message by the receiving end and improving the message receiving efficiency.
A possible implementation manner, before the receiving the first message through the first pin, further includes: receiving a start signal; the starting signal is a high level signal; after receiving the first message through the first pin, the method further includes: receiving an end signal; the ending signal is a low level signal;
Or, before receiving the first message through the first pin, the method further includes: receiving a start signal; the starting 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.
By the method, the start of the received message can be determined through the received start signal, and the message receiving efficiency is improved. And the end of receiving the message is determined through the received end signal, thereby avoiding the false reception of the message and improving the efficiency of receiving the message.
In a possible implementation manner, a second reset signal is received through the first pin; the pulse width of the second reset signal is related to the third electronic device; and resetting according to the second reset signal.
By the method, when the first electronic device confirms that the data transmission is abnormal or under other abnormal conditions, the second reset signal can be sent to the third electronic device, so that the third electronic device confirms that the current data transmission is abnormal according to the received second reset signal, loss can be stopped in time, damage to each electronic device caused by abnormal charging behaviors is avoided, and charging safety is improved.
In one possible implementation, a first reset signal is received through the first pin; the pulse width of the first reset signal is related to the second electronic equipment; ignoring the first reset signal.
By the method, the first reset signal sent by the first electronic device to other receivers can be distinguished, so that the third electronic device is prevented from being reset by mistake according to the first reset signal.
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, where 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, where the method includes: determining that the second pin is in a state of receiving messages and the first pin is in a state of sending messages; the first pin is connected with the first data signal line; the second pin is connected with the second data signal line; sending a third message to the third electronic device through the first pin; the third message is used for acquiring configuration information of the third electronic device, or the third message is used for the first electronic device to instruct the third electronic device to switch the receiving and sending states of the pins.
By the method, the first electronic device can send the third message to the third electronic device through the first pin by determining the state that the second pin receives the message and the state that the first pin sends the message, so that the communication between the first electronic device and the third electronic device is started. In the communication process, the configuration information of the third electronic device may be acquired through the sent third message, or the transmit-receive state of the pin of the third electronic device may be indicated to the third electronic device based on the need, so that the schedule and control of the transmit-receive state of the pin of the third electronic device are realized, and the flexibility of communication and the performance of communication between the first electronic device and the third electronic device are improved. Meanwhile, the problem of possible conflict among the first electronic device, the second electronic device and the third electronic device is also prevented, and the communication performance and the communication efficiency during communication among multiple devices are improved.
A possible implementation manner, where 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 equipment through the second pin, and determining that the second pin is in a message receiving state and the first pin is in a message sending state; or, sending a message to the second electronic device through the first pin, and determining that the second pin is in a message receiving state and the first pin is in a message sending state.
By the method, the state that the second pin receives the message and the state that the first pin sends the message can be determined by receiving the message from the second electronic device, and the state that the second pin receives the message and the state that the first pin sends the message can also be set according to the self requirement, and the state that the second pin receives the message and the state that the first pin sends the message can also be determined by sending the message to the second electronic device through the first pin. And the flexibility of determining the state of the second pin for receiving the message and the state of the first pin for sending the message is improved so as to adapt to more scenes.
In one possible implementation, the method further includes: receiving a third response message from the third electronic device through a second pin, where the third response message is used to indicate configuration information of the third electronic device.
By the method, the configuration information of the third electronic device can be received through the second pin, so that the communication process between the first electronic device and the third electronic device is completed, and preparation is made for subsequent normal communication between the first electronic device and the second electronic device.
In one possible implementation, the third message includes: a third identifier; the third identifier is used to indicate that the receiver of the third message is the third electronic device.
By the method, a plurality of receiving modes can be provided by the third identification mode, the receiver of the third message can be indicated, and the directivity of message transmission can be improved.
In one possible implementation, the method further includes: when determining that the configuration information of the third electronic equipment is failed to be received, sending an indication message to the second electronic equipment; the indication message is used for indicating the second electronic device to acquire the configuration information of the third electronic device.
By the method, when the first electronic device fails to acquire the configuration information of the third electronic device, the second electronic device acquires the configuration information of the third electronic device, so that the fault tolerance and the robustness of acquiring the configuration information of the third electronic device are improved.
In one possible implementation, the method further includes: receiving a notification message from the second electronic device; the notification message is used for notifying the second electronic device that the acquisition of the configuration information of the third electronic device fails.
By the method, the first electronic device may acquire the configuration information of the third electronic device after the second electronic device fails to acquire the configuration information of the third electronic device.
In one possible implementation, the method further includes: and when a fourth message from the second electronic equipment is received through the second pin, determining that the communication with the third electronic equipment is ended.
By the method, when the fourth message of the second electronic device is received, the start of communication between the first electronic device and the second electronic device is determined, and the end of communication between the first electronic device and the third electronic device is determined, so that the message is stopped being transmitted and received with the third electronic device, the possible conflict problem among the first electronic device, the second electronic device and the third electronic device is avoided, and the transmission performance is improved.
In one possible implementation, the method further includes: sending a reset message to the third electronic device through the first pin; the reset message is used for indicating that the first pin of the third electronic device and the second pin of the third electronic device are in a state of receiving messages.
Through the method, the first electronic device can send the reset message to the third electronic device when needed. For example, a reset message may be sent to the third electronic device upon determining to end communication with the third electronic device. The first pin of the third electronic device and the second pin of the third electronic device are in a message receiving state, so that the possible conflict problem among the first electronic device, the second electronic device and the third electronic device is avoided, and the transmission performance is improved.
In one possible implementation, the method further includes: determining that the first pin is in a state of receiving messages and the second pin is in a state of sending messages; sending a fifth message to the third electronic device through the second pin; the fifth message is used for acquiring configuration information of the third electronic equipment; receiving a fifth response message from the third electronic device through the first pin; the fifth response message is used for indicating the configuration information of the third electronic device.
By the method, after the first pin is determined to be in the state of receiving the message and the second pin is determined to be in the state of sending the message, namely after the receiving and sending states of the pins are determined to be switched, the third electronic device can be directly indicated to switch the receiving and sending states of the pins in a mode of sending a fifth message, and meanwhile, the configuration information of the third electronic device is obtained through the fifth message. And the indication of the switching of the receiving and sending states of the pin of the third electronic equipment is finished while the signaling is effectively saved. In another possible scenario, the first electronic device may further send an indication message separately through the second pin, so as to indicate switching of the transceiving state of the pin of the third electronic device.
In a possible implementation manner, the first pin is a pin connected to a negative signal data line; the second pin is connected with the positive signal data line; or the first pin is connected with a positive signal data line; the second pin is connected with the negative signal data line.
In a fifth aspect, the present application provides a data transmission method based on a charging cable, applied to a second electronic device, where the second electronic device is connected to a 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, where the method includes: determining that the first pin is in a message receiving state and the second pin is in a message sending state; the first pin is connected with the first data signal line; the second pin is connected with the second data signal line; sending a third message 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 to indicate, by the second electronic device, a transceiving state of a pin switched by the third electronic device.
By the method, the second electronic device can determine that the first pin is in the state of receiving the message and the second pin is in the state of sending the message; and sending a third message to the third electronic device through the second pin so as to start communication between the second electronic device and the third electronic device. In the communication process, the configuration information of the third electronic device may be acquired through the sent third message, or the transmit-receive state of the pin of the third electronic device may be indicated to the third electronic device based on the need, so that the schedule and control of the transmit-receive state of the pin of the third electronic device are realized, and the flexibility of communication and the performance of communication between the first electronic device and the third electronic device are improved. Meanwhile, the problem of possible conflict among the first electronic device, the second electronic device and the third electronic device is also prevented, and the communication performance and the communication efficiency during communication among multiple devices are improved.
A possible implementation manner, where 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 equipment through the first pin, and determining that the first pin is in a message receiving state and the second pin is in a message sending state; or, sending a message to the first electronic device through the second pin, and determining that the first pin is in a message receiving state and the second pin is in a message sending state.
By the method, the state that the first pin receives the message and the state that the second pin sends the message can be determined by receiving the message from the first electronic device, and the state that the first pin receives the message and the state that the second pin sends the message can also be set according to the self requirement, and the state that the first pin receives the message and the state that the second pin sends the message can also be determined by sending the message to the first electronic device through the second pin. And the flexibility of determining the state of the first pin for receiving the message and the state of the second pin for sending the message is improved so as to adapt to more scenes.
In one possible implementation, the method further includes: receiving a third response message from the third electronic device through the first pin, wherein the third response message is used for indicating the configuration information of the third electronic device.
Through the method, the configuration information of the third electronic device can be received through the first pin, so that the communication process between the second electronic device and the third electronic device is completed, and preparation is made for subsequent normal communication between the first electronic device and the second electronic device.
In one possible implementation, the third message includes: a third identifier; the third identifier is used for indicating that a receiver of the third message is the third electronic device.
By the method, the receiver of the third message can be indicated in a plurality of receiving modes in a third identification mode, and the directivity of message transmission is improved.
In one possible implementation, the method further includes: when determining that the configuration information of the third electronic device is failed to be received, sending a notification message to the first electronic device; the notification message is used for notifying the second electronic device that the acquisition of the configuration information of the third electronic device fails.
By the method, when the second electronic device fails to acquire the configuration information of the third electronic device, the first electronic device acquires the configuration information of the third electronic device, so that the fault tolerance and the robustness of acquiring the configuration information of the third electronic device are improved.
A possible implementation manner, 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 for indicating the second electronic device to acquire the configuration information of the third electronic device.
Through the method, after the first electronic device fails to acquire the configuration information of the third electronic device, the second electronic device may be instructed to acquire the configuration information of the third electronic device. Or, the first electronic device determines, as needed, that the second electronic device acquires the configuration information of the third electronic device, and thus instructs the second electronic device to acquire the configuration information of the third electronic device.
In one possible implementation, the method further includes: and when a fourth message from the first electronic equipment is received through the second pin, determining that the communication with the third electronic equipment is finished.
By the method, after the second electronic device and the third electronic device are determined to be in communication, or after the first electronic device and the third electronic device are determined to be in communication, the fourth message is sent to the first electronic device, the first electronic device and the second electronic device are started to communicate, and the third electronic device stops sending and receiving messages, so that the possible conflict among the first electronic device, the second electronic device and the third electronic device is avoided, and the transmission performance is improved.
In one possible implementation, the method further includes: sending a reset message to the third electronic device through the first pin; the reset message is used for indicating that the first pin of the third electronic device and the second pin of the third electronic device are in a state of receiving messages.
Through the method, the second electronic device can send the reset message to the third electronic device when needed. For example, a reset message may be sent to the third electronic device upon determining to end communication with the third electronic device. The first pin of the third electronic device and the second pin of the third electronic device are in a message receiving state, so that the possible conflict problem among the first electronic device, the second electronic device and the third electronic device is avoided, and the transmission performance is improved.
In one possible implementation, the method further includes: determining that the second pin is in a message receiving state and the first pin is in a message sending state; sending a fifth message to the third electronic device through the second pin; the fifth message is used for acquiring configuration information of the third electronic equipment; receiving a fifth response message from the third electronic device through the second pin; the fifth response message is used for indicating the configuration information of the third electronic device.
By the method, after the second pin is determined to be in the state of receiving the message and the first pin is determined to be in the state of sending the message, namely after the receiving and sending states of the pins are determined to be switched, the third electronic device can be directly indicated to switch the receiving and sending states of the pins in a mode of sending a fifth message, and meanwhile, the configuration information of the third electronic device is obtained through the fifth message. And the indication of switching the transceiving state of the pin of the third electronic equipment is completed while the signaling is effectively saved. In another possible scenario, the second electronic device may further send an indication message separately through the first pin, so as to indicate switching of the transceiving states of the pin of the third electronic device.
In a possible implementation manner, the first pin is a pin connected to a negative signal data line; the second pin is connected with the positive signal data line; or the first pin is a pin connected with a positive signal data line; the second pin is connected with the negative signal data line.
In a sixth aspect, the present application provides a data transmission method based on a charging cable, applied to a third electronic device, where the third electronic device is used to connect a second electronic device and a first electronic device, and the third electronic device includes a first data signal line and a second data signal line, and the method includes: when a third message is received through a first pin, setting the first pin to be in a message receiving state, and setting the second pin to be in a message sending state; the first pin is connected with the first data signal line; the second pin is connected with the second data signal line; the receiver of the third message is the third electronic device.
By the method, when a third message is received through the first pin, the first pin is set to be in a message receiving state, and the second pin is set to be in a message sending state; so as to start the communication between the electronic device corresponding to the third message and the third electronic device. Therefore, the dispatching and the control of the receiving and sending states of the pins of the third electronic equipment through the received third message are realized, and the flexibility and the performance of communication between the first electronic equipment and the third electronic equipment are improved. Meanwhile, the problem of possible conflict among the first electronic device, the second electronic device and the third electronic device is also solved, and the communication performance and the communication efficiency during communication among multiple devices are improved.
A possible implementation manner, before the third message is received through the first pin, further includes: the first pin and the second pin are in a state of receiving a message.
By the method, before communication with the first electronic device or communication with the second electronic device is started, the first pin and the second pin are in a state of receiving messages. Therefore, the third electronic device can effectively receive the message from the first pin or the second pin, and accordingly, the receiving and sending states of the pins are switched according to the received message, communication is started, and communication efficiency and communication effects between the third electronic device and other electronic devices are improved.
In one possible implementation, the third message further includes: a third identification; the third identifier is used to indicate that the receiver of the third message is the third electronic device.
By the method, a plurality of receiving modes can be provided by the third identification mode, the receiver of the third message can be indicated, and the directivity of message transmission can be improved.
In one possible implementation, the method further includes:
when a fourth message is received through the first pin, setting the first pin and the second pin to be in a message receiving state;
Wherein a receiver 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.
By the method, the fourth message of the first electronic device or the second electronic device can be received at the same time, so that 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 according to the fourth message, and the state of actively sending the message to the first electronic device or the second electronic identity is stopped. And adjusting the pin of the third electronic equipment until the next message from the first electronic equipment or the second electronic equipment is received, and starting the sending function of the third electronic equipment. The problem of possible conflict among the first electronic device, the second electronic device and the third electronic device is solved, and the communication performance and the communication efficiency during communication among multiple devices are improved.
In one possible implementation, the method further includes:
when a fifth message is received through the second pin, setting the second pin as a message receiving state and the first pin as a message sending state; and the receiver of the fifth message is the third electronic equipment.
Through the received fifth message, the transceiving state of the switching pin can be determined, namely the second pin is set to be in the state of receiving the message and the first pin is set to be in the state of sending the message.
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.
In a possible implementation manner, 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 for the first electronic device or the second electronic device to indicate the transceiving state of the third electronic device switching pin.
In a possible implementation manner, the first pin is a pin connected to a negative signal data line; the second pin is connected with the positive signal data line; or the first pin is a pin connected with a positive signal data line; the second pin is connected with the negative signal data line.
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, where 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 the method includes: detecting a connection with the second electronic device; sending a first message through a first pin; or, receiving a second message through the first pin; wherein the first message and the second message are messages encoded by Manchester; the first pin is connected with a first data signal line; the first message and the second message are used for setting charging of the first electronic device.
By the method, the first electronic device can transmit the first message after Manchester encoding and decode the received second message through Manchester encoding without transmitting a synchronous clock signal in the message, so that the problems of poor transmission performance and low transmission efficiency caused by the fact that a receiving end in the prior art is difficult to receive continuous high-frequency signals are solved.
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 with a positive signal data line.
By the method, the first pin for transmitting the first message and the second message can be flexibly configured, so that data transmission is more flexible.
According to a possible implementation manner, connection between a first electronic device and a second electronic device is detected through the first pin and the second pin, and the second electronic device is determined to be a special charging interface DCP device; sending a first pulse signal through the first pin; and detecting an electric signal of the second electronic equipment through the second pin, and determining whether to charge the battery of the first electronic equipment through a quick charging mode.
In consideration of the fact that the time consumption of the communication protocol in the prior art is long, by the method for sending the first pulse signal, the first electronic device and the second electronic device support the handshake protocol for charging the battery of the first electronic device through the quick charging mode, the time for entering the quick charging mode is shortened, and particularly when the electric quantity of the first electronic device is too low, the first electronic device can enter the quick charging mode quickly to improve the charging experience.
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.
By the method, when the second pin is a pin connected with the positive signal data line, the first electronic device is considered to send the first pulse signal through the first pin, and at the moment, the first pin is a negative signal data line and is at a low level in an idle state. Thus, the electrical signal of the second electronic device may be a second pulse signal, for example, the second response signal may be a high level pulse signal. Therefore, the first electronic device can quickly confirm the completion of the handshake by detecting the second response signal, and the time for entering the quick charge mode is further shortened.
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.
By the method, when the second pin is a pin connected with the negative signal data line, the first electronic device is considered to send the first pulse signal through the first pin, and at the moment, the first pin is a positive signal data line and is at a high level in an idle state. Therefore, the electric 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, the time for entering the quick charging mode is shortened, and the handshake complexity is reduced.
In one possible implementation, the first message includes: a first identifier; the first identification is used for indicating a receiver of the first message and a sender of the first message; the second message includes: a second identifier; the second identification is used for indicating a receiver of the second message and a sender of the second message; the receiver of the first message or the sender of the second message is any one of: the second electronic device, the third electronic device.
Considering that the third electronic device can also participate in data transmission, through the method, the identifiers can be respectively set for the sender and the receiver of the message, so that the sender and the receiver of the message in the data transmission system are distinguished, message misprocessing is avoided, and the reliability of message transmission is improved.
In a possible implementation manner, a first signal is sent through the first pin; the frequency of the first signal is a first frequency; the first signal is used for negotiating that the communication frequency is the first frequency.
By the method, the first electronic device can send the first signal, so that the frequency for sending the first signal is determined by negotiation with the second electronic device, the frequency of the signal for data transmission between the first electronic device and the second electronic device can be negotiated and adjusted as required, the flexibility of data transmission is improved, in addition, the anti-interference capability of data transmission can be realized by adjusting the frequency of the signal, the reliability of data signal transmission is improved, and the performance of data transmission is improved.
In one possible implementation, a second signal is received through the first pin; the frequency of the second signal is a first frequency; the second signal is used to determine that the communication frequency is the first frequency.
Through the method, the first electronic device can receive the second signal sent by the second electronic device to determine that the frequency for sending the first signal is the first frequency through negotiation with the second electronic device.
In a possible implementation manner, the frequency of the first message and the second message is the first frequency.
By the method, the frequency of the messages sent and received by the first electronic equipment can be set to be consistent, and the complexity of data transmission is reduced.
In one possible implementation, the first message includes at least one data frame; the data frame is any one of: data packet header information, data information, control information and cyclic redundancy check; wherein one data frame includes: a start field, a data field, and an end field. Alternatively, the first message includes at least one of: at least one data frame, a cyclic redundancy check field; wherein one data frame includes: a start field, an end field, a header field, and a data field.
By the method, the first electronic equipment can determine the content of the message sent to the second electronic equipment or the third electronic equipment according to the requirement, and the flexibility of sending the first message is improved. The second electronic device or the third electronic device can accurately receive the first message through the start field and the end field of the transmitted data frame, and 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 may also determine the content of the second message sent to the first electronic device according to needs, so as to improve the flexibility of sending the second message.
A possible implementation manner, after the sending the first message through the first pin, further includes: the first data signal line is used for the first electronic device to receive messages in a first time window.
By the method, the first time window can be set after the first electronic device sends the first message, and the sending permission of the first data signal line can be other electronic devices in the first time window, so that the scheme that other electronic devices send messages actively is realized, the flexibility of data transmission is improved, and the possibility of data transmission conflict is avoided.
A possible implementation manner, after receiving the second message through the first pin, further includes: the first data signal line is used for the first electronic device to receive messages in a second time window.
By the method, the second time window can be set after the first electronic device receives the second message, and the sending permission of the first data signal line can be set to other electronic devices in the second time window, so that the scheme that other electronic devices actively send messages is realized, the flexibility of data transmission is improved, and the possibility of data transmission conflict is avoided.
A possible implementation manner, after receiving the second message through the first pin, further includes: and after the current time is determined to exceed the second time window, the first data signal line is used for the first electronic device to send messages.
By the method, the second time window can be set after the first electronic device receives the second message, and the sending authority of the first data signal line returns to the first electronic device after the second time window is finished, so that the possibility that the first electronic device cannot actively send the message for a long time is avoided, the transmission efficiency of data transmission is improved, and the possibility of data transmission collision is avoided.
In one possible implementation, the method further includes: sending a first reset signal through the first pin; the first reset signal is used for indicating a receiver of the first reset signal to reset; the pulse width of the first reset signal has a correlation with a receiver.
By the method, when the first electronic device confirms that the data transmission is abnormal or under other abnormal conditions, the second reset signal can be sent to the third electronic device, so that the third electronic device confirms that the current data transmission is abnormal according to the received second reset signal, loss can be stopped in time, damage to each electronic device caused by abnormal charging behaviors is avoided, and charging safety is improved. Further, the first reset signal sent by the first electronic device to other receivers can be distinguished, so that the second electronic device or the third electronic device is prevented from being reset by mistake according to the first reset signal.
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, where the second electronic device is connected to a first electronic device through a third electronic device, and the third electronic device includes a first data signal line, and the method includes: determining a connection with the first electronic device; sending a second message through the first pin; or, receiving a first message through the first pin; the first pin is connected with a first data signal line; wherein the first message and the second message are messages encoded by Manchester; the first message and the second message are used to set charging of a first electronic device.
By the method, the second electronic device can transmit the second message after Manchester encoding and decode the received first message through Manchester encoding without transmitting a synchronous clock signal in the message, so that the problems of poor transmission performance and low transmission efficiency caused by the fact that a receiving end in the prior art is difficult to receive continuous high-frequency signals are solved.
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 with a positive signal data line.
By the method, the first pin for transmitting the first message and the second message can be flexibly configured, so that data transmission is more flexible.
In one possible implementation manner, a detection from the first electronic device is received through the first pin and the second pin, and the detection is used for the first electronic device to determine that the second electronic device is a dedicated charging interface DCP device; receiving a first pulse signal from the first electronic device through the first pin; and sending an electric signal to the first electronic equipment through the second pin to confirm whether to charge the battery of the first electronic equipment through a quick charging mode.
In consideration of the fact that the time consumption of the communication protocol in the prior art is long, by the method for sending the first pulse signal, the first electronic device and the second electronic device support the handshake protocol for charging the battery of the first electronic device through the quick charging mode, the time for entering the quick charging mode is shortened, and particularly when the electric quantity of the first electronic device is too low, the first electronic device can enter the quick charging mode quickly to improve the charging experience.
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; the second pin is connected with the negative signal data line, and the electric signal is a low level signal.
By the method, when the second pin is a pin connected with the negative signal data line, it is considered that the first electronic device sends the first pulse signal through the first pin, and at this time, the first pin is a positive signal data line and is at a high level in an idle state. Therefore, the electric 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, the time for entering the quick charging mode is shortened, and the handshake complexity is reduced.
In one possible implementation, the first message includes: a first identifier; the first identification is used for indicating a receiver of the first message and a sender of the first message; the second message includes: a second identifier; the second identification is used for indicating a receiver of the second message and a sender of the second message; the sender of the first message or the receiver of the second message is any one of: the first electronic device, the third electronic device.
Considering that the third electronic device can also participate in data transmission, through the method, the identifiers can be respectively set for the sender and the receiver of the message, so that the sender and the receiver of the message in the data transmission system are distinguished, the message is prevented from being processed by mistake, and the reliability of message transmission is improved.
In one possible implementation, a first signal is received through the first pin; the frequency of the first signal is a first frequency; the first signal is used for negotiating that the communication frequency is the first frequency.
By the method, the first electronic device can send the first signal, so that the frequency for sending the first signal is determined by negotiation with the second electronic device, the frequency of the signal for data transmission between the first electronic device and the second electronic device can be negotiated and adjusted as required, the flexibility of data transmission is improved, in addition, the anti-interference capability of data transmission can be realized by adjusting the frequency of the signal, the reliability of data signal transmission is improved, and the performance of data transmission is improved.
In a possible implementation manner, a second signal is sent through the first pin; the frequency of the second signal is a first frequency; the first signal is used to determine that the communication frequency is the first frequency.
Through the method, the first electronic device can receive the second signal sent by the second electronic device to determine that the frequency for sending the first signal is the first frequency through negotiation with the second electronic device.
In one possible implementation, the frequency of the first message and the second message is the first frequency.
By the method, the frequency of the messages sent and received by the second electronic equipment can be set to be consistent, and the complexity of data transmission is reduced.
In one possible implementation, the first message includes at least one of: at least one data frame, a cyclic redundancy check field; wherein one data frame includes: a start field, an end field, a header field, and a data field. Or, the first message includes at least one data frame; wherein one data frame includes: start field, end field, data field. The data frame is any one of: data packet header information, data information, control information, cyclic redundancy check.
By the method, the first electronic equipment can determine the content of the message sent to the second electronic equipment according to the requirement, and the flexibility of sending the first message is improved. The second electronic device can accurately receive the first message through the start field and the end field of the transmitted data frame, and in addition, the reliability of data transmission can be improved through the cyclic redundancy check field. Similarly, the third device may also determine the content of the second message sent to the first electronic device as needed, so as to improve the flexibility of sending the second message.
A possible implementation manner, after receiving the first message through the first pin, 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.
By the method, the first time window can be set after the first electronic device finishes sending the first message, and the sending authority of the first data signal line can be the second electronic device or the third electronic device in the first time window, so that the scheme that the second electronic device or the third electronic device actively sends the message is realized, the flexibility of data transmission is improved, and the possibility of data transmission collision is avoided.
A possible implementation manner, after the sending the second message through the first pin, further includes:
and in a second time window, the first data signal line is used for the second electronic equipment or the third electronic equipment to send messages.
By the method, the second time window can be set after the first electronic device receives the second message, and the sending permission of the first data signal line can be set to other electronic devices in the second time window, so that the scheme that other electronic devices actively send messages is realized, the flexibility of data transmission is improved, and the possibility of data transmission conflict is avoided.
A possible implementation manner, after the sending the second message through the first pin, further includes:
and after the current time is determined to exceed the second time window, the first data signal line is used for the second electronic equipment or the third electronic equipment to receive messages.
By the method, the second time window can be set after the first electronic device receives the second message, and the sending authority of the first data signal line returns to the first electronic device after the second time window is finished, so that the possibility that the first electronic device cannot actively send the message for a long time is avoided, the transmission efficiency of data transmission is improved, and the possibility of data transmission collision is avoided.
In a possible implementation manner, a first reset signal is received through the first pin; the pulse width of the first reset signal is related to the second electronic equipment; and resetting the charging mode according to the first reset signal.
By the method, when the first electronic device confirms that the data transmission is abnormal or under other abnormal conditions, the first reset signal can be sent to the second electronic device, so that the second electronic device confirms that the current data transmission is abnormal according to the received first reset signal sent by the first electronic device, loss can be stopped in time, damage to each electronic device caused by abnormal charging behaviors is avoided, and charging safety is improved.
In one possible implementation, a second reset signal is received through the first pin; the pulse width of the second reset signal is in a relationship with the third electronic device; ignoring the second reset signal.
By the method, the first reset signal sent by the first electronic device to other receivers can be distinguished, so that the second electronic device is prevented from being reset by mistake according to the second reset signal.
In a ninth aspect, the present application provides a data transmission method based on a charging cable, applied to a third electronic device, where the third electronic device is used to connect a second electronic device and a first electronic device, and the third electronic device includes a first data signal line, where the method includes: sending a second message through the first pin; or, receiving a first message through the first pin; the first pin is connected with a first data signal line; wherein the first message and the second message are messages encoded by Manchester; the first message and the second message are used for setting charging of the first electronic device.
By the method, the third electronic device can transmit the second message after Manchester encoding and decode the received first message through Manchester encoding without transmitting a synchronous clock signal in the message, so that the problems of poor transmission performance and low transmission efficiency caused by the fact that a receiving end is difficult to receive continuous high-frequency signals in the prior art are solved.
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 with a positive signal data line.
By the method, the first pin for transmitting the first message and the second message can be flexibly configured, so that data transmission is more flexible.
In one possible implementation, the first message includes: a first identifier; the first identification is used for indicating a receiver of the first message and a sender of the first message;
the second message includes: a second identifier; the second identification is used for indicating a receiver of the second message and a sender of the second message; the sender of the first message or the receiver of the second message is any one of: the first electronic device, the third electronic device.
Considering that the third electronic device participates in data transmission, the method can set the identifiers for the sender and the receiver of the message respectively, thereby distinguishing the sender and the receiver of the message in the data transmission system, avoiding the error processing of the message and improving the reliability of the message transmission.
In one possible implementation, the frequency of the first message and the second message is the first frequency.
By the method, the frequency of the messages sent and received by the second electronic equipment can be set to be consistent, and the complexity of data transmission is reduced.
In one possible implementation, the first message includes at least one of: at least one data frame, a cyclic redundancy check field; wherein one data frame includes: a start field, an end field, a header field, and a data field. Or, the first message includes at least one data frame; the data frame is any one of: header information, data information, control information, cyclic redundancy check; wherein one data frame includes: a start field, a data field, and an end field.
By the method, the first electronic device can determine the content of the first message sent to the third electronic device according to the requirement, and the flexibility of sending the first message is improved. The second electronic device can accurately receive the first message through the start field and the end field of the transmitted data frame, and in addition, the reliability of data transmission can be improved through cyclic redundancy check information. Similarly, the third electronic device may also determine the content of the second message sent to the first electronic device according to the requirement, so as to improve the flexibility of sending the second message.
A possible implementation manner, after receiving the first message through the first pin, 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.
By the method, the first time window can be set after the first electronic device finishes sending the first message, and the sending authority of the first data signal line can be the second electronic device or the third electronic device in the first time window, so that the scheme that the second electronic device or the third electronic device actively sends the message is realized, the flexibility of data transmission is improved, and the possibility of data transmission collision is avoided.
A possible implementation manner, after the sending the second message through the first pin, further includes: and in a second time window, the first data signal line is used for the second electronic equipment or the third electronic equipment to send messages.
By the method, a second time window can be set after the first electronic device receives the second message, and the sending permission of the first data signal line can be the second electronic device or the third electronic device in the second time window, so that the scheme that the second electronic device or the third electronic device actively sends the message is realized, the flexibility of data transmission is improved, and the possibility of data transmission collision is avoided.
A possible implementation manner, after the sending the second message through the first pin, further includes: and after the current time is determined to exceed the second time window, the first data signal line is used for the third electronic equipment or the second electronic equipment to receive messages.
By the method, the second time window can be set after the first electronic device receives the second message, and the sending authority of the first data signal line returns to the first electronic device after the second time window is finished, so that the possibility that the first electronic device cannot actively send the message for a long time is avoided, the transmission efficiency of data transmission is improved, and the possibility of data transmission collision is avoided.
In one possible implementation, a second reset signal is received through the first pin; the pulse width of the second reset signal is related to the third electronic device; and resetting the charging mode according to the second reset signal.
By the method, when the first electronic device confirms that the data transmission is abnormal or other abnormal conditions occur, the second reset signal can be sent to the third electronic device, so that the third electronic device confirms that the current data transmission is abnormal according to the second reset signal sent by the first electronic device, loss can be stopped in time, damage to each electronic device caused by abnormal charging behaviors is avoided, and charging safety is improved.
In one possible implementation, a first reset signal is received through the first pin; the pulse width of the first reset signal is related to the second electronic equipment; ignoring the first reset signal.
Through the method, the first reset signal sent by the first electronic device to other receivers can be distinguished, so that the third electronic device is prevented from being reset by mistake according to the first reset signal.
In a tenth aspect, the present application provides an electronic device comprising one or more processors, memory, and one or more computer programs; wherein one or more computer programs are stored in the memory, the one or more computer programs comprising instructions which, when executed by the electronic device, cause the electronic device to perform any of the methods of the possible designs provided by the first, fourth or seventh aspects of the embodiments of the present application.
In an eleventh aspect, the present application provides an electronic device comprising one or more processors, memory, and one or more computer programs; wherein one or more computer programs are stored in the memory, the one or more computer programs comprising instructions which, when executed by the electronic device, cause the electronic device to perform the method of any of the possible designs provided by the second, fifth or eighth aspects of the embodiments of the present application.
In a twelfth aspect, the present application provides an electronic device comprising one or more processors, memory, and one or more computer programs; wherein one or more computer programs are stored in the memory, the one or more computer programs comprising instructions which, when executed by the electronic device, cause the electronic device to perform the method of any of the possible designs provided by the third, sixth or ninth aspects of the embodiments of the present application. Alternatively, the electronic device may not include a memory, for example, the processor may execute instructions stored in the external memory, so that the electronic device executes any one of the designed methods provided in the third, sixth or ninth aspects of the embodiments of the present application.
In a thirteenth aspect, an embodiment of the present application provides a data transmission system, including the electronic device of the tenth aspect, the electronic device of the eleventh aspect, and the electronic device of the twelfth aspect.
In a fourteenth aspect, an embodiment of the present application provides a computer storage medium, which stores a program that, when executed on an electronic device, causes the electronic device to execute any one of the possible design methods of the first aspect to the ninth aspect.
In a fifteenth aspect, the present application provides a computer program product, which when run on an electronic device, causes the electronic device to execute the method of any one of the possible designs of the first aspect to the ninth aspect.
Drawings
Fig. 1a is a schematic structural diagram of a charging system according to an embodiment of the present disclosure;
fig. 1b is a schematic structural diagram of a charging interface according to an embodiment of the present disclosure;
FIG. 2 is a schematic structural diagram of an electronic device;
fig. 3 is a schematic structural diagram of a charging system according to an embodiment of the present disclosure;
FIG. 4a is a timing diagram of handshaking in the prior art;
fig. 4b is a flowchart illustrating a protocol handshaking method according to an embodiment of the present application;
fig. 4c and fig. 4d are schematic diagrams of a protocol handshake provided in an embodiment of the present application;
fig. 5a is a schematic flowchart of a protocol handshaking method according to an embodiment of the present application;
fig. 5b and fig. 5c are schematic diagrams of protocol handshaking provided in an embodiment of the present application;
fig. 6a is a schematic encoding diagram of a data transmission method based on a charging cable according to an embodiment of the present application;
fig. 6b is a schematic structural diagram of encoding and decoding of a data transmission method based on a charging cable according to an embodiment of the present application;
Fig. 6c is a schematic flowchart of a data transmission method based on a charging cable according to an embodiment of the present application;
fig. 6d is a schematic structural diagram of a data transmission method based on a charging cable according to an embodiment of the present application;
fig. 6e is a schematic structural diagram of a data transmission method based on a charging cable according to an embodiment of the present application;
fig. 6f is a schematic signal diagram of a data transmission method based on a charging cable according to an embodiment of the present application;
fig. 7 is a schematic flowchart of a data transmission method based on a charging cable according to an embodiment of the present application;
fig. 8a is a timing diagram illustrating a data transmission method based on a charging cable according to an embodiment of the present disclosure;
fig. 8b is a schematic flowchart of a data transmission method based on a charging cable according to an embodiment of the present application;
fig. 8c is a timing diagram illustrating a data transmission method based on a charging cable according to an embodiment of the present disclosure;
fig. 8d and fig. 8e are schematic diagrams of a data structure provided in an embodiment of the present application;
fig. 9a is a schematic flowchart of a data transmission method based on a charging cable according to an embodiment of the present application;
fig. 9b to fig. 9d are schematic structural diagrams of a data transmission method based on a charging cable according to an embodiment of the present application;
Fig. 9e is a schematic signal diagram of a data transmission method based on a charging cable according to an embodiment of the present application;
FIG. 9f is a diagram illustrating a data structure according to an embodiment of the present application;
fig. 9g is a schematic pin status diagram of a data transmission method based on a charging cable according to an embodiment of the present disclosure;
fig. 9h is a schematic pin status diagram of a data transmission method based on a charging cable according to an embodiment of the present disclosure;
fig. 10a is a schematic flowchart of a data transmission method based on a charging cable according to an embodiment of the present application;
fig. 10b is a schematic signal diagram of a data transmission method based on a charging cable according to an embodiment of the present application;
fig. 11a is a schematic flowchart of a data transmission method based on a charging cable according to an embodiment of the present application;
fig. 11b is a diagram illustrating a second reset signal according to an embodiment of the disclosure;
fig. 12 is a schematic structural diagram of a possible electronic device provided in an embodiment of the present application;
fig. 13 is a schematic structural diagram of a possible electronic device according to an embodiment of the present disclosure.
Detailed Description
The present application will be described in further detail below with reference to the accompanying drawings. The particular methods of operation in the method embodiments may also be applied in device embodiments or system embodiments. It should be noted that, in the description of the following embodiments of the present application, "at least one" means one or more, where a plurality means two or more. In view of this, the "plurality" may also be understood as "at least two" in the embodiments of the present invention. "and/or" describes the association relationship of the associated objects, meaning that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" generally indicates that the preceding and succeeding related objects are in an "or" relationship, unless otherwise specified. In addition, it is to be understood that the terms first, second, etc. in the description of the present application are used for distinguishing between the descriptions and not necessarily for describing a sequential or chronological order.
In addition, in the embodiments of the present application, the word "exemplary" is used to mean serving as an example, instance, or illustration. Any embodiment or design described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments or designs. Rather, the term using examples is intended to present concepts in a concrete fashion.
Under the trend of diversification and large screen of intelligent terminal functions, the power consumption of the intelligent terminal is gradually increased, the battery capacity is gradually increased, and the intelligent terminal has stronger and stronger requirements on quick charging along with the increase of the battery capacity. Therefore, based on the USB channel, in the industry of recent years, a plurality of rapid charging protocols are derived, such as USB PD2.0/3.0, high-pass QC2.0/3.0/4.0, OPPO VOOC, samsung AFC, council PE and Huacheng SCP, and the like, and commercial charging power in the current market is different from 10W to 65W, so that the charging time of the terminal equipment is greatly shortened.
The USB is a serial bus standard and is also a technical specification of an input/output interface. The USB interface has three physical specifications at present, which are called USB Type-A, USB Type-B and USB Type-C respectively. The following exemplifies the pin in the USB interface with USB Type-C. USB Type-C includes 24 pins. The pin diagram of the USB Type-C interface is shown in FIG. 1 a. As can be seen, the USB Type-C includes 4 pairs of differential transmission line pins for implementing the TX/RX function, wherein two pairs of differential transmission line pins (or differential data pins) for transmitting data signals are included: a2 (TX 1 +) and A3 (TX 1-), B2 (TX 2 +) and B3 (TX 2-); and two pairs of differential transmission line pins (or differential data pins) for receiving data signals: b11 (RX 1 +) and B10 (RX 1-), A11 (RX 2 +) and A10 (RX 2-). The data signals transmitted by the differential data pins will be referred to as differential data signals for convenience of description later. USB Type-C also includes 2 Channel Configuration (CC) signaling pins for function negotiation. For example, it can be used to determine the direction of device insertion: a forward insertion or a reverse insertion. But also for negotiating a power function, an alternative mode or a peripheral mode on the interface. The peripheral mode supports transmission of analog audio or debugging signals and the like through a USB Type-C interface. The alternate 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 may also include pins for transmitting other signals, such as a Side Band Use (SBU) signal, as shown in table 1.
TABLE 1
Figure BDA0003459413030000221
Wherein, TX/RX (TX 1, TX2, RX1 and RX 2) is a differential data signal of USB 3.1. It should be noted that TX1 is used to represent a differential data signal (TX 1 +/-) transmitted by a pair of differential transmission line terminals, and RX1 is also used to represent RX1+/-, and the same description is also applied to other differential signals. In USB3.1, when the electronic device using the USB Type-C interface is inserted in the forward direction, A2, A3, B10, and B11 are used as differential transmission line terminals for data signals of USB 3.1. When the insertion direction of the electronic device is reverse insertion, B2 and B3, A10 and A11 are used as differential transmission line terminals of the USB3.1 data signal. Whether a forward or reverse plug direction is used, there will be two pairs of differential transmission line pins unused. USB Type-C may also be used to transmit digital video interface (DP) signals. In the DP mode, two pairs of differential signal line pins not used by USB3.1 may be used to transmit DP data signals (or data signals referred to as the DP protocol). Therefore, the USB Type-C interface can be used to implement USB3.1+ DP signaling. In addition, if the receiving end only needs the DP signal and does not need the USB3.1 signal, 4 pairs of differential signal line pins may be used to transmit the DP data signal. The USB Type-C also includes two pairs of differential transmission line pins (A6, A7 and B7, B7) for transmitting USB2.0 data signals, the USB2.0 data signals being D +/D-. A8 and B8 are the reservation pin in the USB Type-C interface for transmit the SBU signal. In different application scenarios, the SBU signal has different purposes, for example, the SBU signal may include a control signal or a data signal of the DP protocol. For example, A8 and B8 serve as audio transmission channels or microphone transmission channels for transmitting audio data or video data. The control signal of the DP protocol may be an Accessory (AUX) signal. The USB Type-C interface also supports a Power Delivery (PD) protocol, i.e., has a power supply function. Referring to fig. 1a, GND is a ground pin, vbus is a power pin, and 4 ground pins and 4 power pins in the USB Type-C interface constitute 4 pairs of power supply pins for realizing power supply.
A charging scenario to which the present application is applicable is described below. FIG. 1a is a schematic diagram of a system provided in accordance with the present application. In this example, a first electronic device 100 (e.g., an electronic device to be charged) may be connected to a second electronic device 200 (e.g., a power class 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 may be a terminal device. The second electronic device 200 may be any suitable type of charging apparatus, such as a charger, a Travel Adapter (TA), a rechargeable electronic device, a reverse charging device, or the like. 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 may be soldered directly 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 may 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. The battery charger communication protocol may be used to negotiate voltage and/or current levels between the second electronic device 200 (or computer 120) and the first electronic device 100.
In a specific charging process, when detecting that a second electronic device (a device to be charged) is connected and connected to a first electronic device (a power supply device) through a third electronic device (e.g., a cable), a processor of the first electronic device sends a charging start signal to a charging chip 14 of the first electronic device to control the charging chip to start charging.
And detecting whether the second electronic equipment is continuously switched on by the processor of the first electronic equipment, continuously charging the second electronic equipment in the continuous switching-on process, and then controlling the charging of the battery of the first electronic equipment by the charging chip in the continuous switching-on process of the second electronic equipment until the electric quantity of the battery is fully charged. And if the second electronic equipment is detected to be disconnected at any time when the step of continuously charging is executed, stopping executing charging, and when the subsequent second electronic equipment is reconnected, sending a charging starting signal from reconnection of the execution circuit to control the charging chip to start charging and re-execute the subsequent step of continuously charging.
Depending on the characteristics of the battery, the charging process from zero or low to full charge of the battery may include, for example: trickle charge (providing a small charging current to the battery at a low rate and in a constant manner), constant current charge (charging current fixed), constant voltage charge (charging voltage fixed) several stages, with the development of high current charging technology, the constant current stage may include a plurality of stages, each stage using a different current for charging.
It should be noted that the circuit structure and the charging scenario described in the embodiment of the present application are for more clearly illustrating the technical solutions in the embodiment of the present application, and do not constitute limitations on the technical solutions provided in the embodiment of the present application.
It should be noted that "connect" in this embodiment of the present application means that electrical connection is achieved between two interfaces, and pins corresponding to each other in the two interfaces are connected one by one, but this embodiment of the present application does not limit how to connect the two interfaces specifically. For example, the connection may be a plug, a butt, or the like. Taking insertion as an example, the interface 1 is connected to the interface 2, and may be the interface 1 is inserted into the interface 2, or may be the interface 2 is inserted into the interface 1.
As shown in fig. 2, the structure of the electronic device will be described by taking the first electronic device as an example. Fig. 2 is a block diagram of an example of a first electronic device 100 in accordance with various aspects of the invention. The first electronic device 100 mentioned in the embodiment of the present application may be applied to various terminal devices including a battery, including but not limited to a mobile phone, a tablet computer, a computer with a wireless transceiving function, a Virtual Reality (VR) terminal, an Augmented Reality (AR) terminal, a wireless terminal in industrial control (industrial control), a wireless terminal in self driving (self driving), a wireless terminal in remote medical (remote medical), a wireless terminal in smart grid (smart grid), a wireless terminal in transportation safety, a wireless terminal in city (smart city), a wireless terminal in smart home (smart home), and the like. The second electronic device provided by the embodiment of the application can also be a terminal device comprising a battery. At this time, the second electronic device may be used not only to charge the battery inside the electronic device, but also to supply power to the outside using the battery as a power source, that is, to perform reverse charging. The reverse charging means that an electronic device (e.g., a mobile phone, a tablet computer, etc.) can charge another electronic device (e.g., another mobile phone) by using the electric energy stored in its own battery in a wired/wireless manner (e.g., supplying electric energy in a wired or wireless manner). When the wired reverse charging mode is adopted, the device to be charged can be connected with the On The Go (OTG) in a Universal Serial Bus (USB) movable mode, so as to realize the wired reverse charging.
The terminal device mentioned in the embodiments of the present application may be a device providing voice/data connectivity to a user, for example, a handheld device, a vehicle-mounted device, or the like having a wireless connection function. Currently, some examples of terminals are: a mobile phone (mobile phone), a tablet computer, a notebook computer, a palm computer, a Mobile Internet Device (MID), a wearable device, a Virtual Reality (VR) device, an Augmented Reality (AR) device, a wireless terminal in industrial control (industrial control), a wireless terminal in unmanned driving (self driving), a wireless terminal in remote surgery (remote medical supply), a wireless terminal in smart grid (smart grid), a wireless terminal in transportation security (smart), a wireless terminal in city (smart city), a wireless terminal in smart home (smart home), a cellular phone, a cordless phone, a session initiation protocol (session initiation protocol), SIP) phone, wireless Local Loop (WLL) station, personal Digital Assistant (PDA), handheld device with wireless communication function, computing device or other processing device connected to wireless modem, vehicle-mounted device, wearable device, terminal device in 5G network or terminal device in Public Land Mobile Network (PLMN) for future evolution, etc., which are not limited by the embodiments of the present application.
The terminal device may also be a User Equipment (UE), a Mobile Station (MS), a Mobile Terminal (MT), an access terminal, a subscriber unit, a subscriber station, a mobile station, a remote terminal, a mobile device, a user terminal, a wireless communication device, a user agent, or a user equipment, etc.
By way of example and not limitation, in the embodiments of the present application, the terminal device may also be a wearable device. Wearable equipment can also be called wearable intelligent equipment, is the general term of applying wearable technique to carry out intelligent design, develop the equipment that can dress to daily wearing, like glasses, gloves, wrist-watch, dress and shoes etc.. A wearable device is a portable device that is worn directly on the body or integrated into the clothing or accessories of the user. The wearable device is not only a hardware device, but also realizes powerful functions through software support, data interaction and cloud interaction. The generalized wearable smart device includes full functionality, large size, and can implement full or partial functionality without relying on a smart phone, such as: smart watches or smart glasses and the like, and only focus on a certain type of application function, and need to be matched with other equipment such as a smart phone for use, such as various smart bracelets for physical sign monitoring, smart jewelry and the like.
In addition, in the embodiment of the present application, the terminal device may also be a terminal device in an internet of things (IoT) system, where IoT is an important component of future information technology development, and a main technical feature of the present application is to connect an article with a network through a communication technology, so as to implement an intelligent network with interconnected human-computer and interconnected objects. The terminal device of the present application may also be an on-board module, an on-board component, an on-board chip, or an on-board unit that is built in the vehicle as one or more components or units, and the vehicle may implement the method of the present application through the built-in on-board module, on-board component, on-board chip, or on-board unit. Therefore, the embodiment of the application can be applied to vehicle networking, such as vehicle to outside (V2X), long term evolution (LTE-V) for vehicle to vehicle communication, V2V, and the like.
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.
The processor 201 may include any suitable type of processing circuitry, and the processor 201 may include an Application Processor (AP), such as a general purpose processor (e.g., an ARM-based processor, an x 86-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 rendering functions in various formats (e.g., audio, image, video, etc.), a graphics engine, and so forth. The processor 201 may execute an Operating System (OS), various functions, and the like. In some implementations, the processor 201 may be constructed from a single chip with a large number of components on the chip. The components may include a logic core, memory, display system/controller, multimedia encoding/decoding codecs, 2D/3D accelerator engines, image Signal Processors (ISPs), cameras, audio modems, various high and low speed serial/parallel connection interfaces, and the like. In some implementations, the processor 201 may be implemented as a system on a chip (SOC). The SOC may be used to process instructions and data in computer software, among other operations. The different processing units may be separate devices or may be integrated into one or more processors. Wherein the controller may be a neural center and a command center of the first electronic device 100. The controller can generate an operation control signal according to the instruction operation code and the timing signal to complete the control of instruction fetching and instruction execution. A memory may also be provided in the processor 201 for storing instructions and data. In some embodiments, the memory in the processor 201 is a cache memory. The memory may hold instructions or data that have just been used or recycled by the processor 201. If the processor 201 needs to use the instruction or data again, it can be called directly from the memory. Avoiding repeated accesses reduces the latency of the processor 201, thereby increasing the efficiency of the system.
The processor 201 may be connected with each module in the first electronic device 100, for example, as shown in fig. 2, the processor 201 may be connected with the charging unit 202 through an Inter-Integrated Circuit (I2C) bus. The processor 201 may transmit a control instruction to the charging unit 202 and the like through the I2C bus.
The first electronic device 100 may further include a general processor, a mobile communication module 212, a wireless communication module (WC) 214, a Front End Module (FEM), a short range communication unit, and a Radio Frequency Integrated Circuit (RFIC).
The general-purpose processor, which may be a processor for enabling voice communication and/or data transmission, may be a separately configured processor, or may be integrated with the processor 201, and is not limited herein. The general purpose processor may also be used to compress voice data and image data, or may decompress compressed data. The communication processor may include a baseband modem, a Baseband Processor (BP), and the like. The Communication processor may be designed to operate by using one of a Global System for Mobile Communication (GSM) network, an Enhanced Data GSM Environment (EDGE) network, a Code Division Multiple Access (CDMA) network, a W-Code Division Multiple Access (W-CDMA) network, a Long Term Evolution (LTE) network, an Orthogonal Frequency Division Multiple Access (OFDMA) network, a Wireless Fidelity (Wi-Fi) network, a WiMax network, and a bluetooth network.
The FEM may be used to control transmission/reception of radio signals, and may separate 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 receive side front end module including a filter for filtering a receive signal and a transmit side front end module including a Power Amplifier Module (PAM) for amplifying a transmit signal.
A radio frequency integrated circuit (e.g., an RF transceiver) may receive radio frequencies from a base station and may modulate a received high frequency band to a low frequency band (i.e., baseband) that may be processed in a module (e.g., a communications processor).
The short-range communication unit may be implemented by including various communication functions unprocessed by the processor 201, such as WiFi, bluetooth, near Field Communication (NFC), universal Serial Bus (USB), or Global Positioning System (GPS).
Memory 221 may be used to store computer-executable program code, which includes instructions. The processor 201 executes various functional applications and data processing of the first electronic device 100 by executing instructions stored in the memory 221. The memory 221 may include a program storage area and a data storage area. Wherein the storage program area may store an operating system, an application program required for at least one function, and the like. The storage data area may store data (such as images, videos, and the like) created during the use of the first electronic device 100, and the like. In addition, the memory 221 may include a high-speed random access memory, and may further include a nonvolatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (UFS), and the like.
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, and the like. The first electronic device 100 may also include a graphics processor or an audio processor. The graphics processor may perform image information processing, acceleration, signal conversion, screen output, and the like. The audio processor may perform any suitable type of audio processing.
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.
Here, the touch sensor K is also referred to as a "touch panel". The touch sensor K may be disposed on the display screen, and the touch sensor K and the display screen form a touch screen, which is also called a "touch screen". The touch sensor K is used to detect a touch operation acting thereon or nearby. The touch sensor can communicate the detected touch operation to the application processor to determine the touch event type. Visual output associated with the touch operation may be provided via the display screen. In other embodiments, the touch sensor K may also be disposed on the surface of the first electronic device 100, at a position different from the position of the display screen.
The display screen is used for displaying a display interface of an application in the first electronic device 100, such as a view finding interface of a camera, a chat interface of WeChat, and the like, and may also display images, videos, and the like in a gallery. The display screen includes a display panel. The display panel may be a Liquid Crystal Display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (active-matrix organic light-emitting diode, AMOLED), a flexible light-emitting diode (FLED), a miniature, a Micro-oeld, a quantum dot light-emitting diode (QLED), or the like. In some embodiments, the first electronic device 100 may include 1 or N display screens, N being a positive integer greater than 1.
The camera is used to capture still images, moving images, or video. In some embodiments, the number of cameras in the first electronic device 100 may be at least two. Take 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 including a plurality of lenses (convex or concave lenses) for collecting optical signals reflected by an object to be photographed (such as a user's face, a landscape, etc.) and transferring the collected optical signals to an image sensor, and an image sensor. The image sensor generates an image of an object to be photographed according to the optical signal.
In addition, the first electronic device 100 may implement an audio function through an audio module, a speaker a, a receiver B, a microphone C, an earphone interface D, an application processor, and the like. Such as music playing, recording, etc. The first electronic device 100 may receive a key input, and generate a key signal input related to user setting and function control of the first electronic device 100. The first electronic device 100 may generate a vibration alert (e.g., an incoming call vibration alert) using a motor. The indicator in the first electronic device 100 may be an indicator light, and may be used to indicate a charging status, a power change, or a message, a missed call, a notification, or the like. The SIM card interface in the first electronic device 100 is used to connect a SIM card. The SIM card can be attached to and detached from the first electronic device 100 by being inserted into or pulled out of the SIM card interface.
It is to be understood that the illustrated structure of the embodiment of the present invention does not specifically limit 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, or combine certain components, or split certain components, or a different arrangement of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The power manager module 224 may be used to regulate the power of the battery 211. For example, the processor 201 may send information, which may be, for example, the load to be processed, to the power manager module 224. The power manager module 224 may regulate the core voltage to be supplied to the processor 201 by using information provided from the processor 201.
The charging unit 202 may charge the battery 211. In some embodiments, the charging unit 202 may generate a signal for charging the battery 211. In some embodiments, the charging unit 202 may regulate (or otherwise adjust) the voltage or current fed to the battery. Additionally or alternatively, the charging unit 202 may perform a constant current charging operation and a constant voltage charging operation. The charging unit 202 may include an external port that may be electrically connected to an external device, such as 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 transmits a wired charging control command to the charging unit 202, thereby instructing the charging unit 202 to convert the voltage input from 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 transmitted from an external device connected to the charging interface, the processor 201 transmits a wired reverse charging control instruction to the charging unit 202, thereby instructing the charging unit 202 to convert the voltage supplied from the battery into a charging voltage for charging the device connected to the charging interface.
The external port may be a USB port having a fast charging interface function.
Taking the example of the fast charging interface working through a USB port and cable as an example, it may be a standard a USB port of TA connected to a micro-B or micro-AB USB socket (plug receptacle). In addition, the second electronic device 200 may be a device having a Dedicated Charging Port (DCP).
When the DCP is detected, fast charge detection may be initiated, and fast charge communication is established after detection is completed. The first electronic device 100 and the second electronic device 200 determine that a fast charge communication link can be established, and thus the first electronic device 100 and the second electronic device 200 can communicate in a fast charge communication manner. If the communication link is disconnected, the ports on both sides of the first electronic device 100 and the second electronic device 200 may be restored to corresponding default values, for example, a communication manner of normal charging.
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 may be received through D + or D +, or may be transmitted through D + or D +, so that for any two electronic devices of the first electronic device 100, the second electronic device 200, and the third electronic device 300, data transmission and data reception may be independent of each other, thereby forming bidirectional communication between the electronic devices. It is also possible to transmit and receive data only through the D-line, or to transmit and receive data only through the D + line. The physical layer may be used to transmit or receive the multi-fields during data transmission of the first electronic device 100, the second electronic device 200, and the third electronic device 300. Furthermore, in the data transmission process, the data packet can also comprise a check field, so that the accuracy of the data packet can be improved.
In various exemplary embodiments of the present application, the electronic device to be charged may be referred to as a master device, in this embodiment, the master device may be the first electronic device 100, and in some embodiments, the master device may be a master and a power receiver in a communication protocol, for example, may be a terminal device. The terminal device is used as a main device, plays a leading role in the communication process, and can send instructions and data through D + or D-.
The electronic device providing the charging service may be referred to as a slave device. In the embodiment of the present application, the slave devices may be the second electronic device 200 and the 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 the information sent by the master device. For example, the terminal sends a voltage adjusting instruction to the power supply device, and after receiving the voltage adjusting instruction, the power supply device executes a voltage adjusting operation according to the voltage adjusting instruction. For another example, the terminal sends a command for reading the current capability of the cable to the cable, and the cable replies the current capability information.
Optionally, the slave devices may be further divided into a primary slave device and a secondary slave device. In some embodiments, the master slave device may be an electronic device on a power output side in the data transmission system, such as a power supply device, for example, a charger, an adapter, or the like, and needs to perform identification detection with the master device to perform communication so as to provide power output for the first electronic device. In some embodiments, the secondary slave device may be an electronic device without power output behavior in the data transmission system, such as a third electronic device in the embodiments of the present application, and the third electronic device may be a cable with a special identification, and does not need to provide power output for the first electronic device. In some embodiments, multiple secondary slaves may be supported with one and only one master and one master, with the master designating the recipient of the information when sending the information and the other non-designated recipients not responding to the current information.
The fast charge protocol layer defines a corresponding negotiation mode for the command transmitted from the master device. For example, in order to set a communication frequency for transmitting data between the master and the slave, the master may transmit an electrical signal of the corresponding communication frequency to the slave, and thus, the second electronic device 200 may return the same communication frequency as a response. If data transmission at that communication frequency cannot be supported, then an attempt may be made to transmit all possible communication frequencies for the slave device so that the master and slave devices can select the appropriate communication frequency.
The fast charging protocol layer may also define corresponding fields for the instruction transmitted from the master device, which is described in detail in the following embodiments.
Charging unit 202 is further discussed below with respect to fig. 3. Fig. 3 is a schematic diagram illustrating a connection between the charging unit 202 of the first electronic device 100 and the second electronic device 200 provided according to the present application. In this example, the second electronic device 200 is a charging apparatus, which may be a charger, but also a computer and/or any other type of battery charger.
As shown in fig. 3, the second electronic device 200 may include an alternating current power input unit 300, an AC/DC conversion unit 310, a fast charging unit 320, and a communication interface 351. Communication interface 351 may be a USB port and/or any other type of port. During charging, the input unit 300 may receive an AC signal from an outlet and feed the AC signal to the AC/DC converting unit 310. The AC/DC conversion unit 310 may convert an 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 4 lines corresponding to the USB interface 223, where the 4 lines include: VBUS line, D-line, D + line and GND line. The VBUS line and the GND line may be used to provide a supply voltage. The D-line and the D + line may be used for data transmission between electronic devices.
In one possible implementation, the fast charging unit 320 may include a controller 321 and a switch. The controller 321 may be a protocol chip of the power supply terminal. It should be noted that the controller 321 may also control the power supply circuit and the communication line in other manners, which is only illustrated by way of a switch.
In some embodiments, the USB voltage may power the first electronic device 100 via the VBUS line and the GND line under the control of the USB controller 321. For example, the GND line may be connected to the ground line (GND) of the charging unit 203 in the second electronic device 200. In some embodiments, the controller 321 may be used to control the switches, e.g., may implement shorting the D-line and the D + line when performing protocol handshaking. In other embodiments, the controller 321 may control the switches to transmit or receive data through a communication line or an electrical signal.
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 (shown in fig. 3). Communication interface 350 may be a USB port and/or any other type of port.
In one 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 manners, which is only exemplified by a switch. The controller 341 may be a protocol chip of the terminal to be charged.
In some embodiments, controller 341 may provide signals received over 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. In order to prevent overvoltage or overcurrent from flowing into the charging circuit, a protection circuit may be connected in front of the charging circuit. For example, the protection circuit may be an Over Voltage Protection (OVP). According to various aspects of the present application, the OVP may be implemented with switched capacitors. In some embodiments, the protection circuit may be located between the fast charge unit 202 and the charging circuit. In other embodiments, the protection circuit may be disposed between the communication interface 350 and the fast charging unit 202.
In some embodiments, the controller 341 may also control the switch to set whether to transmit the received data to the processor 201 through the D-line or the D + line, thereby enabling the controller 341 of the second electronic device 200 to communicate with the first electronic device 100.
For the third electronic device, a controller 361 may be included, and the controller 361 may be configured to record relevant information of the cable, for example, information about a communication protocol that may be supported, a charging current that may be supported, a charging voltage, and the like. In addition, other identification information of the cable can be recorded, and the identification information is used for the first electronic device or the second electronic device to verify the third electronic device or obtain the 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 data transmission and reception. For example, it may be used to control a third electronic device to receive data over the D-line and to transmit data over the D + line. Or may be used to control a third electronic device to receive data over the D + line and to transmit data over the D-line. Or, the method can be used for determining the D-and D + lines used for transmitting and receiving data according to the received instruction.
The communication lines are D-and D + lines. There are various ways to transmit data between the electronic devices through the D + line and the D-line, and ways to transmit and receive data between the first electronic device 100 and the second electronic device 200 are illustrated in ways 1 to 4 below.
The mode 1, d-line may be used to transceive data between the first electronic device 100 and the second electronic device 200. The D + line may be used to transmit a signal indicating whether the first electronic device 100 and the second electronic device 200 are connected.
Mode 2, the d + line may be used to transceive data between the first electronic device 100 and the second electronic device 200. The D-line may be used to transmit a signal indicating whether the first electronic device 100 and the second electronic device 200 are connected.
The mode 3, d-line may be used for the first electronic device 100 to transmit data to the second electronic device 200. The D + line may be used for the first electronic device 100 to receive data transmitted by the second electronic device 200.
Mode 4, the d + line may be used for the first electronic device 100 to send data to the second electronic device 200. The D-line may be used for the first electronic device 100 to receive data transmitted by the second electronic device 200.
For example, the characteristic of the DC signal may be determined through communication data performed between the second electronic device 200 and the first electronic device 100. The characteristic may include a voltage, a current level, and/or any other suitable type of characteristic. For example, the first electronic device 100 may transmit the indication information of the inputted voltage-current to the second electronic device 200. The fast charging interface 320 of the second electronic device 200 may transmit the output indication information of the voltage-current to the first electronic device 100 and output the selected indication information of the voltage-current to the charging unit 202. The indication information may be transmitted through a USB interface with the charging unit 202.
Considering that the prior art handshaking procedure for a communication protocol is time-consuming, for example, as shown in fig. 4a, the handshaking for the communication protocol requires the first electronic device to send a high level (for example, a handshaking signal on a DP port or a DM port shown in fig. 4 a) as long as 1s to the second electronic device, so that after the second electronic device detects the high level of 1s, it is confirmed that the corresponding communication protocol is used for fast charging. The application provides a handshake method of a communication protocol. Fig. 4b is a diagram illustrating a handshaking method according to one communication protocol provided herein. By performing handshaking on the communication protocol provided by the present application between the first electronic device and the second electronic device, a data transmission method based on a charging cable provided by the present application can be prepared. The handshake method may specifically include the following steps:
step 401: after the first electronic device establishes physical connection with the second electronic device through the third electronic device, the second electronic device is determined to be the DCP device.
In some embodiments, the first electronic device and the second electronic device may perform detection of the USB BC1.2 protocol to determine that the second electronic device is a DCP device. Considering that the DCP device can better support a fast charging mode, after the detection is performed through the USB BC1.2 protocol, the fast charging process of the present application can be performed based on the DCP device, so as to ensure that the first electronic device is fast charged better. The following steps of USB BC1.2 detection are briefly introduced:
Step 4011: the first electronic device detects whether the Vbus line is connected.
Step 4012: the first electronic device starts a timer and determines whether Data Connectivity Detect (DCD) is supported.
When the first electronic device is connected with a common USB interface (SDP device) or a USB interface supporting high current (CDP device), the next step is immediately carried out without waiting for the timeout of the timer. And when the first electronic equipment does not support DCD, executing the next step after the waiting timer is overtime.
Step 4013: the first electronic device initiates a first detection.
The first electronic device applies a voltage VDP SRC on D +, and the first electronic device begins to detect the voltage on D-.
The voltage VDP _ SRC may be such that the voltage on the D + line may range from 0.5 v to 0.7v.
When the voltage detected by the first electronic device on the D-line is greater than VDAT _ REF (namely, the voltage measured on the D-line ranges from 0.25 v to 0.4 v), the second electronic device is determined to be a DCP device (during the first detection, the D + line and the D-line are short-circuited through a controller of the DCP device) or a CDP device (during the first detection, the D + line and the D-line are short-circuited through a controller of the CDP device).
Step 4014: the first electronic device performs secondary detection to determine whether the second electronic device is a DCP device.
The first electronic device applies a voltage VDM SRC (0.5-0.7 v) on the D-line and then detects the voltage on the D + line.
And when the voltage on the D + line is greater than VDAT _ REF (the voltage measured on the D + line ranges from 0.25 v to 0.4 v), determining that the second electronic device is the DCP device.
In some embodiments, the DCP device shorts the D + line and the D-line upon a first detection and a second detection. In other embodiments, the second electronic device is a power supply device supporting only BC1.2, and the D + line and the D-line can be directly short-circuited by resistors inside the second electronic device.
After the second electronic device is determined to be a DCP device, the first electronic device and the second electronic device start protocol handshake detection to detect whether the other party supports the data transmission protocol of the application, so that the communication protocol of the application can be better compatible with the third electronic device and the second electronic device of the USB interface.
Step 402: the first electronic device transmits a first pulse signal to the second electronic device through a communication line (D + line or D-line).
Mode a1: the first electronic device transmits a first pulse on the D + line.
The first pulse may be implemented in various ways, for example, the first pulse may be a pulse signal as shown in (a) of fig. 4c, in which the high level has durations 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, and all are 1ms, or may be set to different times, and may be set according to time requirements, which is not limited herein.
For example, 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, at 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 the first pulse of t = 0-3 ms is generated. Therefore, the first electronic equipment sends the first pulse, and the second electronic equipment detects the first pulse.
Mode a2: the first electronic device transmits a first pulse on the D-line.
The first pulse may be implemented in various ways, for example, the first pulse may be a pulse signal as shown in (a) of fig. 4d, in which 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, and all are 1ms, or may be set to different times, and may be set according to time requirements, which is not limited herein.
For example, t =0ms, the first electronic device enables the pull-down resistor, resulting in a low level (e.g., -3.3V) on the D-line; taking Tdet1= Tdet2= Tdet3=1ms as an example, at t =1-2ms, the first electronic device pulls up the voltage of the D + line (for example, the voltage value is 0V), and after t =2ms, restores the low level of the D + line (for example, -3.3V) so that the first pulse of t = 0-3 ms is generated. Therefore, the first electronic equipment sends the first pulse, and the second electronic equipment detects the first pulse.
Step 403: and after detecting the first pulse, the second electronic equipment disconnects the D + line and the D-line and sends a first response signal through the communication line.
In combination with the manner a1, the first response signal may be a high level signal, as shown in (b) of fig. 4c, and 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 may also be detected on the D-line. After the second electronic device detects the first pulse, the D + line and the D-line may be disconnected, and the D-line may be pulled down to a 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.
In other embodiments, the first response signal may be a high-level pulse signal, and the duration of the second electronic device pulling the D-line down to the ground state may be Tdet5. For example, the time of Tdet5 is 1ms. Therefore, the first electronic device can judge whether the handshake is successful only by detecting the Tdet5 time, and the detection efficiency is improved.
With reference to the example of the mode a1 in step 402, the second electronic device may detect the first pulse when t =0 to 3 ms. After the second electronic device detects the first pulse, for example, when t =3 to 4ms, the line between the D + line and the D-line is disconnected, and the D-line is pulled down so that the level on the D-line becomes low after t =4 ms.
In combination with manner a2, the first response signal may be a low level signal, as shown in (b) of fig. 4D, and in some embodiments, after the second electronic device detects the first pulse, the D + line and the D-line may be disconnected, and the D + line may be pulled down to a 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.
In other embodiments, the first response signal may be a low level pulse signal, and the duration of time that the second electronic device pulls the D + line up to the ground state may be Tdet5. Therefore, the first electronic device can judge whether the handshake is successful only by detecting the Tdet5 time, and the detection efficiency is improved.
With reference to the example of the mode a2 in step 402, after the second electronic device detects the first pulse, for example, when t =3 to 4ms, the line between the D + line and the D-line is disconnected, and the D + line is pulled down so that the level on the D + line becomes low after t =4 ms.
Step 404: the first electronic device detects a response signal on the communication line, and determines whether the handshake is successful, if yes, step 406 is performed, otherwise, step 405 is performed.
In conjunction with manner a1, in some embodiments, the first electronic device may confirm that the protocol handshake was successful when it detects that D-is low. In other embodiments, if the first electronic device detects that D-is low and the duration of the low level is Tdet5, it may be determined that the protocol handshake is successful, thereby improving the detection efficiency. In connection with the example of mode a1 in step 402, the first electronic device initiates low level detection of the D-line when t =2 ms.
In conjunction with manner a2, in some embodiments, when the first electronic device detects that D + is low, it may confirm that the protocol handshake is successful. In other embodiments, the first electronic device detects that D-is low and the duration of the low is Tdet5, then the protocol handshake can be confirmed to be successful.
Step 405: the first electronic device performs determining whether the detection frequency of performing step 402 exceeds 3, if yes, performing step 402; otherwise, go to step 407;
step 406: the first electronic device and the second electronic device complete protocol detection.
In connection with the example of mode a1 in step 402, the first electronic device turns off the low level detection of the D-line when t =5 ms.
In connection with the example of the mode a2 in step 402, the first electronic device turns off the low level detection of the D + line when t =5 ms.
When the first electronic device determines that the handshake has failed, the first electronic device may initiate a retry of the handshake detection when t = 5-10 ms.
Step 407: the first electronic device releases control of D + D-and determines that the handshake failed.
Through the handshake protocol, the protocol handshake protocol can be detected on the premise that the second electronic device is determined to be the DCP device, so that the charging protocol based on the USB interface in the current market can be better compatible.
Fig. 5a is a schematic diagram of a handshake method of another communication protocol provided in the present application. By performing handshaking on the communication protocol provided by the present application between the first electronic device and the second electronic device, a data transmission method based on a charging cable provided by the present application can be prepared. The handshake method may specifically include the following steps:
step 501: after the first electronic device establishes physical connection with the second electronic device through the third electronic device, the second electronic device is determined to be the DCP device.
For a specific implementation, reference may be made to the method in step 401, which is not described herein again.
Step 502: the first electronic device transmits a second pulse signal to the second electronic device through the communication line (D + line or D-line).
Mode b1: the first electronic device transmits a second pulse on the D-line.
The second pulse may be implemented in various ways, for example, the second pulse may be a pulse signal as shown in (a) of fig. 5b, 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, and all are 1ms, or may be set to different times, and may be set according to time requirements, which is not limited herein.
For example, t =0ms, the first electronic device enables the pull-up resistor, resulting in a high level on the D-line; taking Tdet1= Tdet2= Tdet3=1ms as an example, at 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 the second pulse of t = 0-3 ms is generated. Thus, the first electronic device is enabled to send the second pulse, and the second electronic device detects the second pulse.
Mode b2: the first electronic device transmits a second pulse on the D + line.
The second pulse may be implemented in various ways, for example, the second pulse may be a pulse signal as shown in (a) of fig. 5b, in which 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, and all are 1ms, or may be set to different times, and may be set according to time requirements, which is not limited herein.
For example, t =0ms, the first electronic device enables the pull-down resistor, resulting in a low level (e.g., -3.3V) on the D-line; taking Tdet1= Tdet2= Tdet3=1ms as an example, at t =1 to 2ms, the first electronic device pulls up the voltage of the D-line (for example, the voltage value is 0V), and after t =2ms, restores the low level of the D-line (for example, -3.3V) so that the second pulse of t =0 to 3ms is generated. Thereby, the first electronic device is enabled to transmit the second pulse, so that the second electronic device detects the second pulse.
Step 503: and the second electronic equipment sends a second response signal after detecting the second pulse signal.
In conjunction with the mode b1, as shown in (b) of fig. 5b, 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 may also be detected on the D + line. After the second electronic device detects the second pulse, the D + line and the D-line may be disconnected and the D + line may be pulled down to a ground state, and after Tdet4 continues, the pull-down of the D + line is released, and the high level of the D + line is restored. Therefore, the electric signal of the D + line lasting Tdet4 is used as a second response signal sent by the second electronic device to the first electronic device, so that the first electronic device detects the second response signal according to the D + line and determines that the handshake is successful.
With reference to the example of the mode b1 in step 502, the second electronic device may detect the second pulse when t =0 to 3 ms. After the second electronic device detects the second pulse, for example, when t =3 to 4ms, the line between the D + line and the D-line is disconnected, and the D + line is pulled down for 1ms so that the level on the D + line becomes low when t =4 to 5 ms.
In conjunction with mode b2, as shown in (b) of fig. 5c, 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 may also be detected on the D-line. After the second electronic device detects the second pulse, the D + line and the D-line may be disconnected and the D-line may be pulled down to ground and, after Tdet4 has continued, the pull-down of the D-line may be released and the low level of the D-line may be restored. And the electric signal lasting Tdet4 is used as a second response signal sent by the second electronic device to the first electronic device, so that the first electronic device detects the second response signal according to the D-line and determines that the handshake is successful.
With reference to the example of the mode b2 in step 502, the second electronic device may detect the second pulse when t =0 to 3 ms. After the second electronic device detects the second pulse, for example, when t =3 to 4ms, the line between the D + line and the D-line is disconnected, and the D-line is pulled down for 1ms, so that the level on the D-line is low when t =4 to 5 ms.
Step 504: the first electronic device detects the second response signal on the communication line, and determines whether the handshake is successful, if so, step 506 is executed, otherwise, step 505 is executed.
In combination with the method b1, if the first electronic device detects a low level on the D-line and the duration of the low level is Tdet4, it may be determined that the protocol handshake is successful. In connection with the example of mode b1 in step 502, the first electronic device may initiate low level detection of the D + line when t =2 ms.
In combination with the method b2, if the first electronic device detects a low level on the D + line and the duration of the low level is Tdet4, it can be confirmed that the protocol handshake is successful. In connection with the example of mode b2 in step 502, the first electronic device may initiate low level detection of the D-line when t =2 ms.
Step 505: the first electronic device determines whether the detection frequency of step 502 exceeds 3 times, if yes, step 502 is executed; otherwise, go to step 507;
in conjunction with the example of mode b1 in step 502, the first electronic device turns off the low level detection of the D + line when t =5 ms.
With reference to the example of mode b2 in step 502, the first electronic device turns off the low level detection of the D-line when t =5 ms.
Step 506: protocol handshake detection is completed.
Step 507: the first electronic device releases control of D + D-and determines that the handshake failed.
For example, referring to fig. 5b, when the first electronic device determines that the handshake has failed, the first electronic device may initiate a retry of handshake detection when t =5 to 10 ms.
Through the protocol handshake detection method in fig. 4a or fig. 5a, rapid protocol handshake can be achieved, after the master device and the slave device (second electronic device or third electronic device) are connected, detection can be completed within tens of milliseconds, and then data transmission between the electronic devices is started, so that the master device and the slave device enter a fast charge state rapidly, and charging efficiency is improved.
The application provides a data transmission method based on a charging cable, which is a data transmission method realized by a D +/D-data channel based on a USB interface. With reference to fig. 1a to 1b and fig. 2 to 3, the data transmission method may be applied to a scenario in which the second electronic device 200 performs fast charging on the first electronic device 100 through the third electronic device 300. In this embodiment, the devices communicate with each other in half-duplex communication, and transmit and receive data through a first data signal line in the communication line.
Problem 1: consider the prior art where the binary is used directly on the D-bus for data transfer. For example, as shown in fig. 6a, taking the example that the first electronic device transmits data to the second electronic device, when the data is consecutive "0" or "1", the level is not transmitted and changed in the whole symbol time, therefore, when the second electronic device is consecutive "0" or "1", if the communication frequency is higher, the number of consecutive 0 or consecutive 1 in the data transmitted by the first electronic device cannot be determined, so that clock synchronization between the first electronic device and the second electronic device cannot be achieved, and an additional transmission line may be required to transmit a clock signal or an additional clock signal may be transmitted to achieve clock synchronization between the first electronic device and the second electronic device. Therefore, only data with a low communication frequency can be transmitted, or continuous "0" or "1" data cannot be transmitted, resulting in a slow communication rate.
Based on the above problem 1, in order to ensure stability of data transmission and increase communication rate, in some embodiments, as shown in fig. 6b, the present application may transmit data based on a manchester encoding mode and receive data through a manchester decoding mode. As shown in fig. 6a, the transition of the inter-symbol time based on the data after the manchester encoding method may be represented as a clock or data. For example, a positive transition (low to high) may represent a 1 and a negative transition (high to low) may represent a 0. Alternatively, a positive transition may represent a 0 and a negative transition may represent a 1. In other embodiments, as shown in fig. 6a, differential manchester encoding may be adopted, and by means of the differential manchester encoding, transitions in the generated electrical signal only represent a clock, and data is represented by whether a change in level occurs at the beginning of a symbol. For example, a change indicates 0 and no change indicates 1. Taking the example of data transmission between the first electronic device and the second electronic device as an example, the data transmission method based on the charging cable provided in this embodiment is described below, and as shown in fig. 6c, the data transmission method may specifically include:
step 601: the first electronic device detecting a connection with a second electronic device;
In step 601, if data is transmitted between the first electronic device and the third electronic device, the first electronic device detects a connection with the third electronic device.
The first electronic device is connected to the second electronic device through a third electronic device, which may include a first data signal line and a second data signal line.
Wherein 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.
Step 602a: a first message is sent over a first pin.
The first message is a message coded by Manchester, and the first pin is connected with the first data signal line.
Step 602b: a second message is received through the first pin.
The second message is a message encoded by Manchester.
In this embodiment, half-duplex communication is performed between devices, and data is transmitted and received through the first data signal line. After the protocol handshake detection is successful, the connection state between the devices can be determined by maintaining the level state on the second data signal line and by monitoring the level state of the second data signal line.
In the mode c1, as shown in fig. 6D, the second data signal line is a D + signal line, and the first data signal line is a D-signal line.
For example, the first electronic device may pull up the D + signal line to 3.3V and maintain the state to monitor the connection state among the first electronic device, the second electronic device, and the third electronic device; for example, when the first electronic device and the second electronic device are in a connection failure, the level of the D + signal line received by the second electronic device is not 3.3V, so that it can be determined that the first electronic device and the second electronic device are in a connection failure. When the first electronic device and the third electronic device are in connection failure, the level of the D + signal line received by the third electronic device is not 3.3V, so that the connection failure of the first electronic device and the third electronic device can be determined.
The first electronic device may transmit 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 the devices.
In the mode c2, as shown in fig. 6e, the first data signal line is a D + signal line, and the second data signal line is a D-signal line.
For example, the first electronic device may pull the D-signal line down to-3.3V and maintain the state to monitor the connection state among the first electronic device, the second electronic device, and the third electronic device; for example, when the first electronic device and the second electronic device are in a connection failure, the level on the D + signal line received by the second electronic device is not-3.3V, so that it can be determined that the first electronic device and the second electronic device are in a connection failure. When the first electronic device and the third electronic device are in connection failure, the level on the D + signal line received by the third electronic device is not-3.3V, so that the connection failure of the first electronic device and the third electronic device can be determined.
The first electronic device may transmit 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, so that data transmission between the devices is realized.
The data structure of the first message and the second message is exemplified below.
Example one
The first message and the second message may include a start field and an end field of the data packet.
In conjunction with mode c1, as shown in fig. 6f (a), in some embodiments, the start field of the data packet may be a high level pulse of a continuous time length. The end field of the packet may be a high pulse of continuous duration. For example, the start field (SOF) of a packet may be a high pulse of 8 UIs. For example, the end of packet field (EOF) may be a high-level pulse of 4 UI.
In conjunction with mode c2, as shown in fig. 6f (b), in some embodiments, the start field of the data packet may be a low level pulse of a continuous time length. The end field of the packet may be a low level pulse of continuous time length. For example, the start field (SOF) of a data packet may be a low-level pulse of 8 UIs (where a UI may be the length of time required for a bus to transmit one data bit, i.e., a UI is related to the frequency f at which the first electronic device communicates with the second electronic device, and UI = T = 1/f). For example, the end of packet field (EOF) may be a low level pulse of 4 UI.
Problem 2: in consideration of the fact that data transmission is carried out on a D-bus at a fixed communication frequency in the prior art, when interference exists in data transmission, the robustness of the data transmission is low, and the communication performance is poor.
Based on the above problem 2, in conjunction with the embodiment in fig. 6c, the first electronic device can select a desired communication frequency according to actual requirements. As shown in fig. 7, a method of configuring a communication frequency between a first electronic device and a second electronic device is described in detail below. The method specifically comprises the following steps:
step 701: the first electronic device sends a first signal through the first pin.
The frequency of the first signal is a first frequency; the first signal is used for negotiating that the communication frequency is the first frequency.
The first frequency may be determined by the transmitted first signal. For example, the first signal may be a 1010 1010 1010 1010 sequence transmitted on the D-channel with a period T; thus, it can be determined that the first frequency of the first signal is 1/T. After the sequence, a high-level pulse may be included as an end bit of the first signal.
Step 702: and after receiving the first signal through the first pin, the second electronic equipment sends a second signal through the first pin.
The frequency of the second signal is a first frequency; the second signal is used to determine that the communication frequency is the first frequency.
With reference to the example in step 701, after the second electronic device receives the sequence, the same sequence with the same frequency is sent to the first electronic device as the second signal. Informing the first electronic device that the first signal is received and the second electronic device supports a communication frequency corresponding to the first signal;
step 703: the first electronic equipment receives a second signal through the first pin, and determines whether the second signal is received or not within a preset time window; if yes, go to step 704, otherwise go to step 705;
step 704: determining the communication frequency of the first electronic device and the second electronic device as a first frequency.
Step 705: the first frequency is updated by the second frequency, and steps 701 to 705 are repeatedly performed.
It should be noted that the determination of the first frequency and the second frequency may be determined according to a plurality of preset frequencies, for example, the communication frequencies f1, f2, f3, and f4 of 4 gears may be preset, and when the configuration of the communication frequency f1 fails, the communication frequencies of other gears may be selected to initiate the configuration of the communication frequency.
In some embodiments, considering that the amount of communication data between the third electronic device and the first electronic device is small, the third electronic device is mainly used for sending the capability information of the third electronic device to the first electronic device, and therefore, in this embodiment, the third electronic device may not perform the configuration of the communication frequency, and only selects a default communication frequency for communication with the first electronic device. For example, the default communication frequency may be the lowest communication frequency among the selectable frequencies. Of course, other communication frequencies may be set, and are not limited herein.
Through the method, the first electronic device can send the first signal, and after the second electronic device and the third electronic device receive the first signal, the first electronic device and the third electronic device determine to communicate at the first frequency of the first signal to prepare for subsequent data transmission.
Problem 3: in the prior art, only peer-to-peer communication between a first electronic device and a second electronic device can be supported on a D-line, communication between multiple devices cannot be supported, and a scenario that the first electronic device, the second electronic device, and a third electronic device are required to perform communication when the third electronic device is still present in a system cannot be adapted.
Based on the above problem, in the embodiment of the present application, different identifiers of electronic devices may be defined, and when the first message or the second message is sent, the identifier of the corresponding electronic device may be carried, so as to implement data transmission between multiple devices.
It is considered that in this embodiment, data is transmitted and received only through the first data signal line. Therefore, it is necessary to carry the identifiers of the sender and the receiver in the first message and the second message to distinguish the plurality of electronic devices.
In some embodiments, the identity of the different electronic devices may be represented by role-coded information. The role coding information can be carried by physical header information.
In one possible implementation, the first message includes: a first identifier; the first identification is used for indicating a receiver of the first message and a sender of the first message; the second message includes: a second identifier; the second identification is used for indicating a receiver of the second message and a sender of the second message; the receiver of the first message or the sender of the second message is any one of: a second electronic device, a third electronic device.
For example, a Role Code (Role Code), which may be composed of 8-bit data bits, the upper four bits identify the Role of the data sender and the lower four bits identify the Role of the data receiver. The details are shown in Table 2.
TABLE 2
Figure BDA0003459413030000371
For another example, the number of fields occupied by the character code may be determined according to a plurality of electronic devices accessed in the communication system, for example, to save the number of fields, the number of fields occupied by the character code may be set to 4 bits. The high 2 bits identify the role of the sender of the data and the low 2 bits identify the role of the receiver of the data. Alternatively, the lower 2 bits identify the role of the sender of the data and the upper 2 bits identify the role of the receiver of the data. Taking the role of the sender of identification data with high 2 bits and the role of the receiver of identification data with low 2 bits as an example, it can be expressed as table 3.
TABLE 3
Figure BDA0003459413030000381
Take the example that the first message is sent to the second electronic device, and the second message is a message fed back to the first electronic device by the second electronic device. By adding the first identifier to the first message, the second electronic device can determine that the receiver of the first message is the second electronic device, and when determining that the subsequent feedback is given to the sender according to the sender in the first identifier, the identifier carried in the sent second message is the identifier of the first electronic device, that is, the sent second message includes the second identifier, the first electronic device can determine that the receiver of the second message is the first electronic device, and when determining that the subsequent feedback is given to the sender according to the sender in the second identifier being the second electronic device, the identifier carried in the sent message is the identifier of the second electronic device, thereby ensuring that the non-specified electronic device (for example, the third electronic device) does not respond to the first message, and the non-specified electronic device (for example, the third electronic device) does not respond to the second message, and realizing communication among the plurality of electronic devices on the single bus.
In other embodiments, the information related to the role coding may be sent through a physical layer before the first message or the second message is sent, so that the first electronic device, the second electronic device, and the third electronic device determine the identifiers corresponding to the roles of the data sender and the data receiver, so as to implement multi-device communication over a single bus for subsequent transceiving of the first message and the second message.
Problem 4: in consideration of the fact that in the prior art, the communication mode is performed in a mode that a master device asks a slave device (a second electronic device or a third electronic device) to answer, the slave device (the second electronic device or the third electronic device) can only respond to the master device, and active communication cannot be performed. That is, only after the first electronic device sends a message to the second electronic device, the second electronic device feeds back a corresponding message, and in a scenario where the second electronic device needs to actively report related information, such as an abnormality, the first electronic device may not be notified in time, which may cause a problem that the charging of the first electronic device is abnormal, or even a corresponding device of the first electronic device is damaged. Based on the problem 4, in the embodiment of the present application, the slave device is allowed to actively send a message. Data transmission is realized among a plurality of electronic devices through D + or D-, and the data transmission is used for sending commands among the devices, reporting and acquiring information. Consider the problem of a plurality of electronic devices sharing a first data signal line to transmit messages. A plurality of devices in the system can simultaneously apply for the right to use the bus, and in order to avoid generating bus conflict, applicants needing to occupy the bus in the system need to be reasonably controlled and managed. In consideration of whether the first electronic device is the master device or the second electronic device, the priority of the first electronic device in transmitting data using the first data signal line may be set to high, the priority of the second electronic device in transmitting data using the first data signal line may be set to medium, and the priority of the third electronic device in transmitting data using the first data signal line may be set to low. In the embodiment of the present application, a method for arbitrating data transmission is provided, which is illustrated in fig. 8a below.
As shown in fig. 8a (a), in some embodiments, the first data signal line is used for the first electronic device to receive the message within a first time window after the first electronic device sends the first message through the first pin.
It should be noted that the slave device (the second electronic device or the third electronic device) may determine that the first message is completely transmitted when receiving the end field of the first message transmitted by the first electronic device. That is, after the first electronic device has sent the first message, the slave device may occupy the first data signal line by initiating communication.
As shown in fig. 8a (b), in some embodiments, after the first electronic device receives the second message through the first pin, the first data signal line is used for the electronic device to receive the message within a second time window.
As shown in (c) of fig. 8a, 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, ownership of the first data signal line will revert back to the first electronic device.
It should be noted that, in some embodiments, to avoid excessive delay, the slave device may end sending the message after the second time window expires regardless of whether the slave device (the second electronic device or the third electronic device) completes sending the data, 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 transmission of the slave device (second electronic device or third electronic device) is not completed, a third time window may be set accordingly, where the window length of the third time window is longer than that of the second time window, so as to ensure that the data transmission of the slave device is completed as much as possible.
Further, in some application scenarios, when the state of the slave device (second electronic device or third electronic device) changes and the state information of the slave device (second electronic device or third electronic device) needs to be reported in time, if the current right of use of the first data signal line is the first electronic device, the state of the slave device (second electronic device or third electronic device) may not be reported to the first electronic device in time. Therefore, in this embodiment of the present application, a data transmission method based on a charging cable may also be provided, as shown in fig. 8b, specifically including:
Step 801: the second electronic device or the third electronic device sends a first interrupt signal when the first data signal line is idle.
When an error event or an abnormal event occurs in the second electronic device or the third electronic device, for example, the second electronic device has conditions of excessive current, poor contact, voltage fluctuation, and the like, at this time, the second electronic device needs to send current state information of the second electronic device to the first electronic device in time, and may send a first interrupt signal to trigger a process of interrupting data sending by the first electronic device.
In some embodiments, the first interrupt signal may be a pulse, and the width of the pulse may be a pulse width that is distinguishable from other messages, so that the first electronic device may be caused to distinguish the first interrupt signal from the signal of a normally communicated message by the pulse width.
Step 802: and 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.
In some embodiments, step 802a: after receiving the first interrupt signal, the first electronic device may send a query message to the second electronic device or the third electronic device, where the query message is used to query current state information of the second electronic device or the third electronic device, so as to obtain an abnormal event or an error event of the second electronic device or the third electronic device.
In other embodiments, after the second electronic device or the third electronic device sends the first interrupt signal, the third message may be directly sent to the second electronic device or the third electronic device, so that the first device obtains an abnormal event or an error event of the second electronic device or the third electronic device according to the sent third message.
By the method, the second electronic device and the third electronic device can actively report respective state information, a passive mode that a slave device (the second electronic device or the third electronic device) only responds to a master device in the prior art is avoided, and the flexibility of charging control and the charging safety are improved.
Considering that the first electronic device is disconnected from the second electronic device when the first data signal line is abnormal, for example, during high-current charging, at this time, the high current may cause irreversible damage to the first electronic device capturing the second electronic device, and at this time, the second electronic device may detect a pulling-out motion of the third electronic device within a microsecond time, quickly close an output path of energy, and stop a charging mode of quick charging. Accordingly, the data transmission mode also needs to be restored to the data transmission mode in the normal charging mode. In the embodiment of the application, the reset signal can be sent by the first electronic device, so that the reset of the communication modes of the second electronic device and the third electronic device is realized.
As shown in fig. 8c, a timing diagram of the first RESET signal (T _ RESET) sent at the first electronic device. The first electronic device can send a first reset signal through the first pin; the first reset signal is used for indicating a receiver of the first reset signal to reset; the pulse width of the first reset signal has a correlation with a receiver.
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 for a preset time. The preset time may be a time length much longer than the data signal or the time window occupied by the present application. For example, the preset time may be 1s.
And after the second electronic equipment receives the first reset signal, the second electronic equipment restores the state of the second electronic equipment to the default state according to the reset protocol. And after the third electronic equipment receives the first reset signal, the third electronic equipment restores the state of the third electronic equipment to the default state according to the reset protocol.
In order to improve the data transmission quality on the communication link, in the embodiment of the present application, the data packet may further include 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.
In some embodiments, the first message, comprises at least one data frame; the data frame is any one of: data packet header information, data information, control information and cyclic redundancy check; wherein one data frame includes: a start field, a data field, and an end field.
For example, as shown in fig. 8d, the data frame includes 3 data frames, the 1 st data frame includes a data frame of header information, the 2 nd data frame includes a data frame of control information, and the 3 rd data frame is a data frame of cyclic redundancy check. Each data frame may also include a start field (labeled SOF in the figure) and an end field (labeled EOF in the figure) in its structure. The transmitting end transmits all data with the length of 8 bits (one field) and automatically counts, and adds a parity check bit to the end of each field. Thus, the data transmitter will count and append a Cyclic Redundancy Check (CRC) to the end of each data packet transmitted over the protocol.
In some embodiments, a cyclic redundancy check field may be added to all data transmitted by the first electronic device to the second electronic device and transmitted by the second electronic device to the first electronic device.
In other embodiments, as shown in fig. 8e, N +3 data frames are included, the 1 st data frame includes a data frame of data header information, the 2 nd data frame includes a data frame of data description information, and the 3 rd to N +2 nd data frames are data contents; the (N + 3) th data frame is a cyclic redundancy check data frame. Each data frame may also include a start field (labeled SOF in the figure) and an end field (labeled EOF in the figure) in its structure. The 2 nd data frame to the N +2 th data frame are data frames including data information. A Cyclic Redundancy Check (CRC) may be performed only for the data field, excluding parity bits. The data transmitter counts a Cyclic Redundancy Check (CRC) and adds it to the end of the data packet. The receiving end needs to calculate Cyclic Redundancy Check (CRC) of the received data and compare the CRC with Cyclic Redundancy Check (CRC) field received by the data packet to check the data.
Based on the above problem 1, the present application provides a data transmission method based on a charging cable, which is a method for realizing data transmission based on a D +/D-data channel of a USB interface. With reference to fig. 1a to 1b and fig. 2 to 3, the data transmission method can be applied to a scenario in which the second electronic device 200 performs fast charging on 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 application, a full-duplex communication mode is adopted, so that the problem that the clock needs to be sent synchronously when the first electronic equipment sends data to the second electronic equipment can be solved. As shown in fig. 9a, the specific steps may include:
Step 901: detecting a connection with a second electronic device and/or a third electronic device;
the first electronic device is connected to the second electronic device through a third electronic device, which may include a first data signal line and a second data signal line. Wherein 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.
In some embodiments, the determination of whether the first electronic device transmits data using the D + line or the D-line as the first data signal line may be various. The manner of communication between the first electronic device and the second electronic device is illustrated in the following manner d1-d 3.
In the mode D1, the first electronic device and the second electronic device determine that the first data signal line is a D + line or a D-line in a preset mode. For example, in the communication protocol for fast charging, a default communication mode is determined, and a first data signal line of an electronic device to be charged (a first electronic device) is a D-line, and a second data signal line of the electronic device to be charged (the first electronic device) is a D + line. Correspondingly, the first data signal line of the power supply device is a D + line. The second data signal line of the power supply device is a D-line.
In other possible implementation manners, 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. The manner d2 and the manner d3 illustrate a manner in which the message may be a negotiation instruction, a negotiation response, a command for switching a line, or a switching response.
In the manner 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 through negotiation before communication, so as to determine the first data signal line and the second data signal line corresponding to the second electronic device accordingly.
In some embodiments, the first electronic device may determine that the first data signal line is a D + line or a D-line after the protocol handshake is completed. Therefore, a negotiation instruction is sent to the second electronic device through the determined first data signal line (D + line or D-line), after the second electronic device receives the negotiation instruction, the data signal line is determined to be the data signal line for receiving the first electronic device, that is, the data signal line is determined to be 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 negotiation instruction may be initiated by the second electronic device, so that the negotiation is determined to be completed through a negotiation response fed back by the first electronic device, and thus, the respective first data signal line and the second data signal line are determined according to a negotiation result.
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, so as to reduce the sending of the instruction. The negotiation instruction may also be an instruction for performing negotiation alone, which is not limited herein.
In the 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 communication.
In some embodiments, the line switching instruction may be an instruction initiated by a first electronic device to a second electronic device, where, for example, a first data signal line of the first electronic device is currently a D-line, a switching instruction may be sent to the second electronic device through the D-line, and after the second electronic device receives the switching instruction through the D-line, it determines that a data signal line communicating with the first electronic device needs to be switched, so as to determine whether to switch the D-line to a second data signal line of the second electronic device as needed, and when it is determined that the second electronic device may switch the D-line to the second data signal line of the second electronic device and switch the D + line to a first data signal line of the second electronic device, the second electronic device may send a switching response to the first electronic device through the switched first data signal line (D + line) of the second electronic device, so as to determine that the switching is completed. When the second electronic device determines that the D-line is not agreed to be switched to the second data signal line of the second electronic device, or when the D-line is not supported to be switched 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 indicate that the switching is not agreed to be switched, or the switching fails, and in the subsequent communication, the second electronic device sends data through the D + line and receives the data through the D-line. The first electronic device sends data through the D-line and receives data through the D + line.
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 switch 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 first data signal line (D-line) of the original second electronic device to determine that the switching is completed. In subsequent communications, the first electronic device transmits data over the D + line and receives data over the D-line. The second electronic device sends data over the D-line and receives data over the D + line.
When the second electronic device determines that the D-line is not agreed to be switched to the second data signal line of the second electronic device, or the D-line is not supported to be switched 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 fails.
In other embodiments, the second electronic device may also initiate a switching instruction, so that the completion of the switching is determined through a negotiation response fed back by the first electronic device, and thus, the respective first data signal line and the second data signal line are determined according to a switching result.
For the communication between the first electronic device and the third electronic device, the following illustrates the communication manner between the first electronic device and the second electronic device in manners e1 to e 4.
In the mode e1, the first electronic device and the third electronic device determine, in a preset mode, that the first data signal line of the first electronic device is a D + line or a D-line, and the first data signal line of the third electronic device is a D-line or a D + line. For example, in the communication protocol for fast charging, a default communication mode is determined, and a first data signal line of an electronic device to be charged (a first electronic device) is a D-line, and a second data signal line of the electronic device to be charged (the first electronic device) is a D + line. Accordingly, the first data signal line of the cable is a D + line. The second data signal line of the cable is a D-line.
In the manner e2, 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 first electronic device by negotiation before the first electronic device communicates with the third electronic device, so that the first data signal line and the second data signal line corresponding to the third electronic device are determined accordingly.
In some embodiments, the first electronic device may determine that the first data signal line is a D + line or a D-line after the protocol handshake is completed. Therefore, after the third electronic device receives the negotiation instruction, the data signal line is determined to be the data signal line for receiving the first electronic device, that is, the data signal line is determined to be the second data signal line of the third electronic device.
In other embodiments, a negotiation instruction may be initiated by the third electronic device, so that the negotiation is determined to be completed through a negotiation response fed back by the first electronic device, and thus, the respective first data signal line and the second data signal line are determined according to a negotiation result.
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 the instruction. The negotiation instruction may also be an instruction for performing negotiation alone, and is not limited herein.
In the 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.
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 may send a negotiation instruction to the third electronic device through the determined first data signal line (D + line or D-line), and at this time, after receiving the negotiation instruction, the third electronic device determines that the data signal line is a data signal line for receiving the first electronic device.
Or 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 may send a negotiation instruction to the third electronic device through the determined first data signal line (D + line or D-line), and at this time, after receiving the negotiation instruction, the third electronic device determines that the data signal line is a data signal line for receiving the second electronic device.
In the above method, the communication method between the third electronic device and the first electronic device may be independent of the communication method between the third electronic device and the first electronic device. For example, the communication method between the third electronic device and the first electronic device may be set before the communication between the third electronic device and the first electronic device. Before communication between the third electronic device and the second electronic device, a communication mode between the third electronic device and the second electronic device is set.
Alternatively, consider a scenario in which 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 a first data signal line of the third electronic device indicated by the second negotiation instruction, and at this time, the third electronic device may determine a communication mode, so as to reply to the first electronic device and the second electronic device correspondingly. For example, the third electronic device determines that the first data signal line and the second data signal line are determined in a manner corresponding to the first negotiation instruction. The negotiation success may be replied to the first electronic device and the negotiation failure may be replied to the second electronic device. Thereby, the first electronic device and the second electronic device are informed of the corresponding negotiation results.
The manner in which the third electronic device determines the first data signal line and the second data signal line may be determined according to a priority of communication between the third electronic device and the first electronic device or the second electronic device, for example, when the priority of communication between the first electronic device and the third electronic device is higher, the determination may be performed according to a first negotiation instruction of the first electronic device, and when the priority of communication between the second electronic device and the third electronic device is higher, the determination may be performed according to a second negotiation instruction of the second electronic device.
The priority of the communication between the third electronic device and the first electronic device or the second electronic device may be determined according to the current electronic device with which the third electronic device preferentially communicates, or may be a preset priority, which is not limited herein.
Step 902a: sending a first message through a first pin; the first pin is connected with a first data signal line.
Step 902b: receiving a second message through a second pin; the second pin is connected with a second data signal line.
Wherein the first message and the second message are used to set charging of an electronic device.
In combination with the manner a1 or b1, in a possible manner f1, the second data signal line is a D + signal line, and the first data signal line is a D-signal line. At the moment, the first pin is connected with the negative signal data line; the second pin is connected with the positive signal data line. As shown in fig. 9b, the first electronic device transmits data on D-and receives data on D +; the second electronic device receives data on D-and transmits data on D +.
In combination with the mode a2 or b2, a possible mode f2, the first data signal line is a D-signal line, and the second data signal line is a D + signal line. At this time, the first pin is a pin connected with a positive signal data line; the second pin is connected with the negative signal data line. As shown in fig. 9c, the first electronic device transmits data on D + and receives data on D-; the second electronic device receives data on D + and transmits data on D-.
For a third electronic device, the third electronic device may receive data on D + and transmit data on D-. Alternatively, the third electronic device receives data on D + and transmits data on D-.
Referring to fig. 9d, as shown in fig. 9g, the third electronic device may be set in a state where both the first pin and the second pin receive a message before communication with the first electronic device or the second electronic device starts and after the communication ends. And when the third electronic equipment receives a third message of the first electronic equipment or the second electronic equipment, determining the message transceiving state of the first pin and the second pin.
Taking the example that the first electronic device communicates with the third electronic device, the first electronic device determines that the second pin of the first electronic device is in a message receiving state and the first pin is in a message sending state, so that the first electronic device can send the third message to the third electronic device through the first pin.
In a possible implementation manner, the third message may include a third identifier; the third identifier is used to identify the recipient of the third message as a third electronic device. The setting mode of the third identifier may refer to the setting mode of the first identifier in the following first message, which is not described herein again.
The third message may be a state for instructing the third electronic device to set the first pin to receive the message and the second pin to transmit the message. Therefore, when the third electronic device receives the third message, the first pin may be set to be in a message receiving state, and the second pin may be set to be in a message sending state. Thus, the third electronic device may start communicating with the first electronic device. In other embodiments, to save signaling overhead, the third message may also be a request message for acquiring configuration information of a third electronic device, and when the third electronic device receives the third message, the first pin may be set to be in a state of receiving the message, and the second pin is set to be in a state of sending the message. Meanwhile, communication with the first electronic device is directly started according to the third message.
After the communication is ended, in a possible implementation manner, the first electronic device may actively send a reset message to the third electronic device, where 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. Therefore, when the third electronic device determines that the reset message is received, the third electronic device confirms that the communication between the first electronic device and the third electronic device is ended, and accordingly, the first pin and the second pin of the third electronic device are recovered to be in a state of receiving the message. In another possible implementation manner, the third electronic device may also determine that the communication between the first electronic device and the third electronic device is ended in other manners. For example, after determining that communication with the third electronic device is ended, the first electronic device communicates with the second electronic device, for example, the first electronic device sends a fourth message to the second electronic device, where the fourth message includes the second identifier; the second identifier is used for indicating the receiver as a second electronic device. The third electronic device may determine that the communication between the first electronic device and the third electronic device is ended when receiving the fourth message, and the third electronic device may set the first pin and the second pin of the third electronic device to a state of receiving the message.
In a possible scenario, when the first electronic device determines that the transceiving pin of the third electronic device needs to be switched, a fifth message may be sent to the third electronic device through the second pin, and a receiver of the fifth message is the third electronic device. The fifth message may be an instruction for instructing the third electronic device to switch the transceiving state of the pin. Therefore, when the third electronic device receives the fifth message through the second pin, the second pin can be set to be in a message receiving state and the first pin can be set to be in a message sending state, so that the receiving and sending states of the first pin and the second pin can be switched.
It should be noted that the fifth message may be sent after the first electronic device and the third electronic device are finished communicating, or may be sent during the communication between the first electronic device and the third electronic device, which is not limited herein.
With reference to fig. 9d, as shown in fig. 9h, the second electronic device and the third electronic device are taken as an example for communication. The second electronic device may determine that the second pin of the second electronic device is in a state of receiving a message and the first pin is in a state of sending a message. The determination manner may be determined after negotiation with the first electronic device, or may be a manner indicated by the first electronic device, for example, the second electronic device receives a message of the first electronic device through the second pin, and thus, determines that the second pin is in a state of receiving the message. Accordingly, the second electronic device may send a third message to the third electronic device through the first pin.
In a possible implementation manner, the third message may include a third identifier; the third identifier is used to identify the recipient of the third message as a third electronic device.
The third message may be a state for instructing the third electronic device to set the first pin to receive a message and the second pin to send a message. Therefore, when the third electronic device receives the third message, the first pin may be set to be in a message receiving state, and the second pin may be set to be in a message sending state. Thus, the third electronic device may start communicating with the second electronic device. In other embodiments, to save signaling overhead, the third message may also be a request message for obtaining configuration information of the third electronic device, and when the third electronic device receives the third message, the first pin may be set to be in a state of receiving the message, and the second pin is set to be in a state of sending the message. Meanwhile, communication with the second electronic device is directly started according to the third message.
After the communication is ended, in a possible implementation manner, the second electronic device may actively send a reset message to the third electronic device, where 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. Therefore, when the third electronic device determines that the reset message is received, the third electronic device confirms that the communication between the second electronic device and the third electronic device is ended, and accordingly, the first pin and the second pin of the third electronic device are recovered to be in a state of receiving the message. In another possible implementation manner, the third electronic device may also determine that the communication between the second electronic device and the third electronic device is ended in other manners. For example, after determining that communication with the third electronic device is ended, the second electronic device communicates with the first electronic device, for example, the second electronic device sends a fourth message to the first electronic device, where the fourth message includes the first identifier; the first identifier is used for indicating that the receiving party is the first electronic equipment. The third electronic device may determine that the communication between the second electronic device and the third electronic device is ended when receiving the fourth message, and the third electronic device may set the first pin and the second pin of the third electronic device to a state of receiving the message.
In a possible scenario, when the second electronic device determines that the transceiving pin of the third electronic device needs to be switched, a fifth message may be sent to the third electronic device through the second pin, and a receiver of the fifth message is the third electronic device. The fifth message may be an instruction for instructing the third electronic device to switch the transceiving state of the pin. Therefore, when the third electronic device receives the fifth message through the second pin, the second pin can be set to be in a message receiving state and the first pin can be set to be in a message sending state, so that the receiving and sending states of the first pin and the second pin can be switched.
In another possible switching scenario, the third electronic device receives a fifth message sent by the first electronic device through the first pin, and the third electronic device also receives a third message sent by the second electronic device through the second pin; at this time, the third electronic device may determine to set the transceiving states of the first pin and the second pin according to the priorities 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, that is, the third electronic device may set the second pin to be in a state of receiving a message and the first pin to be in a state of sending a message according to the received fifth message sent by the first electronic device.
For example, in FIG. 9b, a third electronic device may receive data on D-and transmit data on D +. In other embodiments, the third electronic device may further switch the communication mode of the third electronic device through the controller of the third electronic device. For example, the communication mode may be switched by setting a switch to switch a data transmission pin of the third electronic device to a D + line and a data reception pin of the third electronic device to a D-line, so as to switch the communication mode of the third electronic device to receive data on the D-line and transmit data on the D + line. In fig. 9c, the third electronic device receives data on D + and transmits data on D-. In other embodiments, the third electronic device may further switch the communication mode of the third electronic device through the controller of the third electronic device. For example, the communication mode may be switched by setting a switch to switch a data transmission pin of the third electronic device to a D-line and a data reception pin of the third electronic device to a D + line, so as to switch the communication mode of the third electronic device to receive data at D + and transmit data at D-. In fig. 9D, the third electronic device may implement 2 transceiver modes switching by providing 2 data receiving modules RX1 and RX2 and 2 data transmitting modules TX1 and TX2, for example, the third electronic device may be configured to receive data on D + and transmit data on D-through the receiving module RX1 and the transmitting module TX 1. The setting may be performed by determining the D-data signal line as a received line after the D-receiving control command, and accordingly setting the receiving module RX1 to be enabled and the transmitting module TX1 to be enabled accordingly. It may also be arranged to receive data on D + and to transmit data on D + via the receiving module RX2 and the transmitting module TX 2. The setting may be performed by determining D + as a data signal line as a receiving line after D + receives the control command, and accordingly setting the receiving module RX2 to be enabled and the transmitting module TX2 to be enabled accordingly. (the switching manner may be, for example, a switch as shown in fig. 9d to implement switching, but may also be implemented by other manners, which is not limited herein).
In step 902a, in conjunction with mode a1 or b1, as shown in fig. 9e (a), the first electronic device sends a logic "0" signal by pulling the first data signal line low, indicating the beginning of the character transmission. After the data transmission is completed, a logic "1" signal is sent to indicate that the transmission is finished.
In some embodiments, the first electronic device may set the first data signal line to a high level when the first data signal line is in an idle state, and set a time (for example, a time of one data bit) corresponding to a start field of the first data signal line to be pulled down as the start field of the first message after confirming that the first message starts to be transmitted (the transmission instruction is received) to start communication. And then, sequentially sending the data in the first message from the low order to the high order, and sending the end field of the first message after the data in the first message is sent. In some embodiments, the end field may be a time (e.g., one data bit time) corresponding to pulling up the end field of the first data signal line to determine that one data frame in the first message is sent.
In step 902a, in conjunction with mode a2 or b2, as shown in fig. 9e (b), the first electronic device sends a logic "0" signal by pulling the first data signal line high, indicating the beginning of the character transmission. After the data transmission is completed, the end of the transmission is indicated by sending a logic "1" signal.
In some embodiments, the first electronic device may be configured to pull up the first data signal line to 0V for a time (e.g., a time of one data bit) corresponding to the start field as the start field of the first message after confirming the start of sending the first message (receiving the sending command) when the first data signal line is in the idle state, and the first data signal line is at a low level (e.g., -3.3V) to start communication. And then, sequentially sending the data in the first message from the low order to the high order, and sending the end field of the first message after the data in the first message is sent. In some embodiments, the end field may be a time (e.g., one data bit time) corresponding to pulling down the end field of the first data signal line to determine that one data frame in the first message is sent.
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 may be considered that the current first message transmission is completed, and when the first message includes a plurality of data frames, each data frame in the first message may be sequentially transmitted until each data frame in the first message is completely transmitted.
In step 902b, in combination with manner a1 or b1, in some embodiments, the first electronic device may determine that there is data transmission when the second data signal line is in an idle state, may determine to start receiving the second message, and may sequentially receive a frame data frame in the second message from a lower bit to a higher bit, and after it is determined that data in a preset field is received, determine that the second data signal line is at a high level, thereby determining that receiving of one data frame is completed.
In step 902b, in combination with the manner a2 or b2, when the second data signal line is in an idle state, the first electronic device may determine that there is data transmission when a rising edge of the second data signal line is detected, may determine to start receiving the second message, and may sequentially receive one frame of data frames in the second message from a low bit to a high bit, and after it is determined that the data in the preset field is completely received, determine that the second data signal line is at a low level, thereby determining that the receiving of one data frame is completed.
In some embodiments, the first message, comprises at least one data frame; the data frame is any one of: data packet header information, data information, control information and cyclic redundancy check; wherein one data frame includes: a start field, a data field, and an end field.
As shown in fig. 9f, the structure of one data frame may include a start field (labeled S in the figure), a data field, and an end field (labeled E in the figure). The interval between different data is denoted I. For example, in a data link, a frame of data includes 10 bits (1 bit start field +8bit data field +1bit end field), and at the protocol layer, a data may include a plurality of 10bit data frames according to different information commands.
For example, the control command may include 5 data frames as shown in (a) of fig. 9 f. The data field of the 1 st data frame is a communication frequency (training) field, the data field of the 2 nd data frame is a high-order header field (i.e., header information), the data field of the 3 rd data frame is a low-order header field (i.e., header information), the data field of the 4 th data frame is a control command field (i.e., control information), and the data field of the 5 th data frame is a CRC check field (i.e., CRC information).
The data command may include 4+ N data frames as shown in (b) of FIG. 9 f. The data field of the 1 st data frame is a communication frequency field, the data field of the 2 nd data frame is a high-order message header field, the data field of the 3 rd data frame is a low-order message header field, the data fields of the 4 th data frame to the 3+ n data frame are data fields (i.e., data information), and the data field of the 4+ n data frame is a CRC check field.
The data may also be a custom command, which may include 6+ N frames of data, as shown in FIG. 9f (c), for example. The data field of the 1 st data frame is a communication frequency field, the data field of the 2 nd data frame is a high-order message header field, the data field of the 3 rd data frame is a low-order message header field, the data field of the 4 th data frame is a high-order manufacturer information field, the data field of the 5 th data frame is a low-order manufacturer information field, the data fields of the 6 th to 5+ N data frames are data fields, and the data field of the 6+ N data frame is a CRC (cyclic redundancy check) field.
The format of the command field is only an example, and the data packet may also have data frames corresponding to other fields, which is not described herein again.
Based on the above-mentioned problem 2, it is considered that in the prior art, data transmission is performed on the D-bus at a fixed communication frequency, and when there is interference in data transmission, the robustness of data transmission is low and the communication performance is poor. In connection with the embodiment in fig. 9a, the first electronic device may select a desired communication frequency according to actual requirements. As shown in fig. 10a, a method of configuring a communication frequency between a first electronic device and a second electronic device is described in detail below. The method specifically comprises the following steps:
Step 1001a: and the first electronic equipment sends a first message after sending a first signal through the first pin.
The frequency of the first signal is a first frequency.
The first frequency may be determined by the transmitted first signal. For example, as shown in fig. 10b, the first signal may be 0xAA or 0x55 data transmitted on the D-channel, and the communication frequency of the first signal is determined by receiving the 0xAA or 0x55 data; after the data, a level pulse may be further included as an end bit of the first signal.
Step 1002a: and after the second electronic equipment or the third electronic equipment receives the first signal through the first pin, the first message is received.
And determining the communication frequency of the second message as the frequency of the second signal through the first signal.
Step 1001b: and after the second electronic equipment or the third electronic equipment sends the second signal through the second pin, sending a second message.
And determining the communication frequency of the second message as the frequency of the second signal through the second signal.
Step 1002b: and the first electronic equipment receives a second message after receiving the second signal through the second pin.
And determining the communication frequency of the second message as the frequency of the second signal through the second signal.
By the method, the first electronic device can send the first signal, and after the second electronic device and the third electronic device receive the first signal, the first electronic device determines to perform communication at the first frequency of the first signal.
Problem 3, consider that in the prior art, only peer-to-peer communication between a first electronic device and a second electronic device can be supported on a D-line, communication between multiple devices cannot be supported, and a scenario that the first electronic device, the second electronic device, and a third electronic device need to communicate when the third electronic device is still present in a system cannot be adapted.
Based on the above problem, in the embodiment of the present application, different identifiers of electronic devices may be defined, and when the first message or the second message is sent, the identifier of the corresponding electronic device may be carried, so as to implement data transmission between multiple devices.
It is considered that in this embodiment, taking the first electronic device as an example, the first message is transmitted through the first data signal line, and the second message is received through the second data signal line. Therefore, only the first message and the second message need to carry the identification of the receiving party to distinguish the plurality of electronic devices of the possible receiving party.
In some embodiments, the identity of the different electronic devices may be represented by role-coding information. The role coding information can be carried by physical header information.
In one possible implementation, the first message includes: a first identifier; the first identification is used for indicating a receiver of the first message; the second message includes: a second identifier; the second identification is used for indicating a receiver of the second message; the receiver of the first message is any one of the following: a second electronic device, a third electronic device.
For example, a Role Code (Role Code) may consist of 4 bits of data, with the upper 2 bits identifying the Role of the recipient of the data, or the lower 2 bits identifying the Role of the recipient of the data.
For example, the high 2 bits identify the role of data receiver, in the data packet, the first field is the header information,
the identifier of the data receiver may be carried in the header information of the data packet. For example, as shown in table 4.
TABLE 4
Character encoding Bit Description
7:6 Data receiver identification
Value Description
First mark 01 Send to the second electronic device
First mark 10 Send to a third electronic device
Second identification 11 Send to the first electronic device
In the case of problem 4, it is considered that in the prior art, the communication mode is performed in accordance with a mode in which the master device answers 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 perform active communication. That is, only after the first electronic device sends a message to the second electronic device, the second electronic device feeds back a corresponding message, and in a scenario where the second electronic device needs to actively report related information, such as an abnormality, the first electronic device may not be notified in time, which may cause a problem that the charging of the first electronic device is abnormal, or even a corresponding device of the first electronic device is damaged.
Based on problem 4, in connection with the embodiment in fig. 9a, the slave device is allowed to actively send a message. Data transmission is realized among a plurality of electronic devices through D + or D-, and the data transmission is used for sending commands among the devices, reporting and acquiring information. Consider the problem of sharing the first data signal line between multiple electronic devices to send messages. The data transmission between the third electronic device and the first electronic device may be performed first, and after it is determined 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 started. With reference to fig. 11a, a manner in which the first electronic device actively initiates acquiring the configuration information of the third electronic device is taken as an example for description. For the manner in which the second electronic device actively initiates to acquire the configuration information of the third electronic device, reference may be made to this embodiment, and details are not described herein again.
Step 1101: and after the handshake detection is finished, the first electronic equipment sends a detection instruction to the third electronic equipment.
It should be noted that the detection instruction sent by the first electronic device to the third electronic device may be the third message described above, so as to implement setting of the pin of the third electronic device, and may also be used to obtain configuration information of the third electronic device, and specific contents may refer to the above, and are not described herein again. In the manner that the second electronic device actively initiates acquiring the configuration information of the third electronic device, the detection instruction (third message) sent by the second electronic device to the third electronic device after the handshake detection is completed may be used.
Step 1102: the counter is reset.
Step 1103: the first electronic device determines whether a third electronic device exists, if not, step 1112 is executed, and if so, step 1104 is executed;
step 1104: the first electronic device and the third electronic device start communication according to a set flow, and the second electronic device prohibits active communication initiation in the process.
For example, the first electronic device sends a third message to the third electronic device; the third message is used for acquiring configuration information of the point electronic equipment. Correspondingly, the first electronic device receives a third response message from the third electronic device through the second pin, where the third response message is used to indicate the configuration information of the third electronic device.
Step 1105: the first electronic device determining whether communication between the first electronic device and the third electronic device is completed; if yes, go to step 1108; if not, go to step 1106;
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, step 1107 is executed; if not, go to step 1104;
step 1107: judging whether the counter is larger than a preset threshold (for example, the preset threshold is 3); if yes, go to step 1108; if not, go to step 1109;
Step 1108: and the first electronic equipment judges whether the configuration information of the third electronic equipment is successfully acquired. If yes, go to step 1112; if not, go to step 1110;
step 1109: the count of the counter is incremented.
By means of the counter, it can be guaranteed that communication between the first electronic device and the third electronic device is completed within the number of times of the preset threshold value and within the preset time, and then communication between the first electronic device and the second electronic device is conducted.
Step 1110: the first electronic device sends an indication message to the second electronic device.
Optionally, the first electronic device may send a reset message to the third electronic device before initiating communication with the second electronic device; the reset message is used for indicating that the first pin of the third electronic device and the second pin of the third electronic device are in a state of receiving messages. Thereby, the third electronic device is caused to determine to stop communication with the first electronic device.
The first electronic equipment sends an indication message to the second electronic equipment; the indication message is used for indicating the second electronic device to acquire the configuration information of the third electronic device. Thus, the second electronic device may communicate with the third electronic device, thereby obtaining configuration information of the third electronic device through the second electronic device.
It should be noted that, the manner in which the second electronic device can communicate with the third electronic device may 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-1112, and details are not repeated here.
Step 1111: after the second electronic device requests to obtain the configuration information of the third electronic device in communication with the third electronic device, the second electronic device may send a notification message of the third electronic device to the first electronic device.
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: configuration information of the third electronic device. Optionally, the notification message may be further configured to indicate that the second electronic device is notified that the obtaining of the configuration information of the third electronic device is successful.
In another possible scenario, the second electronic device does not successfully obtain the configuration information of the third electronic device, and at this time, the notification message may be used to indicate that the second electronic device is notified that the obtaining of the configuration information of the third electronic device fails.
Accordingly, the first electronic device obtains the configuration information of the third electronic device by receiving the second electronic device, thereby determining whether to adopt the configuration information of the third electronic device for the charging configuration.
Step 1112: the first electronic device initiates communication with the second electronic device.
Considering that when the first data signal line or the second data signal line is abnormal, for example, when a large current is charged, 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 capturing the second electronic device, at this time, the second electronic device may detect the pulling-out action of the third electronic device within a microsecond-level time, quickly close the output path of the energy, and stop the charging mode of the quick charging. Accordingly, the data transmission mode also needs to be restored to the data transmission mode in the normal charging mode. In the embodiment of the application, the reset signal can be sent by the first electronic device, so that the reset of the communication modes of the second electronic device and the third electronic device can be realized.
As shown in fig. 11b, a timing diagram of the second reset signal transmitted at the first electronic device. The first electronic equipment can send a second reset signal through the first pin; the second reset signal is used for indicating a receiver of the second reset signal to reset; the pulse width of the second reset signal has a relationship with the receiver.
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 for a preset time. For example, the preset time corresponding to the second electronic device may be 1ms. The preset time may be a time length much longer than the data signal or the time window occupied by the present application.
And after the second electronic equipment receives the second reset signal, the second electronic equipment restores the state of the second electronic equipment to the default state according to the reset protocol. And after the third electronic equipment receives the second reset signal, the third electronic equipment restores the state of the third electronic equipment to the default state according to the reset protocol.
When the power supply equipment executes the reset command, if the last command sequence is running, the reset command is issued only after the last command sequence is finished. The pulse width of the second reset signal may be different for the second electronic device or the third electronic device, 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 manner, the second reset signal may also be determined according to the current communication frequency, for example, the time length of the second reset signal of the first electronic device may be N cycles (the cycle T corresponding to the communication frequency f between the first electronic device and the second electronic device) and is not limited herein.
In order to improve the data transmission quality on the communication link, in the embodiment of the present application, the data packet may further include communication data error check. The method may refer to the data error checking method in the above embodiments, and details are not repeated herein.
As shown in fig. 12, based on the same concept, an electronic device 1200 according to an embodiment of the present application as shown in fig. 12 includes: a processing module 1210 and a transceiver module 1220.
In one possible embodiment, electronic device 1200 may be a first electronic device. The electronic device 1200 is connected to the second electronic device through a third electronic device including a first data signal line and a second data signal line.
The processing module 1210 is configured to detect, through the transceiver module 1220, a connection with the second electronic device; a processing module 1210, configured to send a first message through a first pin of the transceiver module 1220; the first pin is connected with a first data signal line; receiving a second message through a second pin of the transceiving module 1220; the second pin is connected with a second data signal line; the first message and the second message are used for setting charging of the first electronic device.
In a possible implementation manner, the first pin is a pin connected to a negative signal data line; the second pin is connected with a positive signal data line.
In a possible implementation manner, the first pin is a pin connected to a positive signal data line; the second pin is connected with the negative signal data line.
In a possible implementation manner, the processing module 1210 is configured to detect, through the first pin or the second pin, a connection with a second electronic device, and determine that the second electronic device is a DCP device with a dedicated charging interface; transmitting a first pulse signal through the first pin of the transceiving module 1220; and detecting an electric signal of the second electronic equipment through the second pin to confirm that the second electronic equipment supports a quick charging mode.
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;
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.
In one possible implementation, the first message includes: a first identifier; the first identification is used for indicating a receiver of the first message; the second message includes: a second identifier; the second identification is used for indicating a receiver of the second message.
In a possible implementation manner, a receiver of the first message is a chip of the third electronic device, and a receiver of the second message is the first electronic device;
in a possible implementation manner, the receiver of the first message is the second electronic device; and the receiver of the second message is the first electronic equipment.
In a possible implementation manner, the processing module 1210 is configured to, before sending the first message through the first pin of the transceiving module 1220, further send a first signal through the first pin; the frequency of the first signal is a first frequency; the first signal is used for indicating that the frequency of the first message is the first frequency.
In a possible implementation manner, the processing module 1210 is configured to receive a second signal through the second pin of the transceiver module 1220; the frequency of the second signal is a second frequency; the second signal is used for indicating that the frequency of the second message is the second frequency.
In one possible implementation, the first message includes at least one data frame; the data frame is any one of: data packet header information, data information, control information and cyclic redundancy check; wherein one data frame includes: a start field, a data field, and an end field.
In a possible implementation manner, the data packet header information includes the first identifier.
In a possible implementation manner, the processing module 1210 is configured to send a start signal before sending the first message through the first pin of the transceiving module 1220; the starting signal is a high level signal; the starting signal is a low level signal; the processing module 1210 is configured to send a termination signal after sending the first message through the first pin of the transceiver module 1220; the ending signal is a low level signal;
or, the processing module 1210 is configured to send a start signal before sending the first message through the first pin of the transceiver module 1220; the starting signal is a low level signal; the processing module 1210 is configured to send a termination signal after sending the first message through the first pin of the transceiver module 1220; the end signal is a high level signal.
In a possible implementation manner, the processing module 1210 is configured to receive a start signal before receiving the second message through the second pin of the transceiver module 1220; the starting signal is a high level signal; the processing module 1210 is configured to receive a second message through a second pin of the transceiver module 1220, and then receive an end signal; the ending signal is a low level signal;
Or, the processing module 1210 is configured to receive a start signal before receiving the second message through the second pin of the transceiving module 1220; the starting signal is a low level signal; the processing module 1210 is configured to receive a second message through a second pin of the transceiver module 1220, and then receive an end signal; the end signal is a high level signal.
In a possible implementation manner, the processing module 1210 is configured to send a first reset signal through a first pin of the transceiver module 1220; the first reset signal is used for indicating a receiver of the first reset signal to reset; the pulse width of the first reset signal has a correlation with a receiver.
In one possible embodiment, electronic device 1200 may be a first electronic device.
In one possible implementation manner, the processing module 1210 is configured to determine that the second pin is in a message receiving state and the first pin is in a message sending state; the first pin is connected with the first data signal line; the second pin is connected with the second data signal line; sending a third message 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 to indicate, by the first electronic device, a transceiving state of a pin switched by the third electronic device.
In a possible implementation manner, the processing module 1210 is configured 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 the message and the first pin is in a state of sending the message; or, a message is sent to the second electronic device through the first pin of the transceiver module 1220, and the state that the second pin receives the message and the state that the first pin sends the message are determined.
In a possible implementation manner, the processing module 1210 is configured to receive a third response message from the third electronic device through the second pin of the transceiving module 1220, where the third response message is used to indicate configuration information of the third electronic device.
In one possible implementation, the third message includes: a third identifier; the third identifier is used to indicate that the receiver of the third message is the third electronic device.
In a possible implementation manner, the processing module 1210 is configured to send, by the transceiver module 1220, an indication message to the second electronic device when it is determined that the configuration information of the third electronic device is failed to be received; the indication message is used for indicating the second electronic device to acquire the configuration information of the third electronic device.
In a possible implementation manner, the processing module 1210 is configured to receive a notification message from the second electronic device through the transceiving module 1220; the notification message is used for notifying the second electronic device that the acquisition of the configuration information of the third electronic device fails.
In a possible implementation manner, the processing module 1210 is configured to determine that communication with the third electronic device is ended when a fourth message from the second electronic device is received through the second pin of the transceiving module 1220.
In a possible implementation manner, the processing module 1210 is configured to send a reset message to the third electronic device through a first pin of the transceiver module 1220; the reset message is used for indicating that the first pin of the third electronic device and the second pin of the third electronic device are in a state of receiving messages.
In one possible implementation manner, the processing module 1210 is configured to determine that a first pin is in a message receiving state and a second pin is in a message sending state; sending a fifth message to the third electronic device through a second pin of the transceiving module 1220; the fifth message is used for acquiring configuration information of the third electronic equipment; receiving a fifth response message from the third electronic device through the first pin of the transceiving module 1220; the fifth response message is used for indicating the configuration information of the third electronic device.
In a possible implementation manner, the first pin is a pin connected to a negative signal data line; the second pin is connected with the positive signal data line; or the first pin is a pin connected with a positive signal data line; the second pin is connected with the negative signal data line.
In one possible embodiment, electronic device 1200 may be a first electronic device. The processing module 1210 is configured to detect a connection with the second electronic device through the transceiver module 1220; transmitting a first message through a first pin of the transceiving module 1220; or, receiving a second message through the first pin; wherein the first message and the second message are messages encoded by Manchester; the first pin is connected with a first data signal line; the first message and the second message are used for setting charging of the first electronic device.
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 with a positive signal data line.
In a possible implementation manner, the processing module 1210 is configured to detect, through the first pin and the second pin of the transceiving module 1220, a connection with a second electronic device, and determine that the second electronic device is a DCP device with a proprietary charging interface; the processing module 1210 is configured to send a first pulse signal through the first pin of the transceiver module 1220; the processing module 1210 is configured to detect an electrical signal of the second electronic device through the second pin of the transceiver module 1220, and determine whether to charge the battery of the first electronic device through a fast charging mode.
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;
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.
In one possible implementation, the first message includes: a first identifier; the first identification is used for indicating a receiver of the first message and a sender of the first message; the second message includes: a second identifier; the second identification is used for indicating a receiver of the second message and a sender of the second message; the receiver of the first message or the sender of the second message is any one of: the second electronic device, the third electronic device.
In a possible implementation manner, the processing module 1210 is configured to send a first signal through the first pin of the transceiver module 1220; the frequency of the first signal is a first frequency; the first signal is used for negotiating that the communication frequency is the first frequency.
In a possible implementation manner, the processing module 1210 is configured to receive a second signal through the first pin of the transceiver module 1220; the frequency of the second signal is a first frequency; the second signal is used to determine that the communication frequency is the first frequency.
In one possible implementation, the frequency of the first message and the second message is the first frequency.
In one possible implementation, the first message includes at least one data frame; the data frame is any one of: data packet header information, data information, control information and cyclic redundancy check; wherein one data frame includes: a start field, a data field, and an end field.
In a possible implementation manner, the processing module 1210 is configured to, after sending the first message through the first pin of the transceiver module 1220, further configured to, within a first time window, use the first data signal line for the first electronic device to receive the message.
In a possible implementation manner, the processing module 1210 is configured to determine, after receiving the second message through the first pin of the transceiving module 1220, that the first data signal line is used for the first electronic device to receive the message in a second time window.
In a possible implementation manner, the processing module 1210 is configured to, after receiving a second message through the first pin of the transceiver module 1220, determine that the current time exceeds the second time window, and then the first data signal line is used by the first electronic device to send a message.
In a possible implementation manner, the processing module 1210 is configured to send a first reset signal through a first pin of the transceiver module 1220; the first reset signal is used for indicating a receiver of the first reset signal to reset; the pulse width of the first reset signal has a correlation with a receiver.
In one possible embodiment, electronic device 1200 may be a second electronic device. The second electronic device is connected with the first electronic device through a third electronic device, and the third electronic device comprises a first data signal line and a second data signal line.
In a possible implementation manner, the processing module 1210 is configured to determine, through the transceiving module 1220, a connection with the first electronic device; the processing module 1210 is configured to receive a first message through a first pin of the transceiver module 1220; the first pin is connected with a first data signal line; the processing module 1210 is configured to send a second message through a second pin of the transceiver module 1220; the second pin is connected with a second data signal line; the first message and the second message are used to set charging of a first electronic device.
In a possible implementation manner, the first pin is a pin connected to a negative signal data line; the second pin is connected with a positive signal data line.
In a possible implementation manner, the first pin is a pin connected to a positive signal data line; the second pin is connected with the negative signal data line.
In a possible implementation manner, the processing module 1210 is configured to receive, through the first pin or the second pin of the transceiver module 1220, a detection from the first electronic device, where the detection is used by the first electronic device to determine that the second electronic device is a DCP device with a dedicated charging interface;
the processing module 1210 is configured to receive a first pulse signal from the first electronic device through a first pin of the transceiver module 1220; the processing module 1210 is configured to send an electrical signal to the first electronic device through the second pin of the transceiver module 1220, and confirm that the battery of the first electronic device is charged through the fast charging mode.
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; the second pin is connected with the negative signal data line, and the electric signal is a low level signal.
In one possible implementation, the first message includes: a first identifier; the first identification is used for indicating a receiver of the first message; the second message includes: a second identifier; the second identifier is used for indicating a receiver of the second message.
In a possible implementation manner, a receiver of the first message is the second electronic device; and the receiver of the second message is the first electronic equipment.
In a possible implementation manner, when the receiver of the first message is the chip of the third electronic device, the second message is not sent to the first electronic device.
In a possible implementation manner, the processing module 1210 is configured to, before sending the second message through the second pin of the transceiver module 1220, send a second signal through the second pin; the frequency of the second signal is a second frequency; the second signal is used for indicating that the frequency of the second message is the second frequency.
In a possible implementation manner, the processing module 1210 is configured to receive a first signal through the first pin of the transceiver module 1220; the frequency of the first signal is a first frequency; the first signal is used for indicating that the frequency of the first message is the first frequency.
In one possible implementation, the first message includes at least one data frame; the data frame is any one of: data packet header information, data information, control information and cyclic redundancy check; wherein one data frame includes: a start field, a data field, and an end field.
In a possible implementation manner, the processing module 1210 is configured to send a start signal before sending the second message through the second pin of the transceiver module 1220; the starting signal is a low level signal; the processing module 1210 is configured to send a second message through the second pin of the transceiver module 1220, and then is further configured to send an end signal; the end signal is a high level signal.
In a possible implementation manner, the processing module 1210 is configured to receive a start signal before receiving the first message through the first pin of the transceiver module 1220; the starting signal is a low level signal; the processing module 1210 is configured 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.
In a possible implementation manner, the processing module 1210 is configured to receive a first reset signal through the first pin of the transceiver module 1220; the pulse width of the first reset signal is in a relationship with the second electronic device;
the processing module 1210 is configured to reset the second electronic device according to the first reset signal.
In a possible implementation manner, the processing module 1210 is configured to receive a second reset signal through the first pin of the transceiver module 1220; the pulse width of the second reset signal is related to the third electronic device; the processing module 1210 is further configured to ignore the second reset signal.
In one possible embodiment, electronic device 1200 may be a second electronic device.
The processing module 1210 is configured to determine that the first pin is in a message receiving state and the second pin is in a message sending state; the first pin is connected with the first data signal line; the second pin is connected with the second data signal line; the processing module 1210 is configured to send a third message to the third electronic device through a 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 to indicate, by the second electronic device, a transceiving state of a pin switched by the third electronic device.
In a possible implementation manner, the processing module 1210 is configured to receive a message from the first electronic device through a first pin of the transceiver module 1220, and determine that the first pin is in a state of receiving the message and the second pin is in a state of sending the message; or, the processing module 1210 is configured to send a message to the first electronic device through a second pin of the transceiver module 1220, and determine that the first pin is in a message receiving state and the second pin is in a message sending state.
In a possible implementation manner, the processing module 1210 is configured to receive a third response message from the third electronic device through the first pin of the transceiving module 1220, where the third response message is used to indicate configuration information of the third electronic device.
In one possible implementation, the third message includes: a third identifier; the third identifier is used to indicate that the receiver of the third message is the third electronic device.
In a possible implementation manner, the processing module 1210 is configured 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 is failed to be received; the notification message is used for notifying the second electronic device that the acquisition of the configuration information of the third electronic device fails.
In a possible implementation manner, the processing module 1210 is configured to receive, before sending the third message to the third electronic device through the first pin of the transceiving module 1220, an indication message from the first electronic device through the second pin of the transceiving module 1220; the indication message is used for indicating the second electronic device to acquire the configuration information of the third electronic device.
In a possible implementation manner, the processing module 1210 is configured to determine that communication with the third electronic device is ended when a fourth message from the first electronic device is received through the second pin of the transceiving module 1220.
In a possible implementation manner, the processing module 1210 is configured to send a reset message to the third electronic device through a first pin of the transceiver module 1220; the reset message is used for indicating that the first pin of the third electronic device and the second pin of the third electronic device are in a state of receiving messages.
In a possible implementation manner, the processing module 1210 is configured to determine that the second pin is in a message receiving state and the first pin is in a message sending state; the processing module 1210 is configured to send a fifth message to the third electronic device through the second pin of the transceiving module 1220; the fifth message is used for acquiring configuration information of the third electronic equipment; the processing module 1210 is configured to receive a fifth response message from the third electronic device through a second pin of the transceiver module 1220; the fifth response message is used for indicating the configuration information of the third electronic device.
In a possible implementation manner, the first pin is a pin connected to a negative signal data line; the second pin is connected with the positive signal data line; or the first pin is a pin connected with a positive signal data line; the second pin is connected with the negative signal data line.
In one possible embodiment, electronic device 1200 may be a second electronic device. The processing module 1210 is configured to determine, through the transceiving module 1220, a connection with the first electronic device; transmitting a second message through a first pin of the transceiving module 1220; alternatively, the first message is received through the first pin of the transceiver module 1220; the first pin is connected with a first data signal line; wherein the first message and the second message are messages encoded by Manchester; the first message and the second message are used for setting charging of the first electronic device.
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 with a positive signal data line.
In a possible implementation manner, the processing module 1210 is configured to receive, through a first pin and a second pin of the transceiving module 1220, a detection from the first electronic device, where the detection is used by the first electronic device to determine that the second electronic device is a DCP device with a proprietary charging interface; receiving a first pulse signal from the first electronic device through the first pin; and sending an electric signal to the first electronic equipment through the second pin to confirm whether to charge the battery of the first electronic equipment in a quick charging mode.
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;
the second pin is connected with the negative signal data line, and the electric signal is a low level signal.
In one possible implementation, the first message includes: a first identifier; the first identification is used for indicating a receiver of the first message and a sender of the first message;
the second message includes: a second identifier; the second identification is used for indicating a receiver of the second message and a sender of the second message; the sender of the first message or the receiver of the second message is any one of: the first electronic device, the third electronic device.
In a possible implementation manner, 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; the first signal is used for negotiating that the communication frequency is the first frequency.
In a possible implementation manner, the processing module 1210 is configured to send a second signal through a first pin of the transceiver module 1220; the frequency of the second signal is a first frequency; the first signal is used to determine that the communication frequency is the first frequency.
In one possible implementation, the frequency of the first message and the second message is the first frequency.
In one possible implementation, the first message includes at least one data frame; the data frame is any one of: data packet header information, data information, control information and cyclic redundancy check; wherein one data frame includes: a start field, a data field, and an end field.
In a possible implementation manner, the processing module 1210 is configured to, after receiving a first message through a first pin of the transceiver module 1220, confirm that the first data signal line is used by the second electronic device or the third electronic device to send a message within a first time window.
In a possible implementation manner, the processing module 1210 is configured to, after sending the second message through the first pin of the transceiver module 1220, confirm that the first data signal line is used by the second electronic device or the third electronic device to send the message within a second time window.
In a possible implementation manner, the processing module 1210 is configured to, after sending a second message through the first pin of the transceiver module 1220, determine that the current time exceeds the second time window, and then use the first data signal line for the second electronic device or the third electronic device to receive the message.
In a possible implementation manner, the processing module 1210 is configured to receive a first reset signal through a first pin of the transceiver module 1220; the pulse width of the first reset signal is related to the second electronic equipment; and resetting the charging mode according to the first reset signal.
In a possible implementation manner, the processing module 1210 is configured to receive a second reset signal through a first pin of the transceiver module 1220; the pulse width of the second reset signal is related to the third electronic device; ignoring the second reset signal.
In one possible embodiment, electronic device 1200 may be a third electronic device. The third electronic device is used for connecting the second electronic device and the first electronic device, and the third electronic device comprises a first data signal line and a second data signal line.
In a possible implementation manner, the processing module 1210 is configured to receive a first message through a first pin of the transceiver module 1220; the first pin is connected with a first data signal line; a processing module 1210, configured to send a second message through a second pin of the transceiving module 1220; the second pin is connected with a second data signal line; the first message and the second message are used for setting charging of the first electronic device.
In a possible implementation manner, the first pin is a pin connected to a negative signal data line; the second pin is connected with the positive signal data line.
In a possible implementation manner, the first pin is a pin connected to a positive signal data line; the second pin is connected with the negative signal data line.
In one possible implementation, the first message includes: a first identifier; the first identification is used for indicating a receiver of the first message; the second message includes: a second identifier; the second identification is used for indicating a receiver of the second message.
In a possible implementation manner, the receiver of the first message is the third electronic device; and the receiver of the second message is the first electronic equipment.
In a possible implementation manner, when the receiver of the first message is the second electronic device, the processing module 1210 is configured to determine not to send the second message to the first electronic device.
In a possible implementation manner, 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; the first signal is used for indicating that the frequency of the first message is the first frequency;
The processing module 1210 is configured to send a first signal through a second pin of the transceiver module 1220 before sending a second message through the second pin; the frequency of the first signal is a second frequency; the first signal is used for indicating that the frequency of the first message is the second frequency.
In a possible implementation manner, the first message includes at least one data frame; the data frame is any one of: data packet header information, data information, control information and cyclic redundancy check; wherein one data frame includes: a start field, a data field, and an end field.
In a possible implementation manner, the processing module 1210 is configured to send a start signal through a second pin of the transceiving module 1220 before sending the second message through the second pin; the starting signal is a high level signal; the processing module 1210 is configured to send a second message through a second pin of the transceiver module 1220, and then send an end signal; the ending signal is a low level signal;
or, the processing module 1210 is configured to send a start signal before sending the second message through the second pin of the transceiver module 1220; the starting signal is a low level signal; the processing module 1210 is configured to send a second message through a second pin of the transceiver module 1220, and then send an end signal; the end signal is a high level signal.
In a possible implementation manner, the processing module 1210 is configured to receive a start signal before receiving the first message through the first pin of the transceiving module 1220; the starting signal is a high level signal; the processing module 1210 is configured to receive an end signal after receiving the first message through the first pin of the transceiver module 1220; the ending signal is a low level signal;
or, the processing module 1210 is configured to receive a start signal before receiving the first message through the first pin of the transceiver module 1220; the starting signal is a low level signal; the processing module 1210 is configured 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.
In a possible implementation manner, the processing module 1210 is configured to receive a second reset signal through a first pin of the transceiver module 1220; the pulse width of the second reset signal is related to the third electronic device; and resetting according to the second reset signal.
In a possible implementation manner, the processing module 1210 is configured to receive a first reset signal through the first pin of the transceiver module 1220; the pulse width of the first reset signal is related to the second electronic equipment; a processing module 1210 configured to ignore the first reset signal.
In one possible embodiment, electronic device 1200 may be a third electronic device. The electronic device 1200 connects a first electronic device and a second electronic device, and the electronic device 1200 includes a first data signal line and a second data signal line.
In a possible implementation manner, the processing module 1210 is configured to send a second message through a first pin of the transceiver module 1220; alternatively, the first message is received through the first pin of the transceiver module 1220; the first pin is connected with a first data signal line; wherein the first message and the second message are messages encoded by Manchester; the first message and the second message are used for setting charging of the first electronic device.
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 with a positive signal data line.
In one possible implementation, the first message includes: a first identifier; the first identification is used for indicating a receiver of the first message and a sender of the first message;
the second message includes: a second identifier; the second identification is used for indicating a receiver of the second message and a sender of the second message; the sender of the first message or the receiver of the second message is any one of: the first electronic device, the third electronic device.
In one possible implementation, the frequency of the first message and the second message is the first frequency.
In one possible implementation, the first message includes at least one data frame; the data frame is any one of: data packet header information, data information, control information and cyclic redundancy check; wherein one data frame includes: a start field, a data field, and an end field.
In a possible implementation manner, the processing module 1210 is configured to, after receiving a first message through a first pin of the transceiver module 1220, further confirm that the first data signal line is used by the second electronic device or the third electronic device to send a message within a first time window.
In a possible implementation manner, the processing module 1210 is configured to, after sending the second message through the first pin of the transceiver module 1220, further confirm that the first data signal line is used by the second electronic device or the third electronic device to send the message within a second time window.
In a possible implementation manner, the processing module 1210 is configured to, after sending a second message through the first pin of the transceiver module 1220, determine that the current time exceeds the second time window, and then use the first data signal line for the third electronic device or the second electronic device to receive the message.
In a possible implementation manner, the processing module 1210 is configured to receive a first reset signal through a first pin of the transceiver module 1220; the pulse width of the first reset signal is related to the third electronic device; and resetting the charging mode according to the first reset signal.
In a possible implementation manner, the processing module 1210 is configured to receive, through the first pin of the transceiver module 1220, a second reset signal; the pulse width of the second reset signal is related to the second electronic device; ignoring the second reset signal.
In one possible embodiment, electronic device 1200 may be a third electronic device.
In a possible implementation manner, the processing module 1210 is configured to set a first pin of the transceiver module 1220 as a state of receiving a message when the first pin receives a third message, and set a second pin as a state of sending a message; the first pin is connected with the first data signal line; the second pin is connected with the second data signal line; the receiver of the third message is the third electronic device.
In a possible implementation manner, before the processing module 1210 is configured to receive the third message through the first pin of the transceiver module 1220, the first pin and the second pin are further set to be in a state of receiving the message.
In one possible implementation, the third message further includes: a third identifier; the third identifier is used to indicate that the receiver of the third message is the third electronic device.
In a possible implementation manner, the processing module 1210 is configured to set the first pin and the second pin to be in a state of receiving a message when receiving a fourth message through the first pin of the transceiving module 1220; wherein a receiver 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.
In a possible implementation manner, the processing module 1210 is configured to set a state that a second pin of the transceiver module 1220 receives a fifth message and a state that the first pin sends the message, when the second pin receives the fifth message; and the receiver of the fifth message is the third electronic equipment.
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.
In a possible implementation manner, 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 for the first electronic device or the second electronic device to indicate the transceiving state of the third electronic device switching pin.
In a possible implementation manner, the first pin is a pin connected to a negative signal data line; the second pin is connected with a positive signal data line; or the first pin is a pin connected with a positive signal data line; the second pin is connected with the negative signal data line.
In one possible embodiment, electronic device 1200 may be a third electronic device.
In a possible implementation manner, the processing module 1210 is configured to send a second message through a first pin of the transceiver module 1220; or, receiving a first message through the first pin; the first pin is connected with a first data signal line; wherein the first message and the second message are messages encoded by Manchester; the first message and the second message are used for setting charging of the first electronic device.
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 with a positive signal data line.
In one possible implementation, the first message includes: a first identifier; the first identification is used for indicating a receiver of the first message and a sender of the first message; the second message includes: a second identifier; the second identification is used for indicating a receiver of the second message and a sender of the second message; the sender of the first message or the receiver of the second message is any one of: the first electronic device, the third electronic device.
In one possible implementation, the frequency of the first message and the second message is the first frequency.
In one possible implementation, the first message includes at least one data frame; the data frame is any one of: data packet header information, data information, control information and cyclic redundancy check; wherein one data frame includes: a start field, a data field, and an end field.
In a possible implementation manner, after the processing module 1210 is configured to receive a first message through a first pin of the transceiver module 1220, within a first time window, the first data signal line is used for the second electronic device or the third electronic device to transmit a message.
In a possible implementation manner, after the processing module 1210 is configured to send the second message through the first pin of the transceiver module 1220, in a second time window, the first data signal line is used for the second electronic device or the third electronic device to send the message.
In a possible implementation manner, after the processing module 1210 is configured to send the second message through the first pin of the transceiver module 1220, the processing module 1210 is configured 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.
In a possible implementation manner, the processing module 1210 is configured to receive a second reset signal through a first pin of the transceiver module 1220; the pulse width of the second reset signal is related to the third electronic device; and resetting the charging mode according to the second reset signal.
In a possible implementation manner, the processing module 1210 is configured to receive a first reset signal through a first pin of the transceiver module 1220; the pulse width of the first reset signal is in a relationship with the second electronic device; ignoring the first reset signal.
Based on the same inventive concept, as shown in fig. 13, a schematic structural diagram of an electronic device provided in the present application is shown.
In one possible embodiment, the electronic device in fig. 13 may be a first electronic device. The first electronic device may include: a processor 1310 and a communication interface 1330. Processor 1310 may be a baseband processor, which 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 the first electronic device is a system on a chip, the communication interface 1330 may be an input/output interface of the system on a chip (for example, a baseband chip), and the processor may be a processor of the system on a chip and may include one or more central processing units. Optionally, a memory 1320 may also be included. Wherein 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 configured to perform operations of the first electronic device other than transceiving operations in the embodiments of the present application, and the communication interface 1330 is configured to perform transceiving operations of the first electronic device in the embodiments 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 configured to perform other operations of the first electronic device in the above embodiments except for the transceiving operation, and the communication interface 1330 is configured to perform the transceiving operation of the first electronic device in the embodiments of the present application.
In one possible embodiment, the electronic device in fig. 13 may be a second electronic device. The second electronic device may include: a processor 1310 and a communication interface 1330. Processor 1310 may be a baseband processor, which may include one or more Central Processing Units (CPUs). The second electronic device may also be a component having the functions of the second electronic device in the embodiment of the present application, for example, when the second electronic device is a system on a chip, the communication interface 1330 may be an input/output interface of the system on a chip (for example, a baseband chip), and the processor may be a processor of the system on a chip and may include one or more central processing units. Optionally, a memory 1320 may also be included. Wherein 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 configured to perform operations of the second electronic device other than transceiving operations in the embodiments of the present application, and the communication interface 1330 is configured to perform transceiving operations of the second electronic device in the embodiments 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 configured to perform other operations of the second electronic device in the above embodiments except the transceiving operation, and the communication interface 1330 is configured to perform the transceiving operation of the second electronic device in the embodiments of the present application.
In one possible embodiment, the electronic device in fig. 13 may be a third electronic device. The third electronic device may include: a processor 1310 and a communication interface 1330. Processor 1310 may be a baseband processor, which 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 the third electronic device is a system on a chip, the communication interface 1330 may be an input/output interface of the system on a chip (for example, a baseband chip), and the processor may be a processor of the system on a chip and may include one or more central processing units. Optionally, a memory 1320 may also be included. Where memory 1320 stores computer instructions or programs therein, processor 1310 may execute the computer instructions or programs stored in memory 1320. When the computer instructions or programs stored in the memory 1320 are executed, the processor 1310 is configured to perform operations of the third electronic device in the embodiment of the present application other than transceiving operations, and the communication interface 1330 is configured to perform transceiving operations 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 configured to perform other operations of the third electronic device in the above embodiments besides the transceiving operation, and the communication interface 1330 is configured to perform the transceiving operation of the third electronic device in the embodiments of the present application.
Embodiments of the present application also provide a computer storage medium for storing a computer program, which, when executed on a computer, causes the computer to perform the method as described in any one of the possible embodiments in fig. 4a to 4d, fig. 4a to 5c, fig. 6a to 6f, fig. 7, fig. 8a to 8e, fig. 9a to 9h, fig. 10a to 10b, and fig. 11 a.
Embodiments of the present application also provide a computer program product comprising instructions for storing a computer program, which, when run on a computer, causes the computer to perform the method described in any one of the possible embodiments in fig. 4 a-4 d, 4 a-5 c, 6 a-6 f, 7, 8 a-8 e, 9 a-9 h, 10 a-10 b, 11 a.
It should be understood that the processor mentioned in the embodiments of the present application may be a CPU, and may also be other general purpose processors, digital Signal Processors (DSPs), application Specific Integrated Circuits (ASICs), field Programmable Gate Arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
It will also be appreciated that the memory referred to in the embodiments of the application may be either volatile memory or nonvolatile memory, or may include both volatile and nonvolatile memory. The non-volatile memory may be a read-only memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically Erasable PROM (EEPROM), or a flash memory. Volatile memory can be Random Access Memory (RAM), which acts as external cache memory. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), synchronous Dynamic Random Access Memory (SDRAM), double data rate SDRAM, enhanced SDRAM, SLDRAM, synchronous Link DRAM (SLDRAM), and direct rambus RAM (DR RAM).
It should be noted that when the processor is a general-purpose processor, a DSP, an ASIC, an FPGA or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component, the memory (memory module) is integrated in the processor.
It should be noted that the memory described herein is intended to comprise, without being limited to, these and any other suitable types of memory.
It should be understood that, in the various embodiments of the present application, the sequence numbers of the above-mentioned processes do not mean the execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the technical solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
It can be clearly understood by those skilled in the art that, for convenience and simplicity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one position, or may be distributed on multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions may be stored in a computer-readable storage medium if they are implemented in the form of software functional units and sold or used as separate products. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a read-only memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above description is only for the specific implementation of the present application, but the scope of the embodiments of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the embodiments of the present application, and all the changes or substitutions should be covered by the scope of the embodiments of the present application. Therefore, the protection scope of the embodiments of the present application shall be subject to the protection scope of the claims.

Claims (28)

1. A data transmission method based on a charging cable is applied to first electronic equipment, the first electronic equipment is connected with second electronic equipment through third electronic equipment, the third electronic equipment comprises a first data signal line and a second data signal line, and the method comprises the following steps:
determining the state of the second pin for receiving the message and the state of the first pin for sending the message; the first pin is connected with the first data signal line; the second pin is connected with the second data signal line;
sending a third message 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 to indicate, by the first electronic device, a transceiving state of a pin switched by the third electronic device.
2. The method of claim 1, wherein determining the status of the second pin as receiving messages and the status of the first pin as sending messages comprises:
receiving a message from the second electronic device through the second pin, and determining that the second pin is in a message receiving state and the first pin is in a message sending state; or,
And sending a message to the second electronic equipment through the first pin, and determining that the second pin is in a message receiving state and the first pin is in a message sending state.
3. The method of claim 1, further comprising:
receiving a third response message from the third electronic device through a second pin, where the third response message is used to indicate configuration information of the third electronic device.
4. The method of any of claims 1-3, wherein the third message comprises: a third identification; the third identifier is used for indicating that a receiver of the third message is the third electronic device.
5. The method according to any of claims 1-3, wherein before sending the third message to the third electronic device via the first pin, further comprising:
sending an indication message to the second electronic device through the second pin; the indication message is used for indicating the second electronic device to acquire the configuration information of the third electronic device.
6. The method according to any one of claims 1 to 3, wherein the first data signal line is a negative signal data line, and the second data signal line is a positive signal data line; or,
The first data signal line is a positive signal data line, and the second data signal line is a negative signal data line.
7. The method according to any one of claims 1-3, wherein 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 cable.
8. The method of any of claims 1-3, wherein the first electronic device is in full duplex communication with the second electronic device via the third electronic device.
9. A data transmission method based on a charging cable is applied to a second electronic device, the second electronic device is connected with a first electronic device through a third electronic device, the third electronic device comprises a first data signal line and a second data signal line, and the method comprises the following steps:
determining that the first pin is in a message receiving state and the second pin is in a message sending state; the first pin is connected with the first data signal line; the second pin is connected with the second data signal line;
sending a third message 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 to indicate, by the second electronic device, a transceiving state of a pin switched by the third electronic device.
10. The method of claim 9, wherein determining that the first pin is in a message receiving state and the second pin is in a message sending state comprises:
receiving a message from the first electronic equipment through the first pin, and determining that the first pin is in a message receiving state and the second pin is in a message sending state; or,
and sending a message to the first electronic device through the second pin, and determining that the first pin is in a message receiving state and the second pin is in a message sending state.
11. The method of claim 9, further comprising:
receiving a third response message from the third electronic device through the first pin, wherein the third response message is used for indicating the configuration information of the third electronic device.
12. The method of any of claims 9-11, wherein the third message comprises: a third identifier; the third identifier is used to indicate that the receiver of the third message is the third electronic device.
13. The method according to any of claims 9-11, wherein before sending the third message to the third electronic device via the first pin, further comprising:
Receiving an indication message from the first electronic device through the second pin; the indication message is used for indicating the second electronic device to acquire the configuration information of the third electronic device.
14. The method according to any one of claims 9 to 11, wherein the first data signal line is a negative signal data line, and the second data signal line is a positive signal data line; or,
the first data signal line is a positive signal data line, and the second data signal line is a negative signal data line.
15. The method according to any one of claims 9-11, wherein 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 cable.
16. The method of any of claims 9-11, wherein the second electronic device is in full duplex communication with the first electronic device via the third electronic device.
17. A data transmission method based on a charging cable is applied to a third electronic device, the third electronic device is used for connecting a second electronic device and a first electronic device, the third electronic device comprises a first data signal line and a second data signal line, and the method comprises the following steps:
When a third message is received through the first pin, setting the first pin to be in a message receiving state, and setting the second pin to be in a message sending state; the first pin is connected with the first data signal line; the second pin is connected with the second data signal line; the receiver of the third message is the third electronic device.
18. The method of claim 17, wherein prior to receiving the third message over the first pin, further comprising:
the first pin and the second pin are in a state of receiving a message.
19. The method of claim 17, wherein the third message further comprises: a third identifier; the third identifier is used for indicating that a receiver of the third message is the third electronic device.
20. The method according to any one of claims 17-19, further comprising:
when a fourth message is received through the first pin, setting the first pin and the second pin to be in a message receiving state;
wherein a receiver 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.
21. The method of any one of claims 17-19, further comprising:
when a fifth message is received through the second pin, setting the second pin as a message receiving state and the first pin as a message sending state; and the receiver of the fifth message is the third electronic equipment.
22. The method according to any one of claims 17 to 19, wherein the first data signal line is a negative signal data line, and the second data signal line is a positive signal data line; or,
the first data signal line is a positive signal data line, and the second data signal line is a negative signal data line.
23. The method of any one of claims 17-19, wherein 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 cable.
24. A first electronic device, wherein the first electronic device comprises memory and one or more processors; wherein the memory is to store computer program code comprising computer instructions; the computer instructions, when executed by the processor, cause the first electronic device to perform the method of any of claims 1-8.
25. A second electronic device, wherein the second electronic device comprises memory and one or more processors; wherein the memory is configured to store computer program code comprising computer instructions; the computer instructions, when executed by the processor, cause the second electronic device to perform the method of any of claims 9-16.
26. A third electronic device, wherein the third electronic device comprises one or more processors and memory; wherein the memory is to store computer program code comprising computer instructions; the computer instructions, when executed by the processor, cause the third electronic device to perform the method of any of claims 17-23.
27. A data transmission system based on a charging cable, comprising a first electronic device according to claim 24, a second electronic device according to claim 25 and a third electronic device according to claim 26.
28. A computer readable storage medium, characterized in that the computer readable storage medium comprises program instructions which, when run on an electronic device, cause the electronic device to perform the method of any of claims 1 to 8, or cause the electronic device to perform the method of any of claims 9 to 16, or cause the electronic device to perform the method of any of claims 17 to 23.
CN202210012219.8A 2020-07-15 2021-07-15 Data transmission method based on charging cable and electronic equipment Active CN114297126B (en)

Applications Claiming Priority (10)

Application Number Priority Date Filing Date Title
CN2020106828942 2020-07-15
CN202010682894 2020-07-15
CN2020111676422 2020-10-27
CN202011167642 2020-10-27
CN202011175402.7A CN113949116A (en) 2020-07-15 2020-10-28 Data transmission method and device
CN2020111754027 2020-10-28
CN2020116147497 2020-12-30
CN202011614749.7A CN114490491A (en) 2020-10-27 2020-12-30 Data transmission method and device based on charging cable
PCT/CN2021/106599 WO2022012644A1 (en) 2020-07-15 2021-07-15 Data transmission method employing charging cable, and electronic devices
CN202180003825.7A CN114631244A (en) 2020-07-15 2021-07-15 Data transmission method based on charging cable and electronic equipment

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
CN202180003825.7A Division CN114631244A (en) 2020-07-15 2021-07-15 Data transmission method based on charging cable and electronic equipment

Publications (2)

Publication Number Publication Date
CN114297126A CN114297126A (en) 2022-04-08
CN114297126B true CN114297126B (en) 2022-11-11

Family

ID=80998311

Family Applications (4)

Application Number Title Priority Date Filing Date
CN202210012459.8A Active CN114297127B (en) 2020-07-15 2021-07-15 Data transmission method based on charging cable and electronic equipment
CN202211613029.8A Pending CN115912567A (en) 2020-07-15 2021-07-15 Data transmission method based on charging cable and electronic equipment
CN202210012219.8A Active CN114297126B (en) 2020-07-15 2021-07-15 Data transmission method based on charging cable and electronic equipment
CN202211602263.0A Pending CN115864582A (en) 2020-07-15 2021-07-15 Data transmission method based on charging cable and electronic equipment

Family Applications Before (2)

Application Number Title Priority Date Filing Date
CN202210012459.8A Active CN114297127B (en) 2020-07-15 2021-07-15 Data transmission method based on charging cable and electronic equipment
CN202211613029.8A Pending CN115912567A (en) 2020-07-15 2021-07-15 Data transmission method based on charging cable and electronic equipment

Family Applications After (1)

Application Number Title Priority Date Filing Date
CN202211602263.0A Pending CN115864582A (en) 2020-07-15 2021-07-15 Data transmission method based on charging cable and electronic equipment

Country Status (1)

Country Link
CN (4) CN114297127B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113949116A (en) * 2020-07-15 2022-01-18 华为技术有限公司 Data transmission method and device
CN116231815B (en) * 2023-05-10 2023-09-08 荣耀终端有限公司 Method for controlling charging and electronic equipment

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN207053208U (en) * 2017-05-31 2018-02-27 珠海市魅族科技有限公司 A kind of USB interface of charge cable and charge cable

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8095713B2 (en) * 2007-09-04 2012-01-10 Apple Inc. Smart cables
EP3178007A4 (en) * 2014-08-05 2018-02-28 Texas Instruments Incorporated Methods, electronic devices, and charger apparatus for quick usb charging
CN104578276B (en) * 2014-12-24 2016-08-31 广东欧珀移动通信有限公司 Charging method, USB transmission line and power supply unit
CN104967200B (en) * 2015-08-05 2018-04-27 青岛海信移动通信技术股份有限公司 A kind of fast charge method and mobile terminal
US20170187200A1 (en) * 2015-12-28 2017-06-29 Dialog Semiconductor (Uk) Limited Charger Communication by Load Modulation
CN107201615A (en) * 2017-06-16 2017-09-26 台嘉玻璃纤维有限公司 A kind of cooling system of glass fabric
CN107544934B (en) * 2017-09-07 2020-07-07 龙迅半导体(合肥)股份有限公司 Two-way signal conditioning chip and USBType-C cable of USBType-C cable
US11675715B2 (en) * 2019-03-27 2023-06-13 Intel Corporation Low pin-count architecture with prioritized message arbitration and delivery
CN210327098U (en) * 2019-09-16 2020-04-14 上海爻火微电子有限公司 Charging device and charging assembly adopting USB PD
CN110534988A (en) * 2019-09-25 2019-12-03 上海爻火微电子有限公司 Type A-Type C cable and its cable chip
CN111157813B (en) * 2019-12-31 2022-09-09 Oppo广东移动通信有限公司 Method and device for determining charging current

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN207053208U (en) * 2017-05-31 2018-02-27 珠海市魅族科技有限公司 A kind of USB interface of charge cable and charge cable

Also Published As

Publication number Publication date
CN114297127B (en) 2022-11-01
CN115864582A (en) 2023-03-28
CN115912567A (en) 2023-04-04
CN114297126A (en) 2022-04-08
CN114297127A (en) 2022-04-08

Similar Documents

Publication Publication Date Title
US11121559B2 (en) Method and apparatus for charging a battery
US10671135B2 (en) Intelligent mobile power supply and method for USB data communication therewith
WO2022012644A1 (en) Data transmission method employing charging cable, and electronic devices
CN114297126B (en) Data transmission method based on charging cable and electronic equipment
US9407981B2 (en) Audio class-compliant charging accessories for wireless headphones and headsets
WO2016179817A1 (en) Quick charging method, power adapter and mobile terminal
US10389153B2 (en) Charging control method and mobile terminal
EP2905859A1 (en) Charging and audio usage
CN107453428B (en) A kind of method of automatic identification apple and Android device
WO2017049548A1 (en) Mobile terminal, power supply adapter, and upgrading method thereof
CN103685953A (en) Shooting device, mobile terminal and watch
CN113949116A (en) Data transmission method and device
EP4283826A1 (en) Charging circuit, charging control method and electronic device
KR101390402B1 (en) Power sharing apparatus and system using power sharing program installed in mobile terminal
CN112018831B (en) Charging control method, charging control device and electronic equipment
WO2017049549A1 (en) Mobile terminal, power supply adapter, and upgrading method thereof
CN107124012B (en) Charging method, device, charger, terminal and system
CN114490491A (en) Data transmission method and device based on charging cable
CN109275058A (en) Dual mode headset system, bluetooth equipment and cable
WO2024037134A1 (en) Communication method and related apparatus
CN204119254U (en) A kind of adapter
CN216625389U (en) Wireless charging equipment
CN109004708B (en) Charging equipment and mobile terminal
CN207518016U (en) Wireless charging built-up circuit and device
RU145542U1 (en) DEVICE FOR MULTIPLATFORM DATA EXCHANGE AND / OR USER IDENTIFICATION

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant