WO2022160320A1 - 通信装置及数据传输方法 - Google Patents

通信装置及数据传输方法 Download PDF

Info

Publication number
WO2022160320A1
WO2022160320A1 PCT/CN2021/074561 CN2021074561W WO2022160320A1 WO 2022160320 A1 WO2022160320 A1 WO 2022160320A1 CN 2021074561 W CN2021074561 W CN 2021074561W WO 2022160320 A1 WO2022160320 A1 WO 2022160320A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
layer
usb
packet
physical
Prior art date
Application number
PCT/CN2021/074561
Other languages
English (en)
French (fr)
Inventor
鲁灯
郑科
张振兴
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to EP21921921.9A priority Critical patent/EP4280487A4/en
Priority to CN202180091764.4A priority patent/CN116803068A/zh
Priority to PCT/CN2021/074561 priority patent/WO2022160320A1/zh
Publication of WO2022160320A1 publication Critical patent/WO2022160320A1/zh
Priority to US18/361,674 priority patent/US20240004826A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • G06F13/4282Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/1066Session management
    • H04L65/1069Session establishment or de-establishment
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/40Bus structure
    • G06F13/4063Device-to-bus coupling
    • G06F13/4068Electrical coupling
    • G06F13/4072Drivers or receivers
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • G06F13/4282Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
    • G06F13/4295Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus using an embedded synchronisation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/08Protocols for interworking; Protocol conversion
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/30Definitions, standards or architectural aspects of layered protocol stacks
    • H04L69/32Architecture of open systems interconnection [OSI] 7-layer type protocol stacks, e.g. the interfaces between the data link level and the physical level
    • H04L69/321Interlayer communication protocols or service data unit [SDU] definitions; Interfaces between layers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/30Definitions, standards or architectural aspects of layered protocol stacks
    • H04L69/32Architecture of open systems interconnection [OSI] 7-layer type protocol stacks, e.g. the interfaces between the data link level and the physical level
    • H04L69/322Intralayer communication protocols among peer entities or protocol data unit [PDU] definitions
    • H04L69/323Intralayer communication protocols among peer entities or protocol data unit [PDU] definitions in the physical layer [OSI layer 1]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2213/00Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F2213/0042Universal serial bus [USB]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L25/00Baseband systems
    • H04L25/02Details ; arrangements for supplying electrical power along data transmission lines
    • H04L25/0264Arrangements for coupling to transmission lines
    • H04L25/0272Arrangements for coupling to multiple lines, e.g. for differential transmission
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/80Responding to QoS

Definitions

  • the present application relates to the field of communication technologies, and in particular, to a communication device and a data transmission method.
  • Video and data transmission interfaces have high demands on transmission bandwidth, and it is difficult to simply increase the transmission rate of a serializer/deserializer (Serdes) due to the limitations of chip manufacturing processes and transmission lines.
  • Serdes serializer/deserializer
  • the usual practice is to increase the number of Serdes physical links, but this will increase the size of connectors and cables to a certain extent, and the user experience will be worse.
  • appropriate measures should be taken to increase the transmission rate of low-speed Serdes physical links.
  • USB universal serial bus
  • USB3 USB3Generation2
  • DP Display Port
  • PCIE Peripheral Component Interconnect Express
  • the transmission rate of a single serializer/deserializer link can be 10Gbps or 20Gbps;
  • the protocol uses a dedicated physical link for data transmission, and the transmission rate is up to 480Mbps, and the bandwidth utilization rate is seriously insufficient.
  • the electrical signals of the USB2.0 bus are converted into signals suitable for transmission on a public high-speed physical link, and then transmitted on the public high-speed physical link.
  • the excess bandwidth of the channel can be used to transmit other data, thereby increasing the overall bandwidth.
  • USB2 is added to the USB2.0 data transmission path of the local side and the opposite end .0 physical layer, which will greatly increase the transmission delay of USB2.0 data, it is difficult to meet the requirements of the USB2.0 protocol, and the application is difficult.
  • the embodiment of the present application discloses a communication device and a data transmission method, which can effectively reduce the data transmission delay while increasing the pin bandwidth utilization rate of the communication device; at the same time, the transmission of data is not limited by the transmission form of the physical link; , compared with the prior art, the chip area and hardware cost can also be saved.
  • an embodiment of the present application discloses a communication device, including: a universal serial bus USB protocol layer, a USB adaptation layer, a transport layer and a physical layer; and a USB protocol layer for sending a first data; the USB adaptation 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 the first physical link, and the second data is adapted to the first physical link.
  • a second physical link is configured; 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 the physical layer, it is sent to the receiving end through the second physical link.
  • the protocol of the second physical link can be an existing protocol or a set of communication methods for data interaction set by those skilled in the art
  • the protocol of the first physical link can be the USB2.0 protocol, which follows the USB transceiver Transeiver macrocell interface (usb transeiver macrocell interface, UTMI) protocol or UTMI low pin interface (UTMI Low Pin Interface, ULPI) protocol.
  • the first data when the above communication device communicates with the receiving end, the first data is first adapted to the physical link through the USB adaptation layer, and the first data transmitted on the first physical link is The data is converted into second data transmitted on the second physical link, where the second physical link is a high-speed physical link with a higher bandwidth than the first physical link. Since the embodiment of the present application converts the first data (protocol layer data) sent by the USB protocol layer, data that can be transmitted on the second physical link is obtained, and then the transmission layer, the physical layer and the second physical link are used to perform the conversion.
  • the first data protocol layer data
  • Transmission and transmission to the receiving end do not need to go through the USB physical layer and pins that match the USB protocol layer, so there is no need to configure the USB physical layer and pins in the above communication device, which can save the chip area of the USB physical layer and pins and the added cost of the USB physical layer and pins.
  • the intermediate links of data transmission can be reduced, so the receiving delay of the receiving end can be effectively reduced to meet the requirements of low-latency communication protocols, and the application is easy;
  • the physical form of the first physical link is a wired form, and in this embodiment of the present application, by performing physical link adaptation on the first data, the obtained second data can be stored at a high speed. Since the second physical link is not limited by the physical form, that is, it can be wired or wireless, the communication device in the embodiment of the present application has good adaptability and can be applied to different applications Scenes.
  • the transport layer and the physical layer, the USB protocol layer and the USB adaptation layer are integrated in the same communication device, and in an optional case, the transport layer and the physical layer may be located at an independent switch In the adapter or switch, that is, the USB protocol layer and the USB adapter layer are in the communication device. After the USB protocol layer and the USB adapter layer process the data, it is sent to the adapter or switch, and the transmission by the adapter or switch After layer and physical layer processing, it is transmitted to the target device through a high-speed physical link, and the target device can also be connected to the high-speed physical link through a switch or switch.
  • the above-mentioned first data includes any one of a token packet, a handshake packet or a special packet
  • the USB adaptation layer is specifically used for: according to the protocol of the above-mentioned second physical link, the first data Perform encapsulation to obtain a first transmission packet; the second data includes the first transmission packet.
  • the USB adaptation layer directly encapsulates the first data as a data payload, and obtains
  • the first transmission packet is adapted to the second physical link, so as to facilitate subsequent transmission of the first transmission packet through the second physical link without using the USB physical layer, pins and first physical layer matching the USB protocol layer.
  • the link is used for transmission, so that the receiving delay of the receiving end can be effectively reduced, and the chip area and related cost of the USB physical layer and pins can be saved.
  • the above-mentioned first data includes a data packet
  • the USB adaptation layer is specifically configured to: split the data packet into a plurality of first data payloads, and pair the data packets according to the protocol of the above-mentioned second physical link.
  • the multiple first data payloads are encapsulated respectively to obtain multiple second transport packets; the second data includes multiple second transport packets.
  • the USB adaptation layer can split it into multiple first data payloads, and then perform a separate processing on the multiple first data payloads. Encapsulation to obtain a plurality of second transmission packets. Since the data amount of each second transmission packet is small, the receiving delay of the receiving end can be effectively reduced to meet the low delay requirement of the communication protocol.
  • the above-mentioned first data further includes a bus event
  • the USB adaptation layer is specifically configured to: when the bus event arrives, encapsulate the beginning part of the bus event according to the protocol of the above-mentioned second physical link, Obtain the third transmission packet; the transmission layer and the 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 adaptation layer is also specifically used for: when the bus event ends, according to the above The protocol of the second physical link encapsulates the end part of the bus event to obtain a fourth transmission packet; the transmission layer and the physical layer are specifically used to process the fourth transmission packet and send it to the receiving end through the second physical link.
  • the above-mentioned USB protocol layer is further configured to send control information to the USB adapter; the USB adaptation layer is further configured to: parse out the first virtual resistance information from the control information; The resistance information is encapsulated to obtain a fifth transmission packet; the transmission layer and the physical layer are specifically used to process the fifth transmission packet and send it to the receiving end through the second physical link; the first virtual resistance information is used to describe the communication device
  • the on or off state of the virtual resistor represents the state of the virtual bus.
  • the virtual bus is a bus that matches the USB protocol layer.
  • the virtual resistor in the communication device corresponds to the physical resistor.
  • the physical resistor includes high-speed matching resistors, pull-up resistors or pull-down resistors. at least one of the resistors.
  • the above-mentioned first virtual resistance information further includes high-resistance (High-Z) information, the high-resistance information is used to represent the on or off state of the high-resistance, and the high-resistance is used to represent the communication device and The connection status between the receivers.
  • High-Z high-resistance
  • the high resistance is in a disconnected state; when the communication device and the receiving end do not establish a communication connection, the high resistance is in an on state.
  • the USB protocol layer data is transmitted through the USB physical layer and pins, but in the embodiment of the present application, after the USB protocol layer data is adapted to the physical link through the USB adaptation layer, it can be
  • the USB physical layer and pins are configured in the communication device, that is, there is no physical resistance in the USB physical layer at this time.
  • the USB protocol layer needs to obtain the information of the resistance in the USB physical layer to report the bus state.
  • a virtual resistance corresponding to the physical resistance in the USB physical layer is introduced, and the virtual resistance information is used to represent the virtual bus state.
  • the reporting requirements of the USB protocol layer on the bus state are satisfied, so that the improvements made to the communication device in the embodiments of the present application are invisible or transparent to the USB protocol layer compared to the prior art, that is, in the prior art, the USB protocol layer receives and transmits.
  • the data corresponds to the data received and sent by the USB protocol layer in the embodiment of the present application, so as to meet the communication requirements of the USB protocol layer.
  • the first virtual resistance is obtained from the control information sent by the USB protocol layer to the USB adaptation layer
  • the second virtual resistance information is obtained from the sixth transmission packet
  • the first virtual resistance information and the second virtual resistance The information will be stored locally and updated or maintained, and the local storage units of the first virtual resistance information and the second virtual resistance information are not limited to registers.
  • 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, and the packet header includes the type of the corresponding transmission packet information, length information of the data payload and reliability protection information.
  • the USB adaptation layer can encapsulate it into a transmission packet of the same format, so that the first data of different types is adapted to the physical link. After that, the corresponding transmission packets are obtained in the same format, which is convenient for subsequent transmission on the common second physical link, so as to realize the function of communicating between the communication device and the receiving end.
  • the above-mentioned physical layer and transport layer are further used for processing the third data received through the second physical link, and then sending it to the USB adaptation layer; the USB adaptation layer is also used for 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. link.
  • the USB adaptation layer in the communication device can also perform physical link adaptation on the processed third data to obtain fourth data, that is, restore the processed third data Obtain the fourth data. It can be seen from the foregoing embodiments that the communication device in this application can not only send data to the receiving end, but also restore the data sent by the receiving end, and send the restored data to the USB protocol layer, thereby realizing the communication device and the USB protocol layer. The function of the receiving end for bidirectional data transmission.
  • the processed third data includes one or more transmission packets
  • the USB adaptation layer is specifically configured to: parse the packet headers of the one or more transmission packets, respectively, to obtain one or more transmission packets.
  • Type information of transport packets when one or more transport packets are data packets, aggregate one or more data payloads corresponding to one or more transport packets to obtain fourth data; when one or more transport packets are not When it is a data packet, one or more data payloads corresponding to one or more transport packets are respectively used as the fourth data.
  • the USB adaptation layer can restore the received multiple transmission packets correspondingly.
  • the data payload is used as the fourth data; for the first data that is split into multiple data payloads for encapsulation during encapsulation, the multiple split data payloads may be aggregated, and the aggregated data is used as the fourth data.
  • the restoration process of the third data can be corresponding to the encapsulation process of the first data, thereby realizing normal communication between the communication device and the receiving end.
  • the above-mentioned physical layer and transport layer are further configured to process the sixth transport packet received through the second physical link, and then send it to the USB adaptation layer; the USB adaptation layer is also used for After receiving the processed sixth transmission packet, and analyzing the processed sixth transmission packet, the second virtual resistance information is obtained; the second virtual resistance information includes the on or off state of the virtual resistance in the receiving end, the second The virtual resistance information is used to represent the virtual bus state, the virtual resistance in the receiving end corresponds to the physical resistance, and the physical resistance includes at least one of a high-speed matching resistance, a pull-up resistance or a pull-down resistance.
  • the communication device can also receive the sixth transmission packet including the second virtual resistance information, and parse the second virtual resistance information from the sixth transmission packet.
  • the virtual resistance information is used to represent the virtual bus state, so as to meet the reporting requirements of the USB protocol layer for the bus state.
  • the USB adaptation layer is further configured to: when the USB adaptation layer receives the first data, determine the virtual bus state according to the content of the first data; when the USB adaptation layer sends the fourth data , determine the virtual bus state according to the content of the fourth data; when the USB adaptation layer does not receive the first data and does not send the fourth data, determine the virtual bus state according to the first virtual resistance information and the second virtual resistance information; The protocol layer sends the current virtual bus state.
  • the virtual bus state can be determined through different rules, so as to meet the requirements of the USB protocol layer for receiving virtual bus state information. Since the implementation of this application can remove the USB physical layer and pins, there is no physical resistance and USB2.0 bus, so a virtual resistance is introduced to characterize the physical resistance in the USB physical layer, and a virtual bus is introduced to characterize the USB2.0 bus.
  • the configuration layer does not receive the first data and does not send the fourth data
  • the virtual bus state can be determined according to the first virtual resistance information sent to the receiving end and the second virtual resistance information received from the receiving end, and the virtual bus state can be determined. It is sent to the USB protocol layer to meet the reporting requirements of the USB protocol layer on the bus state.
  • the USB adaptation layer is further configured to: determine the working state of the communication device at the next moment according to 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 whether to receive 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 control information, the first virtual resistance information parsed by the USB adaptation layer from the control information .
  • the USB protocol layer can determine the control information sent by the USB protocol layer to the USB adaptation layer through the received virtual bus state, and the USB adaptation layer determines the next moment according to the received control information The working state of the communication device, thereby realizing the communication function of the communication device.
  • the present application provides a data transmission method, comprising: sending first data to a USB adaptation layer through a universal serial bus USB protocol layer; obtaining the first data by performing physical link adaptation on the first data by the USB adaptation layer
  • the second data is sent to the transport layer; 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 that of the second physical link
  • the second data is processed through the transport layer and the physical layer, and the processed second data is sent to the receiving end by the second physical link.
  • the above-mentioned first data includes any one of a token packet, a handshake packet or a special packet
  • the USB adaptation layer performs physical link adaptation on the first data to obtain the second data, including : the first data is encapsulated by the USB adaptation layer to obtain the first transmission packet; the second data includes the first transmission packet.
  • the above-mentioned first data includes a data packet
  • the second data is obtained by performing physical link adaptation on the first data by the USB adaptation layer, including: splitting the data packet by the USB adaptation layer into A plurality of first data payloads are encapsulated respectively to obtain a plurality of second transmission packets; the second data includes a plurality of second transmission packets.
  • the first data further includes a bus event
  • obtaining the second data by performing physical link adaptation on the first data by the USB adaptation layer includes: when a bus event arrives, The configuration layer encapsulates the beginning part of the bus event to obtain a third transmission packet; the second data is processed by the transmission layer and the physical layer and then sent to the receiving end through the second physical link, including: passing through the transmission layer and the physical layer. After processing the third transmission packet, it is sent to the receiving end through the second physical link; the above-mentioned first data also includes bus events, and the above-mentioned second data is obtained by performing physical link adaptation on the first data by the USB adaptation layer, and the second data is also obtained.
  • the receiving end further includes: processing the fourth transmission packet through the transport layer and the physical layer, and sending the processed fourth transmission packet to the receiving end through the second physical link.
  • the above method includes: sending control information to the USB adapter through the USB protocol layer; parsing the first virtual resistance information from the control information through the USB adaptation layer; and encapsulating the first virtual resistance information , obtain the fifth transmission packet; process the fifth transmission packet through the transmission layer and the physical layer, and send the processed fifth transmission packet to the receiving end through the second physical link; the first virtual resistance information is used to describe the communication
  • the on or off state of the virtual resistor in the device represents the virtual bus state.
  • the virtual bus is a bus that matches the USB protocol layer.
  • the virtual resistor in the communication device corresponds to the physical resistor.
  • the physical resistor includes high-speed matching resistors and pull-up resistors. or at least one of the pull-down resistors.
  • 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, and the packet header includes the type of the corresponding transmission packet information, length information of the data payload and reliability protection information.
  • 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; Perform physical link adaptation on the processed third data through the USB adaptation layer 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 second physical link.
  • the first physical link is adapted.
  • the processed third data includes one or more transmission packets
  • the fourth data is obtained by performing physical link adaptation on the processed third data through the USB adaptation layer, including:
  • the USB adaptation layer parses the headers of one or more transmission packets respectively to obtain the type information of one or more transmission packets; when one or more transmission packets are data packets, the USB adaptation layer converts one or more transmission packets into One or more data payloads corresponding to the transmission packets are aggregated to obtain fourth data; when one or more transmission packets are not data packets, one or more The data payloads are respectively used as the fourth data.
  • the above 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; receive the processed sixth transmission packet through the USB adaptation layer, and analyze the processed sixth transmission packet to obtain the second virtual resistance information; the second virtual resistance information includes the conduction or Off state, the second virtual resistance information is used to represent the virtual bus state, the virtual resistance in the receiving end corresponds to the physical resistance, and the physical resistance includes at least one of a high-speed matching resistance, a pull-up resistance or a pull-down resistance.
  • the above method further includes: when the USB adaptation layer receives the first data, the USB adaptation layer determines the virtual bus state according to the content of the first data; when the USB adaptation layer sends the fourth data , the USB adaptation layer determines the virtual bus state according to the content of the fourth data; when the USB adaptation layer does not receive the first data and does not send the fourth data, the USB adaptation layer determines the virtual bus state according to the first virtual resistance information and the second virtual resistance The information determines the virtual bus state; the current virtual bus state is sent by the USB adaptation layer to the USB protocol layer.
  • the above method further includes: determining, by the USB protocol layer, the working state of the communication device at the next moment according to 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 whether to receive 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 control information, the first virtual resistance information parsed by the USB adaptation layer from the control information .
  • an embodiment of the present application provides a terminal device, including the communication apparatus provided in any one of the implementations of the foregoing first aspect, and a discrete device coupled to the communication apparatus.
  • an embodiment of the present application provides a communication device, wherein the communication device includes a processor and an interface circuit, and the processor can run a computer program to implement any one of the above-mentioned second aspects through the interface circuit The described data transmission method flow.
  • the present application provides a computer storage medium, where a computer program is stored in the computer storage medium, and when the computer program is executed by a communication device, the flow of the data transmission method described in any one of the second aspect above is implemented.
  • an embodiment of the present invention provides a computer program, where the computer program includes instructions, when the computer program is executed by the above-mentioned communication device, the communication device can perform the data transmission described in any one of the above-mentioned second aspects. method flow.
  • FIG. 1 is a schematic diagram of a tree topology structure of a USB bus provided by an embodiment of the present application
  • FIG. 2 is a schematic structural diagram of a communication system provided by an embodiment of the present application.
  • 3A is a schematic structural diagram of another communication system provided by an embodiment of the present application.
  • 3B is a schematic structural diagram of another communication system provided by an embodiment of the present application.
  • FIG. 4 is a schematic structural diagram of a virtual resistance model in a communication system provided by an embodiment of the present application.
  • FIG. 5 is a schematic diagram of a splitting and encapsulation process of a data packet provided by an embodiment of the present application
  • FIG. 6 is a schematic structural diagram of still another communication system provided by an embodiment of the present application.
  • FIG. 7 is a schematic structural diagram of another communication system provided by an embodiment of the present application.
  • FIG. 8 is a schematic diagram of a scenario in which multiple communication devices communicate according to an embodiment of the present application.
  • FIG. 9 is a schematic flowchart of a data transmission method provided by an embodiment of the present application.
  • FIG. 10 is a schematic diagram of the architecture of an exemplary terminal provided by an embodiment of the present application.
  • FIG. 11 is an architectural diagram of a processor provided by an embodiment of the present application.
  • FIG. 1 is a schematic diagram of a tree topology structure of a USB bus provided by an embodiment of the present application.
  • Figure 1 includes four devices: a host Host, a hub 1 (Hub-1), a hub 2 (Hub-2), and a device Device.
  • the Host is located at the root node.
  • the downstream port of the Host is connected to the upstream port of Hub-1 through the USB bus D+/D-.
  • the two downstream ports of Hub-1 are respectively connected to the upstream ports of Hub-2 and Device through the USB bus.
  • the bus topology in FIG. 1 corresponds to the specific connection modes of the Host, Hub, and Device devices.
  • FIG. 1 is only a specific example given by the embodiment of the present application, and the specific topology of the USB bus can be determined according to specific application scenarios.
  • the Host device may also be directly connected to the Device device, which is not specifically limited in this application.
  • the host Host is responsible for managing all Hubs and Devices connected to the bus, which can include one or more downstream ports, which can be devices such as computers, tablets or mobile phones; the Hub provides the expansion capability of the USB interface, including an upstream port (upstream port) and multiple downstream ports; Device provides a specific function, which can be a mobile storage device, such as a U disk or a hard disk, etc., which is not specifically limited in the embodiment of the present application, and includes an upstream port.
  • the host Host is responsible for managing all Hubs and Devices connected to the bus, which can include one or more downstream ports, which can be devices such as computers, tablets or mobile phones; the Hub provides the expansion capability of the USB interface, including an upstream port (upstream port) and multiple downstream ports; Device provides a specific function, which can be a mobile storage device, such as a U disk or a hard disk, etc., which is not specifically limited in the embodiment of the present application, and includes an upstream port.
  • FIG. 2 is a schematic structural diagram of a communication system 200 provided by an embodiment of the present application.
  • the communication system 200 includes a communication device 210 , a target device 220 , an adaptation device 230 and an adaptation device 240 .
  • the communication device 210 is connected to the target device 220 for communication through the adaptation device 230 , the second physical link and the adaptation device 240 .
  • the data transmitted between the communication device 210 and the target device 220 may be USB 2.0 data.
  • the high-speed second physical link may be configured in a wired form (eg, copper wire or optical fiber) or a wireless form (eg, a wireless channel).
  • 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 U disk or a hard disk, etc.); the communication device 210 and the target device 220 It can be used as a downstream port.
  • the target device 220 is used as an upstream port; when the communication device 210 is used as an upstream port, the target transposition 220 is used as a downstream port.
  • the adapter device 230 and the adapter device 240 may be adapters, switches, or the like.
  • the structures and functions of the devices on both sides of the second physical link correspond to the same. Therefore, the devices and the common transmission path on the left side of the second physical link are used as examples to describe their internal structures, functions, and Corresponding data transfer process.
  • the communication device 210 includes a USB protocol layer (protocol layer) 211 and a USB physical layer (PHY) 212, and the communication device 210 may also include an application layer (not shown); the adaptation device 230 includes a USB physical layer (PHY) 212. Layer 213, USB Adaptation Layer 214, Transport Layer 215 and Physical Layer 216.
  • each layer in the communication device 210 and the adaptation device 230 is logically functionally divided, and includes corresponding hardware structures (circuits).
  • the application layer (not shown in FIG. 2 ) in the communication device 210 can provide an interface for the application program for communication and the underlying network for message transmission, and the application layer can be a combination of software and hardware;
  • the USB protocol layer 211 specifies the host The language structure and rules for the interaction between the Host and the device, the hardware structure corresponding to the USB protocol layer 211 can be integrated in the USB controller, the USB protocol layer can receive the USB2.0 data sent by the application layer, the USB protocol layer 212 and Data transmission is performed between the USB physical layers 212 through the standard UTMI interface; the USB physical layer 212 receives USB2.0 data through the UMTI interface, and converts the USB2.0 data into corresponding analog signals, and the physical layer can be a communication device between communication devices.
  • Data communication provides transmission media and interconnection equipment, and provides a reliable environment for data transmission, that is, the physical layer ensures that original data can be transmitted on various physical media;
  • the communication device 210 and the adapter device 230 are connected through a standard USB interface ( D+/D-) to connect, that is, the analog signal transmitted by the USB physical layer 212 is transmitted to the USB physical layer 213 through the USB interface;
  • the USB physical layer 213 converts the received analog signal into a digital signal and transmits it to the USB adapter through the UTMI interface Layer 214;
  • the USB adaptation layer 214 adapts the USB2.0 data in the form of digital signals for transmission on the common transmission path and the second physical link;
  • the transmission layer 215 provides a unified transmission interface and a unified transmission interface for data of different protocols. It provides common functions such as scheduling quality of service (QOS) guarantee, bandwidth allocation, flow control, power consumption management, and connection management for data of different protocols.
  • QOS quality of service
  • the above describes the process of sending data through the adaptation device 230 when the communication device 210 and the target device 220 transmit data; the process of the communication device 210 receiving data through the adaptation device 230 is opposite to the above process, and will not be repeated here.
  • the process of the target device 220 receiving and sending data through the adaptation device 240 is the same as the corresponding process of the communication device 210, and details are not repeated here.
  • FIG. 3A is a schematic structural diagram of another communication system 300 provided by an embodiment of the present application.
  • the communication system 300 includes a communication device 310 and a target device 320.
  • the communication device 310 and the target device 320 communicate through a high-speed second physical link.
  • the communication device 310 includes a USB protocol layer 311, a USB An adaptation layer (adapter layer) 312, a transport layer (transport layer) 313 and a physical layer (PHY) 314,
  • the target device 320 includes a USB protocol layer 321, a USB adaptation layer 322, a transport layer 323 and a physical layer 324.
  • the functions of the layers included in the communication device 310 correspond to the functions of the layers included in the target device 320.
  • the layers in the above two devices are logically functionally divided, and each layer includes a corresponding physical circuit (structure) .
  • Any one of the communication device 310 and the target device 320 can be used as both an uplink port and a downlink port, which is not specifically limited in this application.
  • the target device 320 may also be referred to as a receiver.
  • the communication device 310 and the target transposition 320 may be a host (such as a computer, mobile phone, tablet, etc.), a hub, or a device (such as a U disk or a hard disk, etc.), which is not specifically limited in this application.
  • the communication device 310 may be a computer
  • the target device 320 may be a USB flash drive.
  • the communication system 300 represents a scenario in which the computer and the USB flash drive perform data transmission.
  • the communication device 310 and the target device 320 may further include an application layer (not shown in FIG. 3A ), whose structure and functions may be the same as those of the application layer in the embodiment of FIG. 2 , which will not be repeated here.
  • an application layer (not shown in FIG. 3A ), whose structure and functions may be the same as those of the application layer in the embodiment of FIG. 2 , which will not be repeated here.
  • the following is an example of the protocol adapted by the USB protocol layer and the USB adaptation layer in the communication system 300 being the USB2.0 protocol (that is, the protocol of the first physical link is the USB2.0 protocol), taking the communication device 310 as the object. Describe its process of sending and receiving data in detail:
  • the USB protocol layer 311 is configured to send the first data to the USB adaptation layer 312 .
  • the USB protocol layer 311 specifies the syntax and protocol when the USBHost interacts with the USBDevice, which defines the structure of fields, packets, transactions and transfers, as well as from fields to packets and from packets to Things, the organizational hierarchical relationship composed of things and transmission, the first data at this time can also be called USB2.0 data; among them, the packet is the basic unit of data transmission on the USB bus, and the USB2.0 protocol specifies four types. Packets: TokenPacket, Data Packet, Handshake packet and Special Packet. Token packets can only be sent from the host; data packets and handshake packets can be sent by the host, or the device.
  • Each packet consists of different fields. All packets start with a Synchronization (SYNC) field and end with an End of Packet (EOP) signal.
  • SYNC Synchronization
  • EOP End of Packet
  • the transmission of packets cannot be interrupted or interfered, otherwise an error will be caused; several packets form a transaction transmission, and a transaction transmission cannot be interrupted, and several packets belonging to a transaction transmission must be continuous; a transmission consists of one to multiple transactions Transmission composition.
  • the USB adaptation layer 312 is configured 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 the first physical link (not shown in FIG. 3A ). ), 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 first data is protocol layer data.
  • the above-mentioned second data is processed by the transport layer and the physical layer, it is sent to the receiving end through the second physical link.
  • the USB adaptation layer 312 includes a corresponding physical circuit (structure), which can be integrated in the USB controller, and the USB adaptation layer 312 can respond to the first data sent by the USB protocol layer 311 according to the protocol of the second physical link.
  • the first physical link may be a physical link specified by the USB2.0 protocol, or in other words, the first physical link is an original USB2.0 protocol data transmission link, and its physical form is a wired form, Such as copper wire, etc., 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, and the physical form of the second physical link can be based on specific applications.
  • Scenarios are configured, which can be wired or wireless, such as copper wires, wireless channels, or optical fibers.
  • the communication device 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, when the communication device and the target device perform data transmission, the second physical link can be a USB flash drive and a USB flash drive.
  • the metal sheet usually copper that contacts when the computer USB interface is connected.
  • the transport layer 313 and the physical layer 314 respectively include corresponding physical circuits (structures), and the transport layer 313 can receive data transmitted to it by different protocol adaptation layers (only the adaptation layer of one protocol is shown in FIG. 3A ). ), and provides a unified transmission interface and data transmission format, that is, the transmission format of the second data is converted into the transmission format specified by the second physical link protocol; in addition, the transport layer 313 can also provide scheduling service quality assurance (quality of service). , QOS), bandwidth allocation, flow control, power management, connection management and other common functions.
  • the physical layer 314 can provide corresponding requirements for line coding, channel coding, and electrical signal indicators according to the set physical link form.
  • the physical layer 314 can be subdivided into a physical coding sublayer (PCS) and a physical medium connector.
  • Layer physical media attachment layer, PMA
  • logical layer logical layer
  • electrical layer electrical layer
  • physical layer 314 can be specifically used for digital-to-analog conversion, that is, the second data represented by digital signals is converted into corresponding analog signal.
  • the above-mentioned first data includes any one of a token packet, a handshake packet or a special packet
  • the USB adaptation layer 312 is specifically configured to: encapsulate the first data to obtain a first transmission packet ;
  • the second data contains the first transport packet.
  • the above-mentioned first data may specifically include any one of a token packet (token packet), a handshake packet (handshake packet) and a special packet (special packet) in the USB2.0 protocol.
  • token packet token packet
  • handshake packet handshake packet
  • special packet special packet
  • the USB adaptation layer 312 can encapsulate the first data according to the protocol of the second physical link to obtain the first transmission packet, so that the first transmission packet can be transmitted on the second physical link.
  • the above-mentioned first data includes a data packet
  • the USB adaptation layer is specifically configured to: split the data packet into a plurality of first data payloads, and perform a encapsulation to obtain multiple second transmission packets; the second data includes multiple second transmission packets.
  • the above-mentioned first data may specifically include a data packet (data packet) in the USB2.0 protocol.
  • the splitting and encapsulation rule of the data packet may be: the initial part of the data packet, for example, the initial 1-byte data (that is, the identifier PID part of the packet) or the initial 2-byte data. (the PID part of the packet and 1 byte after the PID) as a first data payload, and then split the remaining part of the data packet into one or more first data payloads according to a preset rule.
  • the preset rule The average splitting may be performed according to the length, which is not specifically limited in this application; then all the first data payloads obtained by splitting are respectively encapsulated into corresponding second transmission packets.
  • the above-mentioned first data also includes a bus event
  • the USB adaptation layer is specifically used to: when the bus event arrives, encapsulate the beginning part of the bus event to obtain a third transmission packet
  • the transmission layer and The physical layer is specifically used to process the third transmission packet and send it to the receiving end through the second physical link
  • the USB adaptation layer is specifically used to: when the bus event ends, encapsulate the end part of the bus event to obtain the first Four transmission packets
  • the transmission layer and the physical layer are specifically used to process the fourth transmission packet and send it to the receiving end through the second physical link.
  • the above bus event includes any one of ChirpK, ChirpJ or ResumeK in the USB2.0 protocol.
  • the bus event is a level signal.
  • the level signal characteristic of the bus event may be: firstly change from low level 0 to high level 1, then last at high level 1 for a period of time, and finally change from high level 1 to low level 0.
  • the part of this level signal that changes from low level 0 to high level 1 is the beginning part of the bus event
  • the part that changes from high level 1 to low level 0 is the end part of the bus event
  • the duration period at is the middle part of the bus event.
  • the respective start parts and end parts of the three bus events can be determined according to the rules of the above examples.
  • the start and end parts of the three bus events in the above-mentioned USB2.0 protocol can be respectively expressed as: Chirp K start (Chirp K Start), Resume K start (Resume K Start), Chirp J start (Chip J Start) ), Chirp K End (Chirp K End), Resume K End (Resume K End) and Chirp J End (Chirp J End).
  • the USB adaptation layer 312 can encapsulate the start part and the end part of the bus event respectively to obtain the third transmission packet and the fourth transmission packet, the middle part of the bus event is not encapsulated, and then The third transport packet and the fourth transport packet are respectively sent through the transport layer 313, the physical layer 314 and the second physical link.
  • the processing of the third transport packet and the fourth transport packet by the transport layer and the physical layer is the same as the processing process of the second data by the transport layer and the physical layer in the foregoing embodiment, which will not be repeated here.
  • the USB protocol layer is further configured to send control information to the USB adapter.
  • the USB adaptation layer is also used for: parsing out the first virtual resistance information from the control information; and encapsulating the first virtual resistance information to obtain a fifth transmission packet; the transmission layer and the physical layer are specifically used for the fifth transmission packet After processing, it is sent to the receiving end through the second physical link.
  • the first virtual resistance information is used to represent the virtual bus state by describing the on or off state of the virtual resistance in the communication device, the virtual bus is a bus matching the USB protocol layer, and the virtual resistance in the communication device is the same as the physical resistance.
  • the physical resistor includes at least one of a high-speed matching resistor, a pull-up resistor or a pull-down resistor.
  • the communication device 310 in the embodiment of the present application may not include the USB2.0 physical layer and the USB2.0 pins, there is no physical resistance in the USB2.0 physical layer, so that the first virtual resistance is introduced to replace the USB2.0. 0 physical resistance in the physical layer, so that the virtual bus state can be subsequently determined according to the virtual resistance information, and then the communication requirements of the USB2.0 protocol can be met by reporting the virtual bus state.
  • the first virtual resistors included are different.
  • the first virtual resistance includes a virtual high-speed termination resistor and a virtual pull-down resistor.
  • the first virtual resistor when the communication device 310 is used as the upstream port, the first virtual resistor includes a virtual high-speed matching resistor and a virtual pullup resistor.
  • a virtual bus is introduced to replace the physical USB2.0 bus.
  • the virtual bus is a bus that matches the USB2.0 protocol layer, that is, Virtual USB2.0 bus, and then use the virtual bus state to replace the actual USB2.0 bus state, so as to meet the requirements of the USB2.0 protocol for real-time reporting of the bus state.
  • the above-mentioned first virtual resistance information further includes high-resistance (High-Z) information, the high-resistance information is used to represent the on or off state of the high-resistance, and the high-resistance is used to represent the communication device 310 and the target device 320 ( That is, the connection status between the receiving end).
  • High-Z high-resistance
  • the communication connection may refer to a wired or wireless connection, which is not specifically limited in this application.
  • FIG. 3B is a schematic structural diagram of another communication system 300 provided by an embodiment of the present application, as a supplement to the communication scenario in FIG. 3A .
  • FIG. 3B includes a communication device 310 , a target device 320 , a target device 330 and a target device 340 .
  • the communication device 310 expands the connection capability by connecting the target device 320, so as to communicate with multiple devices (only two are shown in FIG. 3B, namely the target device 330 and the target device 340).
  • the target device 320 at this time may be the Hub.
  • the target device 330 and the target device 340 may be a hub or a device.
  • the expansion capability of the communication system 300 can be further improved, so that the communication device 310 can perform data transmission with multiple devices.
  • the communication device 310 may include multiple second physical links, only one is shown in FIG. 3B , which is not specifically limited in this application.
  • the hub Hub may include multiple extended second physical links (only two are shown in FIG. 3B ), which is not specifically limited in this application.
  • For the structure and function of each layer in each device in FIG. 3B reference may be made to the corresponding description in FIG. 3A , which will not be repeated here.
  • the specific data transmission process between the communication device 310 and the target device 320, the target device 320 and the target device 330, and the target device 320 and the target device 340 can be referred to the description in the embodiment of FIG. 3A, which is not repeated here. .
  • FIG. 4 is a schematic structural diagram of a virtual resistance model in a communication system 300 according to an embodiment of the present application.
  • the dummy resistor included in the communication system 300 will be described in detail below by taking FIG. 4 as an example.
  • the virtual resistor included in the communication device 310 is the first virtual resistor
  • the virtual resistor included in the target device 320 (ie, the receiving end) is the second virtual resistor.
  • the first virtual resistor includes D+ high-speed matching resistor, D- high-speed matching resistor, D+ pull-down resistor and D- pull-down resistor on the downstream port;
  • the two dummy resistors include D+ high-speed matching resistor, D- high-speed matching resistor, D+ pull-up resistor and D- pull-up resistor on the upstream port.
  • the communication device 310 and the target device 320 can be used as both the uplink port and the downlink port; when the communication device 310 is used as the uplink port and the target device 320 is used as the downlink port, the first virtual resistance and the second virtual resistance include the specific The virtual resistance type is just the opposite of the above description, and will not be repeated here.
  • the first virtual resistance information can be encapsulated separately to obtain a fifth transmission packet, and then sent to the target device 320; it can also be encapsulated together with the bus event or the first data and sent to the target device 320 together. This is not specifically limited.
  • the embodiment of the present application may not include the USB2.0 physical layer and pins, the data transmission does not need to go through the USB2.0 physical layer, which can reduce the intermediate links of data transmission, and thus can effectively reduce the receiving delay of the receiving end.
  • the application is easy; at the same time, the chip area and related costs can also be effectively reduced; in addition, the embodiment of the present application replaces the USB2.0 physical in the USB2.0 protocol by introducing a virtual resistor and a virtual bus.
  • the physical resistance in the layer and the USB2.0 bus at this time, the first virtual resistance information is directly obtained from the control information analysis, without the need to obtain through detection, and the speed is faster, so the embodiment of the present application can effectively reduce the receiving delay of the receiving end, thereby Better meet the communication requirements of the USB2.0 protocol.
  • the dummy resistance includes a first dummy resistance and a second dummy resistance.
  • 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, and the packet header includes the type of the corresponding transmission packet information, length information of the data payload and reliability protection information.
  • a feasible packet header format can be as shown in Table 1
  • the information sequence contained in the packet header can be reliability protection information, that is, cyclic redundancy check (CRC) code, data payload length (payload length) ) information and transport packet type (type) information.
  • CRC cyclic redundancy check
  • the cyclic redundancy check code is a check code with error detection and error correction capabilities; the cyclic redundancy check is a short fixed-digit check code generated from data such as network data packets or computer files. It is a channel coding technique mainly used to detect or verify errors that may occur after data transmission or storage.
  • the types of transmission packets include non-data packet type, data packet start (DP Start) type, data packet middle (DPmiddle) type, data packet end (data packet end, DPEnd) ) type and bus event type; among them, non-data packet types are used to characterize token packets, handshake packets and special packets; data packet start type, data packet middle type and data packet end type are used to characterize different data packets Location data; the bus event type is used to characterize virtual resistance information and bus events.
  • the format of the data payload in the third transmission packet, the fourth transmission packet and the fifth transmission packet may be as shown in Table 2 and Table 3, where Table 2 represents the data payload format of the downlink port, and Table 3 represents the uplink port. data payload format.
  • the data payload format in Table 2 can be used to represent the data payload contained in the transmission packet encapsulated with bus event or virtual resistance information on the upstream port.
  • the data payload format shown in Table 2 contains 11 Each information unit is identified as: CRC, reserved item (Rsvd), pull-down resistor off (PullDown Resistor off, DR off), pull-down resistor on (PullDown Resistor on, DR on), high-speed Termination resistor off (High Speed Termination Resistor off, HS off), High Speed Termination Resistor on (HS on), High resistance on (High-Zon, 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).
  • the data payload format in Table 3 can be used to represent the data payload contained in the transmission packet encapsulated with bus event or virtual resistance information on the upstream port.
  • the data payload format shown in Table 3 contains a total of 12 information units, namely: 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 off (DP Pullup Resistor off, PRoff), D-pullup 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 starts, bus event K ends, bus event K starts.
  • CRC D+ pull-up resistor off
  • DM Pullup Resistor on, MRoff D+ pull-up resistor on
  • DP Pullup Resistor off, PRoff D-pullup resistor on
  • the D+ high-speed matching resistor and the D- high-speed matching resistor are turned on and off at the same time, so the high-speed matching resistor is represented by an information unit in the data payload of the upstream port and the downstream port; the two pull-down resistors of the downstream port are turned on at the same time.
  • Table 2 uses two information units to represent the state of the pull-down resistor, and the two pull-up resistors of the upstream port can not be turned on or off at the same time, so Table 3 uses four information units to represent the two state of a pull-up resistor.
  • JStart represents the start part of the bus event ChirpJ
  • K End represents the end part of the bus event Chirp K or Resume K end part
  • K Start represents the start part of the bus event Chirp K or Resume K start section.
  • Table 2 and Table 3 are only examples of the data payload format of a transmission packet encapsulating bus event or virtual resistance information given in the embodiment of the present application, and those skilled in the art may also use other data payload formats to represent The bus event and virtual resistance information are not specifically limited in this embodiment of the present application.
  • FIG. 5 is a schematic diagram of a process of splitting and encapsulating a data packet according to an embodiment of the present application.
  • the data structure of the data packet sequentially includes a synchronization (SYNC) identifier, an identifier (packet identifier, PID), a plurality of bytes (byte 1 to the end byte), and a packet from the beginning to the end. End of packet (EOP) delimiter.
  • SYNC synchronization
  • PID packet identifier
  • EOP End of packet
  • the data packet can be split into N data payloads, the identifier PID and byte 1 are data payload 1, and byte 2 to the end byte are split into N-1 data payloads , and then the USB adaptation layer 312 encapsulates the divided N data payloads respectively to obtain N second transmission packets.
  • Each second transmission packet includes a corresponding packet header and data payload, wherein the transmission packet type information contained in the packet header in the first second transmission packet is the data packet start DP Start, the second second transmission packet to the Nth transmission packet -
  • the transmission packet type information contained in the packet header of the 1 second transmission packet is the data packet middle DP Middle, and the transmission packet type information contained in the packet header in the Nth second transmission packet is the data packet end DP End.
  • N is a positive integer greater than or equal to 2.
  • the above-mentioned physical layer and transport layer are further used for processing the third data received through the second physical link, and then sending it to the USB adaptation layer; the USB adaptation layer is also used for 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. link.
  • 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: what is transmitted on the second physical link is the simulation of the third data
  • the physical layer 314 can specifically be used to convert the analog signal representing the third data into a corresponding digital signal
  • the transmission layer 313 can be used to transmit the digital signal of the third data after the conversion, and convert the transmission format of the digital signal. into a transmission format compatible with the USB adaptation layer 312, that is, into a transmission format specified by the USB2.0 protocol.
  • the processed third data includes one or more transmission packets
  • the USB adaptation layer is specifically configured to: parse the packet headers of the one or more transmission packets respectively, Obtain the type information of the one or more transport packets; when the one or more transport packets are the data packets, aggregate one or more data payloads corresponding to the one or more transport packets, Obtain the fourth data; when the one or more transport packets are not the data packets, use one or more of the data payloads corresponding to the one or more transport packets as the fourth data respectively data.
  • the USB adaptation layer 312 is used to restore the one or more transmission packets to obtain fourth data that can be received by the USB protocol layer.
  • the process includes: first Parse the packet headers of the one or more transport packets, and obtain the type information of the one or more transport packets from the corresponding packet headers; when the type of the one or more transport packets is a data packet, transmit the DPStart transport packet and DPEnd packet, and the data payloads contained in the M DPMiddle transmission packets in the middle of the DPStart transmission packet and the DPEnd transmission packet are aggregated in order to obtain the fourth data; wherein, M is an integer greater than or equal to zero; when the above one or more transmission When the packet is a token packet, a special packet, a handshake packet, a bus event starts or a bus event ends, the data payloads contained in the one or more transmission packets are respectively regarded as fourth data.
  • the physical layer and the transport layer are further configured to process the sixth transport packet received through the second physical link, and then send it to the USB adaptation layer;
  • the USB adaptation layer is further configured to Receive the processed sixth transmission packet, analyze the processed sixth transmission packet, and obtain second virtual resistance information;
  • the second virtual resistance information includes the on or off state of the virtual resistance in the receiving end, the second virtual resistance
  • the resistance information is used to represent the virtual bus state, the virtual resistance in the receiving end corresponds to the physical resistance, and the physical resistance includes at least one of a high-speed matching resistance, a pull-up resistance or a pull-down resistance.
  • the process of processing the sixth transport packet by the physical layer 314 and the transport layer 313 is the same as the process of sorting out the third data, and details are not repeated here.
  • the above-mentioned receiving end is the target device 320, and when it is used as the downstream port, the virtual resistor included in the target device 320 is shown in Figure 4, and can include a virtual high-speed matching resistor and a virtual pull-down resistor of the downstream port; when it is used as the upstream port,
  • the dummy resistors may include dummy high-speed matching resistors and dummy pull-up resistors of the upstream port.
  • the above-mentioned USB adaptation layer 312 is also used to restore it to obtain the second virtual resistance information, and the process is specifically: analyzing the packet header of the sixth transmission packet, and determining the first The type of the six transmission packets, that is, the bus event type; the second virtual resistance information in the communication device 310 is updated according to the second virtual resistance information contained in the data payload.
  • the second virtual resistance information further includes high resistance (High-Z) information, the meaning of which is the same as the meaning represented by the high resistance in the first virtual resistance information, and will not be repeated here.
  • High-Z high resistance
  • the USB adaptation layer is further configured to: when the USB adaptation layer receives the first data, determine the virtual bus state according to the content of the first data; when the USB adaptation layer sends the fourth data, Determine the virtual bus state according to the content of the fourth data; when the USB adaptation layer does not receive the first data and does not send the fourth data, determine the virtual bus state according to the first virtual resistance information and the second virtual resistance information; The layer sends the current virtual bus state.
  • the first data may include a token packet, a handshake packet, a special packet, a data packet or a bus event
  • the fourth data may also include a token packet, a handshake packet, a special packet, a data packet or a bus event.
  • the virtual bus state is determined according to the content of the first data, which specifically includes: when the USB adaptation layer 312 receives the token packet, the handshake packet, the In the case of a special packet, data packet or bus event, the virtual bus state is determined according to the USB Transceiver Macrocell Interface (UTMI) protocol, that is, according to the corresponding relationship between the first data content and the bus state.
  • UTMI USB Transceiver Macrocell Interface
  • the virtual bus state is determined according to the content of the fourth data, which specifically includes: when the USB adaptation layer 312 sends the token packet, handshake packet, In the case of a special packet, data packet or bus event, the virtual bus state is determined according to the UTMI protocol, that is, according to the corresponding relationship between the fourth data content and the bus state.
  • the virtual bus state (line_state) is correspondingly determined as K or J according to the type of the bus event; when the received fourth data is the end part of the bus event, the virtual bus state (line_state) is determined as K or J;
  • the bus state is determined to be SE0 (ie, SE0 in the USB2.0 protocol). The correspondence between other USB2.0 transmission packets, bus events and bus states specified in the UTMI protocol will not be repeated here.
  • the virtual bus state is determined according to the corresponding relationship between the virtual resistance and the virtual bus state in Table 4.
  • FS refers to full speed in USB2.0
  • LS refers to USB2
  • the low speed (low speed) and HS in .0 refer to the high speed (high speed), J state, K state and SE0 state in USB2.0.
  • the virtual bus state includes a total of 6 types: the downstream port drives high impedance, the upstream port drives high impedance, FS default state, LS default state, HS default state and HS handshake in the USB2.0 protocol.
  • the USB protocol layer is further configured to: determine the working state of the communication device at the next moment according to 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 whether Receive 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 control information, the first virtual resistance information parsed by the USB adaptation layer from the control information ; or idle state.
  • the working state of the communication device 310 at the next moment includes the following: (1) the USB protocol layer 311 sends the first data to the USB adaptation layer 312, and the specific content contained in the first data; (2) the USB The protocol layer 311 receives the sixth data sent by the USB adaptation layer 312; (3) the USB protocol layer 311 sends control information to the USB adaptation layer 312, and the USB adaptation layer 312 can parse out the corresponding first virtual resistance from the control information (4) idle state, the USB USB protocol layer 311 neither sends the first data nor receives the sixth data.
  • the specific process of sending and receiving data by the target device 320 (the receiving end) is the same as the specific process of the above-mentioned communication device 310.
  • the target device 320 receives the data; when the target device 320 sends data, The communication device 310 receives data, so the process of sending and receiving data by the target device 320 will not be repeated in this embodiment of the present application.
  • FIG. 6 is a schematic structural diagram of still another communication system 300 provided by an embodiment of the present application.
  • Layer refinement As shown in FIG. 6 , for the communication device 310 , the USB adaptation layer 312 includes an encapsulation unit 3121 , a control unit 3122 , a determination unit 3123 and a restoration unit 3124 .
  • the control unit 3122 is configured to receive the control information sent by the USB protocol layer 311, determine the working mode of the communication device 310 according to the control information, and parse out the corresponding first virtual resistance information from the control information; It controls whether the encapsulation unit 3121 encapsulates the first data and the first virtual resistance information, controls whether the restoration unit 3124 restores the third data, and controls whether the determination unit 3123 infers the virtual bus state.
  • the encapsulation unit 3121 is used for receiving the first data and encapsulating the first data to obtain the second data; and for when the first virtual resistance information obtained by this analysis is different from the first virtual resistance information obtained by the previous analysis, The first virtual resistance information of this time is encapsulated to obtain a fifth transmission packet.
  • the restoration unit 3124 is used to receive the third data and restore the third data, obtain the fourth data, and receive and restore the sixth transmission packet, obtain the second virtual resistance information, and use the second virtual resistance obtained this time.
  • the information updates the last obtained second virtual resistance information.
  • 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 encapsulating unit 3121 encapsulates the first data;
  • the virtual bus state is determined according to the corresponding relationship between the specific content of the fourth data and the bus state specified in the UTMI protocol; for when the encapsulation unit 3121 does not receive the first data and the restoration unit 3124 does not send
  • the virtual bus state is determined according to the corresponding relationship between the virtual resistance and the virtual bus state in Table 4; it is used to send the virtual bus state to the USB protocol layer 311 .
  • each functional unit included in the target device 320 and the communication device 310 includes corresponding hardware circuits, respectively.
  • the above control information may include control signals in various USB2.0 protocols: utmi_dppulldown, utmi_dmpulldown, utmi_suspendm, utmi_xcvrselect, utmi_termselect, utmi_opmode, and utmi_txvaild.
  • the control information is the same as the control information specified in the UTMI protocol, which is not repeated in this application.
  • the communication device 310 acts as a downstream port, that is, the USB adaptation layer 312 is located at the downstream port; when utmi_dppulldown or utmi_dmpulldown is 0, the communication device 310 acts as an upstream port, that is, the USB adaptation layer 312 is located at the upstream port.
  • the combinations of the above-mentioned various control signals correspond to different operating modes of the communication device 310 .
  • Table 5 shows that when the communication device 310 is a downlink port, 13 working modes of the communication device 310 can be determined according to the combination of five control signals: utmi_suspendm, utmi_xcvrselect, utmi_termselect, utmi_opmode and utmi_txvaild.
  • "X” indicates that this signal has no effect on the determination of the working mode; the following takes the signal "01b” as an example to explain the meaning of each signal: "b” indicates that the signal is in binary format, "01” indicates the specific numerical value. The meanings of other signal values are similar to this, and will not be repeated here.
  • the above 13 working modes are the working modes of the downlink port in the UTMI protocol.
  • the "packet" in Table 6 refers to the remaining data in the first data or the fourth data except the bus event, that is, any one of the instruction card packet, handshake packet, special packet and data packet .
  • Full speed, high speed and low speed respectively refer to full speed (12Mbps), highspeed (480Mbps) and low speed (1.5Mbps) in the USB2.0 protocol.
  • the virtual bus state is the full-speed J state in the USB2.0 protocol, that is, FSJ .
  • the “high impedance” working mode means that the communication device 310 has not established a communication connection with other devices at this time, and the corresponding high-speed matching resistor and pull-down resistor are not connected.
  • the “standby” working 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 the bus event and the determination of the virtual bus state are performed, and the corresponding high-speed matching resistor is not turned on and the pull-down resistor is turned on.
  • the full-speed mode includes three working modes of full-speed (idle), full-speed (transmitting packets) and full-speed (sending ResumeK) shown in Table 6; Send ChirpJ) and full-speed (send Chirp K) four working modes; low-speed mode includes low-speed (idle), low-speed (packet sending) and low-speed (send Resume K) three working modes shown in Table 6; Idle)” working mode means that the communication device 310 performs encapsulation and restoration of bus events, restores token packets, handshake packets, special packets and data packets sent by the target device 320, and determines the virtual bus state, and the corresponding high-speed matching resistance is not The “full speed (packet sending)” working mode indicates that the communication device 310 encapsulates and restores bus events, and encapsulates and restores token packets, handshake packets, special packets and data packets, and determines the bus event, the corresponding high-speed matching resistance is not connected, and the pull
  • Table 5 Correspondence between downlink port control information and communication device working mode
  • Table 6 The virtual resistance information corresponding to the different working modes of the downstream port and the specific behavior of the control unit
  • Table 7 shows that when the communication device 310 is an uplink port, 12 working modes of the communication device 310 can be determined according to the combination of five control signals: utmi_suspendm, utmi_xcvrselect, utmi_termselect, utmi_opmode and utmi_txvaild. It should be noted that when the communication device 310 is used as the uplink port, there is no preamble (packet sending) working mode.
  • the above 12 working modes are the working modes of the upstream port in the UTMI protocol.
  • Table 8 the meanings of "packet”, “full speed”, “low speed” and “high speed” in Table 8 are the same as those of the related terms in Table 6.
  • utmi_txdata, virtual resistance information and control unit behavior The interpretation rules of the signal values are the same as the interpretation rules of the corresponding signal values in Table 6, and are not repeated here.
  • Table 8 For specific behaviors of the communication device 310 in different working modes, please refer to Table 8, which will not be repeated here.
  • the data in the next packet is bitwise inverted. For example, if the data format in the next packet is binary, the A 0 in a binary data bit becomes a 1, and a 1 becomes a 0; then from the end of this packet to the beginning of the next, the virtual bus state is full-speed J, or FSJ.
  • the upstream port does not have a preamble mode, so it is not necessary to consider the situation of sending a Preamble packet, but it needs to consider the situation of receiving a Preamble packet.
  • the downlink port only needs to consider the situation of sending Preamble packets, but does not need to consider the situation of receiving Preamble packets.
  • the upstream port can choose to support only low-speed LS mode, or support high-speed HS mode or full-speed FS mode. Usually, the upstream port chooses to support the high-speed HS mode or the full-speed FS mode, and does not need to consider supporting the low-speed LS mode.
  • Low speed start of frame can only be sent by the downlink port, so the downlink port only needs to consider sending LS Keepalive, not receiving LS Keepalive; the uplink port only needs to consider receiving LS Keepalive , do not need to consider sending LS Keepalives.
  • Tables 5 to 8 take the communication device 310 as an example to illustrate the correspondence between the control information sent by the USB protocol layer 311 and the working modes of the communication device 310 when it acts as an upstream port and a downstream port, as well as the different working modes
  • Table 7 Correspondence between upstream port control information and communication device working mode
  • Table 8 Virtual resistance information corresponding to different working modes of the upstream port and the specific behavior of the control unit
  • FIG. 7 is a schematic structural diagram of still another communication system 300 provided by an embodiment of the present application.
  • the communication device 310 and the target device 320 respectively include data transmission paths of multiple protocols, that is, the above two communication devices include USB3.0 data transmission paths in addition to the data transmission paths of the USB2.0 protocol. and the data transmission path of the PCIE protocol.
  • the structures shown in the communication device 310 and the target device 320 in FIG. 7 are correspondingly the same.
  • the communication device 310 includes a USB2.0 protocol data transmission path, a USB3.0 protocol data transmission path, and a PCIE protocol data transmission path. These three protocols respectively include their own independent transmissions above their respective adaptation layers.
  • the data transmission path under the adaptation layer, shares the transmission layer 313, the physical layer 314 and the second physical link for data transmission.
  • the data transmission path of the USB2.0 protocol is the transmission path shown in FIG. 3A , and the specific data communication rules thereof have been described in detail in the foregoing embodiments, and will not be repeated here.
  • the USB3.0 protocol data transmission path includes a USB3.0 adaptation layer 333 , a USB3.0 link layer 332 and a USB3.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 a corresponding application layer (not shown) above the respective protocol layers.
  • the communication device 310 in this embodiment of the present application may be either a multi-protocol aggregation communication device (as shown in FIG. 7 , including the USB2.0 protocol and other communication protocols), or a single-protocol communication device (as shown in FIG. 3A ) or as shown in FIG. 3B , including the USB 2.0 protocol), which is not specifically limited in this application.
  • the USB2.0 protocol in the device can be aggregated with one or more other protocols in addition to the USB3.0 protocol and the PCIE protocol. , so as to realize transmission on the public high-speed second physical link, which is not specifically limited in this application.
  • FIG. 8 is a schematic diagram of a scenario in which multiple communication apparatuses 310 are used for communication according to an embodiment of the present application.
  • FIG. 8 depicts a schematic diagram of a scenario in which the host Host establishes a connection with the device Device through the hub Hub for data transmission.
  • the host Host may contain multiple interfaces (only 2 are shown in Figure 8).
  • the method shown in Figure 8 can be adopted, that is, the host Host can be connected by connecting to the hub Hub.
  • Figure 8 includes three communication devices, namely the host Host, the hub Hub, and the device Device.
  • the host Host and the hub Hub can communicate through the second physical link
  • the hub Hub and the device Device can communicate through the second physical link.
  • X and Y in FIG. 8 represent any other protocols that can be aggregated with USB2.0.
  • X protocol and Y protocol can be USB3.0 protocol and PCIE protocol respectively, which are not specifically limited in this application.
  • USB2.0 protocol In the host shown in FIG. 8, the data transmission paths of three protocols are included: USB2.0 protocol, X protocol and Y protocol.
  • USB2.0 data is transmitted to USB protocol layer 1 through USB application layer 1; then transmitted to USB adaptation layer 1 or USB adaptation layer 2 through USB protocol layer 1;
  • the USB2.0 data for physical link adaptation is sent through transport layer 1, physical layer 1, interface 1 and the second physical link (not shown in the figure);
  • the USB2.0 data is sent to the hub through the transport layer 2, the physical layer 2, the interface 2 and the second physical link.
  • the X protocol the X protocol data is sent to the hub Hub through the X controller 1, the X adaptation layer 1, the transport layer 2, the physical layer 2, the interface 2 and the second physical link.
  • the Y protocol data is transmitted through the Y controller 1, the Y adaptation layer 1, the transport layer 1, the physical layer 1 and the interface 1.
  • the data transmission path of the X protocol and the data transmission path of the USB2.0 protocol both include transport layer 2 and physical layer 2
  • the data transmission path of the Y protocol and the data transmission path of the USB2.0 protocol both include transport layer 1 and Physical layer 1.
  • the two USB2.0 data paths in the host may be equivalent to the USB2.0 data paths included in the communication device 310 or the target device 320 in FIG. 3A or FIG. 3B .
  • USB2.0 protocol data transmission path there are data transmission paths of two protocols: USB2.0 protocol data transmission path and X protocol data transmission path.
  • USB2.0 protocol USB2.0 data is transmitted to Routing through interface 3, physical layer 3, transport layer 3, USB adaptation layer 3 and USB protocol layer 2 for processing, and then transmitted to USB through USB protocol layer 3 Adaptation layer 4 or USB adaptation layer 5; the data for physical link adaptation through USB adaptation layer 4 is sent to the device Device through transport layer 4, physical layer 4, interface 4 and the second physical link;
  • the data for physical link adaptation performed by the configuration layer 5 is sent to the device Device through the transport layer 5, the physical layer 5, the interface 5 and the second physical link (not shown).
  • the USB2.0 protocol data transmission path may also reserve the USB2.0 physical layer and the USB2.0 interface (pins), so as to be compatible with existing USB2.0 devices.
  • the X protocol data is transmitted to the X converter through the transport layer 3, the physical layer 3 and the X adaptation layer 2.
  • the X converter expands the data transmission path of the X protocol into two, and the X protocol data passing through the X converter It can be sent to X adaptation layer 3 or X adaptation layer 4; after physical link adaptation through X adaptation layer 3, it passes through transport layer 5, physical layer 5, interface 5 and the second physical link (not shown) It is sent to the device Device; after physical link adaptation is performed through the X adaptation layer 4, it is sent to the device Device through the transport layer 4, the physical layer 4, the interface 4 and the second physical link.
  • the hub Hub may also include a link of the Y protocol, and its specific structure may be defined according to a specific application scenario, which is not specifically limited in this application.
  • USB2.0 protocol USB2.0 data is transmitted to USB adaptation layer 6 through interface 6, physical layer 6 and transport layer 6, restored to USB2.0 data through USB adaptation layer 6, and sent to USB protocol layer 4 and USB application layer 2.
  • USB protocol the X protocol data is transmitted to the X adaptation layer 5 through the interface 6, the physical layer 6 and the transport layer 6, and is restored to the X protocol data through the X adaptation layer 5, and the X protocol data is sent to the X controller 2.
  • Y protocol the data transmission process thereof is the same as that of the X protocol, which is not repeated here.
  • the data transmission path of the USB2.0 protocol in the host Host and the device Device may also reserve the USB2.0 physical layer and the USB2.0 pins, so as to perform data transmission with the existing USB2.0 device.
  • FIG. 9 is a schematic flowchart of a data transmission method 900 provided by an embodiment of the present application.
  • the data transmission method is applicable to any communication device or target device in the above-mentioned FIG. 3A , FIG. 3B , and FIG. 6 to FIG. 8 , and a device including the above-mentioned communication device or target device.
  • the method 900 may include steps S901-S903, wherein, step S901: sending the first data to the USB adaptation layer through the universal serial bus USB protocol layer; step S902: physically linking the first data by the USB adaptation layer The second data is obtained by adaptation, and the second data is sent 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 that of the first physical link. The bandwidth of the second physical link; Step S903: Process the second data through the transport layer and the physical layer, and send the processed second data to the receiving end by the second physical link.
  • the above-mentioned first data includes any one of a token packet, a handshake packet or a special packet
  • the USB adaptation layer performs physical link adaptation on the first data to obtain the second data, including : the first data is encapsulated by the USB adaptation layer to obtain the first transmission packet; the second data includes the first transmission packet.
  • the above-mentioned first data includes a data packet
  • the second data is obtained by performing physical link adaptation on the first data by the USB adaptation layer, including: splitting the data packet by the USB adaptation layer into A plurality of first data payloads are encapsulated respectively to obtain a plurality of second transmission packets; the second data includes a plurality of second transmission packets.
  • the above-mentioned first data further includes a bus event
  • the second data is obtained by performing physical link adaptation on the first data by the USB adaptation layer, including: when the bus event arrives, adapting through the USB The first part of the bus event is encapsulated by the layer to obtain the third transmission packet; the third transmission packet is processed through the transmission layer and the physical layer, and the processed third transmission packet is sent to the receiving end through the second physical link;
  • the bus event ends, the end part of the bus event is encapsulated through the USB adaptation layer to obtain the fourth transmission packet; the fourth transmission packet is processed through the transmission layer and the physical layer, and the processed first transmission packet is processed through the second physical link.
  • Four transport packets are sent to the receiver.
  • the above method includes: sending control information to the USB adapter through the USB protocol layer; parsing the first virtual resistance information from the control information through the USB adaptation layer; and encapsulating the first virtual resistance information , obtain the fifth transmission packet; process the fifth transmission packet through the transmission layer and the physical layer, and send the processed fifth transmission packet to the receiving end through the second physical link; the first virtual resistance information is used to describe the communication
  • the on or off state of the virtual resistor in the device represents the virtual bus state.
  • the virtual bus is a bus that matches the USB protocol layer.
  • the virtual resistor in the communication device corresponds to the physical resistor.
  • the physical resistor includes high-speed matching resistors and pull-up resistors. or at least one of the pull-down resistors.
  • 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, and the packet header includes the type of the corresponding transmission packet information, length information of the data payload and reliability protection information.
  • 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; Perform physical link adaptation on the processed third data through the USB adaptation layer 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 second physical link.
  • the first physical link is adapted.
  • the processed third data includes one or more transmission packets
  • the fourth data is obtained by performing physical link adaptation on the processed third data through the USB adaptation layer, including:
  • the USB adaptation layer parses the headers of one or more transmission packets respectively to obtain the type information of one or more transmission packets; when one or more transmission packets are data packets, the USB adaptation layer converts one or more transmission packets into One or more data payloads corresponding to the transmission packets are aggregated to obtain fourth data; when one or more transmission packets are not data packets, one or more The data payloads are respectively used as the fourth data.
  • the above 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; receive the processed sixth transmission packet through the USB adaptation layer, and analyze the processed sixth transmission packet to obtain the second virtual resistance information; the second virtual resistance information includes the conduction or Off state, the second virtual resistance information is used to represent the virtual bus state, the virtual resistance in the receiving end corresponds to the physical resistance, and the physical resistance includes at least one of a high-speed matching resistance, a pull-up resistance or a pull-down resistance.
  • the above method further includes: when the USB adaptation layer receives the first data, the USB adaptation layer determines the virtual bus state according to the content of the first data; when the USB adaptation layer sends the fourth data , the USB adaptation layer determines the virtual bus state according to the content of the fourth data; when the USB adaptation layer does not receive the first data and does not send the fourth data, the USB adaptation layer determines the virtual bus state according to the first virtual resistance information and the second virtual resistance The information determines the virtual bus state; the current virtual bus state is sent by the USB adaptation layer to the USB protocol layer.
  • the above method further includes: determining, by the USB protocol layer, the working state of the communication device at the next moment according to 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 whether to receive 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 control information, the first virtual resistance information parsed by the USB adaptation layer from the control information .
  • FIG. 10 is a schematic structural diagram of an exemplary terminal 100 provided by an embodiment of the present application. It should be understood that the terminal 100 may be the aforementioned communication device 310 or the 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, a wireless transceiver 190, and the like.
  • RF radio frequency
  • the antenna system 110 may be one or more antennas, and may also be an antenna array composed of multiple antennas.
  • the radio frequency circuit 120 which may include one or more analog radio frequency transceivers, which may also include one or more digital radio frequency transceivers, is coupled to the antenna system 110 . It should be understood that, in various embodiments of the present application, coupling refers to mutual connection in a specific manner, including direct connection or indirect connection through other devices, such as various interfaces, transmission lines, and buses.
  • the radio frequency circuit 120 can be used for various types of cellular wireless communications.
  • the processor 130 may include a communication processor, which may be used to control the RF circuit 120 to effect the reception and transmission of signals, which may be voice signals, media signals, or control signals, through the antenna system 110 .
  • the processor 130 may include various general-purpose processing devices, such as a general-purpose central processing unit (Central Processing Unit, CPU), a system on a chip (System on Chip, SOC), a processor integrated on the SOC, a separate processor chip or a controller, etc.; the processor 130 may also include a dedicated processing device, such as an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or a digital signal processor (Digital Signal Processor).
  • ASIC application specific integrated circuit
  • FPGA field programmable gate array
  • Digital Signal Processor Digital Signal Processor
  • the processor 130 may be a processor group composed of multiple processors, and the multiple processors are coupled to each other through one or more buses.
  • the processor may include an analog-to-digital converter (ADC), a digital-to-analog converter (DAC) to realize the connection of signals between different components of the device.
  • ADC analog-to-digital converter
  • DAC digital-to-analog converter
  • the memory 140 is coupled to the processor 130, in particular, the memory 140 may be coupled to the processor 130 through one or more memory controllers.
  • the memory 140 may be used to store computer program instructions, including a computer operating system (Operation System, OS), various user application programs and user data, and the like.
  • the processor 130 may read computer program instructions or user data from the memory 140, or store the computer program instructions or user data in the memory 140 to implement related processing functions.
  • the memory 140 can be a non-power-down volatile memory, such as EMMC (Embedded Multi Media Card, embedded multimedia card), UFS (Universal Flash Storage, universal flash storage) or read-only memory (Read-Only Memory, ROM), Or other types of static storage devices that can store static information and instructions, and can also be power-down volatile memory (volatile memory), such as random access memory (Random Access Memory, RAM), static random access memory (Static).
  • EMMC embedded Multi Media Card, embedded multimedia card
  • UFS Universal Flash Storage, universal flash storage
  • read-only memory Read-Only Memory
  • volatile memory volatile memory
  • volatile memory such as random access memory (Random Access Memory, RAM), static random access memory (Static).
  • SRAM random-access memory
  • dynamic storage devices that can store information and instructions
  • SRAM electrically Erasable Programmable Read-Only Memory
  • EEPROM Electrically Erasable Programmable Read-Only Memory
  • CD-ROM Compact Disc
  • optical disc storage including compact disc, laser disc, digital versatile disc or Blu-ray disc, etc.
  • magnetic disk storage media or other magnetic storage devices, but not limited thereto.
  • the memory 140 may be independent of the processor 130 , or the memory 140 may be integrated with the processor 130 .
  • the camera 150 is used for capturing images or videos, and the audio circuit 160 is coupled with the processor 130 .
  • the audio circuit 160 may include a microphone 161 and a speaker 162.
  • the microphone 161 may receive sound input from the outside world, and the speaker 162 may implement audio data playback.
  • the display screen 170 is used to provide the user with various display interfaces or various menu information that can be selected.
  • the content displayed on the display screen 170 includes, but is not limited to, a soft keyboard, a virtual mouse, virtual keys and icons, etc. These display contents are associated with specific internal modules or functions, and the display screen 170 may also accept user input.
  • the display screen 170 may include a display panel 171 and a touch panel 172 .
  • Sensors 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.
  • the processor 130 drives the sensor 180 through the sensor controller 12 in the I/O subsystem 10 to receive various information such as audio information, image information or motion information, and the sensor 180 transmits the received information to the processor 130 for processing.
  • the wireless transceiver 190, the wireless transceiver 190 can provide wireless connection capability to other devices, and the other devices can be peripheral devices such as wireless headsets, Bluetooth headsets, wireless mice or wireless keyboards, Fidelity, WiFi) network, Wireless Personal Area Network (Wireless Personal Area Network, WPAN) or its WLAN, etc.
  • the wireless transceiver 190 may be a Bluetooth compatible transceiver for wirelessly coupling the processor 130 to peripheral devices such as a Bluetooth headset, wireless mouse, etc.
  • the wireless transceiver 190 may also be a WiFi compatible transceiver for connecting the processing
  • the device 130 is wirelessly coupled to a wireless network or other device.
  • Terminal 100 may also include other input devices 14 coupled to processor 130 to receive various user inputs, such as receiving entered numbers, names, addresses, and media selections, etc.
  • Other input devices 14 may include keyboards, physical buttons (pressed buttons, rocker buttons, etc.), dials or slide switches, etc.
  • the terminal 100 may also include the aforementioned I/O subsystem 10 and the power supply 101 . It should be understood that the terminal 100 in FIG. 10 is only an example, and the specific form of the terminal 100 is not limited, and the terminal 100 may also include other existing components not shown in FIG. 10 or other components that may be added in the future.
  • FIG. 11 is an architectural diagram of a processor 1600 according to an embodiment of the present application, and the processor 1600 may be the processor in FIG. 10 .
  • the processor 1600 includes: at least one CPU, a memory, and the type of the memory may include, for example, a static random-access memory (Static Random-Access Memory, SRAM) and a read-only memory (Read-Only Memory, ROM), Microcontroller (Microcontroller Unit, MCU), security subsystem, wireless local area network (Wireless Local Area Networks, WLAN) subsystem, bus, transmission interface, etc.
  • the apparatus 700 may also include an application processor (Application Processor, AP), other dedicated processors such as NPU, and other sub-systems such as a power management subsystem, a clock management subsystem, and a power consumption management subsystem. system.
  • Application Processor Application Processor
  • the connectors include various types of interfaces, transmission lines or buses, etc. These interfaces are usually electrical communication interfaces, but may also be mechanical interfaces or other forms of interfaces. The embodiment does not limit this.
  • the CPU may be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor; coupled to each other by one or more buses.
  • the CPU implements any one of the wireless screen projection methods in the foregoing method embodiments by calling program instructions stored in the on-chip memory or the off-chip memory.
  • the CPU and the MCU jointly implement any one of the wireless screen projection methods in the foregoing method embodiments, for example, the CPU completes some steps in the wireless screen projection method, and the MCU completes the wireless screen projection method. other steps in the method.
  • the AP or other special-purpose processor implements any one of the wireless screen projection methods in the foregoing method embodiments by invoking the program instructions stored in the on-chip memory or the off-chip memory.
  • the transmission interface may be an interface for receiving and sending data of the processor chip, and the transmission interface usually includes a variety of interfaces.
  • the transmission interface may include an Inter-Integrated Circuit (I2C). Interface, Serial Peripheral Interface (SPI), Universal Asynchronous Receiver-Transmitter (UART) interface, General-purpose input/output (GPIO) interface, etc. It should be understood that these interfaces may implement different functions by multiplexing the same physical interface.
  • I2C Inter-Integrated Circuit
  • SPI Serial Peripheral Interface
  • UART Universal Asynchronous Receiver-Transmitter
  • GPIO General-purpose input/output
  • the transmission interface may further include High Definition Multimedia Interface (HDMI), V-By-One interface, Embedded Display Port (eDP), mobile industry processing Interface (Mobile Industry Processor Interface, MIPI) or Display Port (DP) and so on.
  • HDMI High Definition Multimedia Interface
  • V-By-One interface V-By-One interface
  • eDP Embedded Display Port
  • MIPI Mobile Industry Processor Interface
  • DP Display Port
  • the above-mentioned parts are integrated on the same chip; in another optional case, the memory may be an independent chip.
  • the security subsystem can be used to implement relevant encryption algorithms for security authentication. It should be understood that the encryption algorithm related to security authentication is usually implemented in hardware, so that the security of the encryption algorithm can be further improved.
  • the WLAN subsystem may include, for example, RF circuitry and baseband.
  • the chip involved in the embodiments of this application is a system fabricated on the same semiconductor substrate by an integrated circuit process, also called a semiconductor chip, which can be fabricated on a substrate (usually a semiconductor such as silicon) using an integrated circuit process A collection of integrated circuits formed on a material), the outer layers of which are usually encapsulated by a semiconductor encapsulation material.
  • the integrated circuit may include various functional devices, each of which includes a logic gate circuit, a metal-oxide-semiconductor (Metal-Oxide-Semiconductor, MOS) transistor, a bipolar transistor or a diode and other transistors, as well as capacitors, resistors, etc. or other components such as inductors.
  • MOS metal-oxide-semiconductor

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • General Business, Economics & Management (AREA)
  • Multimedia (AREA)
  • Business, Economics & Management (AREA)
  • Computer Hardware Design (AREA)
  • Communication Control (AREA)
  • Information Transfer Systems (AREA)

Abstract

本申请实施例提供一种通信装置及数据传输方法,通信装置包括:通用串行总线USB协议层、USB适配层、传输层和物理层;USB协议层,用于向USB适配层发送第一数据;USB适配层,用于对第一数据进行物理链路适配得到第二数据,并向传输层发送第二数据;其中,第一数据适配第一物理链路,第二数据适配第二物理链路;第一物理链路的带宽低于第二物理链路的带宽;第二数据通过传输层和物理层处理之后,通过第二物理链路发送给接收端。采用本申请实施例可以在增加通信装置管脚带宽使用率的同时有效降低数据传输延时;同时,数据的传输不受物理链路传输形式的限制;此外,与现有技术相比还能节省芯片面积和硬件成本。

Description

通信装置及数据传输方法 技术领域
本申请涉及通信技术领域,尤其涉及一种通信装置及数据传输方法。
背景技术
视频和数据传输接口对传输带宽有较高的需求,而受芯片制造工艺、传输线等限制,单纯提高串行器/解串器(seriallizer/deserializer,Serdes)传输速率比较困难。要提高带宽,通常的做法是增加Serdes物理链路的数量,但这样会在一定程度使连接器和线缆的尺寸增加,用户体验变差。在连接器和线缆尺寸受限的前提下,为了提供更高总带宽,应当采取适当方法提高低速Serdes物理链路的传输速率。
通用串行总线(universal serial bus,USB)自推出以来,在消费者领域广泛应用,成为21世纪大量计算机和智能设备的标准扩展接口和必备接口之一。USB标准化组织(USB implementers forum,USB-IF)于2019年发布了USB4.0协议,该协议除了向下兼容USB2.0和第一代USB3(USB3Generation1)协议外,还通过隧道协议支持第二代USB3(USB3Generation2)协议、显示端口(Display Port,DP)协议、快捷外围部件互连标准(Peripheral Component Interconnect Express,PCIE),单个串行器/解串器链路的传输速率可选10Gbps或20Gbps;然而对于向下兼容的USB2.0协议,该协议采用专用的物理链路进行数据传输,传输速率最高480Mbps,带宽使用率严重不足。
现有技术为了提高Serdes物理链路的带宽,将USB2.0总线的电气信号转换成适合在公共的高速物理链路传输的信号,然后在公共的高速物理链路上传输,公共的高速物理链路的多余带宽可以用于传输其它数据,从而提高了总带宽。
然而上述现有技术在将USB2.0管脚的电气信号转换成可以在其它公共的高速物理链路上传输的信号时,在本侧和对端的USB2.0数据传输路径上均增加了一个USB2.0物理层,因而会极大增加USB2.0数据的传输延时,较难满足USB2.0协议的要求,应用困难。
发明内容
本申请实施例公开了一种通信装置及数据传输方法,在增加通信装置管脚带宽使用率的同时可以有效降低数据传输延时;同时,数据的传输不受物理链路传输形式的限制;此外,与现有技术相比还能节省芯片面积和硬件成本。
第一方面,本申请实施例公开了一种通信装置,包括:通用串行总线USB协议层、USB适配层、传输层和物理层;USB协议层,用于向USB适配层发送第一数据;USB适配层,用于对第一数据进行物理链路适配得到第二数据,并向传输层发送第二数据;其中,第一数据适配第一物理链路,第二数据适配第二物理链路;第一物理链路的带宽低于第二物理链路的带宽;第二数据通过传输层和物理层处理之后,通过第二物理链路发送给接收端。
应当理解,上述第二物理链路的协议可以是现有协议或本领域技术人员设定的一套数据交互的通信方法;第一物理链路的协议可以是USB2.0协议,其遵循USB收发器宏单元接口(usb transeiver macrocell interface,UTMI)协议或UTMI减少管脚的接口(UTMI Low Pin  Interface,ULPI)协议。
可以看出,在本申请实施例中,当上述通信装置与接收端通信时,首先通过USB适配层对第一数据进行物理链路适配,将在第一物理链路上传输的第一数据转化为在第二物理链路上传输的第二数据,第二物理链路为带宽高于第一物理链路的高速物理链路。由于本申请实施例将USB协议层所发送的第一数据(协议层数据)进行转换,得到可以在第二物理链路上传输的数据,然后通过传输层、物理层和第二物理链路进行传输并发送到接收端,无需经过与USB协议层相匹配的USB物理层和管脚,因而无需在上述通信装置中配置该USB物理层和管脚,可以节省USB物理层和管脚的芯片面积和增加USB物理层和管脚的成本。进一步的,由于数据的传输无需经过USB物理层,可以减少数据传输的中间环节,因而可以有效降低接收端的接收延时,以满足通信协议低延时的要求,应用容易;此外,当第一物理链路的协议是USB2.0协议时,第一物理链路的物理形态为有线形式,而本申请实施例中通过对第一数据进行物理链路适配,可以将得到的第二数据在高速的第二物理链路进行传输,由于该第二物理链路不受物理形态的限制,即可以为有线或无线形式,因而本申请实施例中的通信装置适应性好,可以适用于不同的应用场景。应当理解,本申请实施例中传输层与物理层与USB协议层和USB适配层集成在同一个通信装置中,在一种可选的情况中,传输层与物理层可以位于独立的转接器或交换机中,也即USB协议层和USB适配层在通信装置中,USB协议层和USB适配层对数据进行处理后,发送给转接器或交换机,由转接器或交换机的传输层和物理层处理之后,通过高速物理链路传输给与目标装置,该目标装置也可以通过转接器或交换机连接到该高速物理链路。
在一种可行的实施方式中,上述第一数据包括令牌包、握手包或特殊包中的任意一种,USB适配层具体用于:按照上述第二物理链路的协议对第一数据进行封装,得到第一传输包;第二数据包含第一传输包。
可以看出,在本申请实施例中,当第一数据中包含令牌包、握手包或特殊包中任意一种时,USB适配层直接将第一数据作为一个数据净荷进行封装,得到与第二物理链路相适配的第一传输包,从而便于后续通过第二物理链路传输第一传输包,而无需利用与USB协议层相匹配的USB物理层、管脚和第一物理链路进行传输,从而可以有效降低接收端的接收延时,并且可以节省USB物理层和管脚的芯片面积和相关成本。
在一种可行的实施方式中,上述第一数据包括数据包,USB适配层具体用于:将数据包拆分为多个第一数据净荷,并按照上述第二物理链路的协议对多个第一数据净荷分别进行封装,得到多个第二传输包;第二数据包含多个第二传输包。
可以看出,在本申请实施例中,对于数据量较大的数据包,USB适配层可以将其拆分为多个第一数据净荷,然后对该多个第一数据净荷分别进行封装,得到多个第二传输包,由于每个第二传输包的数据量较小,因而可以有效降低接收端的接收延时,以满足通信协议低延时的要求。
在一种可行的实施方式中,上述第一数据还包括总线事件,USB适配层具体用于:当 总线事件到来时,按照上述第二物理链路的协议对总线事件的开始部分进行封装,得到第三传输包;传输层和物理层具体用于对第三传输包进行处理后通过第二物理链路发送给接收端;USB适配层具体还用于:当总线事件结束时,按照上述第二物理链路的协议对总线事件的结束部分进行封装,得到第四传输包;传输层和物理层具体用于对第四传输包进行处理后通过第二物理链路发送给接收端。
可以看出,在本申请实施例中,在上述通信装置封装总线事件过程中,通过分别封装总线事件的开始和结束部分,而未封装总线事件的中间部分,来降低接收端的接收延时,以满足通信协议低延时的要求。
在一种可行的实施方式中,上述USB协议层,还用于向USB适配器发送控制信息;USB适配层,还用于:从控制信息中解析出第一虚拟电阻信息;以及对第一虚拟电阻信息进行封装,得到第五传输包;传输层和物理层具体用于对第五传输包进行处理后通过第二物理链路发送给接收端;第一虚拟电阻信息用于通过描述通信装置中虚拟电阻的导通或关断状态来表征虚拟总线状态,虚拟总线为与USB协议层相匹配的总线,通信装置中虚拟电阻与实体电阻相对应,实体电阻包含高速匹配电阻、上拉电阻或下拉电阻中的至少一个。
在一种可行的实施方式中,上述第一虚拟电阻信息还包含高阻(High-Z)信息,高阻信息用于表征高阻的导通或关断状态,高阻用于表征通信装置和接收端之间的连接状态。当通信装置和接收端建立通信连接时,高阻处于断开状态;当通信装置和接收端未建立通信连接时,高阻处于导通状态。
可以看出,现有技术中,USB协议层数据通过USB物理层和管脚进行传输,而在本申请实施例中,USB协议层数据通过USB适配层进行物理链路适配后,可以无需在通信装置中配置USB物理层和管脚,即此时不存在USB物理层中的实体电阻。而USB协议层需要获取USB物理层中的电阻的信息实现对总线状态的上报,本申请实施例通过引入与USB物理层中实体电阻相对应的虚拟电阻,通过虚拟电阻信息来表征虚拟总线状态,从而满足USB协议层对总线状态的上报需求,使得本申请实施例相对于现有技术对通信装置所进行的改进对于USB协议层不可见或透明,即在现有技术,USB协议层接收和发送的数据与和本申请实施例中USB协议层接收和发送的数据对应相同,以满足USB协议层的通信要求。应当理解,第一虚拟电阻是从USB协议层向USB适配层发送的控制信息中获取的,第二虚拟电阻信息是从第六传输包中获取的,第一虚拟电阻信息和第二虚拟电阻信息会储存在本地并进行更新或维护,第一虚拟电阻信息和第二虚拟电阻信息在本地的存储单元不限定于寄存器。
在一种可行的实施方式中,上述第一传输包、第二传输包、第三传输包、第四传输包和第五传输包均包括包头和数据净荷,包头包含对应的传输包的类型信息、数据净荷的长度信息和可靠性保护信息。
可以看出,在本申请实施例中,对于包含不同内容的第一数据,USB适配层可以将其封装为相同格式的传输包,从而使得不同类型的第一数据在进行物理链路适配后得到对应传输包的格式相同,便于后续在公共的第二物理链路上传输,从而实现通信装置与接收端 进行通信的功能。
在一种可行的实施方式中,上述物理层和传输层,还用于对通过第二物理链路接收的第三数据进行处理后,发送给USB适配层;USB适配层,还用于对处理后的第三数据进行物理链路适配得到第四数据,并将第四数据发送至USB协议层;其中,第三数据适配第二物理链路,第四数据适配第一物理链路。
可以看出,在本申请实施例中,通信装置中的USB适配层还可以对经过处理后的第三数据进行物理链路适配得到第四数据,即对处理后的第三数据进行还原得到第四数据。综合前述实施例可以看出,本申请中的通信装置既可以向接收端发送数据,也可以对接收端发送的数据进行还原,并将还原后的数据发送给USB协议层,从而实现通信装置与接收端进行双向数据传输的功能。
在一种可行的实施方式中,上述处理后的第三数据包含一个或多个传输包,USB适配层具体用于:对一个或多个传输包的包头分别进行解析,得到一个或多个传输包的类型信息;当一个或多个传输包为数据包时,将一个或多个传输包对应的一个或多个数据净荷进行聚合,得到第四数据;当一个或多个传输包不为数据包时,将一个或多个传输包对应的一个或多个数据净荷分别作为第四数据。
可以看出,在本申请实施例中,USB适配层可以对接收到的多个传输包进行对应的还原,具体地:对于封装时单独作为数据净荷进行封装的第一数据,则将其数据净荷作为第四数据;对于封装时拆分为多个数据净荷进行封装的第一数据,可以将被拆分的多个数据净荷进行聚合,将聚合后的数据作为第四数据。通过上述还原过程,可以将第三数据的还原过程与第一数据的封装过程相对应,从而实现通信装置和接收端之间的正常通信。
在一种可行的实施方式中,上述物理层和传输层,还用于对通过第二物理链路接收的第六传输包进行处理后,发送给USB适配层;USB适配层,还用于接收处理后的第六传输包,并对处理后的第六传输包进行解析,得到第二虚拟电阻信息;第二虚拟电阻信息包括接收端中虚拟电阻的导通或关断状态,第二虚拟电阻信息用于表征虚拟总线状态,接收端中的虚拟电阻与实体电阻相对应,实体电阻包含高速匹配电阻、上拉电阻或下拉电阻中的至少一个。
可以看出,在本申请实施例中,通信装置还可以接收包含第二虚拟电阻信息的第六传输包,并从第六传输包中解析出第二虚拟电阻信息,本申请实施例通过接收第二虚拟电阻信息来取代直接检测总线上的实体电阻的导通或关断状态,然后通过虚拟电阻信息来表征虚拟总线状态,从而满足USB协议层对总线状态的上报需求。
在一种可行的实施方式中,上述USB适配层还用于:当USB适配层接收第一数据时,根据第一数据的内容确定虚拟总线状态;当USB适配层发送第四数据时,根据第四数据的内容确定虚拟总线状态;当USB适配层未接收第一数据时且未发送第四数据时,根据第一虚拟电阻信息和第二虚拟电阻信息确定虚拟总线状态;向USB协议层发送当前虚拟总线状 态。
可以看出,在本申请实施例中,在不同的数据传输场景下,可以通过不同的规则确定虚拟总线状态,从而满足USB协议层对于接收虚拟总线状态信息的需求。由于本申请实施可以去掉USB物理层和管脚,所以不存在实体电阻和USB2.0总线,从而引入虚拟电阻来表征USB物理层中实体电阻,引入虚拟总线来表征USB2.0总线,当USB适配层未接收第一数据时且未发送第四数据时,可以根据向接收端发送的第一虚拟电阻信息和从接收端接收的第二虚拟电阻信息来确定虚拟总线状态,并将虚拟总线状态发送给USB协议层,从而满足USB协议层对总线状态的上报需求。
在一种可行的实施方式中,上述USB适配层还用于:根据虚拟总线状态确定通信装置下一时刻的工作状态;其中,工作状态包括以下至少一项:USB协议层是否发送第一数据或是否接收第六数据,当USB协议层发送第一数据时,第一数据包含的内容,或者当USB协议层发送控制信息时,USB适配层从控制信息中解析出的第一虚拟电阻信息。
可以看出,在本申请实施例中,USB协议层可以通过接收到的虚拟总线状态确定USB协议层向USB适配层发送的控制信息,USB适配层根据接收到的控制信息确定下一时刻通信装置的工作状态,从而实现通信装置的通信功能。
第二方面,本申请提供了一种数据传输方法,包括:通过通用串行总线USB协议层向USB适配层发送第一数据;由USB适配层对第一数据进行物理链路适配得到第二数据,并向传输层发送第二数据;其中,第一数据适配第一物理链路,第二数据适配第二物理链路;第一物理链路的带宽低于第二物理链路的带宽;通过传输层和物理层对第二数据进行处理,由第二物理链路将处理后的第二数据发送给接收端。
在一种可行的实施方式中,上述第一数据包括令牌包、握手包或特殊包中的任意一种,由USB适配层对第一数据进行物理链路适配得到第二数据,包括:由USB适配层对第一数据进行封装,得到第一传输包;第二数据包含第一传输包。
在一种可行的实施方式中,上述第一数据包括数据包,由USB适配层对第一数据进行物理链路适配得到第二数据,包括:通过USB适配层将数据包拆分为多个第一数据净荷,并对多个第一数据净荷分别进行封装,得到多个第二传输包;第二数据包含多个第二传输包。
在一种可行的实施方式中,上述第一数据还包括总线事件,上述由USB适配层对第一数据进行物理链路适配得到第二数据,包括:当总线事件到来时,通过USB适配层对总线事件的开始部分进行封装,得到第三传输包;上述通过传输层和物理层对第二数据进行处理后通过第二物理链路发送给接收端,包括:通过传输层和物理层对第三传输包进行处理后通过第二物理链路发送给接收端;上述第一数据还包括总线事件,上述由USB适配层对第一数据进行物理链路适配得到第二数据,还包括:当总线事件结束时,通过USB适配层对总线事件的结束部分进行封装,得到第四传输包;上述通过传输层和物理层对第二数据进行处理后通过第二物理链路发送给接收端,还包括:通过传输层和物理层对第四传输包进行处理,通过第二物理链路将处理后的第四传输包发送给接收端。
在一种可行的实施方式中,上述方法包括:通过USB协议层向USB适配器发送控制信息;通过USB适配层从控制信息中解析出第一虚拟电阻信息;以及对第一虚拟电阻信息进行封装,得到第五传输包;通过传输层和物理层对第五传输包进行处理,通过第二物理链路将处理后的第五传输包发送给接收端;第一虚拟电阻信息用于通过描述通信装置中虚拟电阻的导通或关断状态来表征虚拟总线状态,虚拟总线为与USB协议层相匹配的总线,通信装置中虚拟电阻与实体电阻相对应,实体电阻包含高速匹配电阻、上拉电阻或下拉电阻中的至少一个。
在一种可行的实施方式中,上述第一传输包、第二传输包、第三传输包、第四传输包和第五传输包均包括包头和数据净荷,包头包含对应的传输包的类型信息、数据净荷的长度信息和可靠性保护信息。
在一种可行的实施方式中,上述方法还包括:通过物理层和传输层对通过第二物理链路接收的第三数据进行处理,并将处理后的第三数据发送给USB适配层;通过USB适配层对处理后的第三数据进行物理链路适配得到第四数据,并将第四数据发送至USB协议层;其中,第三数据适配第二物理链路,第四数据适配第一物理链路。
在一种可行的实施方式中,上述处理后的第三数据包含一个或多个传输包,通过USB适配层对处理后的第三数据进行物理链路适配得到第四数据,包括:通过USB适配层对一个或多个传输包的包头分别进行解析,得到一个或多个传输包的类型信息;当一个或多个传输包为数据包时,通过USB适配层将一个或多个传输包对应的一个或多个数据净荷进行聚合,得到第四数据;当一个或多个传输包不为数据包时,通过USB适配层将一个或多个传输包对应的一个或多个数据净荷分别作为第四数据。
在一种可行的实施方式中,上述方法还包括:通过物理层和传输层对通过第二物理链路接收的第六传输包进行处理,并将处理后的第六传输包发送给USB适配层;通过USB适配层接收处理后的第六传输包,并对处理后的第六传输包进行解析,得到第二虚拟电阻信息;第二虚拟电阻信息包括接收端中虚拟电阻的导通或关断状态,第二虚拟电阻信息用于表征虚拟总线状态,接收端中的虚拟电阻与实体电阻相对应,实体电阻包含高速匹配电阻、上拉电阻或下拉电阻中的至少一个。
在一种可行的实施方式中,上述方法还包括:当USB适配层接收第一数据时,USB适配层根据第一数据的内容确定虚拟总线状态;当USB适配层发送第四数据时,USB适配层根据第四数据的内容确定虚拟总线状态;当USB适配层未接收第一数据时且未发送第四数据时,USB适配层根据第一虚拟电阻信息和第二虚拟电阻信息确定虚拟总线状态;由USB适配层向USB协议层发送当前虚拟总线状态。
在一种可行的实施方式中,上述方法还包括:由USB协议层根据虚拟总线状态确定通信装置下一时刻的工作状态;其中,工作状态包括以下至少一项:USB协议层是否发送第一数据或是否接收第六数据,当USB协议层发送第一数据时,第一数据包含的内容,或者当USB协议层发送控制信息时,USB适配层从控制信息中解析出的第一虚拟电阻信息。
第三方面,本申请实施例提供了一种终端设备,包括上述第一方面中的任意一种实施方式所提供的通信装置以及耦合于该通信装置的分立器件。
第四方面,本申请实施例提供了一种通信装置,其特征在于,上述通信装置包含处理器和接口电路,处理器可以运行计算机程序来通过该接口电路实现如上述第二方面中任意一项所述的数据传输方法流程。
第五方面,本申请提供一种计算机存储介质,该计算机存储介质存储有计算机程序,该计算机程序被通信装置执行时实现上述第二方面中任意一项所述的数据传输方法流程。
第六方面,本发明实施例提供了一种计算机程序,该计算机程序包括指令,当该计算机程序被上述通信装置执行时,使得通信装置可以执行上述第二方面中任意一项所述的数据传输方法流程。
附图说明
图1是本申请实施例提供的一种USB总线的树形拓扑结构示意图;
图2是本申请实施例提供的一种通信系统的结构示意图;
图3A是本申请实施例提供的另一种通信系统的结构示意图;
图3B是本申请实施例提供的又一种通信系统的结构示意图;
图4是本申请实施例提供的一种通信系统中的虚拟电阻模型的结构示意图;
图5是本申请实施例提供的一种数据包的拆分和封装过程示意图;
图6是本申请实施例提供的再一种通信系统的结构示意图;
图7是本申请实施例提供的又一种通信系统的结构示意图;
图8是本申请实施例提供的一种多个通信装置进行通信的场景示意图;
图9是本申请实施例提供的一种数据传输方法的流程示意图;
图10是本申请实施例提供的一种示例性的终端的架构示意图;
图11是本申请实施例提供的一种处理器的架构图。
具体实施方式
下面结合本申请实施例中的附图对本申请实施例进行描述。本申请的说明书和权利要求书及所述附图中的术语“第一”、“第二”、“第三”和“第四”等是用于区别不同对象,而不是用于描述特定顺序。此外,术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其它步骤或单元。在本文中提及“实施例”意味着,结合实施例描述的特定特征、结构或特性可以包含在本申请的至少一个实施例中。在说明书中的各个位置出现该短语并不一定均是指相同的实施例,也不是与其它实施例互斥的独立的或备选的实施例。本领域技术人员显式地和隐式地理解的是,本文所描述的实施例可以与其它实施例相结合。
请参见图1,图1是本申请实施例提供的一种USB总线的树形拓扑结构示意图。如图1所示,图1中包含四个设备:主机Host、集线器1(Hub-1)、集线器2(Hub-2)和设备Device。Host位于根节点,Host的下行口与Hub-1的上行口通过USB总线D+/D-相连,Hub-1的两 个下行口通过USB总线分别与Hub-2和Device的上行口相连。图1中的总线拓扑结构对应Host、Hub和Device三种设备的具体连接方式,应当理解,图1只是本申请实施例给出的一个具体示例,USB总线的具体拓扑结构可根据具体应用场景确定,例如Host设备也可直接与Device设备相连,本申请对此不做具体限定。
其中,主机Host负责管理连接到总线的所有Hub和Device,可以包含一个或多个下行口(downstream port),可以是电脑、平板或手机等设备;Hub提供USB接口的扩展能力,包含一个上行口(upstream port)和多个下行口;Device提供特定的功能,可以是移动式存储设备,如U盘或硬盘等,本申请实施例对此不做具体限定,包含一个上行口。
请参见图2,图2是本申请实施例提供的一种通信系统200的结构示意图。如图2所示,通信系统200包含通信装置210、目标装置220、适配装置230和适配装置240。通信装置210通过适配装置230、第二物理链路和适配装置240与目标装置220进行连接以进行通信。通信装置210和目标装置220之间传输的数据可以是USB2.0数据。依据具体的应用场景,该高速的第二物理链路可以配置为有线形式(例如铜线或光纤)或无线形式(例如无线信道)。
可选地,通信装置210和目标装置220可以是主机Host(如电脑、手机、平板等)或设备Device(如U盘或硬盘等);通信装置210和目标装置220既可以作为上行口,也可作为下行口,当通信装置210作下行口时,目标装置220作上行口;当通信装置210作上行口时,目标转置220作下行口。适配装置230和适配装置240可以是转接器或交换机等。
如图2所示,第二物理链路两侧的装置的结构和功能对应相同,因而下面以第二物理链路左侧的各装置和公共传输路径为例来描述其内部结构、功能,以及相应的数据传输过程。
可选地,通信装置210包含USB协议层(protocol layer)211和USB物理层(physical layer,PHY)212,此外通信装置210还可以包含应用层(未示出);适配装置230包含USB物理层213、USB适配层214、传输层215和物理层216。
可选地,上述通信装置210、适配装置230中的各层为逻辑功能上的划分,并包含对应的硬件结构(电路)。通信装置210中的应用层(图2未示出)可以为用于通信的应用程序和用于消息传输的底层网络提供接口,应用层可以是软件和硬件的结合;USB协议层211规定了主机Host与设备Device之间进行交互的语言结构和规则,USB协议层211对应的硬件结构可以集成在USB控制器中,USB协议层可以接收应用层所发送的USB2.0数据,USB协议层212与USB物理层212之间通过标准的UTMI接口进行数据传输;USB物理层212通过UMTI接口接收USB2.0数据,并将USB2.0数据转换成相应的模拟信号,物理层可以为通信装置之间的数据通信提供传输媒体及互连设备,为数据传输提供可靠的环境,即物理层确保原始的数据可以在各种物理媒介上传输;通信装置210和适配装置230之间通过标准的USB接口(D+/D-)进行连接,即USB物理层212传输的模拟信号通过USB接口传输到USB物理层213;USB物理层213将接收到的模拟信号转换成数字信号后通过UTMI接口传输到USB适配层214;USB适配层214将数字信号形式的USB2.0数据进行适配以便在公共传输路径和第二物理链路上传输;传输层215用于不同协议的数据提供统一的传输 接口和统一的数据传输格式,为不同协议的数据提供调度服务质量(quality of service,QOS)保证、带宽分配、流量控制、功耗管理、连接管理等公共的功能。
以上描述了通信装置210与目标装置220进行数据传输时,通过适配装置230发送数据的过程;通信装置210通过适配装置230接收数据的过程与上述过程相反,此处不再赘述。同理,目标装置220通过适配装置240接收和发送数据的过程与通信装置210对应过程相同,不再赘述。
如图3A所示,图3A是本申请实施例提供的另一种通信系统300的结构示意图。如图3A所示,通信系统300包含通信装置310和目标装置320,通信装置310和目标装置320通过高速的第二物理链路进行通信,通信装置310包括USB协议层(protocol layer)311、USB适配层(adapter layer)312、传输层(transport layer)313和物理层(physical layer,PHY)314,目标装置320包括USB协议层321、USB适配层322、传输层323和物理层324。应当理解,通信装置310包含的各层的功能与目标装置320包含的层的功能对应相同,上述两个装置中的各层为逻辑功能上的划分,各层都包含对应的物理电路(结构)。通信装置310和目标装置320中任一装置既可作为上行口,也可作为下行口,本申请对此不做具体限定。此时,目标装置320也可称为接收端。
可选地,通信装置310和目标转置320可以是主机Host(如电脑、手机、平板等)、集线器Hub或设备Device(如U盘或硬盘等),本申请对此不做具体限定。例如,通信装置310可以是电脑,目标装置320可以是U盘,此时,通信系统300即是表征电脑和U盘进行数据传输的场景。
可选地,通信装置310和目标装置320还可以分别包含应用层(图3A未示出),其结构和功能可以与图2实施例中应用层的结构和功能相同,此处不再赘述。
下面以通信系统300中的USB协议层和USB适配层所适配的协议为USB2.0协议为例(即第一物理链路的协议为USB2.0协议),以通信装置310为对象来详细描述其发送和接收数据的过程:
一、通信装置310向目标装置320发送数据的场景
USB协议层311,用于向USB适配层312发送第一数据。USB协议层311规定了USBHost与USBDevice交互时的语法和协议,其中定义了字段(field)、包(packet)、事物(transaction)和传送(transfers)的结构,以及由字段到包、由包到事物、由事物到传送所组成的组织层次关系,此时的第一数据也可以称为USB2.0数据;其中,包是USB总线上数据传输的基本单元,USB2.0协议规定了四种类型的包:令牌包(TokenPacket)、数据包(Data Packet)、握手包(Handshake packet)和特殊包(Special Packet)。令牌包只能是从主机发出;数据包和握手包可由主机Host发出,也可是设备Device发出。每个包由不同的域组成,所有的包都以同步(Synchronization,SYNC)域开始,以包结束(End of Packet,EOP)信号作为结束。包的传输不能被打断或干扰,否则会引发错误;若干个包组成一次事务传输,一次事务传输也不能打断,属于一次事务传输的几个包必须连续;一次传送由一次到多次事务传输构成。
USB适配层312,用于对第一数据进行物理链路适配得到第二数据,并向传输层发送第二数据;其中,第一数据适配第一物理链路(图3A未示出),第二数据适配第二物理链路,第一物理链路带宽低于第二物理链路的带宽,上述第一数据为协议层数据。
可选地,上述第二数据通过传输层和物理层处理之后,通过第二物理链路发送给接收端。
可选地,USB适配层312包含对应的物理电路(结构),可以集成在USB控制器中,USB适配层312可以根据第二物理链路的协议对USB协议层311发送的第一数据进行物理链路适配,得到适合于在高速的第二物理链路上传输的第二数据,从而将第一数据复用到高速物理链路上进行传输,也即将USB2.0数据复用到高速物理链路上进行传输;其中,第二物理链路的协议可以是现有的通信协议,也可以是本领域技术人员设定的一套数据交互的通信方法,本申请对此不做具体限定。
可选地,第一物理链路可以为USB2.0协议所规定的物理链路,或者说,第一物理链路为原始的USB2.0协议数据的传输链路,其物理形态为有线形式,如铜线等,其传输速率可以为480Mbps、12Mbps或1.5Mbps;第二物理链路为带宽高于第一物理链路的高速物理链路,第二物理链路的物理形态可以根据具体的应用场景进行配置,可以为有线或无线形式,例如,铜线、无线信道或光纤等。
举例来说,当第二物理链路的物理形态为有线形式,通信装置为电脑,目标装置为U盘时,在通信装置与目标装置进行数据传输时,第二物理链路可以是U盘和电脑USB接口连接时相接触的金属片(一般为铜)。
可选地,传输层313和物理层314分别包含对应的物理电路(结构),传输层313可以接收不同协议适配层向其传输的数据(图3A中仅示出一种协议的适配层),并提供统一的传输接口和数据传输格式,即将第二数据的传输格式转换成第二物理链路协议所规定的传输格式;此外,传输层313还可以提供调度服务质量保证(quality of service,QOS)、带宽分配、流量控制、功耗管理、连接管理等公共的功能。物理层314可以根据设定的物理链路形态提供相应的线路编码、信道编码、电气信号指标的要求,物理层314可细分为物理编码子层(physical coding sublayer,PCS)和物理媒介连接子层(physical media attachment layer,PMA),或分为逻辑层(logical layer)和电气层(electrical layer),物理层314具体可用于进行数模转换,即将用数字信号表示的第二数据转换成对应模拟信号。
在一种可行的实施方式中,上述第一数据包括令牌包、握手包或特殊包中的任意一种,USB适配层312具体用于:对第一数据进行封装,得到第一传输包;第二数据包含第一传输包。
可选地,上述第一数据具体可以包括USB2.0协议中的令牌包(token packet)、握手包(handshake packet)和特殊包(special packet)中的任意一种。
具体地,上述USB适配层312可以根据第二物理链路的协议对第一数据进行封装,得到第一传输包,从而使得第一传输包可以在第二物理链路上进行传输。
在一种可行的实施方式中,上述第一数据包括数据包,USB适配层具体用于:将数据包拆分为多个第一数据净荷,并对多个第一数据净荷分别进行封装,得到多个第二传输包;第二数据包含多个第二传输包。
可选地,上述第一数据具体可以包括USB2.0协议中的数据包(data packet)。
可选地,数据包的拆分和封装规则可以为:将数据包的起始部分,例如起始的1个字节数据(即包的标识符PID部分)或者起始的2个字节数据(包的PID部分和PID后面的1个字节)作为一个第一数据净荷,然后根据预设规则将数据包的剩余部分拆分为一个或多个第一数据净荷,该预设规则可以为根据长度进行平均拆分,本申请对此不做具体限定;然后将拆分得到的所有第一数据净荷分别封装为对应的第二传输包。
在一种可行的实施方式中,上述第一数据还包括总线事件,USB适配层具体用于:当总线事件到来时,对总线事件的开始部分进行封装,得到第三传输包;传输层和物理层具体用于对第三传输包进行处理后通过第二物理链路发送给接收端;USB适配层具体还用于:当总线事件结束时,对总线事件的结束部分进行封装,得到第四传输包;传输层和物理层具体用于对第四传输包进行处理后通过第二物理链路发送给接收端。
具体地,上述总线事件包含USB2.0协议中的ChirpK、ChirpJ或ResumeK中的任意一种。在USB2.0协议中,总线事件为一段电平信号。例如总线事件的电平信号特征可以为:首先从低电平0变化到高电平1,然后在高电平1处持续一段时间,最后从高电平1变化到低电平0。此段电平信号中从低电平0变化到高电平1的部分为总线事件的开始部分,从高电平1变化到低电平0的部分为总线事件的结束部分,高电平1处的持续时间段为总线事件的中间部分。本申请实施例可以依据上述示例的规则来确定三种总线事件各自的开始部分和结束部分。
可选地,上述USB2.0协议中的三种总线事件的开始和结束部分可分别表示为:Chirp K开始(Chirp K Start)、Resume K开始(Resume K Start)、Chirp J开始(Chip J Start)、Chirp K结束(Chirp K End)、Resume K结束(Resume K End)和Chirp J结束(Chirp J End)。当第一数据还包括总线事件时,USB适配层312可以将总线事件的开始部分和结束部分分别进行封装,得到第三传输包和第四传输包,总线事件的中间部分不进行封装,然后通过传输层313、物理层314和第二物理链路分别发送第三传输包第四传输包。此时,传输层和物理层对第三传输包和第四传输包的处理与前述实施例中传输层和物理层对第二数据的处理过程相同,此处不再赘述。
在一种可行的实施方式中,USB协议层,还用于向USB适配器发送控制信息。USB适配层,还用于:从控制信息中解析出第一虚拟电阻信息;以及对第一虚拟电阻信息进行封装,得到第五传输包;传输层和物理层具体用于对第五传输包进行处理后通过第二物理链路发送给接收端。其中,第一虚拟电阻信息用于通过描述通信装置中虚拟电阻的导通或关断状态来表征虚拟总线状态,虚拟总线为与USB协议层相匹配的总线,通信装置中虚拟电阻与实体电阻相对应,实体电阻包含高速匹配电阻、上拉电阻或下拉电阻中的至少一个。
其中,由于本申请实施例中的通信装置310可以不包含USB2.0物理层和USB2.0管脚,因而不存在USB2.0物理层中的实体电阻,从而引入第一虚拟电阻来替代USB2.0物理层中的实体电阻,以便于后续根据虚拟电阻信息确定虚拟总线状态,进而通过上报虚拟总线状态来满足USB2.0协议的通信要求。通信装置310作为上行口和下行口时,其包含的第一虚拟电阻不同,当通信装置310作为下行口时,第一虚拟电阻包含虚拟高速匹配电阻(high speed termination resistor)和虚拟下拉电阻(pulldown resistor);当通信装置310作为上行口时, 第一虚拟电阻包含虚拟高速匹配电阻和虚拟上拉电阻(pullup resistor)。同时,由于本申请实施例中的通信装置310也可以不包含实体USB2.0总线,因而引入虚拟总线来替代实体的USB2.0总线,虚拟总线为与USB2.0协议层相匹配的总线,即虚拟的USB2.0总线,进而采用虚拟总线状态来代替实际的USB2.0总线状态,以满足USB2.0协议对于总线状态实时上报的要求。
可选地,上述第一虚拟电阻信息还包含高阻(High-Z)信息,高阻信息用于表征高阻的导通或关断状态,高阻用于表征通信装置310和目标装置320(即接收端)之间的连接状态。当通信装置310和目标装置320建立通信连接时,高阻处于断开状态;当通信装置310和目标装置320未建立通信连接时,高阻处于导通状态。其中,通信连接可以指有线或无线连接,本申请对此不做具体限定。
请参见图3B,图3B为本申请实施例提供的又一种通信系统300的结构示意图,作为对图3A中通信场景的补充。如图3B所示,图3B中包含通信装置310、目标装置320、目标装置330和目标装置340。
在图3B中,通信装置310通过连接目标装置320来进行连接能力的扩展,从而与多个设备Device(图3B中仅示出了两个,即目标装置330和目标装置340)进行通信,此时的目标装置320可以为集线器Hub。目标装置330和目标装置340可以是集线器Hub或设备Device。当目标装置330和目标装置340为集线器Hub时,可进一步提升通信系统300的扩展能力,使得通信装置310可以与多个设备Device进行数据传输。
应当理解,通信装置310可以包含多条第二物理链路,图3B中仅示出一条,本申请对此不做具体限定。集线器Hub可以包含多条扩展的第二物理链路(图3B中仅示出两条),本申请对此不做具体限定。图3B中各装置内的各层结构与功能可以参照图3A中的对应描述,此处不再赘述。
在图3B中,通信装置310与目标装置320、目标装置320与目标装置330、目标装置320与目标装置340之间具体的数据传输过程可以参见图3A实施例中的描述,此处不再赘述。
请参见图4,图4为本申请实施例中一种通信系统300中虚拟电阻模型的结构示意图。下面将以图4为例详细描述通信系统300中包含的虚拟电阻。
通信装置310中包含的虚拟电阻为第一虚拟电阻,目标装置320(即接收端)中包含的虚拟电阻为第二虚拟电阻。如图4所示,当通信装置310作为下行口时,目标装置320作上行口,第一虚拟电阻包含下行口上D+高速匹配电阻、D-高速匹配电阻、D+下拉电阻和D-下拉电阻;第二虚拟电阻包含上行口上的D+高速匹配电阻、D-高速匹配电阻、D+上拉电阻和D-上拉电阻。应当理解,通信装置310和目标装置320既可以作上行口,也可以作下行口;当通信装置310作为上行口,目标装置320作下行口时,第一虚拟电阻和第二虚拟电阻包含的具体虚拟电阻类型与上述描述正好相反,此处不再赘述。
应当注意,第一虚拟电阻信息可以单独进行封装,得到第五传输包,然后发送给目标装置320;也可与总线事件或第一数据共同封装,一同发送到目标装置320,本申请实施例 对此不做具体限定。
可以看出,由于本申请实施例可以不包含USB2.0物理层和管脚,数据的传输无需经过USB2.0物理层,可以减少数据传输的中间环节,因而可以有效降低接收端的接收延时,以满足通信协议低延时的要求,应用容易;同时,还可以有效减少芯片面积和相关成本;此外,本申请实施例通过引入虚拟电阻和虚拟总线来分别替代USB2.0协议中USB2.0物理层中的实体电阻和USB2.0总线,此时第一虚拟电阻信息直接从控制信息中解析得到,无需通过检测获得,速度更快,因而本申请实施例可以有效降低接收端的接收延时,从而更好地满足USB2.0协议的通信要求。其中,虚拟电阻包含第一虚拟电阻和第二虚拟电阻。
在一种可行的实施方式中,上述第一传输包、第二传输包、第三传输包、第四传输包和第五传输包均包括包头和数据净荷,包头包含对应的传输包的类型信息、数据净荷的长度信息和可靠性保护信息。
可选地,一种可行的包头格式可以如表1所示
可靠性保护信息 数据净荷长度信息 传输包类型信息
表1:包头格式示意
如表1所示,对于上述的五类传输包,其包头中包含的信息顺序可以为可靠性保护信息,即循环冗余校验(cyclic redundancy check,CRC)码、数据净荷长度(payload length)信息和传输包类型(type)信息。
其中,循环冗余校验码是一种具有检错、纠错能力的校验码;循环冗余校验是一种根据网络数据包或计算机文件等数据产生简短固定位数校验码的一种信道编码技术,主要用来检测或校验数据传输或者保存后可能出现的错误。传输包的类型包含非数据包(non-data packet)类型、数据包开始(data packet start,DP Start)类型、数据包中间(data packet middle,DPmiddle)类型、数据包结束(data packet end,DPEnd)类型和总线事件(bus event)类型;其中,非数据包类型用于表征令牌包、握手包和特殊包;数据包开始类型、数据包中间类型和数据包结束类型用于表征数据包不同位置的数据;总线事件类型用于表征虚拟电阻信息和总线事件。
可选地,第三传输包、第四传输包和第五传输包中数据净荷的格式可以如表2和表3所示,表2表示下行口的数据净荷格式,表3表示上行口的数据净荷格式。
CRC Rsvd DRoff DRon HS off HS on Hiz on J End JStart K End K Start
表2:下行口数据净荷格式
Figure PCTCN2021074561-appb-000001
表3:上行口数据净荷格式
如表2所示,表2中的数据净荷格式可以用来表示上行口上封装了总线事件或虚拟电 阻信息的传输包中包含的数据净荷,表2所示的数据净荷格式共包含11个信息单元,标识的信息分别为:循环冗余校验码、保留项(Rsvd)、下拉电阻关断(PullDown Resistor off,DR off)、下拉电阻导通(PullDown Resistor on,DR on)、高速匹配电阻关断(High Speed Termination Resistor off,HS off)、高速匹配电阻导通(High Speed Termination Resistor on,HS on)、高阻导通(High-Zon,Hiz on)、总线事件J结束(J End)、总线事件J开始(J Start)、总线事件K结束(K End)、总线事件K开始(K Start)。
如表3所示,表3中的数据净荷格式可以用来表示上行口上封装了总线事件或虚拟电阻信息的传输包中包含的数据净荷,表3所示的数据净荷格式共包含12个信息单元,分别为:循环冗余校验码、D+上拉电阻关断(DM Pullup Resistor off,MRoff)、D+上拉电阻导通(DM Pullup Resistor on,MRon)、D-上拉电阻关断(DP Pullup Resistor off,PRoff)、D-上拉电阻导通(DP Pullup Resistor on,PRon)、高速匹配电阻关断、高速匹配电阻导通、高阻导通、总线事件J结束、总线事件J开始、总线事件K结束、总线事件K开始。
应当注意,D+高速匹配电阻和D-高速匹配电阻同时导通和关断,因而高速匹配电阻在上行口和下行口的数据净荷中用一个信息单元表示;下行口的两个下拉电阻同时导通或关断,因而表2采用两个信息单元来表示下拉电阻的状态,而上行口的两个上拉电阻可以不同时导通或关断,因而表3采用四个信息单元来分别表示两个上拉电阻的状态。表2和表3中的JEnd表示总线事件ChirpJ结束部分、JStart表示总线事件ChirpJ开始部分、K End表示总线事件Chirp K结束部分或Resume K结束部分、K Start表示总线事件Chirp K开始部分或Resume K开始部分。
应当理解,表2和表3只是本申请实施例给出的一种封装了总线事件或虚拟电阻信息的传输包的数据净荷格式的示例,本领域技术人员也可采用其它数据净荷格式表示总线事件和虚拟电阻信息,本申请实施例对此不做具体限定。
请参见图5,图5为本申请实施例提供的一种数据包的拆分和封装过程示意图。如图5所示,数据包的数据结构从开始到结束依次包含同步(synchronization,SYNC)标识、标识符(packet identifier,PID)、多个字节(字节1到末尾字节),以及包结束(end of packet,EOP)分隔符。
如图5所示,数据包可以被拆分成N个数据净荷,标识符PID和字节1为数据净荷1,字节2到末尾字节被拆分为N-1个数据净荷,然后USB适配层312对划分出的N个数据净荷分别进行封装,得到N个第二传输包。每个第二传输包包含对应的包头和数据净荷,其中,第1个第二传输包中包头中包含的传输包类型信息为数据包开始DP Start、第2个第二传输包到第N-1个第二传输包的包头中包含的传输包类型信息为数据包中间DP Middle、第N个第二传输包中包头中包含的传输包类型信息为数据包结束DP End。其中,N为大于或等于2的正整数。
二、通信装置310接收目标装置320所发送数据的场景
在一种可行的实施方式中,上述物理层和传输层,还用于对通过第二物理链路接收的第三数据进行处理后,发送给USB适配层;USB适配层,还用于对处理后的第三数据进行 物理链路适配得到第四数据,并将第四数据发送至USB协议层;其中,第三数据适配第二物理链路,第四数据适配第一物理链路。
具体地,上述物理层314和传输层313对第三数据的处理过程和物理层314和传输层313对第二数据的处理过程正好相反:第二物理链路上传输的是第三数据的模拟信号,物理层314具体可用于将表示第三数据的模拟信号转换成对应的数字信号,传输层313可以用于传输上述转换后的第三数据的数字信号,并将该数字信号的传输格式转换成与USB适配层312相适配的传输格式,也即转换成USB2.0协议所规定的传输格式。
在一种可行的实施方式中,所述处理后的第三数据包含一个或多个传输包,所述USB适配层具体用于:对所述一个或多个传输包的包头分别进行解析,得到所述一个或多个传输包的类型信息;当所述一个或多个传输包为所述数据包时,将所述一个或多个传输包对应的一个或多个数据净荷进行聚合,得到所述第四数据;当所述一个或多个传输包不为所述数据包时,将所述一个或多个传输包对应的一个或多个所述数据净荷分别作为所述第四数据。
具体地,上述USB适配层312在接收到上述一个或多个传输包后,用于对该一个或多个传输包进行还原,得到USB协议层可以接收的第四数据,其过程包括:首先解析该一个或多个传输包的包头,从对应的包头中得到该一个或多个传输包的类型信息;当该一个或多个传输包的类型为数据包时,将DPStart传输包、DPEnd传输包,以及DPStart传输包和DPEnd传输包中间的M个DPMiddle传输包分别包含的数据净荷按顺序进行聚合,得到第四数据;其中,M为大于或等于零的整数;当上述一个或多个传输包为令牌包、特殊包、握手包、总线事件开始或总线事件结束时,将该一个或多个传输包所包含的数据净荷分别作为第四数据。
在一种可行的实施方式中,物理层和传输层,还用于对通过第二物理链路接收的第六传输包进行处理后,发送给USB适配层;USB适配层,还用于接收处理后的第六传输包,并对处理后的第六传输包进行解析,得到第二虚拟电阻信息;第二虚拟电阻信息包括接收端中虚拟电阻的导通或关断状态,第二虚拟电阻信息用来表征虚拟总线状态,接收端中的虚拟电阻与实体电阻相对应,实体电阻包含高速匹配电阻、上拉电阻或下拉电阻中的至少一个。
其中,上述物理层314和传输层313对第六传输包进行处理的过程与对第三数据进行梳理的过程相同,此处不再赘述。上述接收端即为目标装置320,当其作为下行口时,目标装置320中包含的虚拟电阻如图4所示,可以包括下行口虚拟高速匹配电阻和虚拟下拉电阻;当其作为上行口时,虚拟电阻可以包括上行口虚拟高速匹配电阻和虚拟上拉电阻。
上述USB适配层312在接收到处理后的第六传输包后,还用于对其进行还原,得到第二虚拟电阻信息,其过程具体为:对第六传输包的包头进行解析,确定第六传输包的类型,即总线事件类型;根据数据净荷中包含的第二虚拟电阻信息来更新通信装置310中的第二虚拟电阻信息。
可选地,第二虚拟电阻信息还包括高阻(High-Z)信息,其含义与第一虚拟电阻信息中高 阻所表征的含义相同,此处不再赘述。
Figure PCTCN2021074561-appb-000002
表4:虚拟电阻信息与虚拟总线状态对应关系
在一种可行的实施方式中,USB适配层还用于:当USB适配层接收第一数据时,根据第一数据的内容确定虚拟总线状态;当USB适配层发送第四数据时,根据第四数据的内容确定虚拟总线状态;当USB适配层未接收第一数据时且未发送第四数据时,根据第一虚拟电阻信息和第二虚拟电阻信息确定虚拟总线状态;向USB协议层发送当前虚拟总线状态。
具体地,第一数据可以包含令牌包、握手包、特殊包、数据包或总线事件,第四数据也可包含令牌包、握手包、特殊包、数据包或总线事件。
可选地,上述当USB适配层312接收第一数据时,根据第一数据的内容确定虚拟总线状态,具体包括:当USB适配层312从USB协议层311接收令牌包、握手包、特殊包、数据包或总线事件时,根据USB收发器宏单元接口(UTMI)协议,即根据第一数据内容与总线状态之间对应关系确定虚拟总线状态。
可选地,上述当USB适配层312发送第四数据时,根据第四数据的内容确定虚拟总线状态,具体包括:当USB适配层312向USB协议层311发送令牌包、握手包、特殊包、数据包或总线事件时,根据UTMI协议,即根据第四数据内容与总线状态之间对应关系确定虚拟总线状态。例如,当接收的第四数据为总线事件开始部分时,根据总线事件的类型 将虚拟总线状态(line_state)对应确定为K或J;当接收到的第四数据为总线事件结束部分时,将虚拟总线状态确定为SE0(即USB2.0协议中SE0)。UTMI协议中规定的其它USB2.0传输包、总线事件与总线状态之间的对应关系此处不再赘述。
可选地,当USB适配层未接收第一数据时且未发送第四数据时,根据表4中虚拟电阻与虚拟总线状态之间的对应关系确定虚拟总线状态。
现将表4中相关中英文标识进行解释:ON表示导通、OFF表示关断、X表示对虚拟总线的状态的确定没有影响、FS指USB2.0中的全速(full speed)、LS指USB2.0中的低速(low speed)、HS指USB2.0中的高速(high speed)、J态、K态和SE0态相关含义见USB2.0协议,此处不再赘述;虚拟总线状态共包含6种:分别为USB2.0协议中的下行口驱动高阻、上行口驱动高阻、FS默认状态、LS默认状态、HS默认状态和HS握手(handshake)。
在一种可行的实施方式中,USB协议层还用于:根据虚拟总线状态确定通信装置下一时刻的工作状态;其中,工作状态包括以下至少一项:USB协议层是否发送第一数据或是否接收第六数据,当USB协议层发送第一数据时,第一数据包含的内容,或者当USB协议层发送控制信息时,USB适配层从控制信息中解析出的所述第一虚拟电阻信息;或者空闲状态。
具体地,通信装置310下一时刻的工作状态包括以下几种:(1)USB协议层311向USB适配层312发送第一数据,以及该第一数据中包含的具体内容;(2)USB协议层311接收USB适配层312发送的第六数据;(3)USB协议层311向USB适配层312发送控制信息,USB适配层312可以从控制信息中解析出对应的第一虚拟电阻信息;(4)空闲状态,USB USB协议层311既不发送第一数据,也不接收第六数据。
应当注意,上述工作状态的划分是指某一时刻通信装置310的具体行为,下文将参照图6详细介绍通信装置的不同工作模式,工作模式则是指在一段时间内通信装置310的具体行为。
应当理解,目标装置320(接收端)发送数据和接收数据的具体过程与上述通信装置310的具体过程相同,当通信装置310发送数据时,目标装置320接收数据;当目标装置320发送数据时,通信装置310接收数据,因而目标装置320发送和接收数据的过程在本申请实施例中不再赘述。
在一种可行的实施方式中,请参见图6,图6为本申请实施例提供的再一种通信系统300的结构示意图,作为对图3A或图3B或图7或图8中USB适配层的细化。如图6所示,对于通信装置310而言,其USB适配层312包含封装单元3121、控制单元3122、确定单元3123和还原单元3124。
控制单元3122用于接收USB协议层311发送的控制信息,并根据该控制信息确定通信装置310的工作模式,以及从该控制信息中解析出对应的第一虚拟电阻信息;控制单元3122根据所确定的工作模式来控制封装单元3121是否封装第一数据和第一虚拟电阻信息,以及控制还原单元3124是否还原第三数据,以及控制确定单元3123是否进行虚拟总线状态的推断。
封装单元3121用于接收第一数据并对第一数据进行封装,得到第二数据;以及用于当本次解析得到的第一虚拟电阻信息与上一次解析得到的第一虚拟电阻信息不同时,对本次第一虚拟电阻信息进行封装,得到第五传输包。
还原单元3124用于接收第三数据并对第三数据进行还原,得到第四数据,以及接收并对第六传输包进行还原,得到第二虚拟电阻信息,并利用本次得到的第二虚拟电阻信息更新上一次得到的第二虚拟电阻信息。
确定单元3123用于当封装单元3121对第一数据进行封装时,根据UTMI协议中规定的所封装的第一数据内容与总线状态之间对应关系确定虚拟总线状态;用于当还原单元3124向USB协议层311发送第四数据时,根据UTMI协议中规定的第四数据具体内容与总线状态之间对应关系确定虚拟总线状态;用于当封装单元3121未接收第一数据时且还原单元3124未发送第四数据时,根据表4中虚拟电阻与虚拟总线状态之间的对应关系确定虚拟总线状态;用于将虚拟总线状态发送给USB协议层311。
应当理解,目标装置320中的USB适配层322包含的封装单元3221、控制单元3222、确定单元3223、还原单元3224的功能与USB适配层312包含的封装单元3121、控制单元3122、确定单元3123、还原单元3124的功能分别对应相同,此处不再赘述。目标装置320和通信装置310中的包含的各功能单元分别包含对应的硬件电路。
下面将通过表5至表8来详细描述通信装置310在不同控制信息下对应的工作模式,以及不同工作模式下通信装置310的具体行为。
上述控制信息可以包含多种USB2.0协议中的控制信号:utmi_dppulldown、utmi_dmpulldown、utmi_suspendm、utmi_xcvrselect、utmi_termselect、utmi_opmode和utmi_txvaild。该控制信息与UTMI协议中规定的控制信息相同,本申请不再赘述。当utmi_dppulldown或utmi_dmpulldown为1时,通信装置310作下行口,即USB适配层312位于下行口;当utmi_dppulldown或utmi_dmpulldown为0时,通信装置310作上行口,即USB适配层312位于上行口。上述多种控制信号的组合对应通信装置310不同的工作模式。
请参见表5和表6,表5示出通信装置310作下行口时,可以根据utmi_suspendm、utmi_xcvrselect、utmi_termselect、utmi_opmode和utmi_txvaild这五种控制信号的组合确定通信装置310的13种工作模式。表5中“X”表示此信号对工作模式的确定没有影响;下面以信号“01b”为例解释每种信号的含义:“b”表示该信号为二进制格式,“01”表示该信号的具体数值。其余信号值的含义与此类似,不再赘述。
上述的13种工作模式为UTMI协议中下行口的工作模式。如表6所示,表6中的“包”指的是第一数据或第四数据中除总线事件外的其余数据,即指令牌包、握手包、特殊包和数据包中的任意一种。全速、高速和低速分别指USB2.0协议中的full speed(12Mbps)、highspeed(480Mbps)和low speed(1.5Mbps)。“X”指不影响;“data”指令牌包、握手包、特殊包和数据包中的任意一种;“ON”指处于工作状态;“OFF”指处于未工作状态;“OFF/ON”指既可以处于工作状态也可以处于不工作状态;utmi_txdata的信号值“FFh”中,“h”表示该值为十六进制,“FF”表示信号的具体数值。
应当注意,在前序Preamble(发包)工作模式下,如果发送的包为preamble包,那么从 这个包结束到下一个包开始时,虚拟总线状态为USB2.0协议中的全速J态,即FSJ。
下面将举例说明表6中不同工作模式所对应的通信装置的行为,例如“高阻”工作模式表示此时通信装置310未与其它装置建立通信连接,对应高速匹配电阻和下拉电阻均未接通。“待机”工作模式表示通信装置310与目标装置320建立了通信连接,此时只进行总线事件的封装和还原、以及确定虚拟总线状态,对应的高速匹配电阻未接通、下拉电阻接通。全速模式包含表6中所示的全速(空闲)、全速(发包)和全速(发送ResumeK)三种工作模式;高速模式包含表6中所示的高速(空闲)、高速(发包)、高速(发送ChirpJ)和全速(发送Chirp K)四种工作模式;低速模式包含表6中所示的低速(空闲)、低速(发包)和低速(发送Resume K)三种工作模式;其中,“全速(空闲)”工作模式表示此时通信装置310进行总线事件的封装和还原、还原目标装置320发送的令牌包、握手包、特殊包和数据包,以及确定虚拟总线状态,对应的高速匹配电阻未接通、下拉电阻接通;“全速(发包)”工作模式表示此时通信装置310进行总线事件的封装和还原,并封装和还原令牌包、握手包、特殊包和数据包,以及确定总线事件,此时对应的高速匹配电阻未接通、下拉电阻接通;“全速(发送ResumeK)”工作模式表示此时通信装置310进行总线事件ResumeK开始和结束部分的封装和还原,以及确定虚拟总线状态。以上详细说明了的表6中5种工作模式下通信装置310的行为,其余工作模式下通信装置310的行为可具体参见表6,此处不再赘述。
Figure PCTCN2021074561-appb-000003
Figure PCTCN2021074561-appb-000004
表5:下行口控制信息与通信装置工作模式之间的对应关系
Figure PCTCN2021074561-appb-000005
Figure PCTCN2021074561-appb-000006
表6:下行口不同工作模式对应的虚拟电阻信息和控制单元的具体行为
请参见表7和表8,表7示出通信装置310作上行口时,可以根据utmi_suspendm、utmi_xcvrselect、utmi_termselect、utmi_opmode和utmi_txvaild这五种控制信号的组合确定通信装置310的12种工作模式。应当注意,当通信装置310作上行口时,没有前序Preamble(发包)工作模式。表7中各种信号值代表的具体含义与表5中含义的解释规则相同,表8中各信号值所表示的含义与标6中信号值含义的解释规则相同,此处不再赘述。
上述的12种工作模式为UTMI协议中上行口的工作模式。如表8所示,表8中的“包”、“全速”、“低速”和“高速”的含义与表6中相关术语的含义相同,表8中utmi_txdata、虚拟电阻信息和控制单元行为的信号值的解释规则与表6中对应信号值的解释规则相同,此处不再赘述。不同工作模式下,通信装置310的具体行为请参见表8,此处不再赘述。
应当注意,在全速(空闲)工作模式下,如果接收的包为preamble包,那么就对下一个包中的数据进行按位取反,例如,若下一个包中的数据格式为二进制,就将二进制数据位中的0变为1,1变为0;然后从这个包结束到下一个包开始时,虚拟总线状态为全速J态,即FSJ。
应当注意,上行口不存在前序Preamble模式,所以不需要考虑发送Preamble包的情况,但需要考虑接收Preamble包的情况。下行口只需要考虑发送Preamble包的情况,但不需要考虑接收Preamble包的情况。上行口可以选择只支持低速LS模式,或者支持高速HS模式或全速FS模式。通常,上行口选择支持高速HS模式或全速FS模式,不需要考虑支持低速LS模式。低速帧起始包(low speed start of frame,LS SOF/LS Keepalive)只会由下行口发送,所以下行口只需考虑发送LS Keepalive,不需考虑接收LS Keepalive;上行口只需考虑接收LS Keepalive,不需考虑发送LS Keepalive。
应当理解,上述表5到表8是以通信装置310为例说明其作为上行口和下行口时,USB协议层311发送的控制信息与通信装置310工作模式之间的对应关系,以及不同工作模式下通信装置310的具体行为;目标装置320作上行口或下行口进行通信时,其也遵循表5到表8中对应的规则,此处不再赘述。
Figure PCTCN2021074561-appb-000007
Figure PCTCN2021074561-appb-000008
表7:上行口控制信息与通信装置工作模式之间的对应关系
Figure PCTCN2021074561-appb-000009
Figure PCTCN2021074561-appb-000010
表8:上行口不同工作模式对应的虚拟电阻信息和控制单元的具体行为
请参见图7,图7为本申请实施例提供的又一种通信系统300的结构示意图。如图7所示,通信装置310和目标装置320分别包含多种协议的数据传输路径,即上述两个通信装置除包含USB2.0协议的数据传输路径外,还分别包含USB3.0数据传输路径和PCIE协议的数据传输路径。图7中的通信装置310和目标装置320所示出的结构对应相同。
如图7所示,通信装置310包含USB2.0协议数据传输路径、USB3.0协议数据传输路径以及PCIE协议数据传输路径,此三种协议在各自的适配层之上分别包含各自独立的传输数据传输路径,在适配层之下,共用传输层313、物理层314和第二物理链路进行数据传输。USB2.0协议数据传输路径即为图3A中所示传输路径,其具体的数据通信规则已在前述的实施例中进行了详细描述,此处不再赘述。USB3.0协议数据传输路径在传输层313之上包含USB3.0适配层333、USB3.0链路层332和USB3.0协议层331。PCIE协议数据传输路径在传输层313之上包含PCIE适配层344、PCIE逻辑层343、PCIE数据链路层342和PCIE事物层341。上述三种协议的数据传输路径在各自的协议层之上还应包含对应的应用层(未示出)。
应当理解,本申请实施例中的通信装置310既可以是多协议聚合的通信装置(如图7所示,包含USB2.0协议和其它通信协议),也可以是单协议通信装置(如图3A或图3B所示,包含USB2.0协议),本申请对此不做具体限定。此外,对于如图7所示的多协议聚合通信装置310,该装置中的USB2.0协议除了可以与USB3.0协议、PCIE协议进行聚合外,也可与其它一种或多种协议进行聚合,从而实现在公共的高速第二物理链路上传输,本申请对此不做具体限定。
请参见图8,图8为本申请实施例提供的一种使用多个通信装置310进行通信的场景示意图。如图8所示,图8描述了主机Host通过集线器Hub与设备Device建立连接,以进行数据传输的一个场景示意图。应当理解,主机Host可以包含多个接口(图8中仅示出2个),当主机Host接口数量有限时,可以采用如图8所示的方式,即主机Host通过连接集线器Hub来进行连接能力的扩展,从而使得Host可以连接多个设备Device,以便于同时与多个设备Device进行数据传输;当主机Host不需要同时与多个设备进行数据传输时,其可以直接与设备Devcie进行连接以进行数据传输,本申请对此不做具体限定。
下面详细描述在图8所示场景下,不同协议的数据进行传输时的具体传输路径。图8 中包含三种通信装置,分别为主机Host、集线器Hub和设备Device,主机Host与集线器Hub可以通过第二物理链路进行通信,集线器Hub与设备Device可以通过第二物理链路进行通信。图8中的X和Y表示任意其它可以与USB2.0进行聚合的协议,例如,X协议和Y协议可以分别为USB3.0协议和PCIE协议,本申请对此不做具体限定。
在图8所示的主机Host中,包含三种协议的数据传输路径:USB2.0协议、X协议和Y协议。对于USB2.0协议而言,USB2.0数据通过USB应用层1传输到USB协议层1;然后通过USB协议层1传输到USB适配层1或USB适配层2;经过USB适配层1进行物理链路适配的USB2.0数据通过传输层1、物理层1、接口1和第二物理链路(图中未示出)发出;经过USB适配层2进行物理链路适配的USB2.0数据通过传输层2、物理层2、接口2和第二物理链路发送到集线器Hub。对于X协议而言,X协议数据通过X控制器1、X适配层1、传输层2、物理层2、接口2和第二物理链路发送到集线器Hub。对于Y协议,Y协议数据通过Y控制器1、Y适配层1、传输层1、物理层1和接口1进行传输。可以看出,X协议的数据传输路径和USB2.0协议的数据传输路径都包含传输层2和物理层2,Y协议的数据传输路径和USB2.0协议的数据传输路径都包含传输层1和物理层1。应当理解,主机Host中的两条USB2.0数据路径可以等同于图3A或图3B中通信装置310或目标装置320中包含的USB2.0数据路径。
在图8所示的集线器Hub中,包含两种协议的数据传输路径:USB2.0协议数据传输路径和X协议数据传输路径。对于USB2.0协议而言,USB2.0数据通过接口3、物理层3、传输层3、USB适配层3和USB协议层2传输到路由Routing进行处理,再通过USB协议层3传输到USB适配层4或USB适配层5;经过USB适配层4进行物理链路适配的数据通过传输层4、物理层4、接口4和第二物理链路发送到设备Device;经过USB适配层5进行物理链路适配的数据通过传输层5、物理层5、接口5和第二物理链路(未示出)发送到设备Device。在一种可行实施方式中,USB2.0协议数据传输路径还可以保留USB2.0物理层和USB2.0接口(管脚),从而与现有的USB2.0设备进行兼容。对于X协议,X协议数据经过传输层3、物理层3和X适配层2传输到X转换器,X转换器将X协议的数据传输路径扩展为两条,经过X转换器的X协议数据可以发送到X适配层3或X适配层4;通过X适配层3进行物理链路适配后通过传输层5、物理层5、接口5和第二物理链路(未示出)发送到设备Device;通过X适配层4进行物理链路适配后通过传输层4、物理层4、接口4和第二物理链路发送到设备Device。在集线器Hub中还可以包含Y协议的链路,其具体结构可以根据具体应用场景进行定义,本申请对此不做具体限定。
在图8所示的设备Device中,包含三种协议的数据传输路径:USB2.0协议、X协议和Y协议。对于USB2.0协议而言,USB2.0数据通过接口6、物理层6和传输层6传输到USB适配层6,通过USB适配层6还原成USB2.0数据,并发送给USB协议层4和USB应用层2。对于X协议,X协议数据通过接口6、物理层6和传输层6传输到X适配层5,通过X适配层5还原成X协议数据,并将X协议数据发送到X控制器2。对于Y协议,其数据传输过程与X协议对应相同,此处不再赘述。
可选地,主机Host和设备Device中的USB2.0协议的数据传输路径也可以保留USB2.0物理层和USB2.0管脚,从而与现有USB2.0设备进行数据传输。
应当理解,上述实施例仅描述了各协议数据从主机Host传输到设备Device的过程;各协议数据从设备Device传输到主机Host的过程与上述描述的过程类似,此处不再赘述。此外,主机Host、集线器Hub和设备Device之间可以采用有线或无线的形式进行数据传输,当其采用无线信道进行数据传输时,上述三种通信装置可不包含图8中所示出的接口。
请参见图9,图9为本申请实施例提供的一种数据传输方法900的流程示意图。该数据传输方法适用于上述图3A、图3B、图6-图8中的任一种通信装置或目标装置,以及包含上述通信装置或目标装置的设备。该方法900可以包括步骤S901-步骤S903,其中,步骤S901:通过通用串行总线USB协议层向USB适配层发送第一数据;步骤S902:由USB适配层对第一数据进行物理链路适配得到第二数据,并向传输层发送第二数据;其中,第一数据适配第一物理链路,第二数据适配第二物理链路;第一物理链路的带宽低于第二物理链路的带宽;步骤S903:通过传输层和物理层对第二数据进行处理,由第二物理链路将处理后的第二数据发送给接收端。
在一种可行的实施方式中,上述第一数据包括令牌包、握手包或特殊包中的任意一种,由USB适配层对第一数据进行物理链路适配得到第二数据,包括:由USB适配层对第一数据进行封装,得到第一传输包;第二数据包含第一传输包。
在一种可行的实施方式中,上述第一数据包括数据包,由USB适配层对第一数据进行物理链路适配得到第二数据,包括:通过USB适配层将数据包拆分为多个第一数据净荷,并对多个第一数据净荷分别进行封装,得到多个第二传输包;第二数据包含多个第二传输包。
在一种可行的实施方式中,上述第一数据还包括总线事件,由USB适配层对第一数据进行物理链路适配得到第二数据,包括:当总线事件到来时,通过USB适配层对总线事件的开始部分进行封装,得到第三传输包;通过传输层和物理层对第三传输包进行处理,通过第二物理链路将处理后的第三传输包发送给接收端;当总线事件结束时,通过USB适配层对总线事件的结束部分进行封装,得到第四传输包;通过传输层和物理层对第四传输包进行处理,通过第二物理链路将处理后的第四传输包发送给接收端。
在一种可行的实施方式中,上述方法包括:通过USB协议层向USB适配器发送控制信息;通过USB适配层从控制信息中解析出第一虚拟电阻信息;以及对第一虚拟电阻信息进行封装,得到第五传输包;通过传输层和物理层对第五传输包进行处理,通过第二物理链路将处理后的第五传输包发送给接收端;第一虚拟电阻信息用于通过描述通信装置中虚拟电阻的导通或关断状态来表征虚拟总线状态,虚拟总线为与USB协议层相匹配的总线,通信装置中虚拟电阻与实体电阻相对应,实体电阻包含高速匹配电阻、上拉电阻或下拉电阻中的至少一个。
在一种可行的实施方式中,上述第一传输包、第二传输包、第三传输包、第四传输包和第五传输包均包括包头和数据净荷,包头包含对应的传输包的类型信息、数据净荷的长度信息和可靠性保护信息。
在一种可行的实施方式中,上述方法还包括:通过物理层和传输层对通过第二物理链路接收的第三数据进行处理,并将处理后的第三数据发送给USB适配层;通过USB适配 层对处理后的第三数据进行物理链路适配得到第四数据,并将第四数据发送至USB协议层;其中,第三数据适配第二物理链路,第四数据适配第一物理链路。
在一种可行的实施方式中,上述处理后的第三数据包含一个或多个传输包,通过USB适配层对处理后的第三数据进行物理链路适配得到第四数据,包括:通过USB适配层对一个或多个传输包的包头分别进行解析,得到一个或多个传输包的类型信息;当一个或多个传输包为数据包时,通过USB适配层将一个或多个传输包对应的一个或多个数据净荷进行聚合,得到第四数据;当一个或多个传输包不为数据包时,通过USB适配层将一个或多个传输包对应的一个或多个数据净荷分别作为第四数据。
在一种可行的实施方式中,上述方法还包括:通过物理层和传输层对通过第二物理链路接收的第六传输包进行处理,并将处理后的第六传输包发送给USB适配层;通过USB适配层接收处理后的第六传输包,并对处理后的第六传输包进行解析,得到第二虚拟电阻信息;第二虚拟电阻信息包括接收端中虚拟电阻的导通或关断状态,第二虚拟电阻信息用于表征虚拟总线状态,接收端中的虚拟电阻与实体电阻相对应,实体电阻包含高速匹配电阻、上拉电阻或下拉电阻中的至少一个。
在一种可行的实施方式中,上述方法还包括:当USB适配层接收第一数据时,USB适配层根据第一数据的内容确定虚拟总线状态;当USB适配层发送第四数据时,USB适配层根据第四数据的内容确定虚拟总线状态;当USB适配层未接收第一数据时且未发送第四数据时,USB适配层根据第一虚拟电阻信息和第二虚拟电阻信息确定虚拟总线状态;由USB适配层向USB协议层发送当前虚拟总线状态。
在一种可行的实施方式中,上述方法还包括:由USB协议层根据虚拟总线状态确定通信装置下一时刻的工作状态;其中,工作状态包括以下至少一项:USB协议层是否发送第一数据或是否接收第六数据,当USB协议层发送第一数据时,第一数据包含的内容,或者当USB协议层发送控制信息时,USB适配层从控制信息中解析出的第一虚拟电阻信息。
请参阅图10,图10为本申请实施例提供的一种示例性的终端100的架构示意图。应当理解,该终端100可以是前述通信装置310或目标装置320。该终端100可以包括天线系统110、射频(Radio Frequency,RF)电路120、处理器130、存储器140、摄像头150、音频电路160、显示屏170、一个或多个传感器180和无线收发器190等。
天线系统110可以是一个或多个天线,还可以是由多个天线组成的天线阵列。射频电路120可以包括一个或多个模拟射频收发器,该射频电路120还可以包括一个或多个数字射频收发器,该RF电路120耦合到天线系统110。应当理解,本申请的各个实施例中,耦合是指通过特定方式的相互联系,包括直接相连或者通过其他设备间接相连,例如可以通过各类接口、传输线、总线等相连。该射频电路120可用于各类蜂窝无线通信。
处理器130可包括通信处理器,该通信处理器可用来控制RF电路120通过天线系统110实现信号的接收和发送,该信号可以是语音信号、媒体信号或控制信号。该处理器130可以包括各种通用处理设备,例如可以是通用中央处理器(Central Processing Unit,CPU)、片上系统(System on Chip,SOC)、集成在SOC上的处理器、单独的处理器芯片或控制器等;该处理器130还可以包括专用处理设备,例如专用集成电路(Application Specific  Integrated Circuit,ASIC)、现场可编程门阵列(Field Programmable Gate Array,FPGA)或数字信号处理器(Digital Signal Processor,DSP)、专用的视频或图形处理器、图形处理单元(Graphics Processing Unit,GPU)以及神经网络处理单元(Neural-network Processing Unit,NPU)等。该处理器130可以是多个处理器构成的处理器组,多个处理器之间通过一个或多个总线彼此耦合。该处理器可以包括模拟-数字转换器(Analog-to-Digital Converter,ADC)、数字-模拟转换器(Digital-to-Analog Converter,DAC)以实现装置不同部件之间信号的连接。
存储器140耦合到处理器130,具体的,该存储器140可以通过一个或多个存储器控制器耦合到处理器130。存储器140可以用于存储计算机程序指令,包括计算机操作系统(Operation System,OS),各种用户应用程序和用户数据等。处理器130可以从存储器140读取计算机程序指令或用户数据,或者向存储器140存入计算机程序指令或用户数据,以实现相关的处理功能。该存储器140可以是非掉电易失性存储器,例如是EMMC(Embedded Multi Media Card,嵌入式多媒体卡)、UFS(Universal Flash Storage,通用闪存存储)或只读存储器(Read-Only Memory,ROM),或者是可存储静态信息和指令的其他类型的静态存储设备,还可以是掉电易失性存储器(volatile memory),例如随机存取存储器(Random Access Memory,RAM)、静态随机存取存储器(Static random-access memory,SRAM)或者可存储信息和指令的其他类型的动态存储设备,也可以是电可擦可编程只读存储器(Electrically Erasable Programmable Read-Only Memory,EEPROM)、只读光盘(Compact Disc Read-Only Memory,CD-ROM)或其他光盘存储器、光碟存储器(包括压缩光碟、激光碟、数字通用光碟或蓝光光碟等)、磁盘存储介质或者其他磁存储设备,但不限于此。可选的,存储器140可以独立在处理器130之外,存储器140也可以和处理器130集成在一起。
摄像头150用于采集图像或视频,音频电路160与处理器130耦合。该音频电路160可以包括麦克风161和扬声器162,麦克风161可以从外界接收声音输入,扬声器162可以实现音频数据的播放。
显示屏170,用于向用户提供各种显示界面或者可供选择的各种菜单信息,示例性的,显示屏170显示的内容包括但不限于,软键盘、虚拟鼠标、虚拟按键和图标等,这些显示内容与内部的具体模块或功能相关联,显示屏170还可以接受用户输入,具体的,显示屏170可以包括显示面板171和触控面板172。
传感器180可以包括图像传感器、运动传感器、接近度传感器、环境噪声传感器、声音传感器、加速度计、温度传感器、陀螺仪或者其他类型的传感器,以及它们的各种形式的组合。处理器130通过I/O子系统10中的传感器控制器12驱动传感器180接收音频信息、图像信息或运动信息等各种信息,传感器180将接收的信息传到处理器130中进行处理。
无线收发器190,该无线收发器190可以向其他设备提供无线连接能力,其他设备可以是无线耳麦、蓝牙耳机、无线鼠标或无线键盘等外围设备,也可以是无线网络,例如无线保真(Wireless Fidelity,WiFi)网络、无线个人局域网络(Wireless Personal Area Network,WPAN)或者其WLAN等。无线收发器190可以是蓝牙兼容的收发器,用于将处理器130 以无线方式耦合到蓝牙耳机、无线鼠标等外围设备,该无线收发器190也可以是WiFi兼容的收发器,用于将处理器130以无线方式耦合到无线网络或其他设备。
终端100还可以包括其他输入设备14,耦合到处理器130以接收各种用户输入,例如接收输入的号码、姓名、地址以及媒体选择等,其他输入设备14可以包括键盘、物理按钮(按压按钮、摇臂按钮等)、拨号盘或滑动开关等。终端100还可以包括上述的I/O子系统10和电源101。应当理解,图10中的终端100仅仅是一种示例,对终端100的具体形态不构成限定,终端100还可以包括图10中未显示出来的现有的或者将来可能增加的其他组成部分。
请参见图11,图11为本申请实施例提供的一种处理器1600的架构图,该处理器1600可以是图10中处理器。
如图11所示,处理器1600包括:至少一个CPU,存储器,存储器的类型例如可以包括静态随机存取存储器(Static Random-Access Memory,SRAM)和只读存储器(Read-Only Memory,ROM),微控制器(Microcontroller Unit,MCU)、安全子系统、无线局域网(Wireless Local Area Networks,WLAN)子系统、总线、传输接口等。虽然图11中未示出,该装置700还可以包括应用处理器(Application Processor,AP),NPU等其他专用处理器,以及电源管理子系统、时钟管理子系统和功耗管理子系统等其他子系统。
装置1600的上述各个部分通过连接器相耦合,示例性的,连接器包括各类接口、传输线或总线等,这些接口通常是电性通信接口,但是也可能是机械接口或其它形式的接口,本实施例对此不做限定。
可选的,CPU可以是一个单核(single-CPU)处理器或多核(multi-CPU)处理器;可选的,CPU可以是多个处理器构成的处理器组,多个处理器之间通过一个或多个总线彼此耦合。在一种可选的情况中,CPU通过调用片上存储器或者片外存储器中存储的程序指令实现如前述方法实施例中的任一种无线投屏的方法。在一种可选的情况中,CPU和MCU共同实现如前述方法实施例中的任一种无线投屏的方法,例如CPU完成无线投屏的方法中的部分步骤,而MCU完成无线投屏的方法中的其他步骤。在一种可选的情况中,AP或者其他专用处理器通过调用片上存储器或者片外存储器中存储的程序指令实现如前述方法实施例中的任一种无线投屏的方法。
该传输接口可以为处理器芯片的接收和发送数据的接口,该传输接口通常包括多种接口,在一种可选的情况下,该传输接口可以包括内部整合电路(Inter-Integrated Circuit,I2C)接口、串行外设接口(Serial Peripheral Interface,SPI)、通用异步收发机(Universal asynchronous receiver-transmitter,UART)接口、通用输入输出(General-purpose input/output,GPIO)接口等。应当理解,这些接口可以是通过复用相同的物理接口来实现不同的功能。
在一种可选的情况中,传输接口还可以包括高清晰度多媒体接口(High Definition Multimedia Interface,HDMI)、V-By-One接口、嵌入式显示端口(Embedded Display Port,eDP)、移动产业处理器接口(Mobile Industry Processor Interface,MIPI)或Display Port(DP)等。
在一种可选的情况中,上述各部分集成在同一个芯片上;在另一种可选的情况中,存 储器可以是独立存在的芯片。
安全子系统可以用于实现对安全认证的相关加密算法。应当理解,与安全认证的相关加密算法通常是硬件实现的,从而可以进一步提升加密算法的安全性。
WLAN子系统例如可以包括RF电路和基带。
在本申请实施例中涉及的芯片是以集成电路工艺制造在同一个半导体衬底上的系统,也叫半导体芯片,其可以是利用集成电路工艺制作在衬底(通常是例如硅一类的半导体材料)上形成的集成电路的集合,其外层通常被半导体封装材料封装。所述集成电路可以包括各类功能器件,每一类功能器件包括逻辑门电路、金属氧化物半导体(Metal-Oxide-Semiconductor,MOS)晶体管、双极晶体管或二极管等晶体管,也可包括电容、电阻或电感等其他部件。每个功能器件可以独立工作或者在必要的驱动软件的作用下工作,可以实现通信、运算、或存储等各类功能。

Claims (24)

  1. 一种通信装置,其特征在于,包括:通用串行总线USB协议层、USB适配层、传输层和物理层;
    所述USB协议层,用于向所述USB适配层发送第一数据;
    所述USB适配层,用于对所述第一数据进行物理链路适配得到第二数据,并向所述传输层发送所述第二数据;其中,所述第一数据适配第一物理链路,所述第二数据适配第二物理链路;所述第一物理链路的带宽低于所述第二物理链路的带宽;
    所述第二数据通过所述传输层和所述物理层处理之后,通过所述第二物理链路发送给接收端。
  2. 根据权利要求1所述的通信装置,其特征在于,所述第一数据包括令牌包、握手包或特殊包中的任意一种,所述USB适配层具体用于:
    对所述第一数据进行封装,得到第一传输包;
    所述第二数据包含所述第一传输包。
  3. 根据权利要求1或2所述的通信装置,其特征在于,所述第一数据包括数据包,所述USB适配层具体用于:
    将所述数据包拆分为多个第一数据净荷,并对所述多个第一数据净荷分别进行封装,得到多个第二传输包;
    所述第二数据包含所述多个第二传输包。
  4. 根据权利要求1至3任一项所述的通信装置,其特征在于,所述第一数据还包括总线事件,所述USB适配层具体用于:
    当所述总线事件到来时,对所述总线事件的开始部分进行封装,得到第三传输包;
    所述传输层和所述物理层具体用于对所述第三传输包进行处理后通过所述第二物理链路发送给所述接收端;
    所述USB适配层具体还用于:
    当所述总线事件结束时,对所述总线事件的结束部分进行封装,得到第四传输包;
    所述传输层和所述物理层具体用于对所述第四传输包进行处理后通过所述第二物理链路发送给所述接收端。
  5. 根据权利要求1-4中任一项所述的通信装置,其特征在于,
    所述USB协议层,还用于向所述USB适配器发送控制信息;
    所述USB适配层,还用于:
    从所述控制信息中解析出第一虚拟电阻信息;以及
    对所述第一虚拟电阻信息进行封装,得到第五传输包;
    所述传输层和所述物理层具体用于对所述第五传输包进行处理后通过所述第二物理链路发送给所述接收端;
    所述第一虚拟电阻信息用于通过描述所述通信装置中虚拟电阻的导通或关断状态来表征虚拟总线状态,所述虚拟总线为与所述USB协议层相匹配的总线,所述通信装置中虚拟电阻与实体电阻相对应,所述实体电阻包含高速匹配电阻、上拉电阻或下拉电阻中的至少一个。
  6. 根据权利要求2-5中任一项所述的通信装置,其特征在于,所述第一传输包、所述第二传输包、所述第三传输包、所述第四传输包和所述第五传输包均包括包头和数据净荷,所述包头包含对应的传输包的类型信息、数据净荷的长度信息和可靠性保护信息。
  7. 根据权利要求1-5中任一项所述的通信装置,其特征在于,
    所述物理层和所述传输层,还用于对通过所述第二物理链路接收的第三数据进行处理后,发送给所述USB适配层;
    所述USB适配层,还用于对所述处理后的第三数据进行物理链路适配得到第四数据,并将所述第四数据发送至所述USB协议层;其中,所述第三数据适配所述第二物理链路,所述第四数据适配所述第一物理链路。
  8. 根据权利要求7所述的通信装置,其特征在于,所述处理后的第三数据包含一个或多个传输包,所述USB适配层具体用于:
    对所述一个或多个传输包的包头分别进行解析,得到所述一个或多个传输包的类型信息;
    当所述一个或多个传输包为所述数据包时,将所述一个或多个传输包对应的一个或多个数据净荷进行聚合,得到所述第四数据;
    当所述一个或多个传输包不为所述数据包时,将所述一个或多个传输包对应的一个或多个所述数据净荷分别作为所述第四数据。
  9. 根据权利要求7或8所述的通信装置,其特征在于,
    所述物理层和所述传输层,还用于对通过所述第二物理链路接收的第六传输包进行处理后,发送给所述USB适配层;
    所述USB适配层,还用于接收所述处理后的第六传输包,并对所述处理后的第六传输包进行解析,得到第二虚拟电阻信息;所述第二虚拟电阻信息包括所述接收端中虚拟电阻的导通或关断状态,所述第二虚拟电阻信息用于表征所述虚拟总线状态,所述接收端中的虚拟电阻与实体电阻相对应,所述实体电阻包含高速匹配电阻、上拉电阻或下拉电阻中的至少一个。
  10. 根据权利要求9所述的通信装置,其特征在于,所述USB适配层还用于:
    当所述USB适配层接收所述第一数据时,根据所述第一数据的内容确定所述虚拟总线状态;
    当所述USB适配层发送所述第四数据时,根据所述第四数据的内容确定所述虚拟总线 状态;
    当所述USB适配层未接收所述第一数据时且未发送所述第四数据时,根据所述第一虚拟电阻信息和所述第二虚拟电阻信息确定所述虚拟总线状态;
    向所述USB协议层发送所述当前虚拟总线状态。
  11. 根据权利要求10所述的通信装置,其特征在于,所述USB协议层还用于:
    根据所述虚拟总线状态确定所述通信装置下一时刻的工作状态;其中,所述工作状态包括以下至少一项:所述USB协议层是否发送所述第一数据或是否接收所述第六数据,当所述USB协议层发送所述第一数据时,所述第一数据包含的内容,或者当所述USB协议层发送所述控制信息时,所述USB适配层从所述控制信息中解析出的所述第一虚拟电阻信息。
  12. 一种数据传输方法,其特征在于,包括:
    通过通用串行总线USB协议层向USB适配层发送第一数据;
    由所述USB适配层对所述第一数据进行物理链路适配得到第二数据,并向传输层发送所述第二数据;其中,所述第一数据适配第一物理链路,所述第二数据适配第二物理链路;所述第一物理链路的带宽低于所述第二物理链路的带宽;
    通过所述传输层和物理层对所述第二数据进行处理后通过所述第二物理链路发送给接收端。
  13. 根据权利要求12所述的数据传输方法,其特征在于,所述第一数据包括令牌包、握手包或特殊包中的任意一种,所述由所述USB适配层对所述第一数据进行物理链路适配得到第二数据,包括:由所述USB适配层对所述第一数据进行封装,得到第一传输包;所述第二数据包含所述第一传输包。
  14. 根据权利要求12或13所述的数据传输方法,其特征在于,所述第一数据包括数据包,所述由所述USB适配层对所述第一数据进行物理链路适配得到第二数据,包括:通过所述USB适配层将所述数据包拆分为多个第一数据净荷,并对所述多个第一数据净荷分别进行封装,得到多个第二传输包;所述第二数据包含所述多个第二传输包。
  15. 根据权利要求12至14中任一项所述的数据传输方法,其特征在于,
    所述第一数据还包括总线事件,所述由所述USB适配层对所述第一数据进行物理链路适配得到第二数据,包括:
    当所述总线事件到来时,通过所述USB适配层对所述总线事件的开始部分进行封装,得到第三传输包;
    所述通过所述传输层和所述物理层对所述第二数据进行处理后通过所述第二物理链路发送给接收端,包括:
    通过所述传输层和所述物理层对所述第三传输包进行处理后通过所述第二物理链路发 送给所述接收端;
    所述第一数据还包括总线事件,所述由所述USB适配层对所述第一数据进行物理链路适配得到第二数据,还包括:
    当所述总线事件结束时,通过所述USB适配层对所述总线事件的结束部分进行封装,得到第四传输包;
    所述通过所述传输层和所述物理层对所述第二数据进行处理后通过所述第二物理链路发送给接收端,还包括:
    通过所述传输层和所述物理层对所述第四传输包进行处理,通过所述第二物理链路将所述处理后的第四传输包发送给所述接收端。
  16. 根据权利要求12至15中任一项所述的数据传输方法,其特征在于,还包括:
    通过所述USB协议层向所述USB适配器发送控制信息;
    通过所述USB适配层从所述控制信息中解析出第一虚拟电阻信息;以及对所述第一虚拟电阻信息进行封装,得到第五传输包;
    通过所述传输层和所述物理层对所述第五传输包进行处理,通过所述第二物理链路将所述处理后的第五传输包发送给所述接收端;
    所述第一虚拟电阻信息用于通过描述所述通信装置中虚拟电阻的导通或关断状态来表征虚拟总线状态,所述虚拟总线为与所述USB协议层相匹配的总线,所述通信装置中虚拟电阻与实体电阻相对应,所述实体电阻包含高速匹配电阻、上拉电阻或下拉电阻中的至少一个。
  17. 根据权利要求12至15中任一项所述的数据传输方法,其特征在于,所述第一传输包、所述第二传输包、所述第三传输包、所述第四传输包和所述第五传输包均包括包头和数据净荷,所述包头包含对应的传输包的类型信息、数据净荷的长度信息和可靠性保护信息。
  18. 根据权利要求12至15中任一项所述的数据传输方法,其特征在于,所述方法还包括:
    通过所述物理层和所述传输层对通过所述第二物理链路接收的第三数据进行处理,并将所述处理后的第三数据发送给所述USB适配层;
    通过所述USB适配层对所述处理后的第三数据进行物理链路适配得到第四数据,并将所述第四数据发送至所述USB协议层;其中,所述第三数据适配所述第二物理链路,所述第四数据适配所述第一物理链路。
  19. 根据权利要求18中所述的数据传输方法,其特征在于,所述处理后的第三数据包含一个或多个传输包,所述通过所述USB适配层对所述处理后的第三数据进行物理链路适配得到第四数据,包括:
    通过所述USB适配层对所述一个或多个传输包的包头分别进行解析,得到所述一个或 多个传输包的类型信息;
    当所述一个或多个传输包为所述数据包时,通过所述USB适配层将所述一个或多个传输包对应的一个或多个数据净荷进行聚合,得到所述第四数据;
    当所述一个或多个传输包不为所述数据包时,通过所述USB适配层将所述一个或多个传输包对应的一个或多个所述数据净荷分别作为所述第四数据。
  20. 根据权利要求18或19中所述的数据传输方法,其特征在于,所述方法还包括:
    通过所述物理层和所述传输层对通过所述第二物理链路接收的第六传输包进行处理,并将所述处理后的第六传输包发送给所述USB适配层;
    通过所述USB适配层接收所述处理后的第六传输包,并对所述处理后的第六传输包进行解析,得到第二虚拟电阻信息;所述第二虚拟电阻信息包括所述接收端中虚拟电阻的导通或关断状态,所述第二虚拟电阻信息用于表征所述虚拟总线状态,所述接收端中的虚拟电阻与实体电阻相对应,所述实体电阻包含高速匹配电阻、上拉电阻或下拉电阻中的至少一个。
  21. 根据权利要求20所述的数据传输方法,其特征在于,所述方法还包括:
    当所述USB适配层接收所述第一数据时,所述USB适配层根据所述第一数据的内容确定所述虚拟总线状态;
    当所述USB适配层发送所述第四数据时,所述USB适配层根据所述第四数据的内容确定所述虚拟总线状态;
    当所述USB适配层未接收所述第一数据时且未发送所述第四数据时,所述USB适配层根据所述第一虚拟电阻信息和所述第二虚拟电阻信息确定所述虚拟总线状态;
    由所述USB适配层向所述USB协议层发送所述当前虚拟总线状态。
  22. 根据权利要求20所述的数据传输方法,其特征在于,所述方法还包括:
    由所述USB协议层根据所述虚拟总线状态确定所述通信装置下一时刻的工作状态;其中,所述工作状态包括以下至少一项:所述USB协议层是否发送所述第一数据或是否接收所述第六数据,当所述USB协议层发送所述第一数据时,所述第一数据包含的内容,或者当所述USB协议层发送所述控制信息时,所述USB适配层从所述控制信息中解析出的所述第一虚拟电阻信息。
  23. 一种通信装置,其特征在于,所述通信装置包含处理器和接口电路,所述处理器可以运行计算机程序来通过所述接口电路实现如权利要求12-22中任意一项所述的方法。
  24. 一种计算机存储介质,其特征在于,所述计算机存储介质存储有计算机程序,该计算机程序被通信装置执行时实现上述权利要求12-22中任意一项所述的方法。
PCT/CN2021/074561 2021-01-30 2021-01-30 通信装置及数据传输方法 WO2022160320A1 (zh)

Priority Applications (4)

Application Number Priority Date Filing Date Title
EP21921921.9A EP4280487A4 (en) 2021-01-30 2021-01-30 COMMUNICATION DEVICE AND DATA TRANSMISSION METHOD
CN202180091764.4A CN116803068A (zh) 2021-01-30 2021-01-30 通信装置及数据传输方法
PCT/CN2021/074561 WO2022160320A1 (zh) 2021-01-30 2021-01-30 通信装置及数据传输方法
US18/361,674 US20240004826A1 (en) 2021-01-30 2023-07-28 Communication apparatus and data transmission method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2021/074561 WO2022160320A1 (zh) 2021-01-30 2021-01-30 通信装置及数据传输方法

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US18/361,674 Continuation US20240004826A1 (en) 2021-01-30 2023-07-28 Communication apparatus and data transmission method

Publications (1)

Publication Number Publication Date
WO2022160320A1 true WO2022160320A1 (zh) 2022-08-04

Family

ID=82652929

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/074561 WO2022160320A1 (zh) 2021-01-30 2021-01-30 通信装置及数据传输方法

Country Status (4)

Country Link
US (1) US20240004826A1 (zh)
EP (1) EP4280487A4 (zh)
CN (1) CN116803068A (zh)
WO (1) WO2022160320A1 (zh)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1901492A (zh) * 2005-07-08 2007-01-24 美国博通公司 一种通过网络中的总线接口进行通信的方法和系统
CN101730303A (zh) * 2009-11-19 2010-06-09 杭州竞天数码科技有限公司 一种兼容多种无线传输模块的系统及其实现方法
CN104205781A (zh) * 2012-03-30 2014-12-10 英特尔公司 超高速芯片互连通信
US20150254193A1 (en) * 2014-03-04 2015-09-10 Black Diamond Video Apparatus, system, and method for allowing usb devices to communicate over a network
US20160323435A1 (en) * 2015-04-30 2016-11-03 Nick Antonopoulos Adapter devices for enhancing the functionality of other devices

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105393584B (zh) * 2013-05-16 2019-05-21 英特尔公司 支持协议适应层(pal)上的流的装置、系统和方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1901492A (zh) * 2005-07-08 2007-01-24 美国博通公司 一种通过网络中的总线接口进行通信的方法和系统
CN101730303A (zh) * 2009-11-19 2010-06-09 杭州竞天数码科技有限公司 一种兼容多种无线传输模块的系统及其实现方法
CN104205781A (zh) * 2012-03-30 2014-12-10 英特尔公司 超高速芯片互连通信
US20150254193A1 (en) * 2014-03-04 2015-09-10 Black Diamond Video Apparatus, system, and method for allowing usb devices to communicate over a network
US20160323435A1 (en) * 2015-04-30 2016-11-03 Nick Antonopoulos Adapter devices for enhancing the functionality of other devices

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP4280487A4 *

Also Published As

Publication number Publication date
EP4280487A4 (en) 2023-12-20
EP4280487A1 (en) 2023-11-22
CN116803068A (zh) 2023-09-22
US20240004826A1 (en) 2024-01-04

Similar Documents

Publication Publication Date Title
TWI407313B (zh) 統一多重傳送媒體連接器架構
CN102138297B (zh) 图形多媒体集成电路及其运作方法
EP2172011B1 (en) Operation of media interface to provide bidirectional communications
US8347008B2 (en) Method and system for hardware based implementation of USB 1.1 over a high speed link
US20080285572A1 (en) Single device for handling client side and server side operations for a/v bridging and a/v bridging extensions
EP3035171A1 (en) Apparatus, system and method for communication of touch sensor information
US8046481B2 (en) Peer-to-peer network communications using SATA/SAS technology
CN102932327A (zh) 零终端设备与桌面虚拟机之间的通信方法及系统
US20220358074A1 (en) PCIe-Based Data Transmission Method, Apparatus, and System
US20220358070A1 (en) Pcie-based data transmission method and apparatus
TW201328273A (zh) 遠端管理系統及遠端管理方法
WO2022160320A1 (zh) 通信装置及数据传输方法
US20220365895A1 (en) Pcie-based data transmission method and apparatus
CN217428141U (zh) 网卡、通信设备及网络安全系统
CN115543908B (zh) 基于FPGA的Aurora总线数据交互系统
CN115001627B (zh) 一种InfiniBand网络子网管理报文处理方法及系统
CN114661650A (zh) 通信装置、电子装置和通信方法
CN107066412B (zh) 一种通信电路及其方法
CN115905069A (zh) 一种基于bmc芯片的usb数据传输方法及装置
CN115695176A (zh) 一种配置物理接口芯片的方法及相关装置
CN117544705A (zh) 一种基于硬件加速的终端处理方法及装置
CN114442951A (zh) 传输多路数据的方法、装置、存储介质和电子设备
KR200239091Y1 (ko) Ieee1394 ohci 카드
US8914554B2 (en) Communication network device that compares first and second identification number of packet to determine if they are in conformance or non-conformance with self-ID packet
CN117176888A (zh) 一种扩展坞及其视频分辨率切换方法

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 202180091764.4

Country of ref document: CN

ENP Entry into the national phase

Ref document number: 2021921921

Country of ref document: EP

Effective date: 20230815

NENP Non-entry into the national phase

Ref country code: DE