WO2023011351A1 - Universal serial bus power delivery-based communication method and related apparatus - Google Patents

Universal serial bus power delivery-based communication method and related apparatus Download PDF

Info

Publication number
WO2023011351A1
WO2023011351A1 PCT/CN2022/108982 CN2022108982W WO2023011351A1 WO 2023011351 A1 WO2023011351 A1 WO 2023011351A1 CN 2022108982 W CN2022108982 W CN 2022108982W WO 2023011351 A1 WO2023011351 A1 WO 2023011351A1
Authority
WO
WIPO (PCT)
Prior art keywords
adapter
charging device
power supply
hard reset
voltage value
Prior art date
Application number
PCT/CN2022/108982
Other languages
French (fr)
Chinese (zh)
Inventor
汤厚涛
Original Assignee
深圳英集芯科技股份有限公司
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
Application filed by 深圳英集芯科技股份有限公司 filed Critical 深圳英集芯科技股份有限公司
Publication of WO2023011351A1 publication Critical patent/WO2023011351A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/40Bus structure
    • G06F13/4063Device-to-bus coupling
    • G06F13/4068Electrical coupling
    • G06F13/4072Drivers or receivers
    • G06F13/4077Precharging or discharging
    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02JCIRCUIT ARRANGEMENTS OR SYSTEMS FOR SUPPLYING OR DISTRIBUTING ELECTRIC POWER; SYSTEMS FOR STORING ELECTRIC ENERGY
    • H02J7/00Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries
    • H02J7/00032Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries characterised by data exchange
    • H02J7/00034Charger exchanging data with an electronic device, i.e. telephone, whose internal battery is under charge
    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02JCIRCUIT ARRANGEMENTS OR SYSTEMS FOR SUPPLYING OR DISTRIBUTING ELECTRIC POWER; SYSTEMS FOR STORING ELECTRIC ENERGY
    • H02J2207/00Indexing scheme relating to details of circuit arrangements for charging or depolarising batteries or for supplying loads from batteries
    • H02J2207/30Charge provided using DC bus or data bus of a computer

Definitions

  • the present application relates to the technical field of power supply communication, in particular to a communication method and related devices based on universal serial bus power supply.
  • USB Power Delivery chargers on the market are uneven, which will cause device charging compatibility issues. Some chargers still exist. When the charger receives a hard reset signal, the serial bus voltage VBUS will not be powered off, causing the charging device to be disconnected and the communication process to be wrong.
  • This application proposes a communication method based on universal serial bus power supply and related devices, which can automatically enable the communication function of the adapter and the charging device when an abnormal situation occurs during the USB Power Delivery hard reset process, prevent the process from getting stuck, and improve Charging compatibility.
  • the embodiment of the present application provides a communication method based on universal serial bus power supply, which is applied to an adapter, and the method includes:
  • the embodiment of the present application provides a communication method based on universal serial bus power supply, which is applied to a charging device, and the method includes:
  • a data packet is received from the adapter to re-establish the powered communication link.
  • the embodiment of the present application provides a communication device powered by a universal serial bus, which is applied to an adapter, and the communication device includes:
  • a receiving unit configured to receive a hard reset signal from the charging device to perform initialization processing, the initialization processing including suspending the power supply communication link with the charging device;
  • a voltage adjustment unit configured to adjust the supply voltage to a first voltage value within a first period of time
  • a first enabling unit configured to determine that the adapter is in a hard reset abnormal state when detecting that the first voltage value has not been adjusted to a second voltage value within a second period of time, and enable the first physical layer of the adapter communication function;
  • a first communication unit configured to send a data packet to the charging device to re-establish the power supply communication link.
  • the embodiment of the present application provides a communication device powered by a universal serial bus, which is applied to a charging device, and the communication device includes:
  • a sending unit configured to send a hard reset signal to the adapter, and suspend the power supply communication link with the adapter
  • a second enabling unit configured to enable the communication function of the second physical layer of the charging device after a third period of time when it is detected that the adapter is in a hard reset abnormal state
  • the second communication unit is configured to receive a data packet from the adapter to re-establish the power supply communication link.
  • the embodiment of the present application provides an adapter, the adapter includes a processor, a memory, and one or more programs, the one or more programs are stored in the memory, and configured by the The processor is executed, and the program includes instructions for executing the steps in the method according to any one of the first aspects of the embodiments of the present application.
  • an embodiment of the present application provides a charging device, the charging device includes a processor, a memory, and one or more programs, and the one or more programs are stored in the memory and configured Executed by the processor, the program includes instructions for executing the steps in the method according to any one of the second aspect of the embodiments of the present application.
  • the embodiment of the present application provides a computer storage medium, the computer storage medium 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 according to any one of the first aspect and/or the second aspect of the embodiment of the present application.
  • the embodiment of the present application provides a computer product, wherein the above-mentioned computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the above-mentioned computer program is operable to enable the computer to execute the Part or all of the steps described in any method of the first aspect and/or the second aspect.
  • the computer program product may be a software installation package.
  • Fig. 1 is a kind of output voltage curve diagram based on the universal serial bus power supply process provided by the embodiment of the present application;
  • FIG. 2 is a schematic diagram of a system architecture of a communication method based on universal serial bus power supply provided by an embodiment of the present application;
  • FIG. 3 is a schematic flowchart of a communication method based on universal serial bus power supply provided by an embodiment of the present application
  • FIG. 4 is a schematic flowchart of another communication method based on universal serial bus power supply provided by the embodiment of the present application.
  • FIG. 5 is a schematic flowchart of another communication method based on USB power supply provided by the embodiment of the present application.
  • FIG. 6 is a block diagram of functional units of a communication device powered by a universal serial bus provided by an embodiment of the present application
  • FIG. 7 is a block diagram of functional units of another universal serial bus-based communication device provided by an embodiment of the present application.
  • USB Power Delivery referred to as USB PD
  • USB PD protocol is a USB power supply extension standard that uses a USB (Universal Serial Bus) cable to receive power at a maximum of 100W.
  • USB Universal Serial Bus
  • Downstream Facing Port can be understood as Host, DFP provides VBUS, which can provide data.
  • DFP specifically refers to the downlink transmission of data, and generally refers to the equipment for downlink data and external power supply.
  • an adapter is taken as an example for description.
  • Upstream Facing Port can be understood as Device, UFP takes power from VBUS and can provide data. Typical devices are U disk, mobile hard disk, etc.
  • Dual Role Port can be used as a device that provides power or as a device that receives power.
  • VBUS is the cable for the adapter to supply power to the charging device, and the VBUS voltage is the power supply voltage.
  • the charging device sends a Hard reset command to the adapter.
  • the adapter receives the Hard reset command, it can Adjust the output voltage to vSafe5V within t1, vSafe5V is a term in the protocol standard, generally 4.75V to 5.25V, and then adjust the output voltage from vSafe5V to vSafe0V within t2, where vSafe0V is generally 0 to 0.8V , I won’t go into details here, and finally, after waiting for t3, restore the output voltage to vSafe5V to complete the hard reset process, so as to resume subsequent USB PD communication.
  • a hard reset exception may occur.
  • the output voltage does not drop from vSafe5V to vSafe0V within t2, but continues to maintain vSafe5V, because the charging device will temporarily turn off the communication function after sending the Hard reset command.
  • the hard reset process of the adapter is detected.
  • the output voltage has not dropped from vSafe5V to vSafe0V, it cannot jump to the next process, that is, the subsequent USB PD communication cannot be performed, resulting in compatibility problems.
  • the embodiment of the present application provides a communication method based on universal serial bus power supply and related devices, which can automatically detect the hard reset abnormality in the process of USB PD, and optimize the USB PD without increasing the hardware cost. process to improve compatibility.
  • FIG. 2 is the system architecture of a communication method based on universal serial bus power supply provided in the embodiment of the present application Schematic diagram, the system architecture includes an adapter 110 and a charging device 120 .
  • the above-mentioned adapter 110 is used as a source, and can supply power to the charging device 120 , and the above-mentioned charging device 120 is used as a sink, and the above-mentioned adapter 110 can be connected to the above-mentioned charging device 120 through a cable.
  • the adapter 110 and the charging device 120 can apply the relevant protocols of the USB PD communication standard. In the embodiment of the present application, there is no further improvement on the hardware of the adapter 110 and the charging device 120. You can refer to the structure of the existing adapter and charging device. This is not specifically limited.
  • the above-mentioned adapter 110 and the above-mentioned charging device 120 are described below from the software architecture level.
  • the above-mentioned adapter 110 may include a first physical layer 111, a first protocol layer 112 and a first policy engine 113.
  • the above-mentioned charging device 120 may include The second physical layer 121 , the second protocol layer 122 and the second policy engine 123 .
  • the charging device 120 can send a hard reset Hard reset command through the second policy engine 123, and transmit it to the adapter 110 through the second protocol layer 122 and the second physical layer 121 in turn, specifically, the first physical layer 111, the first protocol layer 112 is transmitted to the first policy engine 113, and the adapter 110 can execute a corresponding hard reset process after receiving the Hard reset command.
  • the specific process will not be described in detail here, and refer to the subsequent description of the communication method based on USB power supply.
  • a hard reset is not required during normal USB PD communication between the adapter 110 and the charging device 120, and the hard reset process is performed only when an abnormal situation occurs and the method provided in the embodiment of this application is applicable.
  • a communication method based on universal serial bus power supply in the embodiment of the present application is further described in conjunction with Fig. 3, and Fig. 3 is a flow chart of a communication method based on universal serial bus power supply provided in the embodiment of the present application Schematic diagram, the communication method is applicable to the adapter, including the following steps:
  • Step 301 receiving a hard reset signal from a charging device for initialization processing.
  • the initialization process includes suspending the power supply communication link with the charging device.
  • the hard reset signal from the charging device may be received through the first physical layer, and when receiving the hard reset signal, the first physical layer transmits a first reception message to the first protocol layer of the adapter, and closes the The communication function of the first physical layer resets the first message identification counter Message ID Counter and the first retransmission counter Retry Counter through the first protocol layer, wherein the first received message is used to indicate that the hard reset has been received signal, the first message identification counter MessageIDCounter is used to record the number of times of the power supply communication link, i.e.
  • the first message identification counter Message ID Counter and the first retransmission counter Retry Counter have been reset, so the count and the number of retransmissions all become zero, which can be understood as initialization processing, and then, through the first protocol layer to the described A first policy engine of the adapter transmits the first received message.
  • the counting content can be reset, so that the USB PD communication can be restarted later.
  • Step 302 adjusting the supply voltage to a first voltage value within a first period of time.
  • the first timer may be started by the first policy engine, and the power supply voltage is adjusted to the first voltage value within the first period recorded by the first timer, and the first timer It can be NoResponseTimer, when the first strategy engine receives the first reception message and determines that the Hard reset command has been received, the first timer can be started, the first timer can be timed for the first period, and the power supply voltage needs to be at the first time. During the time period, the voltage decreases to the first voltage value, which may be Vsafe5V in the PD communication standard.
  • Step 303 when it is detected that the first voltage value is not adjusted to the second voltage value within the second time period, determine that the adapter is in a hard reset abnormal state, and enable the communication function of the first physical layer of the adapter.
  • the above-mentioned first timer can set a 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 The adapter is in the abnormal state of hard reset, and when it is in the abnormal state of hard reset, the communication function of the first physical layer is enabled through the first policy engine, and the above-mentioned second voltage value may be Vsafe0V in the PD communication standard.
  • the hard reset when the first voltage value is adjusted to the second voltage value within the second 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, the first policy engine may transmit a first reset message to the first protocol layer, so The first reset message is used to indicate that the power supply reset in the hard reset is completed;
  • the second reset message uses to indicate that the hard reset is complete.
  • the adapter when it is detected that the first voltage value has not been adjusted to the second voltage value within the second period of time, 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 a hard reset abnormality is detected, the communication function of the first physical layer is automatically restarted, which facilitates the advancement of the subsequent process, prevents the process from getting stuck, and reduces the compatibility problem in the USB PD process.
  • Step 304 sending a data packet to the charging device to re-establish the power supply communication link.
  • the data packet may be transmitted to the first protocol layer through the first policy engine, and the data packet may be a source cap packet;
  • a second timer may be started by the first protocol layer, and the data packet may be transmitted to the first physical layer, and the second timer is used to indicate a cyclic redundancy check (Cyclic Redundancy Check, CRC ), wherein the second timer can be CRCReceiveTimer, the duration of the third period can be 0.9-1.1mS, and the second timer can be used to prompt the loss of the Souce cap information sent, for example, in After sending the Souce cap message, if the GoodCRC message from the other party is not received within the third period of the second timer, that is, 0.9 ⁇ 1.1 mS, it is considered that the message has failed to be sent, and the Souce cap message is resent;
  • CRC Cyclic Redundancy Check
  • the adapter can automatically enable the communication function of the first physical layer when the hard reset is abnormal, and the driving process is advanced, which greatly increases the compatibility of the USB PD process.
  • FIG. 4 is another communication method based on Universal Serial Bus power supply provided in the embodiment of the application, which is applied to charging equipment , including the following steps:
  • Step 401 sending a hard reset signal to the adapter, and suspending the power supply communication link with the adapter.
  • the hard reset signal may be transmitted to the second protocol layer of the charging device through the second policy engine of the charging device, and the second policy engine may be Policy Engine;
  • the second message identification counter and the second retransmission counter are reset through the second protocol layer, and the hard reset signal is transmitted to the second physical layer, and the second message identification counter is used to record the power supply communication
  • the second retransmission counter is used to record the number of retransmissions of the power supply communication link
  • the second message identification counter Message ID Counter is used to record the number of times of the power supply communication link, i.e. Message ID
  • the second retransmission counter Retry Counter is used to record the number of retransmissions of the power supply communication link, here because the second message identification counter Message ID Counter and the second retransmission counter Retry Counter have been reset, so the count and the number of retransmissions all become zero;
  • Step 402 when it is detected that the adapter is in a hard reset abnormal state, enabling the communication function of the second physical layer of the charging device after a third period of time.
  • the charging device can detect the power supply voltage of the adapter in the first period and the second period;
  • the third timer is started by the second physical layer, and the communication function of the second physical layer is enabled after the third period recorded by the third timer, where the third period can be the same as that in FIG. 1
  • the duration of t3 in is the same, for example, the third period may be 800ms.
  • the second policy engine informs the second protocol layer that the charging device has been reset, waiting for the first After three periods, the communication function of the second physical layer is forcibly enabled.
  • Step 403 receiving a data packet from the adapter to re-establish the power supply communication link.
  • the data packet from the adapter may be received through the second physical layer, and the data packet may be a source cap packet;
  • the verification result GoodCRC is transmitted to the second physical layer through the second protocol layer;
  • the check result GoodCRC is fed back to the adapter through the second physical layer, so as to complete the power supply communication link.
  • the charging device can automatically enable the communication function of the second physical layer when the hard reset is abnormal, which greatly improves the compatibility of the USB PD process.
  • FIG. 5 Schematic diagram of the process, which is applied to adapters and charging devices, and specifically includes the following steps:
  • Step 501 the second policy engine sends a hard reset signal to the second protocol layer
  • Step 502 the second protocol layer transmits a hard reset signal to the second physical layer, and resets the second message identification counter and the second retransmission counter;
  • Step 503 the second physical layer transmits a hard reset signal to the first physical layer, and closes its own communication function;
  • Step 504 after receiving the hard reset signal, the first physical layer transmits the first receiving message to the first protocol layer, and closes its own communication function;
  • the first receiving message is used to indicate that a hard reset signal has been received
  • Step 505 the first protocol layer transmits the first received message to the first policy engine, and resets the first message identification counter and the first retransmission counter;
  • Step 506 the first strategy engine starts a first timer, controls the power supply voltage to be powered down to Vsafe5V in the first period, and is powered down to Vsafe0V in the second period;
  • Step 507 when the power is not down to Vsafe0V within the second time period, forcibly enable the communication function of the first physical layer through the first protocol layer;
  • Step 508 the second policy engine informs the second protocol layer that the charging device has recovered
  • Step 509 when it is detected that the adapter is in the hard reset abnormal state, start a third timer through the second protocol layer, and force enable the communication function of the second physical layer after the third time period to complete the hard reset process.
  • USB PD communication can be re-established after the hard reset is complete. The specific steps are as follows:
  • Step 510 the first policy engine sends a Soucecap packet to the first protocol layer
  • Step 511 the first protocol layer starts the second timer CRC receive timer, and sends the Souce cap packet to the first physical layer;
  • Step 512 the first physical layer sends a Source cap packet to the second physical layer and performs a CRC check
  • Step 513 the second physical layer sends a source cap packet to the second protocol layer
  • Step 514 the second protocol layer informs the second strategy engine that the source cap packet has been received, and the source cap packet is verified;
  • Step 515 the second protocol layer sends a GoodCRC message to the second physical layer
  • Step 516 the second physical layer transmits a GoodCRC message to the first physical layer
  • Step 517 the first physical layer transmits the GoodCRC message to the first protocol layer
  • Step 518 the first protocol layer transmits the GoodCRC message to the first policy engine, and stops the second timer;
  • Step 519 the first policy engine controls the first message identification counter to add one, and the USB PD communication is established successfully.
  • the USB Power Delivery process can be optimized without increasing the hardware cost.
  • the sink end process of the charging device can run normally, thereby increasing the USB Power Delivery process. Delivery charging device compatibility.
  • the electronic device includes hardware structures and/or software modules corresponding to each function.
  • the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed by hardware or computer software drives hardware depends on the specific application and design constraints of the technical solution. Skilled artisans may use different methods to implement the described functions for each specific application, but such implementation should not be regarded as exceeding the scope of the present application.
  • the embodiment of the present application may divide the electronic device into functional units according to the above method example, for example, each functional unit may be divided corresponding to each function, or two or more functions may be integrated into one processing unit.
  • the above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units. It should be noted that the division of units in the embodiment of the present application is schematic, and is only a logical function division, and there may be another division manner in actual implementation.
  • FIG. 6 is a communication device based on A block diagram of the functional units of the USB-powered communication device 600, the device is applied to an adapter, and the device includes:
  • the receiving unit 610 is configured to receive a hard reset signal from the charging device to perform initialization processing, the initialization processing including suspending the power supply communication link with the charging device;
  • a voltage adjustment unit 620 configured to adjust the supply voltage to a first voltage value within a first period of time
  • the first enabling unit 630 is configured to determine that the adapter is in a hard reset abnormal state when detecting that the first voltage value has not been adjusted to a second voltage value within a second period of time, and enable the first physical The communication function of the layer;
  • the first communication unit 640 is configured to send a data packet to the charging device to re-establish the power supply communication link.
  • FIG. 7 is another communication device provided by the embodiment of the application.
  • a sending unit 710 configured to send a hard reset signal to the adapter, and suspend the power supply communication link with the adapter
  • the second enabling unit 720 is configured to enable the communication function of the second physical layer of the charging device after a third period of time when it is detected that the adapter is in a hard reset abnormal state;
  • the second communication unit 730 is configured to receive a data packet from the adapter to re-establish the power supply communication link.
  • the embodiment of the present application also provides an adapter, the adapter includes a processor, a memory, and one or more programs, the one or more programs are stored in the memory, and configured by the processor Execution, the program includes instructions for executing the steps in the method as described in any one of FIG. 3 .
  • An embodiment of the present application provides a charging device, the charging device includes a processor, a memory, and one or more programs, the one or more programs are stored in the memory, and configured to be processed by the Executed by a computer, the program includes instructions for executing the steps in the method as described in any one of FIG. 4 .
  • An embodiment of the present application also provides a computer storage medium, wherein the computer storage medium stores a computer program for electronic data exchange, and the computer program enables the computer to execute some or all of the steps of any method described in the above method embodiments , the above-mentioned computer includes electronic equipment.
  • An embodiment of the present application also provides a computer program product, the computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to enable the computer to execute any one of the methods described in the above method embodiments. Some or all steps of the method.
  • the computer program product may be a software installation package.
  • the disclosed device can be implemented in other ways.
  • the device embodiments described above are only illustrative.
  • the division of the above units is only a logical function division.
  • there may be other division methods for example, multiple units or components can be combined or integrated. to another system, or some features may be ignored, or not implemented.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical or other forms.
  • the units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
  • the above-mentioned integrated units are realized in the form of software function units and sold or used as independent products, they can be stored in a computer-readable memory.
  • the technical solution of the present application is essentially or part of the contribution to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a memory.
  • a computer device which may be a personal computer, server or network device, etc.
  • the aforementioned memory includes: various media that can store program codes such as U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk.

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Power Engineering (AREA)
  • Power Sources (AREA)
  • Charge And Discharge Circuits For Batteries Or The Like (AREA)

Abstract

A universal serial bus (USB) power delivery-based communication method and apparatus. The method comprises: firstly, receiving a hard reset signal from a charging device (120), so as to perform initialization processing (301), the initialization processing comprising suspending a power supply communication link with the charging device (120); and then adjusting a power supply voltage to a first voltage value within a first time period (302); next, upon detecting that the first voltage value is not adjusted to a second voltage value within a second time period, determining that an adapter (110) is in a hard reset abnormal state, and enabling the communication function of a first physical layer of the adapter (110) (303); and finally, sending a data packet to the charging device (120) to re-establish the power supply communication link (304). According to the USB power delivery-based communication method and apparatus, the communication function of the adapter (110) and the charging device (120) can be automatically enabled when an anomaly occurs in the USB power delivery hard reset procedure, the procedure is prevented from being interrupted, and the charging compatibility is improved.

Description

基于通用串行总线供电的通信方法及相关装置Communication method and related device based on universal serial bus power supply
本申请要求于2021年8月3日提交中国专利局、申请号为2021108834374、申请名称为“基于通用串行总线供电的通信方法及相关装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with the application number 2021108834374 and the application title "communication method and related device based on universal serial bus power supply" filed with the China Patent Office on August 3, 2021, the entire content of which is incorporated by reference incorporated in this application.
技术领域technical field
本申请涉及供电通信技术领域,特别是一种基于通用串行总线供电的通信方法及相关装置。The present application relates to the technical field of power supply communication, in particular to a communication method and related devices based on universal serial bus power supply.
背景技术Background technique
伴随着通用串行总线供电技术(USB Power Delivery)的迅速普及,越来越多的充电设备开始支持USB Power Delivery充电技术。然而市面上的USB Power Delivery充电器参差不齐,会导致设备充电兼容性问题。部分充电器还存在,当充电器接受到硬复位信号时,串行总线电压VBUS不掉电,导致充电设备断充,通信流程错误等情况。With the rapid popularization of USB Power Delivery, 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 will cause device charging compatibility issues. Some chargers still exist. When the charger receives a hard reset signal, the serial bus voltage VBUS will not be powered off, causing the charging device to be disconnected and the communication process to be wrong.
发明内容Contents of the invention
本申请提出了一种基于通用串行总线供电的通信方法及相关装置,可以在USB Power Delivery硬复位流程中,出现异常情况时自动使能适配器和充电设备的通信功能,防止流程卡住,改善充电兼容性。This application proposes a communication method based on universal serial bus power supply and related devices, which can automatically enable the communication function of the adapter and the charging device when an abnormal situation occurs during the USB Power Delivery hard reset process, prevent the process from getting stuck, and improve Charging compatibility.
第一方面,本申请实施例提供了一种基于通用串行总线供电的通信方法,应用于适配器,所述方法包括:In the first aspect, the embodiment of the present application provides a communication method based on universal serial bus power supply, which is applied to an adapter, and the method includes:
接收来自充电设备的硬复位信号,以进行初始化处理,所述初始化处理包括暂停与所述充电设备之间的供电通信链路;receiving a hard reset signal from a charging device to perform an initialization process that includes suspending a power supply communication link with the charging device;
在第一时段内将供电电压调整为第一电压值;adjusting the supply voltage to a first voltage value within a first period of time;
在检测到第二时段内所述第一电压值未调整为第二电压值时,确定所述适配器处于硬复位异常状态,使能所述适配器的第一物理层的通信功能;When it is detected that the first voltage value is not adjusted to the second voltage value within the second period of time, 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;
向所述充电设备发送数据包以重新建立所述供电通信链路。sending a data packet to the charging device to re-establish the power supply communication link.
第二方面,本申请实施例提供了一种基于通用串行总线供电的通信方法,应用于充电设备,所述方法包括:In the second aspect, the embodiment of the present application provides a communication method based on universal serial bus power supply, which is applied to a charging device, and the method includes:
向适配器发送硬复位信号,并暂停与所述适配器之间的供电通信链路;sending a hard reset signal to the adapter and suspending the powered communication link with the adapter;
在检测到所述适配器处于硬复位异常状态时,在第三时段后使能所述充电设备的第二物理层的通信功能;When detecting that the adapter is in a hard reset abnormal state, enabling the communication function of the second physical layer of the charging device after a third period of time;
接收来自所述适配器的数据包以重新建立所述供电通信链路。A data packet is received from the adapter to re-establish the powered communication link.
第三方面,本申请实施例提供了一种基于通用串行总线供电的通信装置,应用于适配器,所述通信装置包括:In the third aspect, the embodiment of the present application provides a communication device powered by a universal serial bus, which is applied to an adapter, and the communication device includes:
接收单元,用于接收来自充电设备的硬复位信号,以进行初始化处理,所述初始化处理包括暂停与所述充电设备之间的供电通信链路;a receiving unit, configured to receive a hard reset signal from the charging device to perform initialization processing, the initialization processing including suspending the power supply communication link with the charging device;
电压调整单元,用于在第一时段内将供电电压调整为第一电压值;a voltage adjustment unit, configured to adjust the supply voltage to a first voltage value within a first period of time;
第一使能单元,用于在检测到第二时段内所述第一电压值未调整为第二电压值时,确定所述适配器处于硬复位异常状态,使能所述适配器的第一物理层的通信功能;A first enabling unit, configured to determine that the adapter is in a hard reset abnormal state when detecting that the first voltage value has not been adjusted to a second voltage value within a second period of time, and enable the first physical layer of the adapter communication function;
第一通信单元,用于向所述充电设备发送数据包以重新建立所述供电通信链路。A first communication unit, configured to send a data packet to the charging device to re-establish the power supply communication link.
第四方面,本申请实施例提供了一种基于通用串行总线供电的通信装置,应用于充电设备,所述通信装置包括:In a fourth aspect, the embodiment of the present application provides a communication device powered by a universal serial bus, which is applied to a charging device, and the communication device includes:
发送单元,用于向适配器发送硬复位信号,并暂停与所述适配器之间的供电通信链路;a sending unit, configured to send a hard reset signal to the adapter, and suspend the power supply communication link with the adapter;
第二使能单元,用于在检测到所述适配器处于硬复位异常状态时,在第三时段后使能所述充电设备的第二物理层的通信功能;A second enabling unit, configured to enable the communication function of the second physical layer of the charging device after a third period of time when it is detected that the adapter is in a hard reset abnormal state;
第二通信单元,用于接收来自所述适配器的数据包以重新建立所述供电通信链路。The second communication unit is configured to receive a data packet from the adapter to re-establish the power supply communication link.
第五方面,本申请实施例提供了一种适配器,所述适配器包括处理器、存储器,以及一个或多个程序,所述一个或多个程序被存储在所述存储器中,并且被配置由所述处理器执行,所述程序包括用于执行如本申请实施例第一方面任一项所述的方法中的步骤的指令。In a fifth aspect, the embodiment of the present application provides an adapter, the adapter includes a processor, a memory, and one or more programs, the one or more programs are stored in the memory, and configured by the The processor is executed, and the program includes instructions for executing the steps in the method according to any one of the first aspects of the embodiments of the present application.
第六方面,本申请实施例提供了一种充电设备,所述充电设备包括处理器、存储器,以及一个或多个程序,所述一个或多个程序被存储在所述存储器中,并且被配置由所述处理器执行,所述程序包括用于执行如本申请实施例第二方面任一项所述的方法中的步骤的指令。In a sixth aspect, an embodiment of the present application provides a charging device, the charging device includes a processor, a memory, and one or more programs, and the one or more programs are stored in the memory and configured Executed by the processor, the program includes instructions for executing the steps in the method according to any one of the second aspect of the embodiments of the present application.
第七方面,本申请实施例提供了一种计算机存储介质,所述计算机存储介质存储有计算机程序,所述计算机程序包括程序指令,所述程序指令当被处理器执行时使所述处理器执行如本申请实施例第一方面和/或第二方面任一项所述的方法。In a seventh aspect, the embodiment of the present application provides a computer storage medium, the computer storage medium 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 according to any one of the first aspect and/or the second aspect of the embodiment of the present application.
第八方面,本申请实施例提供了一种计算机产品,其中,上述计算机程序产品包括存储了计算机程序的非瞬时性计算机可读存储介质,上述计算机程序可操作来使计算机执行如本申请实施例第一方面和/或第二方面任一方法中所描述的部分或全部步骤。该计算机程序产品可以为一个软件安装包。In an eighth aspect, the embodiment of the present application provides a computer product, wherein the above-mentioned computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the above-mentioned computer program is operable to enable the computer to execute the Part or all of the steps described in any method of the first aspect and/or the second aspect. The computer program product may be a software installation package.
附图说明Description of drawings
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present application. Those skilled in the art can also obtain other drawings based on these drawings without creative work.
图1为本申请实施例提供的一种基于通用串行总线供电过程中的输出电压曲线图;Fig. 1 is a kind of output voltage curve diagram based on the universal serial bus power supply process provided by the embodiment of the present application;
图2为本申请实施例提供的一种基于通用串行总线供电的通信方法的系统架构示意图;FIG. 2 is a schematic diagram of a system architecture of a communication method based on universal serial bus power supply provided by an embodiment of the present application;
图3为本申请实施例提供的一种基于通用串行总线供电的通信方法的流程示意图;FIG. 3 is a schematic flowchart of a communication method based on universal serial bus power supply provided by an embodiment of the present application;
图4为本申请实施例提供的另一种基于通用串行总线供电的通信方法的流程示意图;FIG. 4 is a schematic flowchart of another communication method based on universal serial bus power supply provided by the embodiment of the present application;
图5为本申请实施例提供的另一种基于通用串行总线供电的通信方法的流程示意图;FIG. 5 is a schematic flowchart of another communication method based on USB power supply provided by the embodiment of the present application;
图6为本申请实施例提供的一种基于通用串行总线供电的通信装置的功能单元组成框图;FIG. 6 is a block diagram of functional units of a communication device powered by a universal serial bus provided by an embodiment of the present application;
图7为本申请实施例提供的另一种基于通用串行总线供电的通信装置的功能单元组成框图。FIG. 7 is a block diagram of functional units of another universal serial bus-based communication device provided by an embodiment of the present application.
具体实施方式Detailed ways
为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请实施例中的附图, 对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiment of the application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiment of the application. Obviously, the described embodiment is only It is a part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by persons of ordinary skill in the art without creative efforts fall within the protection scope of this application.
本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别不同对象,而不是用于描述特定顺序。此外,术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其他步骤或单元。The terms "first", "second" and the like in the specification and claims of the present application and the above drawings are used to distinguish different objects, rather than to describe a specific order. Furthermore, the terms "include" and "have", as well as any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but optionally also includes unlisted steps or units, or optionally further includes For other steps or units inherent in these processes, methods, products or devices.
在本文中提及“实施例”意味着,结合实施例描述的特定特征、结构或特性可以包含在本申请的至少一个实施例中。在说明书中的各个位置出现该短语并不一定均是指相同的实施例,也不是与其它实施例互斥的独立的或备选的实施例。本领域技术人员显式地和隐式地理解的是,本文所描述的实施例可以与其它实施例相结合。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 occurrences of this phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is understood explicitly and implicitly by those skilled in the art that the embodiments described herein can be combined with other embodiments.
首先对本申请实施例中的背景技术进行说明。Firstly, the background technology in the embodiments of the present application will be described.
通用串行总线供电:USB Power Delivery,简称USB PD,USB PD协议一种是利用USB(Universal Serial Bus)电缆,最大可100W供电受电的USB供电扩展标准。Universal Serial Bus power supply: USB Power Delivery, referred to as USB PD, the USB PD protocol is a USB power supply extension standard that uses a USB (Universal Serial Bus) cable to receive power at a maximum of 100W.
下行端口(Downstream Facing Port,DFP),可以理解为Host,DFP提供VBUS,可以提供数据。在协议规范中DFP特指数据的下行传输,笼统意义上指的是数据下行和对外提供电源的设备。本申请实施例中以适配器为例进行说明。Downstream Facing Port (DFP), can be understood as Host, DFP provides VBUS, which can provide data. In the protocol specification, DFP specifically refers to the downlink transmission of data, and generally refers to the equipment for downlink data and external power supply. In this embodiment of the application, an adapter is taken as an example for description.
上行端口(Upstream Facing Port,UFP)可以理解为Device,UFP从VBUS中取电,并可提供数据。典型设备是U盘,移动硬盘等。Upstream Facing Port (UFP) can be understood as Device, UFP takes power from VBUS and can provide data. Typical devices are U disk, mobile hard disk, etc.
双角色端口(Dual Role Port),可以作为提供电源的设备也可以作为接收电源的设备。Dual Role Port can be used as a device that provides power or as a device that receives power.
VBUS为适配器向充电设备供电的电缆,VBUS电压即为供电电压。VBUS is the cable for the adapter to supply power to the charging device, and the VBUS voltage is the power supply voltage.
在USB PD过程中,有时候会需要对适配器和充电设备进行硬复位Hardreset,举例来说,如图1所示,充电设备向适配器发送Hard reset指令,适配器在接收到Hard reset指令时,可以在t1时间内将输出电压调整至vSafe5V,vSafe5V为协议标准中的术语,一般为4.75V~5.25V,然后在t2时间内,将输出电压由vSafe5V调整为vSafe0V,其中,vSafe0V一般为0~0.8V,在此不再赘述,最后需要在等待t3时间后,将输出电压恢复至vSafe5V以完成硬复位过程,以便重新进行后续的USB PD通信。During the USB PD process, sometimes it is necessary to hard reset the adapter and the charging device. For example, as shown in Figure 1, the charging device sends a Hard reset command to the adapter. When the adapter receives the Hard reset command, it can Adjust the output voltage to vSafe5V within t1, vSafe5V is a term in the protocol standard, generally 4.75V to 5.25V, and then adjust the output voltage from vSafe5V to vSafe0V within t2, where vSafe0V is generally 0 to 0.8V , I won’t go into details here, and finally, after waiting for t3, restore the output voltage to vSafe5V to complete the hard reset process, so as to resume subsequent USB PD communication.
在一些情况下,可能会出现硬复位异常,举例来说,在t2时间内输出电压未从vSafe5V降低至vSafe0V,而是继续维持vSafe5V,由于充电设备在发送Hard reset指令后会暂时关闭通信功能,并对适配器的硬复位过程进行检测,在检测到输出电压未从vSafe5V降低至vSafe0V时,无法跳转至下一流程,即无法进行后续的USB PD通信,导致兼容性问题。In some cases, a hard reset exception may occur. For example, the output voltage does not drop from vSafe5V to vSafe0V within t2, but continues to maintain vSafe5V, because the charging device will temporarily turn off the communication function after sending the Hard reset command. And the hard reset process of the adapter is detected. When it is detected that the output voltage has not dropped from vSafe5V to vSafe0V, it cannot jump to the next process, that is, the subsequent USB PD communication cannot be performed, resulting in compatibility problems.
为了解决上述问题,本申请实施例提供了一种基于通用串行总线供电的通信方法及相关装置,可以自动检测USB PD过程中的硬复位异常,在不增加硬件成本的基础上,优化USB PD流程,提升兼容性。In order to solve the above problems, the embodiment of the present application provides a communication method based on universal serial bus power supply and related devices, which can automatically detect the hard reset abnormality in the process of USB PD, and optimize the USB PD without increasing the hardware cost. process to improve compatibility.
下面结合图2对本申请实施例中的一种基于通用串行总线供电的通信方法的系统架构进行说明,图2为本申请实施例提供的一种基于通用串行总线供电的通信方法的系统架构示意图,该系统架构包括适配器110和充电设备120。The system architecture of a communication method based on universal serial bus power supply in the embodiment of the present application will be described below in conjunction with FIG. 2. FIG. 2 is the system architecture of a communication method based on universal serial bus power supply provided in the embodiment of the present application Schematic diagram, the system architecture includes an adapter 110 and a charging device 120 .
其中,上述适配器110作为源端source,可以为充电设备120供电,上述充电设备120作为吸端sink,上述适配器110可以通过电缆连接上述充电设备120。该适配器110和充电设备120可以适用USB PD通信标准的相关协议,本申请实施例中对适配器110和充电设备120 在硬件上没有进一步的改进,可以参见现有的适配器和充电设备的构造,在此不做具体限定。Wherein, the above-mentioned adapter 110 is used as a source, and can supply power to the charging device 120 , and the above-mentioned charging device 120 is used as a sink, and the above-mentioned adapter 110 can be connected to the above-mentioned charging device 120 through a cable. The adapter 110 and the charging device 120 can apply the relevant protocols of the USB PD communication standard. In the embodiment of the present application, there is no further improvement on the hardware of the adapter 110 and the charging device 120. You can refer to the structure of the existing adapter and charging device. This is not specifically limited.
为便于理解,下面从软件架构层面对上述适配器110和上述充电设备120进行说明,上述适配器110可以包括第一物理层111、第一协议层112和第一策略引擎113,上述充电设备120可以包括第二物理层121、第二协议层122和第二策略引擎123。充电设备120可以通过第二策略引擎123发送硬复位Hard reset指令,依次通过第二协议层122和第二物理层121传输至适配器110,具体的,可以通过第一物理层111、第一协议层112传输至第一策略引擎113,适配器110在接收到Hard reset指令后,可以执行相应的硬复位流程。具体流程在此先不赘述,参见后续基于通用串行总线供电的通信方法的说明。For ease of understanding, the above-mentioned adapter 110 and the above-mentioned charging device 120 are described below from the software architecture level. The above-mentioned adapter 110 may include a first physical layer 111, a first protocol layer 112 and a first policy engine 113. The above-mentioned charging device 120 may include The second physical layer 121 , the second protocol layer 122 and the second policy engine 123 . The charging device 120 can send a hard reset Hard reset command through the second policy engine 123, and transmit it to the adapter 110 through the second protocol layer 122 and the second physical layer 121 in turn, specifically, the first physical layer 111, the first protocol layer 112 is transmitted to the first policy engine 113, and the adapter 110 can execute a corresponding hard reset process after receiving the Hard reset command. The specific process will not be described in detail here, and refer to the subsequent description of the communication method based on USB power supply.
需要说明的是,适配器110和充电设备120之间正常进行USB PD通信时不需要进行硬复位,出现异常情况时才进行硬复位流程并适用本申请实施例提供的方法。It should be noted that a hard reset is not required during normal USB PD communication between the adapter 110 and the charging device 120, and the hard reset process is performed only when an abnormal situation occurs and the method provided in the embodiment of this application is applicable.
结合上述系统架构,进一步结合图3对本申请实施例中一种基于通用串行总线供电的通信方法进行说明,图3为本申请实施例提供的一种基于通用串行总线供电的通信方法的流程示意图,该通信方法适用于适配器,具体包括以下步骤:In combination with the above system architecture, a communication method based on universal serial bus power supply in the embodiment of the present application is further described in conjunction with Fig. 3, and Fig. 3 is a flow chart of a communication method based on universal serial bus power supply provided in the embodiment of the present application Schematic diagram, the communication method is applicable to the adapter, including the following steps:
步骤301,接收来自充电设备的硬复位信号,以进行初始化处理。 Step 301, receiving a hard reset signal from a charging device for initialization processing.
其中,所述初始化处理包括暂停与所述充电设备之间的供电通信链路。Wherein, the initialization process includes suspending the power supply communication link with the charging device.
具体的,可以通过第一物理层接收来自充电设备的硬复位信号,并在接收到硬复位信号时,第一物理层向所述适配器的第一协议层传输第一接收消息,并关闭所述第一物理层的通信功能,通过第一协议层重置第一消息标识计数器Message ID Counter和第一重传计数器Retry Counter,其中,所述第一接收消息用于指示已经接收到所述硬复位信号,所述第一消息标识计数器MessageIDCounter用于记录所述供电通信链路的次数,即MessageID,所述第一重传计数器RetryCounter用于记录所述供电通信链路的重传次数,在这里由于已经重置第一消息标识计数器Message ID Counter和第一重传计数器Retry Counter,所以计数和重传次数全部变为零,可以理解为初始化的处理,之后,通过所述第一协议层向所述适配器的第一策略引擎传输所述第一接收消息。Specifically, the hard reset signal from the charging device may be received through the first physical layer, and when receiving the hard reset signal, the first physical layer transmits a first reception message to the first protocol layer of the adapter, and closes the The communication function of the first physical layer resets the first message identification counter Message ID Counter and the first retransmission counter Retry Counter through the first protocol layer, wherein the first received message is used to indicate that the hard reset has been received signal, the first message identification counter MessageIDCounter is used to record the number of times of the power supply communication link, i.e. MessageID, and the first retransmission counter RetryCounter is used to record the number of retransmissions of the power supply communication link, here because The first message identification counter Message ID Counter and the first retransmission counter Retry Counter have been reset, so the count and the number of retransmissions all become zero, which can be understood as initialization processing, and then, through the first protocol layer to the described A first policy engine of the adapter transmits the first received message.
可见,通过接收来自充电设备的硬复位信号,以进行初始化处理,可以重置计数内容,便于后续重新开始执行USB PD通信。It can be seen that by receiving the hard reset signal from the charging device for initialization processing, the counting content can be reset, so that the USB PD communication can be restarted later.
步骤302,在第一时段内将供电电压调整为第一电压值。 Step 302, adjusting the supply voltage to a first voltage value within a first period of time.
其中,可以通过所述第一策略引擎启动第一定时器,在所述第一定时器记录的所述第一时段内将所述供电电压调整为所述第一电压值,该第一定时器可以为NoResponseTimer,在第一策略引擎接收到第一接收消息,确定Hard reset指令已经接收到时,可以启动该第一定时器,该第一定时器可以定时第一时段,供电电压需要在第一时段内降低至第一电压值,该第一电压值可以为PD通信标准中的Vsafe5V。Wherein, the first timer may be started by the first policy engine, and the power supply voltage is adjusted to the first voltage value within the first period recorded by the first timer, and the first timer It can be NoResponseTimer, when the first strategy engine receives the first reception message and determines that the Hard reset command has been received, the first timer can be started, the first timer can be timed for the first period, and the power supply voltage needs to be at the first time. During the time period, the voltage decreases to the first voltage value, which may be Vsafe5V in the PD communication standard.
步骤303,在检测到第二时段内所述第一电压值未调整为第二电压值时,确定所述适配器处于硬复位异常状态,使能所述适配器的第一物理层的通信功能。 Step 303, when it is detected that the first voltage value is not adjusted to the second voltage value within the second time period, determine that the adapter is in a hard reset abnormal state, and enable the communication function of the first physical layer of the adapter.
其中,上述第一定时器可以设定第二时段,在所述第一定时器记录的所述第二时段内未将所述第一电压值调整为所述第二电压值时,确定所述适配器处于所述硬复位异常状态,在处于硬复位异常状态时,通过所述第一策略引擎使能所述第一物理层的通信功能,上述第二电压值可以为PD通信标准中的Vsafe0V。Wherein, the above-mentioned first timer can set a 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 The adapter is in the abnormal state of hard reset, and when it is in the abnormal state of hard reset, the communication function of the first physical layer is enabled through the first policy engine, and the above-mentioned second voltage value may be Vsafe0V in the PD communication standard.
在一个可能的实施例中,在所述第一定时器记录的所述第二时段内将所述第一电压值调整为所述第二电压值时,则硬复位正常,继续执行后续的流程,具体的,可以在所述第二时段内将所述第一电压值调整为所述第二电压值时,通过所述第一策略引擎向所述第一协议层 传输第一复位消息,所述第一复位消息用于指示硬复位中的供电功率复位完成;In a possible embodiment, when the first voltage value is adjusted to the second voltage value within the second 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, the first policy engine may transmit a first reset message to the first protocol layer, so The first reset message is used to indicate that the power supply reset in the hard reset is completed;
进一步通过所述第一协议层向所述第一物理层传输第二复位消息,并使能所述第一物理层的通信功能以重新建立所述供电通信链路,所述第二复位消息用于指示硬复位完成。Further transmitting a second reset message to the first physical layer through the first protocol layer, and enabling the communication function of the first physical layer to re-establish the power supply communication link, the second reset message uses to indicate that the hard reset is complete.
可见,在检测到第二时段内所述第一电压值未调整为第二电压值时,确定所述适配器处于硬复位异常状态,使能所述适配器的第一物理层的通信功能,可以在检测到硬复位异常后自动重新启动第一物理层的通信功能,便于后续流程的推进,防止流程卡住,降低了USB PD过程中的兼容性问题。It can be seen that when it is detected that the first voltage value has not been adjusted to the second voltage value within the second period of time, 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 a hard reset abnormality is detected, the communication function of the first physical layer is automatically restarted, which facilitates the advancement of the subsequent process, prevents the process from getting stuck, and reduces the compatibility problem in the USB PD process.
步骤304,向所述充电设备发送数据包以重新建立所述供电通信链路。 Step 304, sending a data packet to the charging device to re-establish the power supply communication link.
其中,可以通过所述第一策略引擎向所述第一协议层传输所述数据包,该数据包可以为Souce cap包;Wherein, the data packet may be transmitted to the first protocol layer through the first policy engine, and the data packet may be a source cap packet;
具体的,可以通过所述第一协议层启动第二定时器,并向所述第一物理层传输所述数据包,所述第二定时器用于指示循环冗余校验(Cyclic Redundancy Check,CRC)的第三时段,其中,该第二定时器可以为CRCReceiveTimer,第三时段的时长可以为0.9~1.1mS,该第二定时器可以用于提示发送的Souce cap信息丢失,举例来说,在发送Souce cap消息后,如果在第二定时器的第三时段内即0.9~1.1mS后,没有收到对方的GoodCRC信息,则认为消息发送失败,则重新发送Souce cap消息;Specifically, a second timer may be started by the first protocol layer, and the data packet may be transmitted to the first physical layer, and the second timer is used to indicate a cyclic redundancy check (Cyclic Redundancy Check, CRC ), wherein the second timer can be CRCReceiveTimer, the duration of the third period can be 0.9-1.1mS, and the second timer can be used to prompt the loss of the Souce cap information sent, for example, in After sending the Souce cap message, if the GoodCRC message from the other party is not received within the third period of the second timer, that is, 0.9 ~ 1.1 mS, it is considered that the message has failed to be sent, and the Souce cap message is resent;
接着通过所述第一物理层向所述充电设备发送所述数据包;then sending the data packet to the charging device through the first physical layer;
在所述第三时段内接收所述充电设备反馈的第二消息时,关闭所述第一定时器和所述第二定时器,控制所述消息标识计数器增加一个计数,以完成所述供电通信链路。When receiving the second message fed back by the charging device within the third time period, turn off the first timer and the second timer, and control the message identification counter to increase a count, so as to complete the power supply communication link.
可见,通过上述方法,适配器可以自动在硬复位异常时使能第一物理层的通信功能,驱动流程推进,使得USB PD过程的兼容性大大增加。It can be seen that through the above method, the adapter can automatically enable the communication function of the first physical layer when the hard reset is abnormal, and the driving process is advanced, which greatly increases the compatibility of the USB PD process.
下面结合图4对本申请实施例中另一种基于通用串行总线供电的通信方法进行说明,图4为本申请实施例提供的另一种基于通用串行总线供电的通信方法,应用于充电设备,具体包括以下步骤:Another communication method based on USB power supply in the embodiment of the present application will be described below in conjunction with FIG. 4. FIG. 4 is another communication method based on Universal Serial Bus power supply provided in the embodiment of the application, which is applied to charging equipment , including the following steps:
步骤401,向适配器发送硬复位信号,并暂停与所述适配器之间的供电通信链路。 Step 401, sending a hard reset signal to the adapter, and suspending the power supply communication link with the adapter.
其中,可以通过充电设备的第二策略引擎向所述充电设备的第二协议层传输所述硬复位信号,第二策略引擎可以为Policy Engine;Wherein, the hard reset signal may be transmitted to the second protocol layer of the charging device through the second policy engine of the charging device, and the second policy engine may be Policy Engine;
通过所述第二协议层重置第二消息标识计数器和第二重传计数器,并向所述第二物理层传输所述硬复位信号,所述第二消息标识计数器用于记录所述供电通信链路的次数,所述第二重传计数器用于记录所述供电通信链路的重传次数,所述第二消息标识计数器Message ID Counter用于记录所述供电通信链路的次数,即Message ID,所述第二重传计数器Retry Counter用于记录所述供电通信链路的重传次数,在这里由于已经重置第二消息标识计数器Message ID Counter和第二重传计数器Retry Counter,所以计数和重传次数全部变为零;The second message identification counter and the second retransmission counter are reset through the second protocol layer, and the hard reset signal is transmitted to the second physical layer, and the second message identification counter is used to record the power supply communication The number of times of the link, the second retransmission counter is used to record the number of retransmissions of the power supply communication link, and the second message identification counter Message ID Counter is used to record the number of times of the power supply communication link, i.e. Message ID, the second retransmission counter Retry Counter is used to record the number of retransmissions of the power supply communication link, here because the second message identification counter Message ID Counter and the second retransmission counter Retry Counter have been reset, so the count and the number of retransmissions all become zero;
进一步,通过所述第二物理层向所述适配器发送所述硬复位信号,关闭所述第二物理层的通信功能。Further, sending the hard reset signal to the adapter through the second physical layer to close the communication function of the second physical layer.
步骤402,在检测到所述适配器处于硬复位异常状态时,在第三时段后使能所述充电设备的第二物理层的通信功能。 Step 402, when it is detected that the adapter is in a hard reset abnormal state, enabling the communication function of the second physical layer of the charging device after a third period of time.
其中,充电设备可以检测所述适配器在第一时段和第二时段的供电电压;Wherein, the charging device can detect the power supply voltage of the adapter in the first period and the second period;
在所述供电电压在第二时段结束时不为第二电压值时,确定所述适配器处于所述硬复位异常状态;determining that the adapter is in the hard reset abnormal state when the supply voltage is not a second voltage value at the end of the second period;
通过所述第二物理层启动第三定时器,在所述第三定时器记录的所述第三时段后使能所 述第二物理层的通信功能,此处的第三时段可以与图1中的t3时长相同,如第三时段可以为800ms。The third timer is started by the second physical layer, and the communication function of the second physical layer is enabled after the third period recorded by the third timer, where the third period can be the same as that in FIG. 1 The duration of t3 in is the same, for example, the third period may be 800ms.
可以理解的是,在检测到第二时段内供电电压未从Vsafe5V掉电至Vsafe0V时,则可以确定适配器处于硬复位异常状态,第二策略引擎告知第二协议层充电设备已经复位,在等待第三时段后强行使能第二物理层的通信功能。It can be understood that when it is detected that the power supply voltage does not drop from Vsafe5V to Vsafe0V within the second time period, it can be determined that the adapter is in a hard reset abnormal state, and the second policy engine informs the second protocol layer that the charging device has been reset, waiting for the first After three periods, the communication function of the second physical layer is forcibly enabled.
可见,通过自动检测适配器的供电电压变化,可以确定适配器的硬复位过程是否出现异常,并在硬复位异常时自动使能第二物理层的通信功能,防止USB PD过程卡住,大大提升了USB PD过程的兼容性。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 getting stuck, which greatly improves the USB Compatibility of PD procedure.
步骤403,接收来自所述适配器的数据包以重新建立供电通信链路。 Step 403, receiving a data packet from the adapter to re-establish the power supply communication link.
其中,可以通过所述第二物理层接收来自所述适配器的所述数据包,该数据包可以为Souce cap包;Wherein, the data packet from the adapter may be received through the second physical layer, and the data packet may be a source cap packet;
通过所述第二协议层保存消息标识MessageID,并对所述数据包进行循环冗余校验以得到校验结果,所述校验结果包括通过和不通过;Save the message identifier MessageID through the second protocol layer, and perform a cyclic redundancy check on the data packet to obtain a check result, and the check result includes pass and fail;
在所述校验结果为通过时,通过所述第二协议层将所述校验结果GoodCRC传输至所述第二物理层;When the verification result is passed, the verification result GoodCRC is transmitted to the second physical layer through the second protocol layer;
通过所述第二物理层将所述校验结果GoodCRC反馈至所述适配器,以完成所述供电通信链路。The check result GoodCRC is fed back to the adapter through the second physical layer, so as to complete the power supply communication link.
可见,通过上述方法,充电设备可以在硬复位异常时自动使能第二物理层的通信功能,大大提升了USB PD过程的兼容性。It can be seen that through the above method, the charging device can automatically enable the communication function of the second physical layer when the hard reset is abnormal, which greatly improves the compatibility of the USB PD process.
为了便于理解,下面结合图5对本申请实施例中另一种基于通用串行总线供电的通信方法进行说明,图5为本申请实施例提供的另一种基于通用串行总线供电的通信方法的流程示意图,应用于适配器和充电设备,具体包括以下步骤:For ease of understanding, another communication method based on USB power supply in the embodiment of the present application will be described below in conjunction with FIG. 5. FIG. Schematic diagram of the process, which is applied to adapters and charging devices, and specifically includes the following steps:
步骤501,第二策略引擎向第二协议层发送硬复位信号;Step 501, the second policy engine sends a hard reset signal to the second protocol layer;
步骤502,第二协议层向第二物理层传输硬复位信号,并复位第二消息标识计数器和第二重传计数器;Step 502, the second protocol layer transmits a hard reset signal to the second physical layer, and resets the second message identification counter and the second retransmission counter;
步骤503,第二物理层向第一物理层传输硬复位信号,并关闭自身的通信功能;Step 503, the second physical layer transmits a hard reset signal to the first physical layer, and closes its own communication function;
步骤504,第一物理层接收到硬复位信号后向第一协议层传输第一接收消息,并关闭自身的通信功能;Step 504, after receiving the hard reset signal, the first physical layer transmits the first receiving message to the first protocol layer, and closes its own communication function;
其中,该第一接收消息用于表示已经接收到硬复位信号;Wherein, the first receiving message is used to indicate that a hard reset signal has been received;
步骤505,第一协议层向第一策略引擎传输第一接收消息,并复位第一消息标识计数器和第一重传计数器;Step 505, the first protocol layer transmits the first received message to the first policy engine, and resets the first message identification counter and the first retransmission counter;
步骤506,第一策略引擎启动第一定时器,控制供电电压在第一时段掉电至Vsafe5V,在第二时段内掉电至Vsafe0V;Step 506, the first strategy engine starts a first timer, controls the power supply voltage to be powered down to Vsafe5V in the first period, and is powered down to Vsafe0V in the second period;
步骤507,在第二时段内未掉电至Vsafe0V时,通过第一协议层强制使能第一物理层的通信功能;Step 507, when the power is not down to Vsafe0V within the second time period, forcibly enable the communication function of the first physical layer through the first protocol layer;
步骤508,第二策略引擎告知第二协议层充电设备已经复原;Step 508, the second policy engine informs the second protocol layer that the charging device has recovered;
步骤509,在检测到适配器处于硬复位异常状态时,通过第二协议层启动第三定时器,在第三时段后强制使能第二物理层的通信功能以完成硬复位过程。Step 509, when it is detected that the adapter is in the hard reset abnormal state, start a third timer through the second protocol layer, and force enable the communication function of the second physical layer after the third time period to complete the hard reset process.
在一个可能的实施例中,在硬复位完成后,可以重新建立USB PD通信。具体如以下步骤:In one possible embodiment, USB PD communication can be re-established after the hard reset is complete. The specific steps are as follows:
步骤510,第一策略引擎向第一协议层发送Soucecap包;Step 510, the first policy engine sends a Soucecap packet to the first protocol layer;
步骤511,第一协议层启动第二定时器CRC receive timer,并向第一物理层发送Souce cap包;Step 511, the first protocol layer starts the second timer CRC receive timer, and sends the Souce cap packet to the first physical layer;
步骤512,第一物理层向第二物理层发送Souce cap包并进行CRC校验;Step 512, the first physical layer sends a Source cap packet to the second physical layer and performs a CRC check;
步骤513,第二物理层向第二协议层发送Souce cap包;Step 513, the second physical layer sends a source cap packet to the second protocol layer;
步骤514,第二协议层告知第二策略引擎已经接收到Souce cap包,并对Souce cap包进行校验;Step 514, the second protocol layer informs the second strategy engine that the source cap packet has been received, and the source cap packet is verified;
步骤515,第二协议层向第二物理层发送GoodCRC消息;Step 515, the second protocol layer sends a GoodCRC message to the second physical layer;
步骤516,第二物理层向第一物理层传输GoodCRC消息;Step 516, the second physical layer transmits a GoodCRC message to the first physical layer;
步骤517,第一物理层向第一协议层传输GoodCRC消息;Step 517, the first physical layer transmits the GoodCRC message to the first protocol layer;
步骤518,第一协议层向第一策略引擎传输GoodCRC消息,停止第二计时器;Step 518, the first protocol layer transmits the GoodCRC message to the first policy engine, and stops the second timer;
步骤519,第一策略引擎控制第一消息标识计数器加一,USB PD通信建立成功。Step 519, the first policy engine controls the first message identification counter to add one, and the USB PD communication is established successfully.
上述未详细说明的步骤可以参见图3和图4中所描述的全部或部分方法的步骤,在此不再赘述。For steps not described in detail above, reference may be made to all or part of the steps of the method described in FIG. 3 and FIG. 4 , and details are not repeated here.
可见,通过上述方法,可以在不增加硬件成本的基础上,优化USB Power Delivery流程,当未检测到source端正常的Hard reset流程情况下,充电设备Sink端流程能够正常运转,从而增加了USB Power Delivery充电设备的兼容性。It can be seen that through the above method, the USB Power Delivery process can be optimized without increasing the hardware cost. When the normal Hard reset process at the source end is not detected, the sink end process of the charging device can run normally, thereby increasing the USB Power Delivery process. Delivery charging device compatibility.
上述主要从方法侧执行过程的角度对本申请实施例的方案进行了介绍。可以理解的是,电子设备为了实现上述功能,其包含了执行各个功能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本文中所提供的实施例描述的各示例的单元及算法步骤,本申请能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。The foregoing mainly introduces the solutions of the embodiments of the present application from the perspective of executing the process on the method side. It can be understood that, in order to realize the above functions, the electronic device includes hardware structures and/or software modules corresponding to each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of the examples 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 executed by hardware or computer software drives hardware depends on the specific application and design constraints of the technical solution. Skilled artisans may use different methods to implement the described functions for each specific application, but such implementation should not be regarded as exceeding the scope of the present application.
本申请实施例可以根据上述方法示例对电子设备进行功能单元的划分,例如,可以对应各个功能划分各个功能单元,也可以将两个或两个以上的功能集成在一个处理单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。需要说明的是,本申请实施例中对单元的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。The embodiment of the present application may divide the electronic device into functional units according to the above method example, for example, each functional unit may be divided corresponding to each function, or two or more functions may be integrated into one processing unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units. It should be noted that the division of units in the embodiment of the present application is schematic, and is only a logical function division, and there may be another division manner in actual implementation.
在采用对应各个功能划分各个功能模块的情况下,下面结合图6对本申请实施例中的一种基于通用串行总线供电的通信装置进行详细说明,图6为本申请实施例提供的一种基于通用串行总线供电的通信装置600的功能单元组成框图,所述装置应用于适配器,所述装置包括:In the case of dividing each functional module corresponding to each function, a communication device based on universal serial bus power supply in the embodiment of the application will be described in detail below in conjunction with FIG. 6. FIG. 6 is a communication device based on A block diagram of the functional units of the USB-powered communication device 600, the device is applied to an adapter, and the device includes:
接收单元610,用于接收来自充电设备的硬复位信号,以进行初始化处理,所述初始化处理包括暂停与所述充电设备之间的供电通信链路;The receiving unit 610 is configured to receive a hard reset signal from the charging device to perform initialization processing, the initialization processing including suspending the power supply communication link with the charging device;
电压调整单元620,用于在第一时段内将供电电压调整为第一电压值;A voltage adjustment unit 620, configured to adjust the supply voltage to a first voltage value within a first period of time;
第一使能单元630,用于在检测到第二时段内所述第一电压值未调整为第二电压值时,确定所述适配器处于硬复位异常状态,使能所述适配器的第一物理层的通信功能;The first enabling unit 630 is configured to determine that the adapter is in a hard reset abnormal state when detecting that the first voltage value has not been adjusted to a second voltage value within a second period of time, and enable the first physical The communication function of the layer;
第一通信单元640,用于向所述充电设备发送数据包以重新建立所述供电通信链路。The first communication unit 640 is configured to send a data packet to the charging device to re-establish the power supply communication link.
在采用对应各个功能划分各个功能模块的情况下,下面结合图7对本申请实施例中的另一种基于通用串行总线供电的通信装置进行详细说明,图7为本申请实施例提供的另一种基于通用串行总线供电的通信装置700的功能单元组成框图,所述装置应用于充电设备,所述 装置包括:In the case of dividing each functional module corresponding to each function, another communication device based on universal serial bus power supply in the embodiment of the application will be described in detail below in conjunction with FIG. 7. FIG. 7 is another communication device provided by the embodiment of the application A block diagram of functional units of a communication device 700 powered by a universal serial bus, the device is applied to a charging device, and the device includes:
发送单元710,用于向适配器发送硬复位信号,并暂停与所述适配器之间的供电通信链路;a sending unit 710, configured to send a hard reset signal to the adapter, and suspend the power supply communication link with the adapter;
第二使能单元720,用于在检测到所述适配器处于硬复位异常状态时,在第三时段后使能所述充电设备的第二物理层的通信功能;The second enabling unit 720 is configured to enable the communication function of the second physical layer of the charging device after a third period of time when it is detected that the adapter is in a hard reset abnormal state;
第二通信单元730,用于接收来自所述适配器的数据包以重新建立所述供电通信链路。The second communication unit 730 is configured to receive a data packet from the adapter to re-establish the power supply communication link.
其中,上述方法实施例涉及的各步骤的所有相关内容均可以援引到对应功能模块的功能描述,在此不再赘述。Wherein, all relevant content of each step involved in the above-mentioned method embodiment can be referred to the function description of the corresponding function module, and will not be repeated here.
本申请实施例还提供了一种适配器,所述适配器包括处理器、存储器,以及一个或多个程序,所述一个或多个程序被存储在所述存储器中,并且被配置由所述处理器执行,所述程序包括用于执行如图3中任一项所述的方法中的步骤的指令。The embodiment of the present application also provides an adapter, the adapter includes a processor, a memory, and one or more programs, the one or more programs are stored in the memory, and configured by the processor Execution, the program includes instructions for executing the steps in the method as described in any one of FIG. 3 .
本申请实施例提供了一种充电设备,所述充电设备包括处理器、存储器,以及一个或多个程序,所述一个或多个程序被存储在所述存储器中,并且被配置由所述处理器执行,所述程序包括用于执行如图4中任一项所述的方法中的步骤的指令。An embodiment of the present application provides a charging device, the charging device includes a processor, a memory, and one or more programs, the one or more programs are stored in the memory, and configured to be processed by the Executed by a computer, the program includes instructions for executing the steps in the method as described in any one of FIG. 4 .
本申请实施例还提供一种计算机存储介质,其中,该计算机存储介质存储用于电子数据交换的计算机程序,该计算机程序使得计算机执行如上述方法实施例中记载的任一方法的部分或全部步骤,上述计算机包括电子设备。An embodiment of the present application also provides a computer storage medium, wherein the computer storage medium stores a computer program for electronic data exchange, and the computer program enables the computer to execute some or all of the steps of any method described in the above method embodiments , the above-mentioned computer includes electronic equipment.
本申请实施例还提供一种计算机程序产品,上述计算机程序产品包括存储了计算机程序的非瞬时性计算机可读存储介质,上述计算机程序可操作来使计算机执行如上述方法实施例中记载的任一方法的部分或全部步骤。该计算机程序产品可以为一个软件安装包。An embodiment of the present application also provides a computer program product, the computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to enable the computer to execute any one of the methods described in the above method embodiments. Some or all steps of the method. The computer program product may be a software installation package.
需要说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请并不受所描述的动作顺序的限制,因为依据本申请,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本申请所必须的。It should be noted that for the foregoing method embodiments, for the sake of simple description, they are expressed as a series of action combinations, but those skilled in the art should know that the present application is not limited by the described action sequence. Depending on the application, certain steps may be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification belong to preferred embodiments, and the actions and modules involved are not necessarily required by this application.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。In the foregoing embodiments, the descriptions of each embodiment have their own emphases, and for parts not described in detail in a certain embodiment, reference may be made to relevant descriptions of other embodiments.
在本申请所提供的几个实施例中,应该理解到,所揭露的装置,可通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如上述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed device can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the above units is only a logical function division. In actual implementation, there may be other division methods, for example, multiple units or components can be combined or integrated. to another system, or some features may be ignored, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical or other forms.
上述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
上述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储器中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计 算机软件产品存储在一个存储器中,包括若干指令用以使得一台计算机设备(可为个人计算机、服务器或者网络设备等)执行本申请各个实施例上述方法的全部或部分步骤。而前述的存储器包括:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。If the above-mentioned integrated units are realized in the form of software function units and sold or used as independent products, they can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application is essentially or part of the contribution to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a memory. Several instructions are included to make a computer device (which may be a personal computer, server or network device, etc.) execute all or part of the steps of the above-mentioned methods in various embodiments of the present application. The aforementioned memory includes: various media that can store program codes such as U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk.
本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序可以存储于一计算机可读存储器中,存储器可以包括:闪存盘、只读存储器(英文:Read-Only Memory,简称:ROM)、随机存取器(英文:Random Access Memory,简称:RAM)、磁盘或光盘等。Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above-mentioned embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable memory, and the memory can include: a flash disk , Read-only memory (English: Read-Only Memory, referred to as: ROM), random access device (English: Random Access Memory, referred to as: RAM), magnetic disk or optical disc, etc.
以上对本申请实施例进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。The embodiments of the present application have been introduced in detail above, and specific examples have been used in this paper to illustrate the principles and implementation methods of the present application. The descriptions of the above embodiments are only used to help understand the methods and core ideas of the present application; meanwhile, for Those skilled in the art will have changes in specific implementation methods and application scopes based on the ideas of the present application. In summary, the contents of this specification should not be construed as limiting the present application.

Claims (10)

  1. 一种基于通用串行总线供电的通信方法,其特征在于,应用于适配器,所述方法包括:A kind of communication method based on universal serial bus power supply, it is characterized in that being applied to adapter, described method comprises:
    接收来自充电设备的硬复位信号,以进行初始化处理,所述初始化处理包括暂停与所述充电设备之间的供电通信链路;receiving a hard reset signal from a charging device to perform an initialization process that includes suspending a power supply communication link with the charging device;
    在第一时段内将供电电压调整为第一电压值;adjusting the supply voltage to a first voltage value within a first period of time;
    在检测到第二时段内所述第一电压值未调整为第二电压值时,确定所述适配器处于硬复位异常状态,使能所述适配器的第一物理层的通信功能;When it is detected that the first voltage value is not adjusted to the second voltage value within the second period of time, 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;
    向所述充电设备发送数据包以重新建立所述供电通信链路。sending a data packet to the charging device to re-establish the power supply communication link.
  2. 根据权利要求1所述的方法,其特征在于,所述接收来自充电设备的硬复位信号,以进行初始化处理,包括:The method according to claim 1, wherein the receiving a hard reset signal from the charging device to perform initialization processing includes:
    通过所述第一物理层接收到来自所述充电设备的硬复位信号时,向所述适配器的第一协议层传输第一接收消息,关闭所述第一物理层的通信功能,所述第一接收消息用于指示接收到所述硬复位信号;When receiving a hard reset signal from the charging device through the first physical layer, transmit a first reception message to the first protocol layer of the adapter, close the communication function of the first physical layer, and the first The receiving message is used to indicate that the hard reset signal is received;
    通过所述第一协议层重置第一消息标识计数器和第一重传计数器,所述第一消息标识计数器用于记录所述供电通信链路的次数,所述第一重传计数器用于记录所述供电通信链路的重传次数;The first message identification counter and the first retransmission counter are reset by the first protocol layer, the first message identification counter is used to record the number of times of the power supply communication link, and the first retransmission counter is used to record The number of retransmissions of the power supply communication link;
    通过所述第一协议层向所述适配器的第一策略引擎传输所述第一接收消息。The first received message is transmitted to a first policy engine of the adapter via the first protocol layer.
  3. 根据权利要求2所述的方法,其特征在于,所述在第一时段内将供电电压调整为第一电压值,包括:The method according to claim 2, wherein the adjusting the supply voltage to the first voltage value within the first period of time comprises:
    通过所述第一策略引擎启动第一定时器,在所述第一定时器记录的所述第一时段内将所述供电电压调整为所述第一电压值。A first timer is started by the first policy engine, and the supply voltage is adjusted to the first voltage value within the first period recorded by the first timer.
  4. 根据权利要求3所述的方法,其特征在于,所述在第二时段内无法将所述第一电压值调整为第二电压值时,确定所述适配器处于硬复位异常状态,使能所述适配器的物理层的通信功能,包括:The method according to claim 3, wherein when the first voltage value cannot be 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 enabling the The communication functions of the physical layer of the adapter, including:
    在所述第一定时器记录的所述第二时段内未将所述第一电压值调整为所述第二电压值时,确定所述适配器处于所述硬复位异常状态;determining that the adapter is in the hard reset abnormal state when the first voltage value is not adjusted to the second voltage value within the second period recorded by the first timer;
    通过所述第一策略引擎使能所述第一物理层的通信功能。The communication function of the first physical layer is enabled by the first policy engine.
  5. 根据权利要求3所述的方法,其特征在于,所述向所述充电设备发送数据包以重新建立所述供电通信链路,包括:The method according to claim 3, wherein the sending a data packet to the charging device to re-establish the power supply communication link comprises:
    通过所述第一策略引擎向所述第一协议层传输所述数据包;transmitting the data packet to the first protocol layer through the first policy engine;
    通过所述第一协议层启动第二定时器,并向所述第一物理层传输所述数据包,所述第二定时器用于指示循环冗余校验的第三时段;Start a second timer through the first protocol layer, and transmit the data packet to the first physical layer, where the second timer is used to indicate a third period of cyclic redundancy check;
    通过所述第一物理层向所述充电设备发送所述数据包;sending the data packet to the charging device through the first physical layer;
    在所述第三时段内接收所述充电设备反馈的第二消息时,关闭所述第一定时器和所述第二定时器,控制所述消息标识计数器增加一个计数,以完成所述供电通信链路。When receiving the second message fed back by the charging device within the third time period, turn off the first timer and the second timer, and control the message identification counter to increase a count, so as to complete the power supply communication link.
  6. 根据权利要求2所述的方法,其特征在于,所述在第一时段内将供电电压调整为第一电压值之后,所述方法还包括:The method according to claim 2, characterized in that, after adjusting the supply voltage to a first voltage value within the first period of time, the method further comprises:
    在所述第二时段内将所述第一电压值调整为所述第二电压值时,通过所述第一策略引擎向所述第一协议层传输第一复位消息,所述第一复位消息用于指示硬复位中的供电功率复位完成;When the first voltage value is adjusted to the second voltage value within the second period, the first reset message is transmitted to the first protocol layer through the first policy engine, and the first reset message is It is used to indicate that the power supply reset in hard reset is completed;
    通过所述第一协议层向所述第一物理层传输第二复位消息,并使能所述第一物理层的通信功能以重新建立所述供电通信链路,所述第二复位消息用于指示硬复位完成。Transmitting a second reset message to the first physical layer through the first protocol layer, and enabling the communication function of the first physical layer to re-establish the power supply communication link, the second reset message is used for Indicates that the hard reset is complete.
  7. 一种基于通用串行总线供电的通信方法,其特征在于,应用于充电设备,所述方法包括:A communication method based on universal serial bus power supply, characterized in that it is applied to a charging device, and the method includes:
    向适配器发送硬复位信号,并暂停与所述适配器之间的供电通信链路;sending a hard reset signal to the adapter and suspending the powered communication link with the adapter;
    在检测到所述适配器处于硬复位异常状态时,在第三时段后使能所述充电设备的第二物理层的通信功能;When detecting that the adapter is in a hard reset abnormal state, enabling the communication function of the second physical layer of the charging device after a third period of time;
    接收来自所述适配器的数据包以重新建立所述供电通信链路。A data packet is received from the adapter to re-establish the powered communication link.
  8. 一种基于通用串行总线供电的通信装置,其特征在于,应用于适配器,所述通信装置包括:A communication device powered by a universal serial bus is characterized in that it is applied to an adapter, and the communication device includes:
    接收单元,用于接收来自充电设备的硬复位信号,以进行初始化处理,所述初始化处理包括暂停与所述充电设备之间的供电通信链路;a receiving unit, configured to receive a hard reset signal from the charging device to perform initialization processing, the initialization processing including suspending the power supply communication link with the charging device;
    电压调整单元,用于在第一时段内将供电电压调整为第一电压值;a voltage adjustment unit, configured to adjust the supply voltage to a first voltage value within a first period of time;
    第一使能单元,用于在检测到第二时段内所述第一电压值未调整为第二电压值时,确定所述适配器处于硬复位异常状态,使能所述适配器的第一物理层的通信功能;A first enabling unit, configured to determine that the adapter is in a hard reset abnormal state when detecting that the first voltage value has not been adjusted to a second voltage value within a second period of time, and enable the first physical layer of the adapter communication function;
    第一通信单元,用于向所述充电设备发送数据包以重新建立所述供电通信链路。A first communication unit, configured to send a data packet to the charging device to re-establish the power supply communication link.
  9. 一种基于通用串行总线供电的通信装置,其特征在于,应用于充电设备,所述通信装置包括:A communication device powered by a universal serial bus is characterized in that it is applied to a charging device, and the communication device includes:
    发送单元,用于向适配器发送硬复位信号,并暂停与所述适配器之间的供电通信链路;a sending unit, configured to send a hard reset signal to the adapter, and suspend the power supply communication link with the adapter;
    第二使能单元,用于在检测到所述适配器处于硬复位异常状态时,在第三时段后使能所述充电设备的第二物理层的通信功能;A second enabling unit, configured to enable the communication function of the second physical layer of the charging device after a third period of time when it is detected that the adapter is in a hard reset abnormal state;
    第二通信单元,用于接收来自所述适配器的数据包以重新建立所述供电通信链路。The second communication unit is configured to receive a data packet from the adapter to re-establish the power supply communication link.
  10. 一种计算机存储介质,其特征在于,所述计算机存储介质存储有计算机程序,所述计算机程序包括程序指令,所述程序指令当被处理器执行时使所述处理器执行如权利要求1~7任一项所述的方法。A computer storage medium, characterized in that, the computer storage medium stores a computer program, the computer program includes program instructions, and when the program instructions are executed by a processor, the processor executes the procedure described in claims 1-7. any one of the methods described.
PCT/CN2022/108982 2021-08-03 2022-07-29 Universal serial bus power delivery-based communication method and related apparatus WO2023011351A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110883437.4 2021-08-03
CN202110883437.4A CN113326222B (en) 2021-08-03 2021-08-03 Communication method based on universal serial bus power supply and related device

Publications (1)

Publication Number Publication Date
WO2023011351A1 true WO2023011351A1 (en) 2023-02-09

Family

ID=77426900

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/108982 WO2023011351A1 (en) 2021-08-03 2022-07-29 Universal serial bus power delivery-based communication method and related apparatus

Country Status (2)

Country Link
CN (2) CN113326222B (en)
WO (1) WO2023011351A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113326222B (en) * 2021-08-03 2021-12-10 深圳英集芯科技股份有限公司 Communication method based on universal serial bus power supply and related device

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1728097A (en) * 2004-07-29 2006-02-01 国际商业机器公司 Method to switch the lock-bits combination used to lock a page table entry upon receiving system reset exceptions
JP2010226819A (en) * 2009-03-23 2010-10-07 Rohm Co Ltd Power supply device
JP2012055133A (en) * 2010-09-03 2012-03-15 Ricoh Co Ltd Charger for secondary cell
CN103381756A (en) * 2013-07-03 2013-11-06 惠州市亿能电子有限公司 Method for monitoring abnormal resetting or abnormal power failure of battery management system
US20170222435A1 (en) * 2016-01-28 2017-08-03 Renesas Electronics Corporation Semiconductor device and power feed system
KR20190005643A (en) * 2017-07-07 2019-01-16 삼성전자주식회사 Electronic device supporting usb power delivery standard and a method of charging the electronic device
CN109696903A (en) * 2018-12-11 2019-04-30 东风汽车集团有限公司 A kind of functional safety circuit and control method for automobile controller
CN110661968A (en) * 2018-06-29 2020-01-07 佳能株式会社 Electronic device, control method thereof, and non-transitory computer-readable storage medium
CN113326222A (en) * 2021-08-03 2021-08-31 深圳英集芯科技股份有限公司 Communication method based on universal serial bus power supply and related device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6697957B2 (en) * 2016-06-07 2020-05-27 ローム株式会社 Power supply device, power supply controller, and power supply method

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1728097A (en) * 2004-07-29 2006-02-01 国际商业机器公司 Method to switch the lock-bits combination used to lock a page table entry upon receiving system reset exceptions
JP2010226819A (en) * 2009-03-23 2010-10-07 Rohm Co Ltd Power supply device
JP2012055133A (en) * 2010-09-03 2012-03-15 Ricoh Co Ltd Charger for secondary cell
CN103381756A (en) * 2013-07-03 2013-11-06 惠州市亿能电子有限公司 Method for monitoring abnormal resetting or abnormal power failure of battery management system
US20170222435A1 (en) * 2016-01-28 2017-08-03 Renesas Electronics Corporation Semiconductor device and power feed system
KR20190005643A (en) * 2017-07-07 2019-01-16 삼성전자주식회사 Electronic device supporting usb power delivery standard and a method of charging the electronic device
CN110661968A (en) * 2018-06-29 2020-01-07 佳能株式会社 Electronic device, control method thereof, and non-transitory computer-readable storage medium
CN109696903A (en) * 2018-12-11 2019-04-30 东风汽车集团有限公司 A kind of functional safety circuit and control method for automobile controller
CN113326222A (en) * 2021-08-03 2021-08-31 深圳英集芯科技股份有限公司 Communication method based on universal serial bus power supply and related device

Also Published As

Publication number Publication date
CN113326222B (en) 2021-12-10
CN113326222A (en) 2021-08-31
CN115706437A (en) 2023-02-17

Similar Documents

Publication Publication Date Title
US10845868B2 (en) Methods and apparatus for running and booting an inter-processor communication link between independently operable processors
US10339093B2 (en) USB interface using repeaters with guest protocol support
US8661168B2 (en) Specialized universal serial bus controller
US10831700B2 (en) Methods and apparatus for reducing power consumption within embedded systems
US20060076977A1 (en) USB 1.1 for USB OTG implementation
US10348616B2 (en) Packet transmission method and apparatus, and interconnect interface
US20050055456A1 (en) Method, system, and program for managing a speed at which data is transmitted between network adaptors
US20070198761A1 (en) Connection management mechanism
JP2007020398A (en) Method and apparatus for processing charge status inside mobile electronic device
WO2023011351A1 (en) Universal serial bus power delivery-based communication method and related apparatus
CN108008980B (en) Method and apparatus for initiating re-enumeration of USB3.0 compatible devices
US11463198B2 (en) Security module for a serial communications device
WO2021093734A1 (en) Usb communication implementing method and apparatus
TW201029410A (en) Data communication device, communication control method, and program
WO2022166698A1 (en) Charging control method and apparatus, electronic device, and charger
EP2726992B1 (en) Network control model driver
JP2000267951A (en) Data transfer control system and its method
JP2002055887A (en) Transmission controller, transmission control method, information processor and information recording medium
CN107346294A (en) Data-flow-control system and method based on SPI protocol
CN112910047A (en) Charging control method, charging equipment and charging control chip
WO2018188404A1 (en) Usb device configuration method and host
CN117667813A (en) Data communication method, device, electronic device and storage medium
EP2936760A1 (en) Devices and methods for transmitting usb termination signals over extension media
TWI231672B (en) SOL realizing method in accordance with IPMI standard
EP3040858A1 (en) A method and system of processing an image update

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22852064

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE