USB data transmission method and device, USB equipment, storage medium and electronic device
By detecting and generating link power management transactions for LPM tokens, the problem of USB terminals supporting the ULPI protocol being unable to perform LPM transmission is solved, a low-power mode is achieved without modifying the physical layer interface, and the design efficiency and security of the device are improved.
Patent Information
- Application Number
- CN202510537499.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-27
- Publication Date
- 2025-09-05
AI Technical Summary
In the prior art, a USB terminal supporting the ULPI protocol cannot perform Link Power Management (LPM) transmission, resulting in an inability to enter a low power consumption mode.
By detecting the token data to be transmitted by the USB terminal, a link power management transaction containing the LPM token is generated and transmitted to the physical layer interface of the USB terminal at the opposite end to realize LPM transmission.
Without modifying the physical layer interface of the USB terminal, LPM transmission of the USB terminal supporting the ULPI protocol is realized, and the USB terminal enters the low power mode, which shortens the design cycle of the device and reduces the risk.
Smart Images

Figure CN120595930A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a USB data transmission method and device, a USB device, a storage medium, and an electronic device. Background Art
[0002] In related technologies, the USB 2.0 protocol originally had only one low-power mode, the Suspend / Resume mode. To enter Suspend mode, a device or root port must detect that the bus is idle for 3ms (i.e., no transmission on the USB bus, including the SOF signal). Resume takes more than 20ms. USB 2.0 Link Power Management (LPM), introduced as an ECN (Engineering Change Notice), allows the host and device to exchange information through control transmissions, quickly entering a low-power state (L1); the time required to exit low-power mode is also greatly shortened.
[0003] In order to facilitate the implementation of USB2.0 hosts / devices, shorten product design cycles, and reduce risks, the industry proposed the UTMI (USB2.0 Transceiver Macrocell Interface) protocol to standardize the USB2.0 EPHY interface.
[0004] Because the UTMI specification requires many pins, the ULPI (UTMI + Low Pin Interface (LPI)) specification was later proposed. Its idea is to design the signals that are not frequently switched on the original UTMI interface into configurable registers, thereby reducing the number of required pins. ULPI is the low pin version of UTMI. LPM Extended Transaction uses the reserved PID (4'b0) specified in the USB2.0 protocol. However, this reserved PID is not supported in the ULPIPHY (physical layer). The ULPI Spec uses the PID of all 0s (NOPID) for operations such as Chirp / Resume, which makes LPM transmission impossible and prevents entering low-power mode.
[0005] Currently, no effective solution has been found for the above-mentioned problems existing in the related technologies. Summary of the Invention
[0006] Embodiments of the present invention provide a USB data transmission method and apparatus, a USB device, a storage medium, and an electronic device.
[0007] According to one embodiment of the present invention, a method for transmitting USB data is provided, comprising: detecting token data to be transmitted by a first USB terminal, wherein the first USB terminal includes a first physical layer interface (PHY) and is a USB terminal supporting the ULPI protocol; generating a link power management (LPM) transaction based on the token data, wherein the LPM transaction includes an LPM token; and transmitting the LPM transaction to a second PHY of a second USB terminal, wherein the second USB terminal includes the second PHY, and the first PHY is communicatively connected to the second PHY.
[0008] Optionally, generating an LPM transaction according to the token data includes: determining whether the token data is an LPM token; if the token data is an LPM token, generating an LPM transaction according to the LPM token.
[0009] Optionally, generating an LPM transaction according to the LPM token includes: obtaining a data packet to be transmitted by the first USB terminal; and inserting a token packet containing the LPM token before the data packet to obtain an LPM transaction.
[0010] Optionally, before generating an LPM transaction based on the LPM token, the method further includes: converting the LPM token into a NOPID token packet, wherein the NOPID token packet is used to indicate that the transmitted USB data does not contain a data packet identifier PID; transmitting the NOPID data packet to the second PHY of the second USB terminal; and after the NOPID data packet is transmitted, determining to generate an LPM transaction based on the LPM token.
[0011] Optionally, after determining whether the token data is an LPM token, the method further includes: if the token data is not an LPM token, forwarding the token data to the second PHY of the second USB.
[0012] Optionally, transmitting the LPM transaction to the second PHY of the second USB terminal includes: transmitting the LPM transaction to the first PHY through the ULPI link encapsulator of the first USB terminal; converting the LPM transaction into an analog signal on the first PHY, and transmitting the analog signal to the second PHY of the second USB terminal.
[0013] According to another embodiment of the present invention, a USB data transmission device is provided, comprising: a detection module for detecting token data to be transmitted by a first USB terminal, wherein the first USB terminal includes a first physical layer interface PHY and is a USB terminal supporting the ULPI protocol; a generation module for generating a link power management (LPM) transaction based on the token data, wherein the LPM transaction includes an LPM token; and a transmission module for transmitting the LPM transaction to a second PHY of a second USB terminal, wherein the second USB terminal includes the second PHY and the first PHY is communicatively connected to the second PHY.
[0014] Optionally, the generation module includes: a judgment unit, used to judge whether the token data is an LPM token; and a generation unit, used to generate an LPM transaction according to the LPM token if the token data is an LPM token.
[0015] Optionally, the generating unit includes: an acquiring subunit, used for acquiring a data packet to be transmitted by the first USB terminal; and an inserting subunit, used for inserting a token packet containing the LPM token before the data packet to obtain an LPM transaction.
[0016] Optionally, the generation module also includes: a conversion unit, used to convert the LPM token into a NOPID token packet before the generation unit generates an LPM transaction based on the LPM token, wherein the NOPID token packet is used to indicate that the transmitted USB data does not contain a data packet identifier PID; a transmission unit, used to transmit the NOPID data packet to the second PHY of the second USB terminal; and a determination unit, used to determine to generate an LPM transaction based on the LPM token after the NOPID data packet is transmitted.
[0017] Optionally, the generation module further includes: a forwarding unit, configured to forward the token data to the second PHY of the second USB if the token data is not an LPM token after the determination unit determines whether the token data is an LPM token.
[0018] Optionally, the transmission module includes: a first transmission unit, used to transmit the LPM transaction to the first PHY through the ULPI link encapsulator of the first USB terminal; a second transmission unit, used to convert the LPM transaction into an analog signal on the first PHY, and transmit the analog signal to the second PHY of the second USB terminal.
[0019] According to another embodiment of the present invention, a USB device is provided, comprising a UTMI link core layer, an adapter, a ULPI link encapsulator, and a physical layer interface PHY, wherein the adapter is connected between the UTMI link core layer and the ULPI link encapsulator, and the adapter comprises: a detection module for detecting token data to be transmitted by a first USB terminal, wherein the first USB terminal comprises a first physical layer interface PHY, and the first USB terminal is a USB terminal supporting the ULPI protocol; a generation module for generating a link power management (LPM) transaction based on the token data, wherein the LPM transaction comprises an LPM token; and a transmission module for transmitting the LPM transaction to a second PHY of a second USB terminal, wherein the second USB terminal comprises the second PHY, and the first PHY is communicatively connected to the second PHY.
[0020] According to yet another embodiment of the present invention, a storage medium is provided, in which a computer program is stored. The computer program is configured to execute the steps of any one of the above method embodiments when running.
[0021] According to another embodiment of the present invention, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to perform the steps in any one of the above method embodiments.
[0022] Through the present invention, token data to be transmitted by a first USB terminal is detected, wherein the first USB terminal includes a first physical layer interface PHY, and the first USB terminal is a USB terminal supporting the ULPI protocol; a link power management LPM transaction is generated according to the token data, wherein the LPM transaction includes an LPM token; the LPM transaction is transmitted to a second PHY of a second USB terminal, wherein the second USB terminal includes the second PHY, and the first PHY is communicatively connected with the second PHY. By generating the token data to be transmitted into an LPM transaction including the LPM token, the LPM token can be transmitted to the second USB terminal, thereby solving the technical problem in the related art that a USB terminal supporting the ULPI protocol cannot perform LPM transmission, and there is no need to modify the PHY of the USB terminal. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0024] Figure 1This is a hardware structure block diagram of a USB device according to an embodiment of the present invention;
[0025] Figure 2 is a flow chart of a USB data transmission method according to an embodiment of the present invention;
[0026] Figure 3 is a logical architecture diagram of a USB terminal in an embodiment of the present invention;
[0027] Figure 4 4 is a structural block diagram of a USB data transmission device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0028] In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only embodiments of a part of the present application, not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work should fall within the scope of protection of this application. It should be noted that, in the absence of conflict, the embodiments in the present application and the features in the embodiments can be combined with each other.
[0029] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0030] Example 1
[0031] The method embodiment provided in the first embodiment of the present application can be executed in a USB device, a USB chip, a processor, a computer or a similar electronic terminal. Taking running on a USB device as an example, Figure 1 This is a hardware structure diagram of a USB device according to an embodiment of the present invention. Figure 1 As shown, a USB device may include one or more ( Figure 1Only one is shown in the figure) processor 102 (processor 102 may include but is not limited to a microprocessor MCU or a programmable logic device FPGA and other processing devices) and a memory 104 for storing data. Optionally, the above-mentioned USB device may also include a transmission device 106 for communication functions and an input and output device 108. It will be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above USB device. Figure 1 More or fewer components than shown, or with Figure 1 Different configurations shown.
[0032] The memory 104 can be used to store USB device programs, for example, software programs and modules of application software, such as a USB device program corresponding to a USB data transmission method in an embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the USB device program stored in the memory 104, that is, implementing the above-mentioned method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely located relative to the processor 102, and these remote memories can be connected to the USB device via a network. Examples of the above-mentioned network include but are not limited to the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. In this embodiment, the processor 104 is used to respond to human-computer interaction instructions and system instructions and perform code analysis tasks. The memory 104 is used to store configuration information, script information, etc.
[0033] The transmission device 106 is used to receive or send data via a network. A specific example of the aforementioned network may include a wireless network provided by a communication provider of the USB device. In one embodiment, the transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to communicate with the Internet. In another embodiment, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0034] Optionally, the input and output device 108 further includes a human-computer interaction screen for obtaining human-computer interaction instructions through a human-computer interaction interface and for presenting a human-computer interaction interface;
[0035] In this embodiment, a USB data transmission method is provided. Figure 2 FIG. 1 is a flow chart of a USB data transmission method according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:
[0036] Step S202: Detecting token data to be transmitted by a first USB terminal, wherein the first USB terminal includes a first physical layer interface PHY and is a USB terminal supporting the ULPI protocol;
[0037] In this embodiment, the second USB terminal is also a USB terminal that supports or does not support the ULPI protocol.
[0038] When the first USB terminal and the second USB terminal perform data exchange, the direction of the data flow is first USB terminal→first PHY→second PHY→second USB terminal.
[0039] Step S204: generating a link power management (LPM) transaction according to the token data, wherein the LPM transaction includes an LPM token;
[0040] Optionally, an LPM transaction in this embodiment consists of several packets, which are categorized by type: token, start of frame, data, and handshake. In addition to the token packet containing the LPM token, an LPM transaction may also include data packets. The LPM token is used to instruct a communicating USB 2.0 host and a USB 2.0 device, such as the first and second USB terminals in this embodiment, to enter low-power mode.
[0041] Step S206: Transmitting the LPM transaction to a second PHY of a second USB terminal, wherein the second USB terminal includes the second PHY, and the first PHY is communicatively connected to the second PHY;
[0042] After the second USB terminal receives the LPM transaction, the first USB terminal and the second USB terminal enter a low power consumption mode by parsing the LPM token therein.
[0043] Through the above steps, token data to be transmitted by the first USB terminal is detected, wherein the first USB terminal includes a first physical layer interface PHY, and the first USB terminal is a USB terminal supporting the ULPI protocol; a link power management LPM transaction is generated according to the token data, wherein the LPM transaction includes an LPM token; the LPM transaction is transmitted to the second PHY of the second USB terminal, wherein the second USB terminal includes the second PHY, and the first PHY is communicatively connected to the second PHY. By generating the token data to be transmitted as an LPM transaction including the LPM token, the LPM token can be transmitted to the second USB terminal, thereby solving the technical problem in the related art that the USB terminal supporting the ULPI protocol cannot perform LPM transmission, and there is no need to modify the PHY of the USB terminal.
[0044] In this embodiment, generating an LPM transaction according to the token data includes: determining whether the token data is an LPM token; and if the token data is an LPM token, generating an LPM transaction according to the LPM token.
[0045] According to the USB LPM protocol, when the token data is 0xF0, it corresponds to the LPM token, that is, it determines whether the hexadecimal value of the token data is 0xF0. If the hexadecimal value of the token data is 0xF0, it is an LPM token. If the hexadecimal value of the token data is not 0xF0, it is not an LPM token (it may be a token of other instructions).
[0046] In one example, generating an LPM transaction according to the LPM token includes: obtaining a data packet to be transmitted by the first USB terminal; and inserting a token packet containing the LPM token before the data packet to obtain the LPM transaction.
[0047] For example, if the data packets to be transmitted are 0x02 and 0xa8, and the data of the token packet is 0xF0, 0xF0 is inserted before the first characters of 0x02 and 0xa8, then the data payload of the LPM transaction is 0xF0, 0x02, 0xa8.
[0048] In one example, before generating an LPM transaction based on the LPM token, it also includes: converting the LPM token into a NOPID token packet, wherein the NOPID token packet is used to indicate that the transmitted USB data does not contain a data packet identifier PID; transmitting the NOPID data packet to the second PHY of the second USB terminal; and after the NOPID data packet is transmitted, determining to generate an LPM transaction based on the LPM token.
[0049] In this example, if it is an LPM token (0xF0), it will be sent twice. During the first transmission, the LPM Token will be converted into a NOPID token. During the second transmission, the second LPM token will be constructed into a completed transaction and sent out. The second USB terminal at the receiving end will receive the data packet with the LPM token, thereby realizing LPM transmission.
[0050] Optionally, after determining whether the token data is an LPM token, the method further includes: if the token data is not an LPM token, forwarding the token data to the second PHY of the second USB.
[0051] By detecting and retransmitting the sending path of the first USB terminal, if the token data to be transmitted is not an LPM token, it is directly forwarded; if it is an LPM Token, a NOPID token packet is inserted in front to generate an LPM transaction.
[0052] In this embodiment, transmitting the LPM transaction to the second PHY of the second USB terminal includes: transmitting the LPM transaction to the first PHY through the ULPI link encapsulator of the first USB terminal; converting the LPM transaction into an analog signal on the first PHY, and transmitting the analog signal to the second PHY of the second USB terminal.
[0053] Figure 3 FIG1 is a logical architecture diagram of a USB terminal according to an embodiment of the present invention. The USB terminal includes a UTMI+Link Core layer, an adapter, a ULPI Link Wrapper, and a physical layer interface PHY (ULPIPHY Chip) connected in sequence. The adapter includes a synchronous FIFO (First-In-First-Out) and related logic for regenerating TXVALID / TXREADY.
[0054] This embodiment utilizes an existing ULPIPHY chip to implement LPM transactions between a USB host and a USB device. By detecting the token data sent by the USB host's UTMI+LINK Core and repeating it twice if it is an LPM token (0xF0), the first LPM token is converted to a NOPID token. The second LPM token is then sent with the data. The USB device then receives the data packet containing the LPM token, thus implementing LPM transmission between the USB host and the USB device.
[0055] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present invention.
[0056] Example 2
[0057] This embodiment also provides a USB data transmission device for implementing the above-mentioned embodiments and preferred implementations. Details already described will not be repeated here. As used below, the term "module" may refer to a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation using hardware, or a combination of software and hardware, is also possible and contemplated.
[0058] Figure 4 is a structural block diagram of a USB data transmission device according to an embodiment of the present invention. Figure 4 As shown, the device includes: a detection module 40, a generation module 42, and a transmission module 44, wherein:
[0059] a detection module 40, configured to detect token data to be transmitted by a first USB terminal, wherein the first USB terminal includes a first physical layer interface PHY and is a USB terminal supporting the ULPI protocol;
[0060] A generating module 42, configured to generate a link power management (LPM) transaction according to the token data, wherein the LPM transaction includes an LPM token;
[0061] The transmission module 44 is configured to transmit the LPM transaction to a second PHY of a second USB terminal, wherein the second USB terminal includes the second PHY, and the first PHY is communicatively connected to the second PHY.
[0062] Optionally, the generation module includes: a judgment unit, used to judge whether the token data is an LPM token; and a generation unit, used to generate an LPM transaction according to the LPM token if the token data is an LPM token.
[0063] Optionally, the generating unit includes: an acquiring subunit, used for acquiring a data packet to be transmitted by the first USB terminal; and an inserting subunit, used for inserting a token packet containing the LPM token before the data packet to obtain an LPM transaction.
[0064] Optionally, the generation module also includes: a conversion unit, used to convert the LPM token into a NOPID token packet before the generation unit generates an LPM transaction based on the LPM token, wherein the NOPID token packet is used to indicate that the transmitted USB data does not contain a data packet identifier PID; a transmission unit, used to transmit the NOPID data packet to the second PHY of the second USB terminal; and a determination unit, used to determine to generate an LPM transaction based on the LPM token after the NOPID data packet is transmitted.
[0065] Optionally, the generation module further includes: a forwarding unit, configured to forward the token data to the second PHY of the second USB if the token data is not an LPM token after the determination unit determines whether the token data is an LPM token.
[0066] Optionally, the transmission module includes: a first transmission unit, used to transmit the LPM transaction to the first PHY through the ULPI link encapsulator of the first USB terminal; a second transmission unit, used to convert the LPM transaction into an analog signal on the first PHY, and transmit the analog signal to the second PHY of the second USB terminal.
[0067] The solution of this embodiment also provides a USB device, which includes a UTMI link core layer, an adapter, a ULPI link encapsulator, and a physical layer interface PHY, wherein the adapter is connected between the UTMI link core layer and the ULPI link encapsulator, and the adapter includes: a detection module, used to detect token data to be transmitted by a first USB terminal, wherein the first USB terminal includes a first physical layer interface PHY, and the first USB terminal is a USB terminal supporting the ULPI protocol; a generation module, used to generate a link power management LPM transaction based on the token data, wherein the LPM transaction includes an LPM token; and a transmission module, used to transmit the LPM transaction to a second PHY of a second USB terminal, wherein the second USB terminal includes the second PHY, and the first PHY is communicatively connected to the second PHY.
[0068] It should be noted that the above modules can be implemented through software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0069] Example 3
[0070] An embodiment of the present invention further provides a storage medium storing a computer program, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
[0071] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps:
[0072] S1, detecting token data to be transmitted by a first USB terminal, wherein the first USB terminal includes a first physical layer interface PHY, and the first USB terminal is a USB terminal supporting the ULPI protocol;
[0073] S2, generating a link power management (LPM) transaction according to the token data, wherein the LPM transaction includes an LPM token;
[0074] S3: Transmit the LPM transaction to a second PHY of a second USB terminal, wherein the second USB terminal includes the second PHY, and the first PHY is communicatively connected to the second PHY.
[0075] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store computer programs.
[0076] An embodiment of the present invention further provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0077] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0078] Optionally, in this embodiment, the processor may be configured to execute the following steps through a computer program:
[0079] S1, detecting token data to be transmitted by a first USB terminal, wherein the first USB terminal includes a first physical layer interface PHY, and the first USB terminal is a USB terminal supporting the ULPI protocol;
[0080] S2, generating a link power management (LPM) transaction according to the token data, wherein the LPM transaction includes an LPM token;
[0081] S3: Transmit the LPM transaction to a second PHY of a second USB terminal, wherein the second USB terminal includes the second PHY, and the first PHY is communicatively connected to the second PHY.
[0082] Optionally, specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.
[0083] The serial numbers of the above embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0084] In the above embodiments of the present application, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0085] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0086] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0087] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0088] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes 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 storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0089] The above is only a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A USB data transmission method, characterized in that: include: Detecting token data to be transmitted by a first USB terminal, wherein the first USB terminal includes a first physical layer interface PHY and is a USB terminal supporting the ULPI protocol; generating a link power management (LPM) transaction according to the token data, wherein the LPM transaction includes an LPM token; The LPM transaction is transmitted to a second PHY of a second USB terminal, wherein the second USB terminal includes the second PHY and the first PHY is communicatively connected to the second PHY.
2. The method according to claim 1, characterized in that Generating an LPM transaction based on the token data includes: Determine whether the token data is an LPM token; If the token data is an LPM token, generate an LPM transaction according to the LPM token.
3. The method according to claim 2, characterized in that Generating an LPM transaction based on the LPM token includes: Obtaining a data packet to be transmitted by the first USB terminal; The token packet containing the LPM token is inserted before the data packet to obtain the LPM transaction.
4. The method according to claim 2, characterized in that Before generating an LPM transaction according to the LPM token, the method further includes: Convert the LPM token into a NOPID token packet, wherein the NOPID token packet is used to indicate that the transmitted USB data does not contain a data packet identifier PID; Transmitting the NOPID data packet to the second PHY of the second USB terminal; After the NOPID data packet is transmitted, it is determined to generate an LPM transaction according to the LPM token.
5. The method according to claim 2, characterized in that After determining whether the token data is an LPM token, the method further includes: If the token data is not an LPM token, forward the token data to the second PHY of the second USB.
6. The method according to claim 1, characterized in that Transmitting the LPM transaction to the second PHY of the second USB terminal includes: transmitting the LPM transaction to the first PHY via a ULPI link wrapper of the first USB terminal; The LPM transaction is converted into an analog signal on the first PHY, and the analog signal is transmitted to the second PHY of the second USB terminal.
7. A USB data transmission device, characterized in that: include: a detection module, configured to detect token data to be transmitted by a first USB terminal, wherein the first USB terminal includes a first physical layer interface PHY and is a USB terminal supporting the ULPI protocol; a generating module, configured to generate a link power management (LPM) transaction according to the token data, wherein the LPM transaction includes an LPM token; The transmission module is configured to transmit the LPM transaction to a second PHY of a second USB terminal, wherein the second USB terminal includes the second PHY, and the first PHY is communicatively connected to the second PHY.
8. A USB device, characterized in that: The USB device includes a UTMI link core layer, an adapter, a ULPI link encapsulator, and a physical layer interface PHY, wherein the adapter is connected between the UTMI link core layer and the ULPI link encapsulator, and the adapter includes: a detection module, configured to detect token data to be transmitted by a first USB terminal, wherein the first USB terminal includes a first physical layer interface PHY and is a USB terminal supporting the ULPI protocol; a generating module, configured to generate a link power management (LPM) transaction according to the token data, wherein the LPM transaction includes an LPM token; The transmission module is configured to transmit the LPM transaction to a second PHY of a second USB terminal, wherein the second USB terminal includes the second PHY, and the first PHY is communicatively connected to the second PHY.
9. A storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to execute the method according to any one of claims 1 to 6 when executed.
10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the method according to any one of claims 1 to 6.