Communication device and data transmission method

By introducing a USB adapter layer and virtual resistor technology into the communication device, the problems of increased latency and cost in the improvement of USB 2.0 bus bandwidth have been solved, achieving low-latency, high-efficiency data transmission and cost savings.

CN116803068BActive Publication Date: 2026-04-14HUAWEI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HUAWEI TECH CO LTD
Filing Date
2021-01-30
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

Existing technologies, while increasing the bandwidth of the USB 2.0 bus, have increased data transmission latency, making it difficult to meet the requirements of the USB 2.0 protocol, and have also increased chip area and hardware costs.

Method used

By introducing a USB adapter layer into the communication device, the data of the USB 2.0 protocol is adapted to the physical link and converted into data suitable for transmission on a high-speed physical link. This avoids the need to use the USB physical layer and pins, and instead uses virtual resistors to represent the bus status instead of physical resistors.

Benefits of technology

It reduces data transmission latency, saves chip area and hardware costs, and is highly adaptable to various application scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116803068B_ABST
    Figure CN116803068B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a kind of communication device and data transmission method, communication device includes: universal serial bus USB protocol layer, USB adaptation layer, transport layer and physical layer;USB protocol layer is used to send first data to USB adaptation layer;USB adaptation layer is used to obtain second data by carrying out physical link adaptation to first data, and second data is sent to transport layer;Wherein, first data adapts first physical link, and second data adapts second physical link;The bandwidth of first physical link is lower than the bandwidth of second physical link;Second data is sent to receiving end by second physical link after being handled by transport layer and physical layer.It can effectively reduce data transmission delay while increasing the pin bandwidth utilization of communication device by using the embodiment of the present application;Meanwhile, the transmission of data is not limited by the transmission form of physical link;In addition, compared with prior art, chip area and hardware cost can also be saved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technology, and in particular to a communication device and a data transmission method. Background Technology

[0002] Video and data transmission interfaces have high bandwidth requirements, but due to limitations in chip manufacturing processes and transmission lines, simply increasing the transmission rate of serializers / deserializers (SerDes) is difficult. To increase bandwidth, the common approach is to increase the number of physical SerDes links, but this inevitably increases the size of connectors and cables, degrading the user experience. Given the constraints on connector and cable size, to provide higher overall bandwidth, appropriate methods should be adopted to improve the transmission rate of low-speed SerDes physical links.

[0003] Since its introduction, the Universal Serial Bus (USB) has been widely used in the consumer market, becoming one of the standard expansion interfaces and essential interfaces for a large number of computers and smart devices in the 21st century. In 2019, the USB Implementers Forum (USB-IF) released the USB 4.0 protocol. Besides being backward compatible with USB 2.0 and the first-generation USB 3 (USB 3 Generation 1) protocol, this protocol also supports the second-generation USB 3 (USB 3 Generation 2) protocol, DisplayPort (DP) protocol, and Peripheral Component Interconnect Express (PCIe) via a tunneling protocol. The transmission rate of a single serializer / deserializer link can be selected as 10Gbps or 20Gbps. However, for the backward-compatible USB 2.0 protocol, which uses a dedicated physical link for data transmission, the maximum transmission rate is 480Mbps, resulting in severely insufficient bandwidth utilization.

[0004] To increase the bandwidth of the SerDes physical link, existing technology converts the electrical signals of the USB 2.0 bus into signals suitable for transmission on a common high-speed physical link, and then transmits them on the common high-speed physical link. The excess bandwidth of the common high-speed physical link can be used to transmit other data, thereby increasing the total bandwidth.

[0005] However, the aforementioned existing technologies, when converting the electrical signals of USB 2.0 pins into signals that can be transmitted over other public high-speed physical links, add a USB 2.0 physical layer to both the local and remote USB 2.0 data transmission paths. This greatly increases the transmission latency of USB 2.0 data, making it difficult to meet the requirements of the USB 2.0 protocol and hindering its application. Summary of the Invention

[0006] This application discloses a communication device and a data transmission method, which can effectively reduce data transmission latency while increasing the utilization rate of the communication device pin bandwidth; at the same time, the data transmission is not limited by the physical link transmission form; in addition, it can save chip area and hardware cost compared with the prior art.

[0007] In a first aspect, embodiments of this application disclose a communication device, comprising: a Universal Serial Bus (USB) protocol layer, a USB adapter layer, a transport layer, and a physical layer; the USB protocol layer is used to send first data to the USB adapter layer; the USB adapter layer is used to perform physical link adaptation on the first data to obtain second data, and send the second data to the transport layer; wherein, the first data is adapted to a first physical link, and the second data is adapted to a second physical link; the bandwidth of the first physical link is lower than the bandwidth of the second physical link; the second data is processed by the transport layer and the physical layer, and then sent to the receiving end through the second physical link.

[0008] It should be understood that the protocol of the second physical link can be an existing protocol or a set of data interaction communication methods set by those skilled in the art; the protocol of the first physical link can be the USB 2.0 protocol, which follows the USB transceiver macrocell interface (UTMI) protocol or the UTMI Low Pin Interface (ULPI) protocol.

[0009] As can be seen in this embodiment, when the communication device communicates with the receiving end, it first performs physical link adaptation on the first data through the USB adapter layer, converting the first data transmitted on the first physical link into second data transmitted on the second physical link. The second physical link is a high-speed physical link with a higher bandwidth than the first physical link. Since this embodiment converts the first data (protocol layer data) sent by the USB protocol layer into data that can be transmitted on the second physical link, and then transmits it to the receiving end through the transport layer, physical layer, and second physical link, it does not need to go through the USB physical layer and pins that match the USB protocol layer. Therefore, it is not necessary to configure the USB physical layer and pins in the communication device, which can save the chip area of ​​the USB physical layer and pins and reduce the cost of the USB physical layer and pins. Furthermore, since data transmission does not need to pass through the USB physical layer, the intermediate links in data transmission can be reduced, thus effectively reducing the receiving latency at the receiving end to meet the low latency requirements of the communication protocol, making it easy to apply. In addition, when the protocol of the first physical link is the USB 2.0 protocol, the physical form of the first physical link is wired. However, in this embodiment, by adapting the first data to the physical link, the obtained second data can be transmitted on a high-speed second physical link. Since the second physical link is not limited by its physical form, it can be either wired or wireless. Therefore, the communication device in this embodiment has good adaptability and can be applied to different application scenarios. It should be understood that in the embodiments of this application, the transport layer and physical layer are integrated with the USB protocol layer and USB adapter layer in the same communication device. In an optional case, the transport layer and physical layer can be located in a separate adapter or switch. That is, the USB protocol layer and USB adapter layer are in the communication device. After the USB protocol layer and USB adapter layer process the data, they are sent to the adapter or switch. After being processed by the transport layer and physical layer of the adapter or switch, the data is transmitted to the target device through a high-speed physical link. The target device can also be connected to the high-speed physical link through the adapter or switch.

[0010] In one feasible implementation, the first data includes any one of a token packet, a handshake packet, or a special packet, and the USB adapter layer is specifically used to: encapsulate the first data according to the protocol of the second physical link to obtain a first transmission packet; the second data includes the first transmission packet.

[0011] As can be seen in this embodiment, when the first data contains any one of a token packet, a handshake packet, or a special packet, the USB adapter layer directly encapsulates the first data as a data payload to obtain a first transmission packet that is compatible with the second physical link. This facilitates the subsequent transmission of the first transmission packet through the second physical link without the need to use the USB physical layer, pins, and the first physical link that are compatible with the USB protocol layer. This effectively reduces the receiving latency at the receiving end and saves the chip area and related costs of the USB physical layer and pins.

[0012] In one feasible implementation, the first data includes data packets, and the USB adapter layer is specifically used to: split the data packets into multiple first data payloads, and encapsulate the multiple first data payloads according to the protocol of the second physical link to obtain multiple second transmission packets; the second data includes multiple second transmission packets.

[0013] As can be seen in this embodiment, for data packets with a large amount of data, the USB adapter layer can split them into multiple first data payloads, and then encapsulate the multiple first data payloads to obtain multiple second transmission packets. Since the amount of data in each second transmission packet is small, the receiving delay of the receiving end can be effectively reduced to meet the low latency requirements of the communication protocol.

[0014] In one feasible implementation, the first data further includes a bus event. The USB adapter layer is specifically used to: when a bus event arrives, encapsulate the beginning portion of the bus event according to the protocol of the second physical link to obtain a third transmission packet; the transport layer and physical layer are specifically used to process the third transmission packet and send it to the receiving end through the second physical link; the USB adapter layer is also specifically used to: when a bus event ends, encapsulate the end portion of the bus event according to the protocol of the second physical link to obtain a fourth transmission packet; the transport layer and physical layer are specifically used to process the fourth transmission packet and send it to the receiving end through the second physical link.

[0015] As can be seen in the embodiments of this application, in the process of encapsulating bus events by the above-mentioned communication device, the receiving delay of the receiving end is reduced by encapsulating the beginning and end parts of the bus event respectively, while the middle part of the bus event is not encapsulated, so as to meet the low latency requirement of the communication protocol.

[0016] In one feasible implementation, the aforementioned USB protocol layer is further configured to send control information to the USB adapter; the USB adapter layer is further configured to: parse the first virtual resistance information from the control information; and encapsulate the first virtual resistance information to obtain a fifth transmission packet; the transport layer and physical layer are specifically configured to process the fifth transmission packet and send it to the receiving end through a second physical link; the first virtual resistance information is used to characterize the virtual bus state by describing the on or off state of the virtual resistance in the communication device, the virtual bus being a bus that matches the USB protocol layer, the virtual resistance in the communication device corresponding to the physical resistance, and the physical resistance including at least one of a high-speed matching resistor, a pull-up resistor, or a pull-down resistor.

[0017] In one feasible implementation, the aforementioned first virtual resistance information further includes high-resistance (High-Z) information. The high-resistance information characterizes the on or off state of the high resistance, and characterizes the connection state between the communication device and the receiving end. When the communication device and the receiving end establish a communication connection, the high resistance is in an off state; when the communication device and the receiving end do not establish a communication connection, the high resistance is in a on state.

[0018] As can be seen, in the prior art, USB protocol layer data is transmitted through the USB physical layer and pins. However, in this embodiment, after the USB protocol layer data undergoes physical link adaptation through the USB adapter layer, it is not necessary to configure the USB physical layer and pins in the communication device; that is, there is no physical resistor in the USB physical layer. The USB protocol layer needs to obtain information about the resistance in the USB physical layer to report the bus status. This embodiment introduces a virtual resistor corresponding to the physical resistor in the USB physical layer, using the virtual resistance information to characterize the virtual bus status, thereby satisfying the USB protocol layer's requirement for reporting the bus status. This makes the improvements made to the communication device in this embodiment compared to the prior art invisible or transparent to the USB protocol layer. In other words, in the prior art, the data received and sent by the USB protocol layer corresponds to the same data received and sent by the USB protocol layer in this embodiment, thus satisfying the communication requirements of the USB protocol layer. It should be understood that the first virtual resistor is obtained from the control information sent from the USB protocol layer to the USB adapter layer, and the second virtual resistor information is obtained from the sixth transmission packet. The first and second virtual resistor information will be stored locally and updated or maintained. The local storage unit for the first and second virtual resistor information is not limited to registers.

[0019] In one feasible implementation, the first, second, third, fourth, and fifth transmission packets all include a packet header and a data payload. The packet header contains the type information of the corresponding transmission packet, the length information of the data payload, and the reliability protection information.

[0020] As can be seen in this embodiment, for first data containing different content, the USB adapter layer can encapsulate it into a transmission packet of the same format, so that the first data of different types can obtain the same format of the corresponding transmission packet after physical link adaptation, which is convenient for subsequent transmission on the common second physical link, thereby realizing the function of communication between the communication device and the receiving end.

[0021] In one feasible implementation, the physical layer and transport layer are further configured to process the third data received through the second physical link and send it to the USB adapter layer; the USB adapter layer is further configured to perform physical link adaptation on the processed third data to obtain fourth data and send the fourth data to the USB protocol layer; wherein the third data is adapted to the second physical link and the fourth data is adapted to the first physical link.

[0022] As can be seen, in this embodiment, the USB adapter layer in the communication device can also perform physical link adaptation on the processed third data to obtain the fourth data, that is, restore the processed third data to obtain the fourth data. In summary, the communication device in this application can both send data to the receiving end and restore the data sent by the receiving end, and send the restored data to the USB protocol layer, thereby realizing the function of bidirectional data transmission between the communication device and the receiving end.

[0023] In one feasible implementation, the third data after the above processing includes one or more transmission packets. The USB adapter layer is specifically used to: parse the headers of one or more transmission packets to obtain the type information of one or more transmission packets; when one or more transmission packets are data packets, aggregate one or more data payloads corresponding to one or more transmission packets to obtain fourth data; when one or more transmission packets are not data packets, use one or more data payloads corresponding to one or more transmission packets as fourth data.

[0024] As can be seen from the embodiments of this application, the USB adapter layer can restore the received multiple transmission packets accordingly. Specifically: for the first data that is encapsulated as a separate data payload during encapsulation, its data payload is used as the fourth data; for the first data that is split into multiple data payloads during encapsulation, the multiple split data payloads can be aggregated, and the aggregated data is used as the fourth data. Through the above restoration process, the restoration process of the third data can be correlated with the encapsulation process of the first data, thereby realizing normal communication between the communication device and the receiving end.

[0025] In one feasible implementation, the physical layer and transport layer are further configured to process the sixth transmission packet received through the second physical link and then send it to the USB adapter layer; the USB adapter layer is further configured to receive the processed sixth transmission packet and parse the processed sixth transmission packet to obtain second virtual resistance information; the second virtual resistance information includes the on or off state of the virtual resistor in the receiving end, and the second virtual resistance information is used to characterize the virtual bus state, the virtual resistor in the receiving end corresponds to the physical resistor, and the physical resistor includes at least one of a high-speed matching resistor, a pull-up resistor, or a pull-down resistor.

[0026] As can be seen, in this embodiment of the application, the communication device can also receive a sixth transmission packet containing the second virtual resistance information, and parse the second virtual resistance information from the sixth transmission packet. This embodiment of the application replaces the direct detection of the on or off state of the physical resistor on the bus by receiving the second virtual resistance information, and then uses the virtual resistance information to characterize the virtual bus state, thereby meeting the reporting requirements of the USB protocol layer for the bus state.

[0027] In one feasible implementation, the USB adapter layer is further configured to: determine the virtual bus state based on the content of the first data when the USB adapter layer receives the first data; determine the virtual bus state based on the content of the fourth data when the USB adapter layer sends the fourth data; determine the virtual bus state based on the first virtual resistance information and the second virtual resistance information when the USB adapter layer neither receives the first data nor sends the fourth data; and send the current virtual bus state to the USB protocol layer.

[0028] As can be seen, in this embodiment, the virtual bus state can be determined by different rules under different data transmission scenarios, thereby meeting the USB protocol layer's requirement for receiving virtual bus state information. Since this implementation can remove the USB physical layer and pins, there are no physical resistors or USB 2.0 buses. Therefore, virtual resistors are introduced to represent the physical resistors in the USB physical layer, and a virtual bus is introduced to represent the USB 2.0 bus. When the USB adapter layer has not received the first data and has not sent the fourth data, the virtual bus state can be determined based on the first virtual resistance information sent to the receiving end and the second virtual resistance information received from the receiving end. The virtual bus state is then sent to the USB protocol layer, thereby meeting the USB protocol layer's requirement for reporting the bus state.

[0029] In one feasible implementation, the USB adapter layer is further configured to: determine the operating state of the communication device at the next moment based on the virtual bus state; wherein the operating state includes at least one of the following: whether the USB protocol layer sends first data or receives sixth data, the content contained in the first data when the USB protocol layer sends the first data, or the first virtual resistance information parsed by the USB adapter layer from the control information when the USB protocol layer sends control information.

[0030] As can be seen, in this embodiment of the application, the USB protocol layer can determine the control information sent by the USB protocol layer to the USB adapter layer by receiving the virtual bus state, and the USB adapter layer can determine the working state of the communication device at the next moment according to the received control information, thereby realizing the communication function of the communication device.

[0031] Secondly, this application provides a data transmission method, comprising: sending first data to a USB adapter layer via a Universal Serial Bus (USB) protocol layer; obtaining second data by physical link adaptation of the first data by the USB adapter layer, and sending the second data to a transport layer; wherein the first data is adapted to a first physical link, and the second data is adapted to a second physical link; the bandwidth of the first physical link is lower than the bandwidth of the second physical link; processing the second data by the transport layer and the physical layer, and sending the processed second data to a receiving end by the second physical link.

[0032] In one feasible implementation, the first data includes any one of a token packet, a handshake packet, or a special packet. The second data is obtained by physical link adaptation of the first data by the USB adapter layer, including: encapsulating the first data by the USB adapter layer to obtain a first transmission packet; the second data includes the first transmission packet.

[0033] In one feasible implementation, the first data includes a data packet, and the second data is obtained by physical link adaptation of the first data by the USB adapter layer, including: splitting the data packet into multiple first data payloads by the USB adapter layer, and encapsulating the multiple first data payloads respectively to obtain multiple second transmission packets; the second data includes multiple second transmission packets.

[0034] In one feasible implementation, the first data further includes a bus event. The process of adapting the first data to the second data via a physical link using the USB adapter layer includes: when a bus event arrives, encapsulating the beginning portion of the bus event using the USB adapter layer to obtain a third transmission packet; the process of processing the second data through the transport layer and physical layer and then sending it to the receiving end via a second physical link includes: processing the third transmission packet through the transport layer and physical layer and then sending it to the receiving end via the second physical link; the first data further includes a bus event. The process of adapting the first data to the second data via a physical link using the USB adapter layer also includes: when a bus event ends, encapsulating the end portion of the bus event using the USB adapter layer to obtain a fourth transmission packet; the process of processing the second data through the transport layer and physical layer and then sending it to the receiving end via the second physical link also includes: processing the fourth transmission packet through the transport layer and physical layer and then sending the processed fourth transmission packet to the receiving end via the second physical link.

[0035] In one feasible implementation, the method includes: sending control information to a USB adapter via the USB protocol layer; parsing first virtual resistance information from the control information via the USB adapter layer; encapsulating the first virtual resistance information to obtain a fifth transmission packet; processing the fifth transmission packet via the transport layer and the physical layer; and sending the processed fifth transmission packet to the receiving end via a second physical link; wherein the first virtual resistance information is used to characterize the virtual bus state by describing the on or off state of the virtual resistance in the communication device, the virtual bus being a bus that matches the USB protocol layer, the virtual resistance in the communication device corresponding to the physical resistance, and the physical resistance including at least one of a high-speed matching resistor, a pull-up resistor, or a pull-down resistor.

[0036] In one feasible implementation, the first, second, third, fourth, and fifth transmission packets all include a packet header and a data payload. The packet header contains the type information of the corresponding transmission packet, the length information of the data payload, and the reliability protection information.

[0037] In one feasible implementation, the above method further includes: processing the third data received through the second physical link through the physical layer and the transport layer, and sending the processed third data to the USB adaptation layer; performing physical link adaptation on the processed third data through the USB adaptation layer to obtain fourth data, and sending the fourth data to the USB protocol layer; wherein the third data is adapted to the second physical link, and the fourth data is adapted to the first physical link.

[0038] In one feasible implementation, the processed third data includes one or more transmission packets. The fourth data is obtained by physical link adaptation of the processed third data through the USB adapter layer, including: parsing the headers of one or more transmission packets through the USB adapter layer to obtain the type information of one or more transmission packets; when one or more transmission packets are data packets, aggregating one or more data payloads corresponding to one or more transmission packets through the USB adapter layer to obtain the fourth data; when one or more transmission packets are not data packets, using one or more data payloads corresponding to one or more transmission packets as the fourth data through the USB adapter layer.

[0039] In one feasible implementation, the method further includes: processing the sixth transmission packet received through the second physical link through the physical layer and the transport layer, and sending the processed sixth transmission packet to the USB adapter layer; receiving the processed sixth transmission packet through the USB adapter layer, and parsing the processed sixth transmission packet to obtain second virtual resistance information; the second virtual resistance information includes the on or off state of the virtual resistor in the receiving end, the second virtual resistance information is used to characterize the virtual bus state, the virtual resistor in the receiving end corresponds to the physical resistor, and the physical resistor includes at least one of a high-speed matching resistor, a pull-up resistor, or a pull-down resistor.

[0040] In one feasible implementation, the method further includes: when the USB adapter layer receives first data, the USB adapter layer determines the virtual bus state based on the content of the first data; when the USB adapter layer sends fourth data, the USB adapter layer determines the virtual bus state based on the content of the fourth data; when the USB adapter layer neither receives the first data nor sends the fourth data, the USB adapter layer determines the virtual bus state based on the first virtual resistance information and the second virtual resistance information; and the USB adapter layer sends the current virtual bus state to the USB protocol layer.

[0041] In one feasible implementation, the above method further includes: the USB protocol layer determining the next working state of the communication device based on the virtual bus state; wherein the working state includes at least one of the following: whether the USB protocol layer sends first data or receives sixth data, the content contained in the first data when the USB protocol layer sends the first data, or the first virtual resistance information parsed from the control information by the USB adapter layer when the USB protocol layer sends control information.

[0042] Thirdly, embodiments of this application provide a terminal device, including a communication device provided in any of the embodiments of the first aspect above, and discrete components coupled to the communication device.

[0043] Fourthly, embodiments of this application provide a communication device, characterized in that the communication device includes a processor and an interface circuit, the processor being able to run a computer program to implement the data transmission method flow as described in any one of the second aspects above through the interface circuit.

[0044] Fifthly, this application provides a computer storage medium storing a computer program that, when executed by a communication device, implements the data transmission method flow described in any one of the second aspects above.

[0045] In a sixth aspect, embodiments of the present invention provide a computer program including instructions that, when executed by the aforementioned communication device, enable the communication device to execute the data transmission method flow described in any of the second aspects. Attached Figure Description

[0046] Figure 1 This is a schematic diagram of a tree topology of a USB bus provided in an embodiment of this application;

[0047] Figure 2 This is a schematic diagram of the structure of a communication system provided in an embodiment of this application;

[0048] Figure 3A This is a schematic diagram of another communication system provided in an embodiment of this application;

[0049] Figure 3B This is a schematic diagram of the structure of another communication system provided in the embodiments of this application;

[0050] Figure 4 This is a schematic diagram of the structure of a virtual resistor model in a communication system provided in an embodiment of this application;

[0051] Figure 5 This is a schematic diagram illustrating a data packet splitting and encapsulation process provided in an embodiment of this application;

[0052] Figure 6 This is a schematic diagram of another communication system provided in an embodiment of this application;

[0053] Figure 7 This is a schematic diagram of the structure of another communication system provided in the embodiments of this application;

[0054] Figure 8 This is a schematic diagram illustrating a scenario where multiple communication devices communicate, as provided in an embodiment of this application.

[0055] Figure 9 This is a flowchart illustrating a data transmission method provided in an embodiment of this application;

[0056] Figure 10 This is a schematic diagram of an exemplary terminal architecture provided in an embodiment of this application;

[0057] Figure 11 This is an architecture diagram of a processor provided in an embodiment of this application. Detailed Implementation

[0058] The embodiments of this application are described below with reference to the accompanying drawings. The terms "first," "second," "third," and "fourth," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or devices. The reference to "embodiment" herein means that a specific feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0059] Please see Figure 1 , Figure 1 This is a schematic diagram of a tree topology of a USB bus provided in an embodiment of this application. For example... Figure 1 As shown, Figure 1 It contains four devices: Host, Hub-1, Hub-2, and Device. The Host is located at the root node. The Host's downstream port is connected to the Hub-1's upstream port via the USB bus D+ / D-. The two downstream ports of Hub-1 are connected to the Hub-2 and Device's upstream ports via the USB bus, respectively. Figure 1 The bus topology in the diagram corresponds to the specific connection methods of the three types of devices: Host, Hub, and Device. This should be understood. Figure 1 This is just a specific example given in the embodiments of this application. The specific topology of the USB bus can be determined according to the specific application scenario. For example, the host device can also be directly connected to the device. This application does not make any specific limitations on this.

[0060] The host is responsible for managing all hubs and devices connected to the bus. It may include one or more downstream ports, such as computers, tablets, or mobile phones. The hub provides USB interface expansion capabilities and includes one upstream port and multiple downstream ports. The device provides specific functions and may be a mobile storage device, such as a USB flash drive or hard drive. This application embodiment does not specifically limit this and includes one upstream port.

[0061] Please see Figure 2 , Figure 2 This is a schematic diagram of the structure of a communication system 200 provided in an embodiment of this application. For example... Figure 2 As shown, the communication system 200 includes a communication device 210, a target device 220, an adapter 230, and an adapter 240. The communication device 210 is connected to the target device 220 via the adapter 230, a second physical link, and the adapter 240 for communication. The data transmitted between the communication device 210 and the target device 220 can be USB 2.0 data. Depending on the specific application scenario, the high-speed second physical link can be configured as wired (e.g., copper wire or fiber optic) or wireless (e.g., wireless channel).

[0062] Optionally, the communication device 210 and the target device 220 can be a host (such as a computer, mobile phone, tablet, etc.) or a device (such as a USB flash drive or hard drive, etc.); the communication device 210 and the target device 220 can function as either an uplink port or a downlink port. When the communication device 210 functions as a downlink port, the target device 220 functions as an uplink port; when the communication device 210 functions as an uplink port, the target device 220 functions as a downlink port. The adapter device 230 and the adapter device 240 can be a converter or a switch, etc.

[0063] like Figure 2 As shown, the devices on both sides of the second physical link have the same structure and function. Therefore, the internal structure, function, and corresponding data transmission process are described below using the devices on the left side of the second physical link and the common transmission path as examples.

[0064] Optionally, the communication device 210 includes a USB protocol layer 211 and a USB physical layer (PHY) 212. In addition, the communication device 210 may also include an application layer (not shown); the adapter device 230 includes a USB physical layer 213, a USB adapter layer 214, a transport layer 215, and a physical layer 216.

[0065] Optionally, each layer in the communication device 210 and adapter 230 is a logical functional division and includes a corresponding hardware structure (circuit). The application layer in the communication device 210 ( Figure 2 (Not shown) can provide interfaces for applications used for communication and the underlying network used for message transmission. The application layer can be a combination of software and hardware. The USB protocol layer 211 specifies the language structure and rules for interaction between the host and the device. The hardware structure corresponding to the USB protocol layer 211 can be integrated into the USB controller. The USB protocol layer can receive USB 2.0 data sent by the application layer. Data transmission between the USB protocol layer 212 and the USB physical layer 212 is performed through the standard UTMI interface. The USB physical layer 212 receives USB 2.0 data through the UTMI interface and converts the USB 2.0 data into corresponding analog signals. The physical layer can provide transmission media and interconnection devices for data communication between communication devices. The transmission layer provides a reliable environment, meaning the physical layer ensures that raw data can be transmitted over various physical media. Communication device 210 and adapter device 230 are connected via a standard USB interface (D+ / D-), meaning the analog signals transmitted by USB physical layer 212 are transmitted to USB physical layer 213 via the USB interface. USB physical layer 213 converts the received analog signals into digital signals and transmits them to USB adapter layer 214 via the UTMI interface. USB adapter layer 214 adapts the digital USB 2.0 data for transmission over a common transmission path and a second physical link. Transport layer 215 provides a unified transmission interface and a unified data transmission format for data from different protocols, and provides common functions such as quality of service (QoS) guarantees, bandwidth allocation, flow control, power management, and connection management for data from different protocols.

[0066] The above describes the process of data transmission between the communication device 210 and the target device 220 via the adapter 230. The process of the communication device 210 receiving data via the adapter 230 is the reverse of the above process and will not be described again here. Similarly, the process of the target device 220 receiving and sending data via the adapter 240 is the same as the corresponding process of the communication device 210 and will not be described again here.

[0067] like Figure 3A As shown, Figure 3A This is a schematic diagram of another communication system 300 provided in an embodiment of this application. For example... Figure 3AAs shown, the communication system 300 includes a communication device 310 and a target device 320. The communication device 310 and the target device 320 communicate via a high-speed second physical link. The communication device 310 includes a USB protocol layer 311, a USB adapter layer 312, a transport layer 313, and a physical layer (PHY) 314. The target device 320 includes a USB protocol layer 321, a USB adapter layer 322, a transport layer 323, and a physical layer 324. It should be understood that the functions of each layer in the communication device 310 correspond to the functions of the layers in the target device 320. The layers in the two devices are logically divided, and each layer contains a corresponding physical circuit (structure). Either the communication device 310 or the target device 320 can act as an uplink port or a downlink port; this application does not specifically limit this. In this case, the target device 320 can also be referred to as a receiving end.

[0068] Optionally, the communication device 310 and the target device 320 can be a host (such as a computer, mobile phone, tablet, etc.), a hub, or a device (such as a USB flash drive or hard drive, etc.), and this application does not specifically limit them. For example, the communication device 310 can be a computer, and the target device 320 can be a USB flash drive. In this case, the communication system 300 represents a scenario in which the computer and the USB flash drive are transmitting data.

[0069] Optionally, the communication device 310 and the target device 320 may also each include an application layer (…). Figure 3A (not shown), its structure and function can be compared with Figure 2 The structure and function of the application layer are the same in the embodiments, and will not be described again here.

[0070] The following description, using the USB protocol layer and USB adapter layer in the communication system 300 as examples (i.e., the protocol of the first physical link is the USB 2.0 protocol), and taking the communication device 310 as an example, details its data transmission and reception process:

[0071] 1. Scenario of communication device 310 sending data to target device 320

[0072] USB protocol layer 311 is used to send the first data to USB adapter layer 312. USB protocol layer 311 specifies the syntax and protocol for interaction between USB Host and USB Device, defining the structure of fields, packets, transactions, and transfers, as well as the hierarchical relationship between fields to packets, packets to transactions, and transactions to transfers. The first data at this stage can also be called USB 2.0 data. A packet is the basic unit of data transmission on the USB bus. The USB 2.0 protocol specifies four types of packets: token packets, data packets, handshake packets, and special packets. Token packets can only be sent by the host; data packets and handshake packets can be sent by the host or the device. Each packet consists of different fields, and all packets begin with a synchronization (SYNC) field and end with an end-of-packet (EOP) signal. The transmission of packets cannot be interrupted or interfered with, otherwise errors will occur; several packets constitute a transaction transmission, and a transaction transmission cannot be interrupted either, and the packets belonging to a transaction transmission must be consecutive; a transmission consists of one or more transaction transmissions.

[0073] USB adapter layer 312 is used to perform physical link adaptation on the first data to obtain the second data, and send the second data to the transport layer; wherein, the first data adapts to the first physical link ( Figure 3A (Not shown), the second data is adapted to the second physical link, the bandwidth of the first physical link is lower than the bandwidth of the second physical link, and the above first data is protocol layer data.

[0074] Optionally, the second data is processed by the transport layer and the physical layer, and then sent to the receiving end through the second physical link.

[0075] Optionally, the USB adapter layer 312 includes corresponding physical circuitry (structures) and can be integrated into the USB controller. The USB adapter layer 312 can perform physical link adaptation on the first data sent by the USB protocol layer 311 according to the protocol of the second physical link to obtain second data suitable for transmission on the high-speed second physical link, thereby multiplexing the first data onto the high-speed physical link for transmission, that is, multiplexing USB 2.0 data onto the high-speed physical link for transmission. The protocol of the second physical link can be an existing communication protocol or a set of data interaction communication methods set by those skilled in the art. This application does not specifically limit this.

[0076] Optionally, the first physical link can be a physical link defined by the USB 2.0 protocol, or in other words, the first physical link is the original USB 2.0 protocol data transmission link, and its physical form is wired, such as copper wire, and its transmission rate can be 480Mbps, 12Mbps or 1.5Mbps; the second physical link is a high-speed physical link with a higher bandwidth than the first physical link. The physical form of the second physical link can be configured according to the specific application scenario, and it can be wired or wireless, such as copper wire, wireless channel or fiber optic.

[0077] For example, when the physical form of the second physical link is wired, the communication device is a computer, and the target device is a USB flash drive, the second physical link can be the metal plate (usually copper) that contacts the USB flash drive and the computer's USB interface when the communication device and the target device are transmitting data.

[0078] Optionally, the transport layer 313 and the physical layer 314 each include corresponding physical circuits (structures), and the transport layer 313 can receive data transmitted to it by different protocol adaptation layers. Figure 3A The diagram only shows an adaptation layer for one protocol, and provides a unified transmission interface and data transmission format, that is, converting the transmission format of the second data into the transmission format specified by the second physical link protocol; in addition, the transmission layer 313 can also provide common functions such as scheduling quality of service (QoS), bandwidth allocation, flow control, power management, and connection management. The physical layer 314 can provide corresponding line coding, channel coding, and electrical signal indicator requirements according to the set physical link configuration. The physical layer 314 can be subdivided into a physical coding sublayer (PCS) and a physical media attachment layer (PMA), or into a logical layer and an electrical layer. Specifically, the physical layer 314 can be used to perform digital-to-analog conversion, that is, converting the second data represented by digital signals into corresponding analog signals.

[0079] In one feasible implementation, the first data includes any one of a token packet, a handshake packet, or a special packet, and the USB adapter layer 312 is specifically used to: encapsulate the first data to obtain a first transmission packet; and the second data includes the first transmission packet.

[0080] Optionally, the aforementioned first data may specifically include any one of the token packet, handshake packet, and special packet in the USB 2.0 protocol.

[0081] Specifically, the USB adapter layer 312 can encapsulate the first data according to the protocol of the second physical link to obtain the first transmission packet, thereby enabling the first transmission packet to be transmitted on the second physical link.

[0082] In one feasible implementation, the first data includes a data packet, and the USB adapter layer is specifically used to: split the data packet into multiple first data payloads, and encapsulate the multiple first data payloads respectively to obtain multiple second transmission packets; the second data includes multiple second transmission packets.

[0083] Optionally, the aforementioned first data may specifically include data packets in the USB 2.0 protocol.

[0084] Optionally, the rules for splitting and encapsulating data packets can be as follows: the beginning part of the data packet, such as the first 1 byte of data (i.e., the packet identifier PID part) or the first 2 bytes of data (the packet PID part and the 1 byte after the PID), is taken as a first data payload. Then, the remaining part of the data packet is split into one or more first data payloads according to a preset rule. The preset rule can be to split the data evenly according to the length. This application does not make a specific limitation on this rule. Then, all the first data payloads obtained from the splitting are encapsulated into corresponding second transmission packets.

[0085] In one feasible implementation, the first data further includes a bus event. The USB adapter layer is specifically used to: encapsulate the beginning part of the bus event when the bus event arrives to obtain a third transmission packet; the transport layer and physical layer are specifically used to process the third transmission packet and send it to the receiving end through the second physical link; the USB adapter layer is also specifically used to: encapsulate the end part of the bus event when the bus event ends to obtain a fourth transmission packet; the transport layer and physical layer are specifically used to process the fourth transmission packet and send it to the receiving end through the second physical link.

[0086] Specifically, the aforementioned bus events include any one of ChirpK, ChirpJ, or ResumeK in the USB 2.0 protocol. In the USB 2.0 protocol, a bus event is a segment of a voltage level signal. For example, the voltage level signal characteristics of a bus event can be: first, it changes from a low level 0 to a high level 1, then it remains at the high level 1 for a period of time, and finally it changes from the high level 1 to a low level 0. The portion of this voltage level signal that changes from low level 0 to high level 1 is the beginning of the bus event, the portion that changes from high level 1 to low level 0 is the end of the bus event, and the duration of high level 1 is the middle portion of the bus event. Embodiments of this application can determine the beginning and end portions of each of the three types of bus events according to the rules in the above examples.

[0087] Optionally, the start and end portions of the three bus events in the USB 2.0 protocol described above can be represented as: Chirp K Start, Resume K Start, Chirp J Start, Chirp K End, Resume K End, and Chirp J End. When the first data also includes bus events, the USB adapter layer 312 can encapsulate the start and end portions of the bus events to obtain the third and fourth transmission packets, respectively. The middle portion of the bus event is not encapsulated. Then, the third and fourth transmission packets are sent through the transport layer 313, the physical layer 314, and the second physical link, respectively. In this case, the processing of the third and fourth transmission packets by the transport layer and the physical layer is the same as the processing of the second data by the transport layer and the physical layer in the aforementioned embodiment, and will not be repeated here.

[0088] In one feasible implementation, the USB protocol layer is further used to send control information to the USB adapter. The USB adapter layer is further used to: parse the first virtual resistance information from the control information; and encapsulate the first virtual resistance information to obtain a fifth transmission packet; the transport layer and physical layer are specifically used to process the fifth transmission packet and send it to the receiving end through a second physical link. The first virtual resistance information is used to characterize the virtual bus state by describing the on or off state of the virtual resistor in the communication device. The virtual bus is a bus that matches the USB protocol layer. The virtual resistor in the communication device corresponds to a physical resistor, and the physical resistor includes at least one of a high-speed matching resistor, a pull-up resistor, or a pull-down resistor.

[0089] In this embodiment, the communication device 310 may not include a USB 2.0 physical layer or USB 2.0 pins, thus eliminating the physical resistors in the USB 2.0 physical layer. Therefore, a first virtual resistor is introduced to replace the physical resistors in the USB 2.0 physical layer. This allows for subsequent determination of the virtual bus state based on the virtual resistor information, and then reporting the virtual bus state to meet the communication requirements of the USB 2.0 protocol. The first virtual resistor differs depending on whether the communication device 310 is used as an uplink or downlink port. When used as a downlink port, the first virtual resistor includes a virtual high-speed termination resistor and a virtual pull-down resistor; when used as an uplink port, the first virtual resistor includes a virtual high-speed termination resistor and a virtual pull-up resistor. Meanwhile, since the communication device 310 in this embodiment may not include a physical USB 2.0 bus, a virtual bus is introduced to replace the physical USB 2.0 bus. The virtual bus is a bus that matches the USB 2.0 protocol layer, i.e., a virtual USB 2.0 bus. The virtual bus state is then used to replace the actual USB 2.0 bus state in order to meet the requirements of the USB 2.0 protocol for real-time reporting of bus state.

[0090] Optionally, the aforementioned first virtual resistance information further includes high-resistance (High-Z) information. The high-resistance information characterizes the on or off state of the high-resistance, and characterizes the connection state between the communication device 310 and the target device 320 (i.e., the receiving end). When the communication device 310 and the target device 320 establish a communication connection, the high-resistance is in an off state; when the communication device 310 and the target device 320 do not establish a communication connection, the high-resistance is in a on state. The communication connection can refer to a wired or wireless connection, and this application does not specifically limit it.

[0091] Please see Figure 3B , Figure 3B This is a schematic diagram of another communication system 300 provided in an embodiment of this application, serving as a reference. Figure 3A Supplementing communication scenarios in China. For example... Figure 3B As shown, Figure 3B It includes a communication device 310, a target device 320, a target device 330, and a target device 340.

[0092] exist Figure 3B In this process, the communication device 310 extends its connectivity by connecting to the target device 320, thereby enabling it to connect with multiple devices. Figure 3BOnly two are shown in the diagram, namely target device 330 and target device 340, communicating with each other. In this case, target device 320 can be a hub. Target devices 330 and 340 can be hubs or devices. When target devices 330 and 340 are hubs, the scalability of the communication system 300 can be further enhanced, allowing communication device 310 to transmit data with multiple devices.

[0093] It should be understood that the communication device 310 may include multiple second physical links. Figure 3B Only one is shown in the image, and this application does not make any specific limitation on it. A hub can contain multiple extended second physical links ( Figure 3B (Only two examples are shown in the text), and this application does not make any specific limitations on them. Figure 3B The structure and function of each layer within each device can be referred to Figure 3A The corresponding description in [the document] will not be repeated here.

[0094] exist Figure 3B For details on the specific data transmission processes between communication device 310 and target device 320, target device 320 and target device 330, and target device 320 and target device 340, please refer to [link to relevant documentation]. Figure 3A The descriptions in the embodiments will not be repeated here.

[0095] Please see Figure 4 , Figure 4 This is a schematic diagram of the structure of a virtual resistor model in a communication system 300 according to an embodiment of this application. The following will use... Figure 4 The virtual resistor included in the communication system 300 is described in detail for example.

[0096] The virtual resistor included in the communication device 310 is a first virtual resistor, and the virtual resistor included in the target device 320 (i.e., the receiving end) is a second virtual resistor. For example... Figure 4 As shown, when the communication device 310 acts as a downlink port and the target device 320 acts as an uplink port, the first virtual resistor includes a D+ high-speed matching resistor, a D- high-speed matching resistor, a D+ pull-down resistor, and a D- pull-down resistor on the downlink port; the second virtual resistor includes a D+ high-speed matching resistor, a D- high-speed matching resistor, a D+ pull-up resistor, and a D- pull-up resistor on the uplink port. It should be understood that the communication device 310 and the target device 320 can act as either uplink or downlink ports. When the communication device 310 acts as an uplink port and the target device 320 acts as a downlink port, the specific types of virtual resistors included in the first and second virtual resistors are exactly the opposite of those described above, and will not be repeated here.

[0097] It should be noted that the first virtual resistance information can be encapsulated separately to obtain the fifth transmission packet and then sent to the target device 320; or it can be encapsulated together with the bus event or the first data and sent to the target device 320 together. This application embodiment does not specifically limit this.

[0098] As can be seen, since this embodiment does not include the USB 2.0 physical layer and pins, data transmission does not need to pass through the USB 2.0 physical layer, reducing intermediate steps in data transmission. Therefore, it can effectively reduce the receiving latency at the receiving end to meet the low-latency requirements of the communication protocol, making it easy to apply. Simultaneously, it can effectively reduce chip area and related costs. Furthermore, this embodiment introduces virtual resistors and virtual buses to replace the physical resistors and USB 2.0 bus in the USB 2.0 physical layer, respectively. In this case, the first virtual resistor information is directly parsed from the control information, eliminating the need for detection, resulting in faster speed. Therefore, this embodiment can effectively reduce the receiving latency at the receiving end, thereby better meeting the communication requirements of the USB 2.0 protocol. The virtual resistor includes a first virtual resistor and a second virtual resistor.

[0099] In one feasible implementation, the first, second, third, fourth, and fifth transmission packets all include a packet header and a data payload. The packet header contains the type information of the corresponding transmission packet, the length information of the data payload, and the reliability protection information.

[0100] Alternatively, a feasible header format may be shown in Table 1.

[0101] Reliability protection information Data payload length information Transmission packet type information

[0102] Table 1: Packet header format illustration

[0103] As shown in Table 1, for the five types of transmission packets mentioned above, the information contained in their headers can be in the following order: reliability protection information, namely, cyclic redundancy check (CRC) code, data payload length information, and transmission packet type information.

[0104] Cyclic Redundancy Check (CRC) is a check code with error detection and correction capabilities. It's a channel coding technique that generates short, fixed-length check codes based on network data packets or computer files, primarily used to detect or verify errors that may occur after data transmission or storage. Transmission packet types include non-data packet, data packet start (DP Start), data packet middle (DP Middle), data packet end (DP End), and bus event types. Non-data packet types represent token packets, handshake packets, and special packets; DP Start, DP Middle, and DP End types represent data at different positions within a data packet; and bus event types represent virtual resistance information and bus events.

[0105] Optionally, the data payload format in the third, fourth, and fifth transmission packets can be as shown in Tables 2 and 3, where Table 2 shows the data payload format for the downlink port and Table 3 shows the data payload format for the uplink port.

[0106] CRC Rsvd DRoff DRon HS off HS on Hiz on J End JStart K End K Start

[0107] Table 2: Downlink Port Data Net Load Format

[0108]

[0109] Table 3: Uplink Data Payload Format

[0110] As shown in Table 2, the data payload format in Table 2 can be used to represent the data payload contained in the transmission packet that encapsulates bus events or virtual resistance information on the uplink port. The data payload format shown in Table 2 contains a total of 11 information units, and the information identified is as follows: Cyclic Redundancy Check (CR) code, Reserved item (Rsvd), Pull-Down Resistor off (DR off), Pull-Down Resistor on (DR on), High Speed ​​Termination Resistor off (HS off), High Speed ​​Termination Resistor on (HS on), High-Impedance (Hiz on), Bus Event J End (J End), Bus Event J Start (J Start), Bus Event K End (K End), Bus Event K Start (K Start).

[0111] As shown in Table 3, the data payload format in Table 3 can be used to represent the data payload contained in the transmission packet encapsulating bus events or virtual resistance information on the uplink port. The data payload format shown in Table 3 contains a total of 12 information units, namely: Cyclic Redundancy Check (CRC), D+ Pull-up Resistor Off (DM Pullup Resistor Off, MRoff), D+ Pull-up Resistor On (DM Pullup Resistor On, MRon), D- Pull-up Resistor Off (DP Pullup Resistor Off, PRoff), D- Pull-up Resistor On (DP Pullup Resistor On, PRon), High-speed Matching Resistor Off, High-speed Matching Resistor On, High Impedance On, Bus Event J End, Bus Event J Start, Bus Event K End, Bus Event K Start.

[0112] It should be noted that the D+ and D- high-speed matching resistors are simultaneously turned on and off, therefore, the high-speed matching resistors are represented by one information unit in the data payload of the uplink and downlink ports. The two pull-down resistors of the downlink port are simultaneously turned on or off, therefore Table 2 uses two information units to represent the state of the pull-down resistors. The two pull-up resistors of the uplink port may not be simultaneously turned on or off, therefore Table 3 uses four information units to represent the states of the two pull-up resistors respectively. In Tables 2 and 3, JEnd represents the end of the bus event ChirpJ, JStart represents the beginning of the bus event ChirpJ, KEnd represents the end of the bus event ChirpK or ResumeK, and KStart represents the beginning of the bus event ChirpK or ResumeK.

[0113] It should be understood that Tables 2 and 3 are merely examples of data payload formats for transmission packets that encapsulate bus events or virtual resistance information, as provided in the embodiments of this application. Those skilled in the art may also use other data payload formats to represent bus events and virtual resistance information, and the embodiments of this application do not specifically limit this.

[0114] Please see Figure 5 , Figure 5 This is a schematic diagram illustrating a data packet splitting and encapsulation process provided in an embodiment of this application. Figure 5 As shown, the data structure of a data packet, from beginning to end, includes a synchronization (SYNC) flag, a packet identifier (PID), multiple bytes (byte 1 to the last byte), and an end of packet (EOP) delimiter.

[0115] like Figure 5As shown, the data packet can be split into N data payloads. The identifier PID and byte 1 represent data payload 1. Byte 2 to the last byte are split into N-1 data payloads. Then, the USB adapter layer 312 encapsulates each of the N data payloads to obtain N second transmission packets. Each second transmission packet contains a corresponding header and data payload. The header of the first second transmission packet contains the transmission packet type information DP Start, the headers of the second to (N-1)th second transmission packets contain the transmission packet type information DP Middle, and the header of the Nth second transmission packet contains the transmission packet type information DP End. Here, N is a positive integer greater than or equal to 2.

[0116] II. Scenario where communication device 310 receives data sent by target device 320

[0117] In one feasible implementation, the physical layer and transport layer are further configured to process the third data received through the second physical link and send it to the USB adapter layer; the USB adapter layer is further configured to perform physical link adaptation on the processed third data to obtain fourth data and send the fourth data to the USB protocol layer; wherein the third data is adapted to the second physical link and the fourth data is adapted to the first physical link.

[0118] Specifically, the processing of the third data by the physical layer 314 and the transport layer 313 is exactly the opposite of the processing of the second data by the physical layer 314 and the transport layer 313: the third data is transmitted on the second physical link as an analog signal. The physical layer 314 can be used to convert the analog signal representing the third data into a corresponding digital signal. The transport layer 313 can be used to transmit the digital signal of the converted third data and convert the transmission format of the digital signal into a transmission format compatible with the USB adapter layer 312, that is, into the transmission format specified by the USB 2.0 protocol.

[0119] In one feasible implementation, the processed third data includes one or more transmission packets, and the USB adapter layer is specifically used to: parse the headers of the one or more transmission packets to obtain the type information of the one or more transmission packets; when the one or more transmission packets are data packets, aggregate the one or more data payloads corresponding to the one or more transmission packets to obtain the fourth data; when the one or more transmission packets are not data packets, use the one or more data payloads corresponding to the one or more transmission packets as the fourth data.

[0120] Specifically, after receiving the one or more transmission packets, the USB adapter layer 312 restores the one or more transmission packets to obtain the fourth data that the USB protocol layer can receive. The process includes: firstly, parsing the header of the one or more transmission packets to obtain the type information of the one or more transmission packets from the corresponding header; when the type of the one or more transmission packets is a data packet, the data payloads contained in the DPStart transmission packet, DPEnd transmission packet, and the M DPPMiddle transmission packets between the DPStart and DPEnd transmission packets are aggregated sequentially to obtain the fourth data; where M is an integer greater than or equal to zero; when the one or more transmission packets are token packets, special packets, handshake packets, bus event start packets, or bus event end packets, the data payloads contained in the one or more transmission packets are respectively used as the fourth data.

[0121] In one feasible implementation, the physical layer and transport layer are further configured to process the sixth transmission packet received through the second physical link and then send it to the USB adapter layer; the USB adapter layer is further configured to receive the processed sixth transmission packet and parse the processed sixth transmission packet to obtain second virtual resistance information; the second virtual resistance information includes the on or off state of the virtual resistor in the receiving end, and the second virtual resistance information is used to characterize the virtual bus state, the virtual resistor in the receiving end corresponds to the physical resistor, and the physical resistor includes at least one of a high-speed matching resistor, a pull-up resistor, or a pull-down resistor.

[0122] The process by which the physical layer 314 and the transport layer 313 process the sixth transmission packet is the same as the process by which they organize the third data, and will not be described again here. The receiving end is the target device 320. When it is used as a downlink port, the virtual resistor included in the target device 320 is as follows: Figure 4 As shown, it can include a virtual high-speed matching resistor and a virtual pull-down resistor for the downlink port; when it is used as an uplink port, the virtual resistor can include a virtual high-speed matching resistor and a virtual pull-up resistor for the uplink port.

[0123] After receiving the processed sixth transmission packet, the USB adapter layer 312 is also used to restore it to obtain the second virtual resistance information. The specific process is as follows: the header of the sixth transmission packet is parsed to determine the type of the sixth transmission packet, i.e., the bus event type; and the second virtual resistance information in the communication device 310 is updated according to the second virtual resistance information contained in the data payload.

[0124] Optionally, the second virtual resistance information also includes high resistance (High-Z) information, which has the same meaning as the high resistance in the first virtual resistance information, and will not be repeated here.

[0125]

[0126] Table 4: Correspondence between Virtual Resistor Information and Virtual Bus Status

[0127] In one feasible implementation, the USB adapter layer is further configured to: determine the virtual bus state based on the content of the first data when the USB adapter layer receives the first data; determine the virtual bus state based on the content of the fourth data when the USB adapter layer sends the fourth data; determine the virtual bus state based on the first virtual resistance information and the second virtual resistance information when the USB adapter layer neither receives the first data nor sends the fourth data; and send the current virtual bus state to the USB protocol layer.

[0128] Specifically, the first data may include token packets, handshake packets, special packets, data packets, or bus events, and the fourth data may also include token packets, handshake packets, special packets, data packets, or bus events.

[0129] Optionally, when the USB adapter layer 312 receives the first data, determining the virtual bus state based on the content of the first data specifically includes: when the USB adapter layer 312 receives a token packet, handshake packet, special packet, data packet, or bus event from the USB protocol layer 311, determining the virtual bus state according to the USB transceiver macrocell interface (UTMI) protocol, that is, according to the correspondence between the content of the first data and the bus state.

[0130] Optionally, when the USB adapter layer 312 sends the fourth data, the virtual bus state is determined based on the content of the fourth data. Specifically, when the USB adapter layer 312 sends a token packet, handshake packet, special packet, data packet, or bus event to the USB protocol layer 311, the virtual bus state is determined according to the UTMI protocol, i.e., according to the correspondence between the fourth data content and the bus state. For example, when the received fourth data is the beginning part of a bus event, the virtual bus state (line_state) is determined to be K or J according to the type of bus event; when the received fourth data is the end part of a bus event, the virtual bus state is determined to be SE0 (i.e., SE0 in the USB 2.0 protocol). The correspondence between other USB 2.0 transport packets, bus events, and bus states specified in the UTMI protocol will not be elaborated here.

[0131] Optionally, when the USB adapter layer does not receive the first data and does not send the fourth data, the virtual bus state is determined according to the correspondence between the virtual resistor and the virtual bus state in Table 4.

[0132] The relevant Chinese and English symbols in Table 4 are explained below: ON indicates conduction, OFF indicates shutdown, X indicates no effect on the determination of the virtual bus state, FS refers to full speed in USB 2.0, LS refers to low speed in USB 2.0, HS refers to high speed in USB 2.0, and the meanings of J state, K state, and SEO state are found in the USB 2.0 protocol and will not be repeated here; there are a total of 6 virtual bus states: downlink port drive high impedance, uplink port drive high impedance, FS default state, LS default state, HS default state, and HS handshake (handshake) in the USB 2.0 protocol.

[0133] In one feasible implementation, the USB protocol layer is further configured to: determine the operating state of the communication device at the next moment based on the virtual bus state; wherein the operating state includes at least one of the following: whether the USB protocol layer sends first data or receives sixth data, the content contained in the first data when the USB protocol layer sends the first data, or the first virtual resistance information parsed by the USB adapter layer from the control information when the USB protocol layer sends control information; or an idle state.

[0134] Specifically, the next working state of the communication device 310 includes the following: (1) The USB protocol layer 311 sends first data to the USB adapter layer 312, and the specific content contained in the first data; (2) The USB protocol layer 311 receives the sixth data sent by the USB adapter layer 312; (3) The USB protocol layer 311 sends control information to the USB adapter layer 312, and the USB adapter layer 312 can parse the corresponding first virtual resistance information from the control information; (4) Idle state, the USB protocol layer 311 neither sends the first data nor receives the sixth data.

[0135] It should be noted that the above division of working states refers to the specific behavior of the communication device 310 at a certain moment, which will be referred to below. Figure 6 The different operating modes of the communication device are described in detail. The operating mode refers to the specific behavior of the communication device 310 over a period of time.

[0136] It should be understood that the specific process of the target device 320 (receiving end) sending and receiving data is the same as that of the communication device 310 described above. When the communication device 310 sends data, the target device 320 receives data; when the target device 320 sends data, the communication device 310 receives data. Therefore, the process of the target device 320 sending and receiving data will not be described again in this embodiment of the application.

[0137] In one possible implementation, please refer to Figure 6 , Figure 6This is a schematic diagram of another communication system 300 provided in an embodiment of this application, serving as a reference. Figure 3A or Figure 3B or Figure 7 or Figure 8 Refinement of the USB adapter layer. For example... Figure 6 As shown, for the communication device 310, its USB adapter layer 312 includes an encapsulation unit 3121, a control unit 3122, a determination unit 3123, and a restoration unit 3124.

[0138] The control unit 3122 is used to receive control information sent by the USB protocol layer 311, determine the operating mode of the communication device 310 according to the control information, and parse the corresponding first virtual resistance information from the control information; the control unit 3122 controls whether the encapsulation unit 3121 encapsulates the first data and the first virtual resistance information according to the determined operating mode, controls whether the restoration unit 3124 restores the third data, and controls whether the determination unit 3123 performs virtual bus state inference.

[0139] The encapsulation unit 3121 is used to receive the first data and encapsulate the first data to obtain the second data; and to encapsulate the first virtual resistance information obtained in this parsing when it is different from the first virtual resistance information obtained in the previous parsing to obtain the fifth transmission packet.

[0140] The restoration unit 3124 is used to receive the third data and restore the third data to obtain the fourth data, and to receive and restore the sixth transmission packet to obtain the second virtual resistance information, and to update the second virtual resistance information obtained last time using the second virtual resistance information obtained this time.

[0141] The determining unit 3123 is used to determine the virtual bus state according to the correspondence between the encapsulated first data content and the bus state specified in the UTMI protocol when the encapsulation unit 3121 encapsulates the first data; it is used to determine the virtual bus state according to the correspondence between the specific content of the fourth data and the bus state specified in the UTMI protocol when the restoration unit 3124 sends the fourth data to the USB protocol layer 311; it is used to determine the virtual bus state according to the correspondence between the virtual resistor and the virtual bus state in Table 4 when the encapsulation unit 3121 does not receive the first data and the restoration unit 3124 does not send the fourth data; and it is used to send the virtual bus state to the USB protocol layer 311.

[0142] It should be understood that the functions of the encapsulation unit 3221, control unit 3222, determination unit 3223, and restoration unit 3224 included in the USB adapter layer 322 of the target device 320 are the same as those of the encapsulation unit 3121, control unit 3122, determination unit 3123, and restoration unit 3124 included in the USB adapter layer 312, and will not be repeated here. Each functional unit included in the target device 320 and the communication device 310 includes corresponding hardware circuits.

[0143] The following tables 5 to 8 will describe in detail the operating modes of the communication device 310 under different control information, as well as the specific behaviors of the communication device 310 under different operating modes.

[0144] The aforementioned control information may include various control signals from the USB 2.0 protocol: utmi_dppulldown, utmi_dmpulldown, utmi_suspendm, utmi_xcvrselect, utmi_termselect, utmi_opmode, and utmi_txvaild. This control information is identical to the control information specified in the UTMI protocol and will not be described further in this application. When utmi_dppulldown or utmi_dmpulldown is 1, the communication device 310 operates as a downlink port, meaning the USB adapter layer 312 is located at the downlink port; when utmi_dppulldown or utmi_dmpulldown is 0, the communication device 310 operates as an uplink port, meaning the USB adapter layer 312 is located at the uplink port. Combinations of these various control signals correspond to different operating modes of the communication device 310.

[0145] Please refer to Tables 5 and 6. Table 5 shows that when the communication device 310 is used as a downlink port, 13 operating modes of the communication device 310 can be determined based on the combination of five control signals: utmi_suspendm, utmi_xcvrselect, utmi_termselect, utmi_opmode, and utmi_txvaild. In Table 5, "X" indicates that this signal has no effect on the determination of the operating mode. The meaning of each signal is explained below using signal "01b" as an example: "b" indicates that the signal is in binary format, and "01" indicates the specific value of the signal. The meanings of the other signal values ​​are similar and will not be repeated.

[0146] The 13 operating modes mentioned above are the downlink port operating modes in the UTMI protocol. As shown in Table 6, "packet" in Table 6 refers to any of the data in the first or fourth data, excluding bus events, namely, any one of the following: command packet, handshake packet, special packet, and data packet. Full speed, high speed, and low speed refer to full speed (12Mbps), high speed (480Mbps), and low speed (1.5Mbps) in the USB 2.0 protocol, respectively. "X" means no effect; "data" refers to any one of the following: command packet, handshake packet, special packet, and data packet; "ON" means in the working state; "OFF" means in the non-working state; "OFF / ON" means it can be in either the working or non-working state; in the signal value "FFh" of utmi_txdata, "h" indicates that the value is in hexadecimal, and "FF" indicates the specific value of the signal.

[0147] It should be noted that in the Preamble (packet sending) working mode, if the packet sent is a preamble packet, then from the end of this packet to the beginning of the next packet, the virtual bus state is the full-speed J state in the USB 2.0 protocol, i.e., FSJ.

[0148] The following examples illustrate the behavior of the communication device corresponding to the different operating modes in Table 6. For instance, the "high impedance" operating mode indicates that the communication device 310 has not established a communication connection with other devices, and the corresponding high-speed matching resistor and pull-down resistor are not connected. The "standby" operating mode indicates that the communication device 310 has established a communication connection with the target device 320. At this time, only the encapsulation and restoration of bus events and the determination of the virtual bus state are performed, and the corresponding high-speed matching resistor is not connected while the pull-down resistor is connected. The full-speed mode includes the three operating modes shown in Table 6: full-speed (idle), full-speed (packet sending), and full-speed (resuming K). The high-speed mode includes the four operating modes shown in Table 6: high-speed (idle), high-speed (packet sending), high-speed (resuming Chirp J), and full-speed (resuming Chirp K). The low-speed mode includes the four operating modes shown in Table 6: low-speed (idle), low-speed (packet sending), and low-speed (resuming K). K) There are three operating modes; among them, the "full speed (idle)" operating mode means that the communication device 310 encapsulates and restores bus events, restores the token packet, handshake packet, special packet and data packet sent by the target device 320, and determines the virtual bus state. The corresponding high-speed matching resistor is not connected and the pull-down resistor is connected. The "full speed (packet sending)" operating mode means that the communication device 310 encapsulates and restores bus events, encapsulates and restores the token packet, handshake packet, special packet and data packet, and determines the bus event. The corresponding high-speed matching resistor is not connected and the pull-down resistor is connected. The "full speed (resume K)" operating mode means that the communication device 310 encapsulates and restores the beginning and end parts of the bus event Resume K, and determines the virtual bus state. The behavior of the communication device 310 in the five operating modes in Table 6 is described in detail above. The behavior of the communication device 310 in other operating modes can be referred to Table 6 for details, and will not be repeated here.

[0149]

[0150]

[0151] Table 5: Correspondence between downlink control information and communication device operating modes

[0152]

[0153] Table 6: Virtual resistance information and specific behavior of the control unit corresponding to different working modes of the downlink port

[0154] Please refer to Tables 7 and 8. Table 7 shows that when communication device 310 is used as an uplink port, 12 operating modes of communication device 310 can be determined based on the combination of five control signals: utmi_suspendm, utmi_xcvrselect, utmi_termselect, utmi_opmode, and utmi_txvaild. It should be noted that when communication device 310 is used as an uplink port, there is no preamble (packet transmission) operating mode. The specific meanings of the various signal values ​​in Table 7 are interpreted according to the same rules as those in Table 5, and the meanings of the signal values ​​in Table 8 are interpreted according to the same rules as those in Table 6; therefore, they will not be repeated here.

[0155] The 12 operating modes mentioned above are the uplink port operating modes in the UTMI protocol. As shown in Table 8, the meanings of "packet," "full speed," "low speed," and "high speed" in Table 8 are the same as those in Table 6. The interpretation rules for the signal values ​​of utmi_txdata, virtual resistor information, and control unit behavior in Table 8 are the same as those for the corresponding signal values ​​in Table 6, and will not be repeated here. For the specific behavior of the communication device 310 under different operating modes, please refer to Table 8, and will not be repeated here.

[0156] It should be noted that in full-speed (idle) working mode, if the received packet is a preamble packet, then the data in the next packet is inverted bit by bit. For example, if the data format in the next packet is binary, then the 0 bits in the binary data are changed to 1, and the 1 bits are changed to 0. Then, from the end of this packet to the beginning of the next packet, the virtual bus state is full-speed J state, i.e., FSJ.

[0157] It should be noted that the uplink port does not have a preamble mode, so there is no need to consider sending preamble packets, but the case of receiving preamble packets needs to be considered. The downlink port only needs to consider sending preamble packets, but not receiving them. The uplink port can choose to support only low-speed LS mode, or support high-speed HS mode or full-speed FS mode. Typically, the uplink port chooses to support high-speed HS mode or full-speed FS mode, and does not need to consider supporting low-speed LS mode. Low-speed start of frame (LS SOF / LS Keepalive) packets are only sent by the downlink port, so the downlink port only needs to consider sending LS Keepalive, not receiving it; the uplink port only needs to consider receiving LS Keepalive, not sending it.

[0158] It should be understood that Tables 5 to 8 above are examples of how communication device 310, when used as an uplink or downlink port, corresponds to the control information sent by the USB protocol layer 311 and the working mode of communication device 310, as well as the specific behavior of communication device 310 under different working modes. When target device 320 communicates as an uplink or downlink port, it also follows the corresponding rules in Tables 5 to 8, which will not be repeated here.

[0159]

[0160] Table 7: Correspondence between Uplink Control Information and Communication Device Operating Mode

[0161]

[0162] Table 8: Virtual resistance information and specific behavior of the control unit corresponding to different working modes of the uplink port

[0163] Please see Figure 7 , Figure 7 This is a schematic diagram of the structure of another communication system 300 provided in an embodiment of this application. For example... Figure 7 As shown, the communication device 310 and the target device 320 each include data transmission paths for multiple protocols. That is, in addition to the data transmission path of the USB 2.0 protocol, the two communication devices also include the data transmission path of the USB 3.0 protocol and the data transmission path of the PCIe protocol. Figure 7 The communication device 310 and the target device 320 shown in the diagram have the same structure.

[0164] like Figure 7 As shown, the communication device 310 includes a USB 2.0 protocol data transmission path, a USB 3.0 protocol data transmission path, and a PCIe protocol data transmission path. These three protocols each have their own independent data transmission paths above their respective adaptation layers. Below the adaptation layers, they share the transport layer 313, the physical layer 314, and the second physical link for data transmission. The USB 2.0 protocol data transmission path is... Figure 3A The specific data communication rules of the transmission paths shown have been described in detail in the foregoing embodiments and will not be repeated here. The USB 3.0 protocol data transmission path includes a USB 3.0 adaptation layer 333, a USB 3.0 link layer 332, and a USB 3.0 protocol layer 331 above the transport layer 313. The PCIe protocol data transmission path includes a PCIe adaptation layer 344, a PCIe logic layer 343, a PCIe data link layer 342, and a PCIe transaction layer 341 above the transport layer 313. The data transmission paths of the above three protocols should also include corresponding application layers (not shown) above their respective protocol layers.

[0165] It should be understood that the communication device 310 in the embodiments of this application can be a multi-protocol aggregation communication device (such as...). Figure 7 As shown, it includes USB 2.0 protocol and other communication protocols), or it can be a single-protocol communication device (such as...). Figure 3A or Figure 3B As shown, it includes the USB 2.0 protocol; however, this application does not specifically limit this. Furthermore, regarding... Figure 7 The multi-protocol aggregation communication device 310 shown can aggregate the USB 2.0 protocol with the USB 3.0 protocol and the PCIe protocol, as well as with one or more other protocols, to achieve transmission on a common high-speed second physical link. This application does not make any specific limitations on this.

[0166] Please see Figure 8 , Figure 8 This is a schematic diagram illustrating a scenario where multiple communication devices 310 communicate using an embodiment of this application. Figure 8 As shown, Figure 8 This diagram illustrates a scenario where a host establishes a connection with a device via a hub for data transfer. It should be understood that a host can contain multiple interfaces (...). Figure 8 Only two are shown in the image. When the number of host interfaces is limited, the following can be used: Figure 8 The method shown is that the host extends its connectivity by connecting to a hub, enabling the host to connect to multiple devices for simultaneous data transmission. When the host does not need to transmit data to multiple devices simultaneously, it can directly connect to the device for data transmission; this application does not specifically limit this.

[0167] The following is a detailed description of... Figure 8 The specific transmission paths for data transmission using different protocols are shown in the scenario. Figure 8 It contains three communication devices: a host, a hub, and a device. The host and the hub can communicate via a second physical link, and the hub and the device can also communicate via a second physical link. Figure 8 In this context, X and Y represent any other protocol that can be aggregated with USB 2.0. For example, protocol X and protocol Y could be USB 3.0 and PCIe, respectively. This application does not impose any specific limitations on this.

[0168] exist Figure 8The host shown contains data transmission paths for three protocols: USB 2.0, X, and Y. For USB 2.0, USB 2.0 data is transmitted through USB Application Layer 1 to USB Protocol Layer 1; then through USB Protocol Layer 1 to either USB Adapter Layer 1 or USB Adapter Layer 2; USB 2.0 data, after physical link adaptation by USB Adapter Layer 1, is sent through Transport Layer 1, Physical Layer 1, Interface 1, and a second physical link (not shown in the diagram); USB 2.0 data, after physical link adaptation by USB Adapter Layer 2, is sent to the hub through Transport Layer 2, Physical Layer 2, Interface 2, and the second physical link. For X, X protocol data is sent to the hub through X Controller 1, X Adapter Layer 1, Transport Layer 2, Physical Layer 2, Interface 2, and the second physical link. For Y, Y protocol data is transmitted through Y Controller 1, Y Adapter Layer 1, Transport Layer 1, Physical Layer 1, and Interface 1. It can be seen that the data transmission paths of both the X protocol and the USB 2.0 protocol include Transport Layer 2 and Physical Layer 2, while the data transmission paths of both the Y protocol and the USB 2.0 protocol include Transport Layer 1 and Physical Layer 1. It should be understood that the two USB 2.0 data paths in the host can be considered equivalent to... Figure 3A or Figure 3B The USB 2.0 data path included in the communication device 310 or the target device 320.

[0169] exist Figure 8The hub shown contains data transmission paths for two protocols: a USB 2.0 protocol data transmission path and an X protocol data transmission path. For the USB 2.0 protocol, USB 2.0 data is transmitted through interface 3, physical layer 3, transport layer 3, USB adapter layer 3, and USB protocol layer 2 to the routing layer for processing, and then through USB protocol layer 3 to either USB adapter layer 4 or USB adapter layer 5. Data that has undergone physical link adaptation at USB adapter layer 4 is sent to the device through transport layer 4, physical layer 4, interface 4, and a second physical link. Data that has undergone physical link adaptation at USB adapter layer 5 is sent to the device through transport layer 5, physical layer 5, interface 5, and a second physical link (not shown). In one feasible implementation, the USB 2.0 protocol data transmission path can also retain the USB 2.0 physical layer and USB 2.0 interface (pins) to ensure compatibility with existing USB 2.0 devices. For the X protocol, X protocol data is transmitted to the X converter via transport layer 3, physical layer 3, and X adaptation layer 2. The X converter extends the X protocol data transmission path into two, allowing X protocol data to be sent to either X adaptation layer 3 or X adaptation layer 4. After physical link adaptation by X adaptation layer 3, the data is sent to the device via transport layer 5, physical layer 5, interface 5, and a second physical link (not shown). After physical link adaptation by X adaptation layer 4, the data is sent to the device via transport layer 4, physical layer 4, interface 4, and a second physical link. The hub can also include links for the Y protocol; its specific structure can be defined according to the specific application scenario, and this application does not impose specific limitations on it.

[0170] exist Figure 8 The device shown contains data transmission paths for three protocols: USB 2.0, X protocol, and Y protocol. For the USB 2.0 protocol, USB 2.0 data is transmitted through interface 6, physical layer 6, and transport layer 6 to the USB adapter layer 6. The USB adapter layer 6 then restores the data to USB 2.0 and sends it to the USB protocol layer 4 and USB application layer 2. For the X protocol, X protocol data is transmitted through interface 6, physical layer 6, and transport layer 6 to the X adapter layer 5. The X adapter layer 5 then restores the data to X protocol and sends it to the X controller 2. The data transmission process for the Y protocol is the same as that for the X protocol, and will not be described further here.

[0171] Alternatively, the data transfer paths of the USB 2.0 protocol in the host and device can also retain the USB 2.0 physical layer and USB 2.0 pins, thereby enabling data transfer with existing USB 2.0 devices.

[0172] It should be understood that the above embodiments only describe the process of transmitting protocol data from the host to the device; the process of transmitting protocol data from the device to the host is similar to the process described above, and will not be repeated here. Furthermore, data transmission between the host, hub, and device can be wired or wireless. When wireless data transmission is used, the above three communication devices may not include… Figure 8 The interface shown is shown.

[0173] Please see Figure 9 , Figure 9 This is a flowchart illustrating a data transmission method 900 provided in an embodiment of this application. This data transmission method is applicable to the above-described... Figure 3A , Figure 3B , Figures 6-8 The method 900 includes any one of the communication devices or target devices, and a device comprising the aforementioned communication device or target device. The method 900 may include steps S901-S903, wherein: step S901: sending first data to the USB adapter layer via the Universal Serial Bus (USB) protocol layer; step S902: the USB adapter layer performs physical link adaptation on the first data to obtain second data, and sends the second data to the transport layer; wherein the first data adapts to a first physical link, and the second data adapts to a second physical link; the bandwidth of the first physical link is lower than the bandwidth of the second physical link; step S903: processing the second data through the transport layer and the physical layer, and sending the processed second data to the receiving end via the second physical link.

[0174] In one feasible implementation, the first data includes any one of a token packet, a handshake packet, or a special packet. The second data is obtained by physical link adaptation of the first data by the USB adapter layer, including: encapsulating the first data by the USB adapter layer to obtain a first transmission packet; the second data includes the first transmission packet.

[0175] In one feasible implementation, the first data includes a data packet, and the second data is obtained by physical link adaptation of the first data by the USB adapter layer, including: splitting the data packet into multiple first data payloads by the USB adapter layer, and encapsulating the multiple first data payloads respectively to obtain multiple second transmission packets; the second data includes multiple second transmission packets.

[0176] In one feasible implementation, the first data further includes a bus event. The USB adapter layer performs physical link adaptation on the first data to obtain the second data, including: when a bus event arrives, the USB adapter layer encapsulates the beginning portion of the bus event to obtain a third transmission packet; the transport layer and physical layer process the third transmission packet, and the processed third transmission packet is sent to the receiving end via a second physical link; when the bus event ends, the USB adapter layer encapsulates the end portion of the bus event to obtain a fourth transmission packet; the transport layer and physical layer process the fourth transmission packet, and the processed fourth transmission packet is sent to the receiving end via a second physical link.

[0177] In one feasible implementation, the method includes: sending control information to a USB adapter via the USB protocol layer; parsing first virtual resistance information from the control information via the USB adapter layer; encapsulating the first virtual resistance information to obtain a fifth transmission packet; processing the fifth transmission packet via the transport layer and the physical layer; and sending the processed fifth transmission packet to the receiving end via a second physical link; wherein the first virtual resistance information is used to characterize the virtual bus state by describing the on or off state of the virtual resistance in the communication device, the virtual bus being a bus that matches the USB protocol layer, the virtual resistance in the communication device corresponding to the physical resistance, and the physical resistance including at least one of a high-speed matching resistor, a pull-up resistor, or a pull-down resistor.

[0178] In one feasible implementation, the first, second, third, fourth, and fifth transmission packets all include a packet header and a data payload. The packet header contains the type information of the corresponding transmission packet, the length information of the data payload, and the reliability protection information.

[0179] In one feasible implementation, the above method further includes: processing the third data received through the second physical link through the physical layer and the transport layer, and sending the processed third data to the USB adaptation layer; performing physical link adaptation on the processed third data through the USB adaptation layer to obtain fourth data, and sending the fourth data to the USB protocol layer; wherein the third data is adapted to the second physical link, and the fourth data is adapted to the first physical link.

[0180] In one feasible implementation, the processed third data includes one or more transmission packets. The fourth data is obtained by physical link adaptation of the processed third data through the USB adapter layer, including: parsing the headers of one or more transmission packets through the USB adapter layer to obtain the type information of one or more transmission packets; when one or more transmission packets are data packets, aggregating one or more data payloads corresponding to one or more transmission packets through the USB adapter layer to obtain the fourth data; when one or more transmission packets are not data packets, using one or more data payloads corresponding to one or more transmission packets as the fourth data through the USB adapter layer.

[0181] In one feasible implementation, the method further includes: processing the sixth transmission packet received through the second physical link through the physical layer and the transport layer, and sending the processed sixth transmission packet to the USB adapter layer; receiving the processed sixth transmission packet through the USB adapter layer, and parsing the processed sixth transmission packet to obtain second virtual resistance information; the second virtual resistance information includes the on or off state of the virtual resistor in the receiving end, the second virtual resistance information is used to characterize the virtual bus state, the virtual resistor in the receiving end corresponds to the physical resistor, and the physical resistor includes at least one of a high-speed matching resistor, a pull-up resistor, or a pull-down resistor.

[0182] In one feasible implementation, the method further includes: when the USB adapter layer receives first data, the USB adapter layer determines the virtual bus state based on the content of the first data; when the USB adapter layer sends fourth data, the USB adapter layer determines the virtual bus state based on the content of the fourth data; when the USB adapter layer neither receives the first data nor sends the fourth data, the USB adapter layer determines the virtual bus state based on the first virtual resistance information and the second virtual resistance information; and the USB adapter layer sends the current virtual bus state to the USB protocol layer.

[0183] In one feasible implementation, the above method further includes: the USB protocol layer determining the next working state of the communication device based on the virtual bus state; wherein the working state includes at least one of the following: whether the USB protocol layer sends first data or receives sixth data, the content contained in the first data when the USB protocol layer sends the first data, or the first virtual resistance information parsed from the control information by the USB adapter layer when the USB protocol layer sends control information.

[0184] Please see Figure 10 , Figure 10This is a schematic diagram of an exemplary terminal 100 provided in an embodiment of this application. It should be understood that the terminal 100 may be the aforementioned communication device 310 or target device 320. The terminal 100 may include an antenna system 110, a radio frequency (RF) circuit 120, a processor 130, a memory 140, a camera 150, an audio circuit 160, a display screen 170, one or more sensors 180, and a wireless transceiver 190, etc.

[0185] Antenna system 110 may be one or more antennas, or an antenna array composed of multiple antennas. Radio frequency (RF) circuit 120 may include one or more analog RF transceivers, and may also include one or more digital RF transceivers, coupled to antenna system 110. It should be understood that in the various embodiments of this application, coupling refers to mutual connection in a specific manner, including direct connection or indirect connection through other devices, such as through various interfaces, transmission lines, buses, etc. RF circuit 120 can be used for various cellular wireless communications.

[0186] Processor 130 may include a communication processor, which can be used to control RF circuit 120 to receive and transmit signals through antenna system 110. These signals may be voice signals, media signals, or control signals. Processor 130 may include various general-purpose processing devices, such as a general-purpose central processing unit (CPU), a system-on-a-chip (SoC), a processor integrated on an SoC, a separate processor chip, or a controller. Processor 130 may also include special-purpose processing devices, such as application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital signal processors (DSPs), dedicated video or graphics processors, graphics processing units (GPUs), and neural-network processing units (NPUs). Processor 130 may be a processor group consisting of multiple processors, which are coupled to each other via one or more buses. The processor may include an analog-to-digital converter (ADC) and a digital-to-analog converter (DAC) to enable signal connection between different components of the device.

[0187] Memory 140 is coupled to processor 130. Specifically, memory 140 can be coupled to processor 130 through one or more memory controllers. Memory 140 can be used to store computer program instructions, including the computer operating system (OS), various user applications, and user data. Processor 130 can read computer program instructions or user data from memory 140, or store computer program instructions or user data into memory 140, to implement related processing functions. The memory 140 can be a non-volatile memory, such as an EMMC (Embedded MultiMedia Card), UFS (Universal Flash Storage), or Read-Only Memory (ROM), or other types of static storage devices capable of storing static information and instructions. It can also be a volatile memory, such as Random Access Memory (RAM), Static Random-Access Memory (SRAM), or other types of dynamic storage devices capable of storing information and instructions. It can also be an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM), or other optical disc storage, optical disk storage (including compressed optical discs, laser discs, digital universal optical discs, or Blu-ray discs), magnetic disk storage media, or other magnetic storage devices, but is not limited to these. Optionally, the memory 140 can be separate from the processor 130, or the memory 140 can be integrated with the processor 130.

[0188] The camera 150 is used to capture images or videos, and the audio circuit 160 is coupled to the processor 130. The audio circuit 160 may include a microphone 161 and a speaker 162. The microphone 161 can receive sound input from the outside, and the speaker 162 can play audio data.

[0189] The display screen 170 is used to provide users with various display interfaces or selectable menu information. For example, the content displayed on the display screen 170 includes, but is not limited to, a soft keyboard, a virtual mouse, virtual buttons and icons. These display contents are associated with specific internal modules or functions. The display screen 170 can also accept user input. Specifically, the display screen 170 may include a display panel 171 and a touch panel 172.

[0190] Sensor 180 may include image sensors, motion sensors, proximity sensors, ambient noise sensors, sound sensors, accelerometers, temperature sensors, gyroscopes, or other types of sensors, as well as various combinations thereof. Processor 130 drives sensor 180 to receive various information such as audio information, image information, or motion information through sensor controller 12 in I / O subsystem 10. Sensor 180 transmits the received information to processor 130 for processing.

[0191] The wireless transceiver 190 provides wireless connectivity to other devices, such as wireless headsets, Bluetooth headphones, wireless mice, or wireless keyboards, or wireless networks, such as Wireless Fidelity (WiFi), Wireless Personal Area Networks (WPANs), or their WLANs. The wireless transceiver 190 can be a Bluetooth-compatible transceiver used to wirelessly couple the processor 130 to peripheral devices such as Bluetooth headsets and wireless mice. Alternatively, it can be a WiFi-compatible transceiver used to wirelessly couple the processor 130 to wireless networks or other devices.

[0192] Terminal 100 may also include other input devices 14 coupled to processor 130 to receive various user inputs, such as received numbers, names, addresses, and media selections. Other input devices 14 may include a keyboard, physical buttons (press buttons, rocker buttons, etc.), a dial pad, or a slide switch. Terminal 100 may also include the aforementioned I / O subsystem 10 and power supply 101. It should be understood that... Figure 10 Terminal 100 in the example is merely an example and does not limit the specific form of terminal 100. Terminal 100 may also include Figure 10 Other existing or future components not shown in the document.

[0193] Please see Figure 11 , Figure 11 This application provides an architecture diagram of a processor 1600, which can be... Figure 10 Mid-processor.

[0194] like Figure 11As shown, the processor 1600 includes: at least one CPU, memory (the type of memory may include, for example, Static Random-Access Memory (SRAM) and Read-Only Memory (ROM), a microcontroller unit (MCU), a security subsystem, a Wireless Local Area Networks (WLAN) subsystem, a bus, a transmission interface, etc. Although Figure 11 As not shown in the diagram, the processor 1600 may also include other dedicated processors such as an application processor (AP), an NPU, and other subsystems such as a power management subsystem, a clock management subsystem, and a power management subsystem.

[0195] The various parts of the processor 1600 are coupled together via connectors. For example, the connectors include various interfaces, transmission lines or buses, etc. These interfaces are usually electrical communication interfaces, but may also be mechanical interfaces or other forms of interfaces. This embodiment does not limit them.

[0196] Optionally, the CPU can be a single-core or multi-core processor; alternatively, the CPU can be a processor group consisting of multiple processors, which are coupled to each other through one or more buses. In one optional case, the CPU implements any of the wireless screen projection methods described in the foregoing method embodiments by calling program instructions stored in on-chip memory or off-chip memory. In one optional case, the CPU and MCU jointly implement any of the wireless screen projection methods described in the foregoing method embodiments; for example, the CPU completes some steps of the wireless screen projection method, while the MCU completes other steps. In one optional case, the AP or other dedicated processor implements any of the wireless screen projection methods described in the foregoing method embodiments by calling program instructions stored in on-chip memory or off-chip memory.

[0197] This transmission interface can serve as the interface for the processor chip to receive and send data. It typically includes multiple interfaces; optionally, it may include an Inter-Integrated Circuit (I2C) interface, a Serial Peripheral Interface (SPI), a Universal Asynchronous Receiver-Transmitter (UART) interface, or a General-Purpose Input / Output (GPIO) interface. It should be understood that these interfaces can achieve different functions by multiplexing the same physical interface.

[0198] In one alternative, the transmission interface may also include High Definition Multimedia Interface (HDMI), V-By-One interface, Embedded Display Port (eDP), Mobile Industry Processor Interface (MIPI), or Display Port (DP), etc.

[0199] In one alternative scenario, the aforementioned components are integrated onto the same chip; in another alternative scenario, the memory can be a separate chip.

[0200] The security subsystem can be used to implement encryption algorithms related to security authentication. It should be understood that encryption algorithms related to security authentication are typically implemented in hardware, which can further enhance the security of the encryption algorithms.

[0201] A WLAN subsystem may include, for example, RF circuitry and a baseband.

[0202] The chip involved in this application embodiment is a system manufactured on the same semiconductor substrate using integrated circuit technology, also called a semiconductor chip. It can be a collection of integrated circuits formed on a substrate (usually a semiconductor material such as silicon) using integrated circuit technology, and its outer layer is typically encapsulated by semiconductor packaging materials. The integrated circuit can include various functional devices, each including logic gates, metal-oxide-semiconductor (MOS) transistors, bipolar transistors, or diodes, and may also include other components such as capacitors, resistors, or inductors. Each functional device can operate independently or under the action of necessary driving software, and can realize various functions such as communication, computation, or storage.

Claims

1. A communication device, characterized in that, include: The Universal Serial Bus (USB) protocol layer unit, USB adapter layer unit, transport layer unit, and physical layer unit; The USB protocol layer unit is used to send first data to the USB adapter layer unit; The USB adaptation layer unit is used to perform physical link adaptation on the first data through the protocol of the second physical link to obtain the second data, and send the second data to the transport layer unit; wherein, the first data is adapted to the first physical link, and the second data is adapted to the second physical link; the bandwidth of the first physical link is lower than the bandwidth of the second physical link; After being processed by the transport layer unit and the physical layer unit, the second data is sent to the receiving end through the second physical link.

2. The communication device according to claim 1, characterized in that, The USB protocol is USB 2.

0.

3. The communication device according to claim 1, characterized in that, The first data includes any one of a token packet, a handshake packet, or a special packet, and the USB adapter layer unit is specifically used for: The first data is encapsulated to obtain the first transmission packet; The second data includes the first transmission packet.

4. The communication device according to claim 3, characterized in that, The first data includes data packets, and the USB adapter layer unit is specifically used for: The data packet is split into multiple first data payloads, and the multiple first data payloads are encapsulated to obtain multiple second transmission packets; The second data includes the plurality of second transmission packets.

5. The communication device according to claim 4, characterized in that, The first data also includes bus events, and the USB adapter layer unit is specifically used for: When the bus event arrives, the beginning part of the bus event is encapsulated to obtain a third transmission packet; The transport layer unit and the physical layer unit are specifically used to process the third transport packet and then send it to the receiving end through the second physical link; The USB adapter layer unit is also specifically used for: When the bus event ends, the end portion of the bus event is encapsulated to obtain the fourth transmission packet; The transport layer unit and the physical layer unit are specifically used to process the fourth transport packet and then send it to the receiving end through the second physical link.

6. The communication device according to claim 5, characterized in that, The USB protocol layer unit is also used to send control information to the USB adapter; The USB adapter layer unit is also used for: The first virtual resistance information is parsed from the control information; and The first virtual resistance information is encapsulated to obtain the fifth transmission packet; The transport layer unit and the physical layer unit are specifically used to process the fifth transport packet and then send it to the receiving end through the second physical link; The first virtual resistor information is used to characterize the virtual bus state by describing the on or off state of the virtual resistor in the communication device. The virtual bus is a bus that matches the USB protocol layer unit. The virtual resistor in the communication device corresponds to a physical resistor, and the physical resistor includes at least one of a high-speed matching resistor, a pull-up resistor, or a pull-down resistor.

7. The communication device according to claim 6, characterized in that, The first transmission packet, the second transmission packet, the third transmission packet, the fourth transmission packet, and the fifth transmission packet all include a packet header and a data payload. The packet header contains the type information of the corresponding transmission packet, the length information of the data payload, and the reliability protection information.

8. The communication device according to claim 6, characterized in that, The physical layer unit and the transport layer unit are further configured to process the third data received through the second physical link and then send it to the USB adapter layer unit. The USB adaptation layer unit is further configured to perform physical link adaptation on the processed third data to obtain fourth data, and send the fourth data to the USB protocol layer unit; wherein the third data is adapted to the second physical link, and the fourth data is adapted to the first physical link.

9. The communication device according to claim 8, characterized in that, The processed third data contains one or more transmission packets, and the USB adapter layer unit is specifically used for: The headers of the one or more transmission packets are parsed to obtain the type information of the one or more transmission packets; When the one or more transmission packets are data packets, the one or more data payloads corresponding to the one or more transmission packets are aggregated to obtain the fourth data; When the one or more transmission packets are not data packets, the one or more data payloads corresponding to the one or more transmission packets are respectively used as the fourth data.

10. The communication device according to claim 8 or 9, characterized in that, The physical layer unit and the transport layer unit are further configured to process the sixth transport packet received through the second physical link and then send it to the USB adapter layer unit. The USB adapter layer unit is also used to receive the processed sixth transmission packet and parse the processed sixth transmission packet to obtain the second virtual resistance information. The second virtual resistance information includes the on or off state of the virtual resistor in the receiving end. The second virtual resistance information is used to characterize the virtual bus state. The virtual resistor in the receiving end corresponds to the physical resistor. The physical resistor includes at least one of a high-speed matching resistor, a pull-up resistor, or a pull-down resistor.

11. The communication device according to claim 10, characterized in that, The USB adapter layer unit is also used for: When the USB adapter layer unit receives the first data, it determines the virtual bus state based on the content of the first data. When the USB adapter layer unit sends the fourth data, the virtual bus state is determined based on the content of the fourth data. When the USB adapter layer unit does not receive the first data and does not send the fourth data, the virtual bus state is determined based on the first virtual resistance information and the second virtual resistance information. Send the current virtual bus status to the USB protocol layer unit.

12. The communication device according to claim 11, characterized in that, The USB protocol layer unit is also used for: The operating state of the communication device at the next moment is determined based on the virtual bus state; wherein the operating state includes at least one of the following: whether the USB protocol layer unit sends the first data or receives the sixth data; when the USB protocol layer unit sends the first data, the content contained in the first data; or when the USB protocol layer unit sends the control information, the first virtual resistance information parsed by the USB adapter layer unit from the control information.

13. A data transmission method, characterized in that, include: The first data is sent from the Universal Serial Bus (USB) protocol layer to the USB adapter layer. The USB adaptation layer performs physical link adaptation on the first data through the protocol of the second physical link to obtain the second data, and then sends the second data to the transport layer; wherein, the first data is adapted to the first physical link, and the second data is adapted to the second physical link; the bandwidth of the first physical link is lower than the bandwidth of the second physical link; After the second data is processed by the transport layer and physical layer, it is sent to the receiving end through the second physical link.

14. The data transmission method according to claim 13, wherein the USB protocol is the USB 2.0 protocol.

15. The data transmission method according to claim 13, characterized in that, The first data includes any one of a token packet, a handshake packet, or a special packet. The step of obtaining the second data by physical link adaptation of the first data by the USB adapter layer includes: encapsulating the first data by the USB adapter layer to obtain a first transmission packet; the second data includes the first transmission packet.

16. The data transmission method according to claim 15, characterized in that, The first data includes data packets. The step of obtaining the second data by physical link adaptation of the first data by the USB adapter layer includes: splitting the data packets into multiple first data payloads by the USB adapter layer, and encapsulating the multiple first data payloads respectively to obtain multiple second transmission packets; the second data includes the multiple second transmission packets.

17. The data transmission method according to claim 16, characterized in that, The first data also includes bus events, and the process of obtaining the second data by physical link adaptation of the first data by the USB adaptation layer includes: When the bus event arrives, the beginning part of the bus event is encapsulated by the USB adapter layer to obtain a third transmission packet; The process of processing the second data through the transport layer and the physical layer and then sending it to the receiving end through the second physical link includes: After the third transmission packet is processed by the transport layer and the physical layer, it is sent to the receiving end through the second physical link; The first data also includes bus events, and the step of obtaining the second data by physical link adaptation of the first data by the USB adaptation layer further includes: When the bus event ends, the end portion of the bus event is encapsulated by the USB adapter layer to obtain a fourth transmission packet; The step of processing the second data through the transport layer and the physical layer and then sending it to the receiving end through the second physical link further includes: The fourth transmission packet is processed by the transport layer and the physical layer, and then sent to the receiving end through the second physical link.

18. The data transmission method according to claim 17, characterized in that, Also includes: Control information is sent to the USB adapter through the USB protocol layer; The first virtual resistance information is parsed from the control information through the USB adapter layer; And the first virtual resistance information is encapsulated to obtain the fifth transmission packet; The fifth transmission packet is processed by the transport layer and the physical layer, and the processed fifth transmission packet is sent to the receiving end through the second physical link; The first virtual resistor information is used to characterize the virtual bus state by describing the on or off state of the virtual resistor in the communication device. The virtual bus is a bus that matches the USB protocol layer. The virtual resistor in the communication device corresponds to a physical resistor, and the physical resistor includes at least one of a high-speed matching resistor, a pull-up resistor, or a pull-down resistor.

19. The data transmission method according to claim 18, characterized in that, The first transmission packet, the second transmission packet, the third transmission packet, the fourth transmission packet, and the fifth transmission packet all include a packet header and a data payload. The packet header contains the type information of the corresponding transmission packet, the length information of the data payload, and the reliability protection information.

20. The data transmission method according to claim 18, characterized in that, The method further includes: The third data received through the second physical link is processed by the physical layer and the transport layer, and the processed third data is sent to the USB adapter layer. The processed third data is adapted to the physical link through the USB adaptation layer to obtain the fourth data, and the fourth data is sent to the USB protocol layer; wherein the third data is adapted to the second physical link, and the fourth data is adapted to the first physical link.

21. The data transmission method according to claim 20, characterized in that, The processed third data contains one or more transmission packets, and the process of obtaining the fourth data by physical link adaptation of the processed third data through the USB adapter layer includes: The headers of the one or more transmission packets are parsed by the USB adapter layer to obtain the type information of the one or more transmission packets. When the one or more transmission packets are the data packets, the one or more data payloads corresponding to the one or more transmission packets are aggregated through the USB adapter layer to obtain the fourth data; When the one or more transmission packets are not data packets, the USB adapter layer uses one or more data payloads corresponding to the one or more transmission packets as the fourth data.

22. The data transmission method according to claim 20 or 21, characterized in that, The method further includes: The physical layer and the transport layer process the sixth transmission packet received through the second physical link, and then send the processed sixth transmission packet to the USB adapter layer. The processed sixth transmission packet is received through the USB adapter layer, and the processed sixth transmission packet is parsed to obtain the second virtual resistance information. The second virtual resistance information includes the on or off state of the virtual resistor in the receiving end. The second virtual resistance information is used to characterize the virtual bus state. The virtual resistor in the receiving end corresponds to the physical resistor. The physical resistor includes at least one of a high-speed matching resistor, a pull-up resistor, or a pull-down resistor.

23. The data transmission method according to claim 22, characterized in that, The method further includes: When the USB adapter layer receives the first data, the USB adapter layer determines the virtual bus state based on the content of the first data; When the USB adapter layer sends the fourth data, the USB adapter layer determines the virtual bus state based on the content of the fourth data; When the USB adapter layer does not receive the first data and does not send the fourth data, the USB adapter layer determines the virtual bus state based on the first virtual resistance information and the second virtual resistance information; The current virtual bus status is sent from the USB adapter layer to the USB protocol layer.

24. The data transmission method according to claim 22, characterized in that, The method further includes: The USB protocol layer determines the next working state of the communication device based on the virtual bus state; wherein the working state includes at least one of the following: whether the USB protocol layer sends the first data or receives the sixth data; when the USB protocol layer sends the first data, the content contained in the first data; or when the USB protocol layer sends the control information, the first virtual resistance information parsed by the USB adapter layer from the control information.

25. A communication device, characterized in that, The communication device includes a processor and an interface circuit, the processor being able to run a computer program to implement the method as described in any one of claims 13-24 through the interface circuit.

26. A computer storage medium, characterized in that, The computer storage medium stores a computer program that, when executed by a communication device, implements the method described in any one of claims 13-24.

27. A computer program product comprising a computer program, the computer program including instructions that, when executed by a communication device, cause the communication device to perform the method as described in any one of claims 13-24.

Citation Information

Patent Citations

  • Superspeed inter-chip communications

    CN104205781A

  • Apparatus, system and method of supporting streaming over a protocol adaptation layer (PAL)

    WO2014185944A1