Universal serial bus power delivery based communication method and apparatus, medium and program
By receiving the hard reset signal, adjusting the voltage, and automatically enabling the communication function during the USB Power Delivery hard reset process, the compatibility problem of charging devices during hard reset anomalies is solved, and more stable charging communication is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-03
- Publication Date
- 2026-03-20
AI Technical Summary
Existing USB Power Delivery chargers may experience abnormalities during the hard reset process, leading to charging device disconnection and communication errors, affecting charging compatibility.
The system performs initialization by receiving a hard reset signal, adjusts the power supply voltage, and automatically enables the physical layer communication function between the adapter and the charging device when an anomaly is detected, thereby re-establishing the power supply communication link.
Without increasing hardware costs, the USB Power Delivery process has been optimized, improving the compatibility and communication stability of charging devices.
Smart Images

Figure CN115706437B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of power supply communication, and in particular to a communication method and device based on universal serial bus (USB) power supply, and a medium and program. BACKGROUND
[0002] With the rapid popularization of USB Power Delivery technology, more and more charging devices begin to support USB Power Delivery charging technology. However, the USB Power Delivery chargers on the market are uneven, which may cause charging compatibility problems of the devices. Some chargers still have the problem that when the charger receives a hard reset signal, the serial bus voltage VBUS does not drop, which causes the charging device to break off charging, communication flow errors and other situations. SUMMARY
[0003] Embodiments of the present application provide a communication method and device based on universal serial bus (USB) power supply, and a medium and program, which can automatically enable the communication function of the adapter and the charging device when an abnormal situation occurs in the USB Power Delivery hard reset process, prevent the process from being stuck, and improve charging compatibility.
[0004] In a first aspect, embodiments of the present application provide a communication method based on universal serial bus (USB) power supply, applied to an adapter, and the method comprises:
[0005] receiving a hard reset signal from a charging device for initialization processing, the initialization processing comprising suspending a power supply communication link between the charging device and the adapter;
[0006] adjusting the power supply voltage to a first voltage value within a first time period;
[0007] when it is detected that the first voltage value is not adjusted to a second voltage value within a second time period, determining that the adapter is in a hard reset abnormal state, and enabling the communication function of a first physical layer of the adapter;
[0008] sending a data packet to the charging device to reestablish the power supply communication link.
[0009] In a second aspect, embodiments of the present application provide a communication method based on universal serial bus (USB) power supply, applied to a charging device, and the method comprises:
[0010] sending a hard reset signal to an adapter and suspending a power supply communication link between the adapter and the charging device;
[0011] when it is detected that the adapter is in a hard reset abnormal state, enabling the communication function of a second physical layer of the charging device after a third time period;
[0012] receive a data packet from the adapter to reestablish the power supply communication link.
[0013] In a third aspect, an embodiment of the present application provides a communication device based on universal serial bus power supply, applied to an adapter, the communication device comprising:
[0014] a receiving unit, configured to receive a hard reset signal from a charging device to perform an initialization process, the initialization process comprising suspending a power supply communication link between the charging device and the adapter;
[0015] a voltage adjusting unit, configured to adjust a power supply voltage to a first voltage value in a first time period;
[0016] a first enabling unit, configured to, when detecting that the first voltage value is not adjusted to a second voltage value in a second time period, determine that the adapter is in a hard reset abnormal state, and enable a communication function of a first physical layer of the adapter;
[0017] a first communication unit, configured to send a data packet to the charging device to reestablish the power supply communication link.
[0018] In a fourth aspect, an embodiment of the present application provides a communication device based on universal serial bus power supply, applied to a charging device, the communication device comprising:
[0019] a sending unit, configured to send a hard reset signal to an adapter, and suspend a power supply communication link between the adapter and the charging device;
[0020] a second enabling unit, configured to, when detecting that the adapter is in a hard reset abnormal state, enable a communication function of a second physical layer of the charging device after a third time period;
[0021] a second communication unit, configured to receive a data packet from the adapter to reestablish the power supply communication link.
[0022] In a fifth aspect, an embodiment of the present application provides an adapter, the adapter comprising a processor, a memory, and one or more programs, the one or more programs being stored in the memory and configured to be executed by the processor, and the program comprising instructions for performing steps in the method according to any one of the first aspect of the embodiments of the present application.
[0023] In a sixth aspect, an embodiment of the present application provides a charging device, the charging device comprising a processor, a memory, and one or more programs, the one or more programs being stored in the memory and configured to be executed by the processor, and the program comprising instructions for performing steps in the method according to any one of the second aspect of the embodiments of the present application.
[0024] In a seventh aspect, an embodiment of the present application provides a computer storage medium, which stores a computer program. The computer program includes program instructions, and when the program instructions are executed by a processor, the processor executes the method in any one of the first aspect and / or the second aspect of the embodiments of the present application.
[0025] In an eighth aspect, an embodiment of the present application provides a computer product. The above computer program product includes a non-transitory computer readable storage medium storing a computer program. The computer program is operable to cause a computer to perform some or all of the steps of the method described in any one of the first aspect and / or the second aspect of the embodiments of the present application. The computer program product can be a software installation package.
[0026] It can be seen that, by the above communication method based on USB PD and the related device, first, a hard reset signal from a charging device is received to perform initialization processing, the initialization processing including suspending a power supply communication link with the charging device; then, a power supply voltage is adjusted to a first voltage value in a first time period; next, when it is detected that the first voltage value is not adjusted to a second voltage value in a second time period, it is determined that the adapter is in a hard reset abnormal state, and the communication function of the first physical layer of the adapter is enabled, the second voltage value being lower than the first voltage value; finally, a data packet is sent to the charging device to reestablish the power supply communication link. In the USB PD hard reset process, the communication function of the adapter and the charging device can be automatically enabled when an abnormal condition occurs, the process is prevented from being stuck, and the charging compatibility is improved. BRIEF DESCRIPTION OF DRAWINGS
[0027] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or the prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor.
[0028] Figure 1 An output voltage curve diagram in a USB PD process is provided for the embodiments of the present application;
[0029] Figure 2 A system architecture schematic diagram of the communication method based on USB PD is provided for the embodiments of the present application;
[0030] Figure 3 A flowchart of the communication method based on USB PD is provided for the embodiments of the present application;
[0031] Figure 4 FIG. 2 shows a flowchart illustrating an example of a method for communication based on USB power supply according to an embodiment of the present application;
[0032] Figure 5 FIG. 2 shows a flowchart illustrating an example of a method for communication based on USB power supply according to an embodiment of the present application;
[0033] Figure 6 FIG. 3 shows a block diagram illustrating an example of a functional unit of a device for communication based on USB power supply according to an embodiment of the present application;
[0034] Figure 7 FIG. 3 shows a block diagram illustrating an example of a functional unit of a device for communication based on USB power supply according to an embodiment of the present application; DETAILED DESCRIPTION
[0035] In order to make the personnel in the art better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative labor fall within the scope of the present application.
[0036] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish different objects, and are not used to describe a specific order. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but can optionally include steps or units not listed, or can optionally include other steps or units inherent to the process, method, product or device.
[0037] Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the present application. The appearance of the phrase in various places in the specification does not necessarily all refer to the same embodiment, nor does it necessarily refer to a particular embodiment that is preferred over other embodiments. It is explicitly and implicitly understood that the embodiments described herein can be combined.
[0038] First, the background art in the embodiments of the present application is described.
[0039] Universal Serial Bus Power Delivery (USB PD) is a USB power delivery extension standard that utilizes a USB (Universal Serial Bus) cable and can supply up to 100W of power.
[0040] A Downstream Facing Port (DFP) can be understood as a Host. The DFP provides VBUS and can supply data. In the protocol specification, DFP specifically refers to downstream data transmission; broadly speaking, it refers to devices that handle downstream data transmission and provide power. This application uses an adapter as an example for illustration.
[0041] An upstream facing port (UFP) can be understood as a device. The UFP draws power from the VBUS and can provide data. Typical devices include USB flash drives and external hard drives.
[0042] A dual-role port can function as both a power supply device and a power receiving device.
[0043] VBUS is the cable through which the adapter supplies power to the charging device; the VBUS voltage is the supply voltage.
[0044] During USB PD, sometimes a hard reset of the adapter and charging device is required. For example, Figure 1 As shown, the charging device sends a Hard reset command to the adapter. Upon receiving the Hard reset command, the adapter can adjust the output voltage to vSafe5V within time t1. vSafe5V is a term in the protocol standard, generally ranging from 4.75V to 5.25V. Then, within time t2, the output voltage is adjusted from vSafe5V to vSafe0V. vSafe0V is generally 0 to 0.8V, which will not be elaborated here. Finally, after waiting for time t3, the output voltage is restored to vSafe5V to complete the hard reset process, so that subsequent USB PD communication can resume.
[0045] In some cases, a hard reset anomaly may occur. For example, if the output voltage does not drop from vSafe5V to vSafe0V within time t2, but continues to remain at vSafe5V, the charging device will temporarily disable the communication function after sending the Hard reset command and detect the adapter's hard reset process. If it detects that the output voltage has not dropped from vSafe5V to vSafe0V, it cannot jump to the next process, that is, it cannot perform subsequent USB PD communication, resulting in compatibility issues.
[0046] To solve the above problems, the embodiment of the application provides a communication method based on universal serial bus power supply and related devices, which can automatically detect hard reset exceptions in the USB PD process, optimize the USB PD process without increasing hardware costs, and improve compatibility.
[0047] The following will be described in combination with Figure 2 The system architecture of the communication method based on universal serial bus power supply in the embodiment of the application is described, Figure 2 The system architecture of the communication method based on universal serial bus power supply provided in the embodiment of the application is shown in the figure, and the system architecture comprises an adapter 110 and a charging device 120.
[0048] The adapter 110 described above can supply power to the charging device 120 as a source, the charging device 120 described above is a sink, and the adapter 110 described above can be connected to the charging device 120 described above through a cable. The adapter 110 and the charging device 120 can apply related protocols of the USB PD communication standard. In the embodiment of the application, the adapter 110 and the charging device 120 are not further improved in hardware, and reference can be made to the existing structure of the adapter and the charging device, which is not specifically limited here.
[0049] For ease of understanding, the adapter 110 described above and the charging device 120 described above are described from the software architecture level as follows. The adapter 110 described above can comprise a first physical layer 111, a first protocol layer 112, and a first strategy engine 113. The charging device 120 described above can comprise a second physical layer 121, a second protocol layer 122, and a second strategy engine 123. The charging device 120 can send a hard reset instruction through the second strategy engine 123, and the hard reset instruction is transmitted to the adapter 110 through the second protocol layer 122 and the second physical layer 121 in sequence. Specifically, the hard reset instruction can be transmitted to the first strategy engine 113 through the first physical layer 111 and the first protocol layer 112. After receiving the hard reset instruction, the adapter 110 can execute a corresponding hard reset process. The specific process is not described here in detail, and reference can be made to the description of the communication method based on universal serial bus power supply later.
[0050] It should be noted that the adapter 110 and the charging device 120 do not need to perform hard reset when they normally perform USB PD communication, and the hard reset process is performed and the method provided in the embodiment of the application is applied only when an abnormal situation occurs.
[0051] In combination with the system architecture described above, the communication method based on universal serial bus power supply in the embodiment of the application is described, Figure 3 The communication method based on universal serial bus power supply in the embodiment of the application is described, Figure 3A flowchart of a communication method based on universal serial bus power supply is provided for the embodiment of the present application. The communication method is applicable to an adapter and specifically includes the following steps:
[0052] In step 301, a hard reset signal from a charging device is received for initialization processing.
[0053] The initialization processing includes suspending a power supply communication link between the charging device.
[0054] Specifically, the hard reset signal from the charging device can be received through a first physical layer, and when the hard reset signal is received, the first physical layer transmits a first receiving message to a first protocol layer of the adapter and closes the communication function of the first physical layer, and resets a first message identifier counter Message ID Counter and a first retransmission counter Retry Counter through the first protocol layer. The first receiving message is used to indicate that the hard reset signal has been received. The first message identifier counter Message ID Counter is used to record the number of power supply communication links, i.e., Message ID. The first retransmission counter Retry Counter is used to record the number of retransmissions of the power supply communication link. Here, since the first message identifier counter Message ID Counter and the first retransmission counter Retry Counter are reset, the count and the number of retransmissions are all zero, which can be understood as initialization processing. Then, the first receiving message is transmitted to the first strategy engine of the adapter through the first protocol layer.
[0055] As can be seen, by receiving the hard reset signal from the charging device for initialization processing, the count can be reset, which facilitates the subsequent resumption of USB PD communication.
[0056] In step 302, the power supply voltage is adjusted to a first voltage value within a first time period.
[0057] The first strategy engine can start a first timer, and the power supply voltage is adjusted to the first voltage value within the first time period recorded by the first timer. The first timer can be NoResponseTimer. When the first receiving message is received by the first strategy engine, it is determined that the Hard reset instruction has been received, and the first timer can be started. The first timer can time the first time period, and the power supply voltage needs to be reduced to the first voltage value within the first time period. The first voltage value can be Vsafe 5V in the PD communication standard.
[0058] In step 303, when it is detected that the first voltage value is not adjusted to the second voltage value within the second time period, it is determined that the adapter is in a hard reset abnormal state, and the communication function of the first physical layer of the adapter is enabled.
[0059] The first timer can be set to the second time period, and when the first voltage value is not adjusted to the second voltage value within the second time period recorded by the first timer, it is determined that the adapter is in the hard reset abnormal state, and the communication function of the first physical layer is enabled by the first policy engine when in the hard reset abnormal state. The second voltage value can be Vsafe 0V in the PD communication standard.
[0060] In one possible embodiment, when the first voltage value is adjusted to the second voltage value within the second time period recorded by the first timer, the hard reset is normal, and the subsequent process is continued. Specifically, when the first voltage value is adjusted to the second voltage value within the second time period, a first reset message can be transmitted from the first policy engine to the first protocol layer, and the first reset message is used to indicate that the power supply reset in the hard reset is completed.
[0061] Further, a second reset message is transmitted from the first protocol layer to the first physical layer, and the communication function of the first physical layer is enabled to reestablish the power supply communication link, and the second reset message is used to indicate that the hard reset is completed.
[0062] It can be seen that when it is detected that the first voltage value is not adjusted to the second voltage value within the second time period, it is determined that the adapter is in a hard reset abnormal state, and the communication function of the first physical layer of the adapter is enabled. After detecting the hard reset abnormality, the communication function of the first physical layer can be automatically restarted, which facilitates the subsequent process, prevents the process from being stuck, and reduces the compatibility problem in the USB PD process.
[0063] In step 304, a data packet is transmitted to the charging device to reestablish the power supply communication link.
[0064] The first policy engine can be used to transmit the data packet to the first protocol layer, and the data packet can be a Source cap packet.
[0065] Specifically, the second timer for indicating a third period of Cyclic Redundancy Check (CRC) can be started by the first protocol layer, and the data packet can be transmitted to the first physical layer, wherein the second timer can be CRCReceiveTimer, the third period can be 0.9-1.1 ms, and the second timer can be used to prompt the loss of Source cap information. For example, if no GoodCRC information is received from the other party after the transmission of the Source cap message within the third period of the second timer (0.9-1.1 ms), it is considered that the message transmission fails, and the Source cap message is retransmitted.
[0066] Then the data packet is transmitted to the charging device through the first physical layer.
[0067] When the second message fed back by the charging device is received within the third period, the first timer and the second timer are closed, the message identification counter is increased by one count, and the power supply communication link is completed.
[0068] It can be seen that through the above method, the adapter can automatically enable the communication function of the first physical layer in the hard reset exception, drive the flow to proceed, and greatly increase the compatibility of the USB PD process.
[0069] The following will be described in combination with Figure 4 The other communication method based on universal serial bus power supply provided in the embodiment of the application is described, Figure 4 The other communication method based on universal serial bus power supply provided in the embodiment of the application is described,
[0070] Step 401, a hard reset signal is transmitted to the adapter, and the power supply communication link between the adapter is suspended.
[0071] The hard reset signal can be transmitted to the second protocol layer of the charging device through the second strategy engine of the charging device, and the second strategy engine can be Policy Engine.
[0072] resetting a second message identification counter and a second retransmission counter through the second protocol layer, and transmitting the hard reset signal to the second physical layer, the second message identification counter being used to record the number of times of the power supply communication link, the second retransmission counter being used to record the number of times of retransmission of the power supply communication link, the second message identification counter Message ID Counter being used to record the number of times of the power supply communication link, i.e. Message ID, the second retransmission counter Retry Counter being used to record the number of times of retransmission of the power supply communication link, where the count and the number of times of retransmission are all zero due to the resetting of the second message identification counter Message ID Counter and the second retransmission counter Retry Counter;
[0073] Further, the hard reset signal is sent to the adapter through the second physical layer, and the communication function of the second physical layer is closed.
[0074] Step 402, enabling the communication function of the second physical layer of the charging device after a third period of time when detecting that the adapter is in the hard reset abnormal state.
[0075] Wherein, the charging device can detect the power supply voltage of the adapter in the first period and the second period;
[0076] When the power supply voltage is not the second voltage value at the end of the second period, it is determined that the adapter is in the hard reset abnormal state;
[0077] Starting a third timer through the second physical layer, and enabling the communication function of the second physical layer after the third period of time recorded by the third timer, where the third period of time can be the same as t3 in the above embodiment, i.e. the third period of time can be 800 ms. Figure 1
[0078] It can be understood that when it is detected that the power supply voltage does not drop from Vsafe5V to Vsafe0V in the second period of time, it can be determined that the adapter is in the hard reset abnormal state, the second strategy engine informs the second protocol layer that the charging device has been reset, and the communication function of the second physical layer is forcibly enabled after waiting for the third period of time.
[0079] It can be seen that by automatically detecting the change of the power supply voltage of the adapter, it can be determined whether the hard reset process of the adapter is abnormal, and the communication function of the second physical layer is automatically enabled when the hard reset is abnormal, preventing the USB PD process from being stuck, and greatly improving the compatibility of the USB PD process.
[0080] Step 403, receiving a data packet from the adapter to reestablish the power supply communication link.
[0081] The second physical layer can receive the data packet from the adapter, and the data packet can be a Source cap packet.
[0082] The second protocol layer stores a message identifier MessageID and performs a cyclic redundancy check on the data packet to obtain a check result, and the check result includes pass and fail.
[0083] When the check result is pass, the second protocol layer transmits the check result GoodCRC to the second physical layer.
[0084] The second physical layer feeds back the check result GoodCRC to the adapter to complete the power supply communication link.
[0085] It can be seen that by the above method, the charging device can automatically enable the communication function of the second physical layer when the hard reset exception occurs, greatly improving the compatibility of the USB PD process.
[0086] In order to facilitate understanding, the following will be combined with Figure 5 Another USB PD communication method is described below. Figure 5 Another USB PD communication method provided by the embodiment of the application is described below.
[0087] Step 501, the second strategy engine sends a hard reset signal to the second protocol layer.
[0088] Step 502, the second protocol layer transmits the hard reset signal to the second physical layer, and resets the second message identifier counter and the second retransmission counter.
[0089] Step 503, the second physical layer transmits the hard reset signal to the first physical layer, and closes the communication function of the second physical layer.
[0090] Step 504, after receiving the hard reset signal, the first physical layer transmits a first received message to the first protocol layer, and closes the communication function of the first physical layer.
[0091] The first received message is used to indicate that the hard reset signal has been received.
[0092] Step 505, the first protocol layer transmits the first received message to the first strategy engine, and resets the first message identifier counter and the first retransmission counter.
[0093] Step 506, the first strategy engine starts a first timer to control the power supply voltage to drop to Vsafe5V in a first time period and to drop to Vsafe0V in a second time period.
[0094] Step 507, when the second period is not powered down to Vsafe 0V, the first protocol layer is forced to enable the communication function of the first physical layer;
[0095] Step 508, the second strategy engine informs the second protocol layer that the charging device has recovered;
[0096] Step 509, when the adapter is detected in a hard reset abnormal state, the third timer is started by the second protocol layer, and the communication function of the second physical layer is forced to be enabled after the third period to complete the hard reset process.
[0097] In one possible embodiment, after the hard reset is completed, the USB PD communication can be re-established. Specifically, as follows:
[0098] Step 510, the first strategy engine sends a Sourcecap packet to the first protocol layer;
[0099] Step 511, the first protocol layer starts a second timer CRC receive timer, and sends the Sourcecap packet to the first physical layer;
[0100] Step 512, the first physical layer sends the Sourcecap packet to the second physical layer and performs CRC check;
[0101] Step 513, the second physical layer sends the Sourcecap packet to the second protocol layer;
[0102] Step 514, the second protocol layer informs the second strategy engine that the Sourcecap packet has been received, and checks the Sourcecap packet;
[0103] Step 515, the second protocol layer sends a GoodCRC message to the second physical layer;
[0104] Step 516, the second physical layer transmits the GoodCRC message to the first physical layer;
[0105] Step 517, the first physical layer transmits the GoodCRC message to the first protocol layer;
[0106] Step 518, the first protocol layer transmits the GoodCRC message to the first strategy engine, and stops the second timer;
[0107] Step 519, the first strategy engine controls the first message identification counter to be incremented by one, and the USB PD communication is established successfully.
[0108] The above steps not described in detail can refer to the steps of all or part of the methods described in Figure 3 and Figure 4 , and will not be described here again.
[0109] It can be seen that, by the above method, the USB Power Delivery process can be optimized without increasing hardware cost, and the charging device Sink process can normally run when the normal Hard reset process of the source is not detected, thereby increasing the compatibility of the USB Power Delivery charging device.
[0110] The above mainly introduces the scheme of the embodiments of the present application from the perspective of the method execution process. It can be understood that, in order to implement the above functions, the electronic device includes the hardware structure and / or software module corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the unit and algorithm steps of each example described in the embodiments provided herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is implemented in hardware or computer software driven hardware depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0111] The embodiments of the present application can divide the functional units of the electronic device according to the above method examples, for example, each functional unit can be divided according to each function, or two or more functions can be integrated in one processing unit. The integrated unit can be realized in the form of hardware or software functional unit. It should be noted that the division of units in the embodiments of the present application is illustrative, and is only a logical function division. When actually implemented, there can be another division method.
[0112] In the case of dividing each functional module according to each function, the following will be described in combination with Figure 6 A communication device based on universal serial bus power supply in the embodiments of the present application will be described in detail, Figure 6 A functional unit composition block diagram of a communication device 600 based on universal serial bus power supply provided by the embodiments of the present application, the device is applied to an adapter, the device includes:
[0113] The receiving unit 610 is configured to receive a hard reset signal from a charging device for initialization processing, the initialization processing including suspending a power supply communication link between the charging device and the adapter;
[0114] The voltage adjusting unit 620 is configured to adjust the power supply voltage to a first voltage value in a first time period;
[0115] The first enabling unit 630 is used to determine that the adapter is in a hard reset abnormal state when the first voltage value is not adjusted to the second voltage value during the second time period, and to enable the communication function of the first physical layer of the adapter.
[0116] The first communication unit 640 is used to send data packets to the charging device to re-establish the power supply communication link.
[0117] Given the division of functions into modules corresponding to each function, the following is combined with... Figure 7 Another communication device based on a universal serial bus power supply in the embodiments of this application will be described in detail. Figure 7 A functional unit block diagram of another communication device 700 powered by a universal serial bus provided in this application embodiment, the device being applied to a charging device, the device comprising:
[0118] The transmitting unit 710 is used to send a hard reset signal to the adapter and suspend the power supply communication link with the adapter;
[0119] The second enabling unit 720 is used to enable the communication function of the second physical layer of the charging device after a third time period when the adapter is detected to be in a hard reset abnormal state.
[0120] The second communication unit 730 is used to receive data packets from the adapter to re-establish the power supply communication link.
[0121] All relevant content of each step involved in the above method embodiments can be referenced from the functional description of the corresponding functional module, and will not be repeated here.
[0122] This application embodiment also provides an adapter, the adapter including a processor, a memory, and one or more programs, the one or more programs being stored in the memory and configured to be executed by the processor, the programs including functions for performing tasks such as... Figure 3 The instructions for the steps in any one of the methods.
[0123] This application provides a charging device, which includes a processor, a memory, and one or more programs. The one or more programs are stored in the memory and configured to be executed by the processor. The programs include functions for performing actions such as... Figure 4 The instructions for the steps in any one of the methods.
[0124] The embodiment of the present application further provides a computer storage medium, wherein the computer storage medium stores a computer program for electronic data exchange, and the computer program causes a computer to execute part or all of steps of any method described in the above method embodiments, and the computer includes an electronic device.
[0125] The embodiment of the present application further provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute part or all of steps of any method described in the above method embodiments. The computer program product can be a software installation package.
[0126] It should be noted that, for the above-mentioned method embodiments, in order to simply describe, they are all described as a series of action combinations, but those skilled in the art should know that the present application is not limited to the order of actions described, because according to the present application, some steps can be performed in other order or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification all belong to preferred embodiments, and the actions and modules involved are not necessarily necessary for the present application.
[0127] In the above embodiments, the description of each embodiment has its own focus, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments.
[0128] In several embodiments provided by the present application, it should be understood that the disclosed device can be implemented in other ways. For example, the device embodiments described above are only schematic, and the division of the above units is only a logical function division, and there can be another division manner in actual implementation, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual coupling or direct coupling or communication connection can be indirect coupling or communication connection through some interface, device or unit, and can be electrical or other forms.
[0129] The units described as separate components can or can not be physically separate, and the components displayed as units can or can not be physical units, that is, they can be located in one place, or can be distributed on a plurality of network units. According to actual needs, part or all of the units can be selected to achieve the purpose of the embodiment scheme.
[0130] In addition, each of the functional units in the various embodiments of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.
[0131] When the integrated unit is realized in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable memory. Based on this understanding, the technical solutions of the present application, essentially or in part, or all or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a memory and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods in the various embodiments of the present application. The aforementioned memory includes various media that can store program codes, such as a U disk, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, etc.
[0132] A person of ordinary skill in the art can understand that all or part of the steps of the various methods of the above embodiments can be instructed by a program to related hardware, and the program can be stored in a computer readable memory, and the memory can include a flash disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0133] The embodiments of the present application are described in detail above, and the specific examples are applied to the principles and implementation modes of the present application. The above description of the embodiments is only used to help understand the method of the present application and its core idea; at the same time, for those skilled in the art, according to the idea of the present application, the specific implementation mode and application range will be changed; in summary, the content of the specification should not be understood as a limitation of the present application.
Claims
1. A communication method based on a universal serial bus power supply, characterized in that, Applied to an adapter, the method includes: The adapter receives a hard reset signal from the charging device to perform initialization processing, which includes suspending the power supply communication link with the charging device; however, a hard reset is not required when the adapter and the charging device are normally communicating via USB PD. The power supply voltage is adjusted to the first voltage value during the first time period; When the first voltage value is not adjusted to the second voltage value during the second time period, it is determined that the adapter is in a hard reset abnormal state, and the communication function of the first physical layer of the adapter is enabled. Send data packets to the charging device to re-establish the power supply communication link.
2. The method according to claim 1, characterized in that, The process of receiving a hard reset signal from the charging device for initialization includes: When a hard reset signal is received from the charging device through the first physical layer, a first receive message is transmitted to the first protocol layer of the adapter to disable the communication function of the first physical layer. The first receive message is used to indicate that the hard reset signal has been received. The first retransmission counter and the first message identifier counter are reset through the first protocol layer. The first message identifier counter is used to record the number of times the power supply communication link is used; the first retransmission counter is used to record the number of retransmissions of the power supply communication link; and the first received message is transmitted to the first policy engine of the adapter through the first protocol layer.
3. The method according to claim 2, characterized in that, The step of adjusting the power supply voltage to a first voltage value during the first time period includes: The first timer is started by the first strategy engine, and the power supply voltage is adjusted to the first voltage value within the first time period recorded by the first timer.
4. The method according to claim 3, characterized in that, The step of determining that the adapter is in a hard reset abnormal state when the first voltage value is not adjusted to the second voltage value during the second time period, and enabling the physical layer communication function of the adapter, includes: If the first voltage value is not adjusted to the second voltage value within the second time period recorded by the first timer, the adapter is determined to be in the hard reset abnormal state. The communication function of the first physical layer is enabled through the first policy engine.
5. The method according to claim 3, characterized in that, Sending data packets to the charging device to re-establish the power supply communication link includes: The data packet is transmitted to the first protocol layer through the first policy engine; The second timer is started through the first protocol layer and the data packet is transmitted to the first physical layer. The second timer is used to indicate the third time period of cyclic redundancy check. The data packet is sent to the charging device through the first physical layer; When the second message from the charging device is received during the third time period, the first timer and the second timer are turned off, and the message identifier counter is incremented by one to complete the power supply communication link.
6. The method according to any one of claims 2 to 5, characterized in that, After adjusting the power supply voltage to the first voltage value during the first time period, the method further includes: When the first voltage value is adjusted to the second voltage value during the second time period, a first reset message is transmitted to the first protocol layer through the first strategy engine. The first reset message is used to indicate that the power supply reset in the hard reset is completed. The first protocol layer transmits a second reset message to the first physical layer and enables the communication function of the first physical layer to re-establish the power supply communication link. The second reset message is used to indicate that the hard reset is complete.
7. A communication method based on a universal serial bus power supply, characterized in that, Applied to a charging device, the method includes: The charging device sends a hard reset signal to the adapter through the second physical layer and disables the communication function of the second physical layer to suspend the power supply communication link with the adapter. When the adapter is detected to be in a hard reset abnormal state, the communication function of the second physical layer of the charging device is enabled after the third time period; wherein, a hard reset is not required when the adapter and the charging device are normally communicating via USB PD. Receive data packets from the adapter to re-establish the power supply communication link.
8. A communication device powered by a universal serial bus, characterized in that, Applied to an adapter, the communication device includes: A receiving unit is configured to receive a hard reset signal from a charging device for initialization processing, the initialization processing including suspending the power supply communication link with the charging device; wherein, a hard reset is not required when the adapter and the charging device are normally communicating via USBPD. A voltage adjustment unit is used to adjust the supply voltage to a first voltage value during a first time period. The first enabling unit is used to determine that the adapter is in a hard reset abnormal state when the first voltage value is not adjusted to the second voltage value during the second time period, and to enable the communication function of the first physical layer of the adapter. The first communication unit is used to send data packets to the charging device to re-establish the power supply communication link.
9. A communication device powered by a universal serial bus, characterized in that, The communication device, used in charging equipment, includes: The transmitting unit is used to send a hard reset signal to the adapter through the second physical layer and disable the communication function of the second physical layer to suspend the power supply communication link with the adapter. The hard reset is not required when the adapter and the charging device are normally communicating via USB PD. The second enabling unit is used to enable the communication function of the second physical layer of the charging device after a third time period when the adapter is detected to be in a hard reset abnormal state. The second communication unit is used to receive data packets from the adapter to re-establish the power supply communication link.
10. A computer storage medium or computer program product, characterized in that, The computer storage medium stores a computer program, the computer program including program instructions, which, when executed by a processor, cause the processor to perform the method as described in any one of claims 1 to 7.
11. A computer program product, characterized in that, The computer program product is used to cause a computer to perform the method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Electronic device, method of controlling electronic device and non-transitory computer-readable storage medium
CN110661968A
Communication methods and related devices based on universal serial bus power supply
CN113326222B
Method to switch the lock-bits combination used to lock a page table entry upon receiving system reset exceptions
CN1728097A
KR20190005643A