WO2022228011A1 - Method and apparatus for data transmission using quic, client, and server - Google Patents

Method and apparatus for data transmission using quic, client, and server Download PDF

Info

Publication number
WO2022228011A1
WO2022228011A1 PCT/CN2022/084139 CN2022084139W WO2022228011A1 WO 2022228011 A1 WO2022228011 A1 WO 2022228011A1 CN 2022084139 W CN2022084139 W CN 2022084139W WO 2022228011 A1 WO2022228011 A1 WO 2022228011A1
Authority
WO
WIPO (PCT)
Prior art keywords
application layer
layer protocol
data
server
client
Prior art date
Application number
PCT/CN2022/084139
Other languages
French (fr)
Chinese (zh)
Inventor
梁乾灯
康娇
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2022228011A1 publication Critical patent/WO2022228011A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions
    • 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/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/164Adaptation or special uses of UDP protocol
    • 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/22Parsing or analysis of headers
    • 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/329Intralayer communication protocols among peer entities or protocol data unit [PDU] definitions in the application layer [OSI layer 7]

Definitions

  • the present application relates to the field of terminals, and in particular, to a QUIC data transmission method, device, client and server.
  • Quick UDP Internet Connection is a low-latency Internet transport layer protocol based on UDP. QUIC can be used in scenarios that require data transmission, such as web pages or applications.
  • the QUIC protocol can multiplex the transport layer, that is, after establishing a session between the client and the server, for each element that needs to be transmitted, a reliable data stream (stream) or an unreliable data stream (flow) can be used separately. ) for data transfer.
  • the embodiments of the present application provide a QUIC data transmission method, device, client and server, which can improve the waste of network bandwidth caused by the need to establish an independent session for each application layer protocol when there are multiple application layer protocols. , waste QUIC session resources and reduce the efficiency of QUIC session chain building.
  • an embodiment of the present application provides a QUIC data transmission method applied to a client, the method comprising:
  • the client determines the second application layer protocol used by the second data request when performing data transmission between the client and the server in response to the second data request.
  • the second application layer protocol is an application layer protocol in the application layer protocol list corresponding to the first QUIC session
  • a second data stream is established in the first QUIC session, and the second data stream is used to carry the data requested to be transmitted in the second data request.
  • the first QUIC session is the QUIC session established with the server when the client responds to the first data request
  • the list of application layer protocols corresponding to the first QUIC session includes the application layer protocols supported by both the client and the server.
  • the client may be a mobile phone (mobile phone), a tablet computer (Pad), a computer with a transceiver function, a virtual reality (VR) terminal device, an augmented reality (AR) terminal device, Wireless terminals in industrial control, wireless terminals in self-driving, wireless terminals in remote medical, wireless terminals in smart grid, transportation safety ), wireless terminals in smart cities, wireless terminals in smart homes, wearable devices, in-vehicle devices, ultra-mobile personal computers (UMPCs), netbooks , personal digital assistant (personal digital assistant, PDA) and other electronic equipment.
  • UMPCs ultra-mobile personal computers
  • PDA personal digital assistant
  • the QUIC data transmission method provided by the first aspect obtains the application layer protocol list corresponding to the first QUIC session through negotiation when the client and the server establish the first QUIC session.
  • the client responds to the second data request and performs data transmission between the server, if the second application layer protocol used by the second data request is in the application layer protocol list corresponding to the first QUIC session, there is no need to create QUIC again. Instead, a second data stream using the second application layer protocol is established under the first QUIC session to carry the data requested to be transmitted in the second data request. Since there is no need to establish multiple QUIC sessions, the first QUIC session is reused, which can save network bandwidth and QUIC session resources, reduce data transmission delay, and improve chain construction efficiency.
  • establishing a second data stream with the server in the first QUIC session includes: the client generating a first type of data frame in response to the second data request, where the first type of data frame includes a second application layer protocol, a second The identification information of the data stream and the data information corresponding to the second data request are recorded, and the corresponding relationship between the identification information of the second data stream and the second application layer protocol is recorded.
  • the client sends the first type of data frame to the server, instructing the server to establish a second data stream according to the second application layer protocol in the first type of data frame.
  • the method further includes: the client receives the first type of data frame from the server.
  • the client determines that the correspondence between the identification information of the second data stream in the first type of data frame and the second application layer protocol is consistent with the correspondence between the identification information of the second data stream recorded by the client and the second application layer protocol , and send the first type of data frame to the processing module corresponding to the second application layer protocol for processing.
  • the application layer protocol corresponding to the second type of data frame can be accurately obtained when the first type of data frame is not used, so that the data Subsequent use of the second type of data frame frame can also transmit data streams of different application layer protocols under a QUIC session.
  • the second type of data frame includes identification information of the second data stream and data information corresponding to the second data request.
  • the method further includes: the client receives the second type of data frame from the server.
  • the client sends the second type of data frame to the processing corresponding to the second application layer protocol according to the identification information of the second data stream in the second type of data frame and the corresponding relationship between the identification information of the second data stream and the second application layer protocol module for processing.
  • the second type of data frame includes identification information of the second data stream and data information corresponding to the second data request.
  • the client establishing the second data stream with the server in the first QUIC session includes: the client determining that the second application layer protocol is the first application layer protocol in the application layer protocol list corresponding to the first QUIC session.
  • the client generates a second type of data frame in response to the second data request, and records the correspondence between the identification information of the second data stream and the second application layer protocol.
  • the client sends the second type of data frame to the server, instructing the server to respond to the second type of data frame and establish the second data stream according to the first application layer protocol in the application layer protocol list corresponding to the first QUIC session.
  • the data stream established by the second type of data frame uses the first application layer protocol in the application layer protocol list, so that when the second application layer protocol is the first application layer protocol in the application layer protocol list , the client can establish a second data stream through the second type of data frame, adding the application scenario of the QUIC data transmission method.
  • the QUIC data transmission method further includes: after establishing the first QUIC session, the client records the number of citations of the first QUIC session, where the number of citations is the number of data streams in the first QUIC session.
  • the reference count is incremented by one.
  • the reference count is decremented by one.
  • the QUIC data transmission method further includes: when the number of references is reduced to zero, and the number of references does not change after a preset duration, the client closes the first QUIC session.
  • the first QUIC session by recording the number of data streams in the first QUIC session, when there is no data stream in the first QUIC session and no new data stream is created within the preset time period, the first QUIC session can be closed, saving energy Network resources and QUIC session resources.
  • the method before the client responds to the second data request, the method further includes: establishing a first QUIC session with the server in response to the first data request, and generating an application layer protocol list corresponding to the first QUIC session.
  • a first data stream is established in the first QUIC session, the first data stream is used to carry the data requested to be transmitted in the first data request, the first data request uses the first application layer protocol, and the first application layer protocol corresponds to the first QUIC session The application layer protocol in the list of application layer protocols.
  • establishing a first QUIC session with the server in response to the first data request, and generating a list of application layer protocols corresponding to the first QUIC session includes: the client responding to the first data request and sending the server to establish the first QUIC session.
  • the session handshake request for the session includes: the client receivings a handshake message from the server, the handshake message is generated by the server according to the session handshake request, and the handshake message includes the application layer protocol supported by the server.
  • the client establishes the first QUIC session according to the handshake message, and sends the application layer protocol list corresponding to the first QUIC session and the confirmation message for establishment of the first QUIC session to the server through the first QUIC session.
  • the QUIC data transmission method further includes: the client receives a first notification frame or a second notification frame from the server, where the first notification frame is used to instruct the client to send an application corresponding to the first QUIC session stored in the client. At least one application layer protocol is added to the layer protocol list, and the second notification frame is used to instruct the client to remove at least one application layer protocol stored in the application layer protocol list corresponding to the first QUIC session in the client.
  • the client updates the application layer protocol list according to the received first notification frame or the second notification frame.
  • the QUIC data transmission method further includes: the client responds to an update instruction of the application layer protocol list, and updates the application layer protocol list stored in the client.
  • the update instruction instructs to add at least one application layer protocol to the application layer protocol list stored in the client
  • a first notification frame is generated, and the first notification frame is used to instruct the server to correspond to the first QUIC session stored in the server
  • the update instruction instructs to remove at least one application layer protocol in the application layer protocol list stored in the client
  • a second notification frame is generated, and the second notification frame is used to instruct the server to remove the first QUIC stored in the server.
  • At least one application layer protocol in the application layer protocol list corresponding to the session.
  • the client sends the first notification frame or the second notification frame to the server.
  • the QUIC data transmission method further includes: when the second application layer protocol is not an application layer protocol in the application layer protocol list corresponding to the first QUIC session, the client generates an update instruction of the application layer protocol list, and the update instruction uses for writing the second application layer protocol into the application layer protocol list corresponding to the first QUIC session stored in the client.
  • the client responds to the update instruction and generates the first notification frame. After the client sends the first notification frame to the server through the first QUIC session, a second data stream is established with the server in the first QUIC session.
  • the server and the client can also dynamically negotiate the application layer protocol carried by the bearer.
  • the Establishing a data stream increases the application scenarios of the QUIC data transmission method.
  • the embodiments of the present application provide a QUIC data transmission method applied to a server, the method comprising:
  • the server determines the second application layer protocol used by the second data request when performing data transmission between the server and the client in response to the second data request.
  • the second application layer protocol is an application layer protocol in the application layer protocol list corresponding to the first QUIC session
  • a second data stream is established in the first QUIC session, and the second data stream is used to carry the data requested to be transmitted in the second data request.
  • the first QUIC session is the QUIC session established with the server when the client responds to the first data request
  • the list of application layer protocols corresponding to the first QUIC session includes the application layer protocols supported by both the client and the server.
  • the server may be a device serving the client, and the server may provide resources to the client, save data from the client, and the like.
  • the server can be a server or a network device
  • the server can be a blade server, a rack server, a cloud server, etc.
  • the network device includes a Layer 3 switch, a router, a broadband gateway, a firewall, a load balancer, and the like.
  • the QUIC data transmission method provided by the second aspect obtains the application layer protocol list of the first QUIC session through negotiation when the server and the client establish the first QUIC session.
  • the server responds to the second data request, if the second application layer protocol used by the second data request is in the application layer protocol list, there is no need to create a QUIC session, but a bearer is established under the first QUIC session using the first QUIC session.
  • the second data stream of the second application layer protocol Since there is no need to establish multiple QUIC sessions, the first QUIC session is reused, which can save network bandwidth and QUIC session resources, reduce data transmission delay, and improve chain construction efficiency.
  • the server establishes a second data stream with the client in the first QUIC session, including: the server responds to the second data request to generate a first type of data frame, and the first type of data frame includes the second application layer protocol, The identification information of the second data stream and the data information corresponding to the second data request are recorded, and the correspondence between the identification information of the second data stream and the second application layer protocol is recorded.
  • the server sends the first type of data frame to the client, and instructs the client to establish a second data stream according to the second application layer protocol in the first type of data frame.
  • the method further includes: the server receives the first type of data frame from the client.
  • the server determines that the corresponding relationship between the identification information of the second data stream in the first type of data frame and the second application layer protocol is consistent with the corresponding relationship between the identification information of the second data stream recorded by the server and the second application layer protocol , and send the first type of data frame to the processing module corresponding to the second application layer protocol for processing.
  • the second type of data frame includes identification information of the second data stream and data information corresponding to the second data request.
  • the method further includes: the server receives the second type of data frame from the client.
  • the server sends the second type of data frame to the processing corresponding to the second application layer protocol according to the identification information of the second data stream in the second type of data frame and the corresponding relationship between the identification information of the second data stream and the second application layer protocol module for processing.
  • the second type of data frame includes identification information of the second data stream and data information corresponding to the second data request.
  • the server establishing the second data stream with the client in the first QUIC session includes: the server determining that the second application layer protocol is the first application layer protocol in the application layer protocol list corresponding to the first QUIC session.
  • the server generates a second type of data frame in response to the second data request, and records the correspondence between the identification information of the second data stream and the second application layer protocol.
  • the server sends the second type of data frame to the client, instructing the client to respond to the second type of data frame and establish the second data stream according to the first application layer protocol in the application layer protocol list corresponding to the first QUIC session.
  • the QUIC data transmission method further includes: after establishing the first QUIC session, the server records the number of citations of the first QUIC session, where the number of citations is the number of data streams in the first QUIC session.
  • the server records the number of citations of the first QUIC session, where the number of citations is the number of data streams in the first QUIC session.
  • the reference count is incremented by one.
  • the reference count is decremented by one.
  • the QUIC data transmission method further includes: when the number of references decreases to zero and the number of references does not change after a preset time period, the server closes the first QUIC session.
  • the method before the server responds to the second data request, the method further includes: establishing a first QUIC session between the server and the client.
  • the server responds to the first data request from the client, and establishes a first data stream with the client, where the first data stream is used to carry the data requested to be transmitted in the first data request, and the first data request uses the first application layer protocol,
  • the first application layer protocol is an application layer protocol in the application layer protocol list corresponding to the first QUIC session.
  • establishing the first QUIC session between the server and the client includes: receiving a session handshake request from the client, where the session handshake request is used to instruct the server and the client to establish the first QUIC session.
  • a handshake packet is generated according to the session handshake request and sent to the client.
  • the handshake packet includes the application layer protocol supported by the server. Receive the application layer protocol list from the client and the confirmation message for the establishment of the first QUIC session.
  • the server confirms the establishment of the first QUIC session according to the confirmation message.
  • the QUIC data transmission method further includes: the server receiving a first notification frame or a second notification frame from the client, where the first notification frame is used to instruct the server to send the application corresponding to the first QUIC session stored in the server. At least one application layer protocol is added to the layer protocol list, and the second notification frame is used to instruct the server to remove at least one application layer protocol in the application layer protocol list corresponding to the first QUIC session stored in the server.
  • the server updates the application layer protocol list according to the received first notification frame or the second notification frame.
  • the QUIC data transmission method further includes: the server responds to an update instruction of the application layer protocol list, and updates the application layer protocol list stored in the server.
  • the update instruction instructs to add at least one application layer protocol to the application layer protocol list stored in the server
  • a first notification frame is generated, and the first notification frame is used to instruct the client to correspond to the first QUIC session stored in the client
  • the update instruction instructs to remove at least one application layer protocol in the application layer protocol list stored in the server
  • a second notification frame is generated, and the second notification frame is used to instruct the client to remove the first QUIC stored in the client
  • the server sends the first notification frame or the second notification frame to the client.
  • the QUIC data transmission method further includes: when the second application layer protocol is not an application layer protocol in the application layer protocol list corresponding to the first QUIC session, the server generates an update instruction of the application layer protocol list, and the update instruction uses for writing the second application layer protocol into the application layer protocol list corresponding to the first QUIC session stored in the server.
  • the server responds to the update instruction and generates a first notification frame. After the server sends the first notification frame to the client through the first QUIC session, a second data stream is established with the client in the first QUIC session.
  • an embodiment of the present application provides a QUIC data transmission device applied to a client, including:
  • the determining module is configured to determine the second application layer protocol used by the second data request in response to the data transmission between the second data request and the server.
  • the establishment module is configured to establish a second data stream in the first QUIC session when the second application layer protocol is an application layer protocol in the application layer protocol list corresponding to the first QUIC session, and the second data stream is used to carry the second data The data requested to be transmitted in the request.
  • the first QUIC session is the QUIC session established with the server when the client responds to the first data request.
  • the list of application layer protocols corresponding to the first QUIC session includes the application layer supported by both the client and the server. protocol.
  • the establishment module is specifically configured to generate a first type of data frame in response to the second data request, where the first type of data frame includes the second application layer protocol, the identification information of the second data stream, and the data corresponding to the second data request. information, recording the correspondence between the identification information of the second data stream and the second application layer protocol.
  • the first type of data frame is sent to the server, and the server is instructed to establish a second data stream according to the second application layer protocol in the first type of data frame.
  • the apparatus further includes a receiving module for receiving the first type of data frame from the server.
  • the device further includes a processing module for determining the correspondence between the identification information of the second data stream in the first type of data frame and the second application layer protocol, and the identification information of the second data stream recorded by the client and the second application layer protocol.
  • the first type of data frame is sent to the processing module corresponding to the second application layer protocol for processing.
  • the second type of data frame includes identification information of the second data stream and data information corresponding to the second data request.
  • the receiving module is further configured to receive the second type of data frame from the server.
  • the processing module is further configured to send the second type of data frame to the second application layer according to the identification information of the second data stream in the second type of data frame and the corresponding relationship between the identification information of the second data stream and the second application layer protocol.
  • the processing module corresponding to the protocol performs processing.
  • the second type of data frame includes identification information of the second data stream and data information corresponding to the second data request.
  • the establishment module is specifically configured to determine that the second application layer protocol is the first application layer protocol in the application layer protocol list corresponding to the first QUIC session.
  • the client generates a second type of data frame in response to the second data request, and records the correspondence between the identification information of the second data stream and the second application layer protocol.
  • the client sends the second type of data frame to the server, instructing the server to respond to the second type of data frame and establish the second data stream according to the first application layer protocol in the application layer protocol list corresponding to the first QUIC session.
  • the apparatus further includes a recording module configured to record the number of citations of the first QUIC session after the first QUIC session is established, where the number of citations is the number of data streams in the first QUIC session.
  • a recording module configured to record the number of citations of the first QUIC session after the first QUIC session is established, where the number of citations is the number of data streams in the first QUIC session.
  • the recording module is further configured to close the first QUIC session when the number of references is reduced to zero and the number of references does not change after a preset duration.
  • the establishment module is further configured to establish a first QUIC session with the server in response to the first data request, and generate a list of application layer protocols corresponding to the first QUIC session.
  • a first data stream is established in the first QUIC session, the first data stream is used to carry the data requested to be transmitted in the first data request, the first data request uses the first application layer protocol, and the first application layer protocol corresponds to the first QUIC session The application layer protocol in the list of application layer protocols.
  • the establishment module is specifically configured to send a session handshake request for establishing the first QUIC session to the server in response to the first data request.
  • the client receives a handshake message from the server, the handshake message is generated by the server according to the session handshake request, and the handshake message includes the application layer protocol supported by the server.
  • the client establishes the first QUIC session according to the handshake message, and sends the application layer protocol list corresponding to the first QUIC session and the confirmation message for establishment of the first QUIC session to the server through the first QUIC session.
  • the receiving module is further configured to receive a first notification frame or a second notification frame from the server, where the first notification frame is used to instruct the client to send the application layer protocol list corresponding to the first QUIC session stored in the client. At least one application layer protocol is added in the second notification frame, and the second notification frame is used to instruct the client to remove at least one application layer protocol stored in the application layer protocol list corresponding to the first QUIC session in the client.
  • the apparatus further includes an update module, configured to update the application layer protocol list according to the received first notification frame or the second notification frame.
  • the update module is further configured to update the application layer protocol list stored in the client in response to the update instruction of the application layer protocol list.
  • the update instruction instructs to add at least one application layer protocol to the application layer protocol list stored in the client
  • a first notification frame is generated, and the first notification frame is used to instruct the server to correspond to the first QUIC session stored in the server
  • the update instruction instructs to remove at least one application layer protocol in the application layer protocol list stored in the client, a second notification frame is generated, and the second notification frame is used to instruct the server to remove the first QUIC stored in the server.
  • At least one application layer protocol in the application layer protocol list corresponding to the session. Send the first notification frame or the second notification frame to the server.
  • the update module is further configured to generate an update instruction of the application layer protocol list when the second application layer protocol is not an application layer protocol in the application layer protocol list corresponding to the first QUIC session, and the update instruction is used to update the first QUIC session.
  • the second application layer protocol is written into the application layer protocol list corresponding to the first QUIC session stored in the client. Respond to the update instruction and generate a first notification frame.
  • the establishing module is further configured to establish a second data stream with the server in the first QUIC session after the client sends the first notification frame to the server through the first QUIC session.
  • an embodiment of the present application provides a QUIC data transmission device applied to a server, including:
  • the determining module is configured to determine the second application layer protocol used by the second data request when performing data transmission between the client and the second data request in response to the second data request.
  • the establishment module is configured to establish a second data stream in the first QUIC session when the second application layer protocol is an application layer protocol in the application layer protocol list corresponding to the first QUIC session, and the second data stream is used to carry the second data The data requested to be transmitted in the request.
  • the first QUIC session is the QUIC session established with the server when the client responds to the first data request.
  • the list of application layer protocols corresponding to the first QUIC session includes the application layer supported by both the client and the server. protocol.
  • the establishment module is specifically configured to generate a first type of data frame in response to the second data request, where the first type of data frame includes the second application layer protocol, the identification information of the second data stream, and the data corresponding to the second data request. information, recording the correspondence between the identification information of the second data stream and the second application layer protocol.
  • the server sends the first type of data frame to the client, and instructs the client to establish a second data stream according to the second application layer protocol in the first type of data frame.
  • the apparatus further includes a receiving module for receiving the first type of data frame from the client.
  • the device further includes a processing module for determining the correspondence between the identification information of the second data stream in the first type of data frame and the second application layer protocol, and the identification information of the second data stream recorded by the server and the second application layer protocol.
  • the first type of data frame is sent to the processing module corresponding to the second application layer protocol for processing.
  • the second type of data frame includes identification information of the second data stream and data information corresponding to the second data request.
  • the receiving module is further configured to receive the second type of data frame from the client.
  • the processing module is further configured to send the second type of data frame to the second application layer according to the identification information of the second data stream in the second type of data frame and the corresponding relationship between the identification information of the second data stream and the second application layer protocol.
  • the processing module corresponding to the protocol performs processing.
  • the second type of data frame includes identification information of the second data stream and data information corresponding to the second data request.
  • the establishment module is specifically configured to determine that the second application layer protocol is the first application layer protocol in the application layer protocol list corresponding to the first QUIC session.
  • the server generates a second type of data frame in response to the second data request, and records the correspondence between the identification information of the second data stream and the second application layer protocol.
  • the server sends the second type of data frame to the client, instructing the client to respond to the second type of data frame and establish the second data stream according to the first application layer protocol in the application layer protocol list corresponding to the first QUIC session.
  • the apparatus further includes a recording module configured to record the number of citations of the first QUIC session after the first QUIC session is established, where the number of citations is the number of data streams in the first QUIC session.
  • a recording module configured to record the number of citations of the first QUIC session after the first QUIC session is established, where the number of citations is the number of data streams in the first QUIC session.
  • the recording module is further configured to close the first QUIC session when the number of references is reduced to zero and the number of references does not change after a preset duration.
  • the establishing module is further configured to establish the first QUIC session between the server and the client.
  • the server responds to the first data request from the client, and establishes a first data stream with the client, where the first data stream is used to carry the data requested to be transmitted in the first data request, and the first data request uses the first application layer protocol,
  • the first application layer protocol is an application layer protocol in the application layer protocol list corresponding to the first QUIC session.
  • the establishment module is specifically configured to receive a session handshake request from the client, where the session handshake request is used to instruct the server and the client to establish a first QUIC session.
  • a handshake packet is generated according to the session handshake request and sent to the client.
  • the handshake packet includes the application layer protocol supported by the server. Receive the application layer protocol list from the client and the confirmation message for the establishment of the first QUIC session. The server confirms the establishment of the first QUIC session according to the confirmation message.
  • the receiving module is further configured to receive the first notification frame or the second notification frame from the client, where the first notification frame is used to instruct the server to send the application layer protocol list corresponding to the first QUIC session stored in the server. At least one application layer protocol is added in the second notification frame, and the second notification frame is used to instruct the server to remove at least one application layer protocol stored in the application layer protocol list corresponding to the first QUIC session in the server.
  • the apparatus further includes an update module, configured to update the application layer protocol list according to the received first notification frame or the second notification frame.
  • the update module is further configured to update the application layer protocol list stored in the server in response to the update instruction of the application layer protocol list.
  • the update instruction instructs to add at least one application layer protocol to the application layer protocol list stored in the server
  • a first notification frame is generated, and the first notification frame is used to instruct the client to correspond to the first QUIC session stored in the client
  • the update instruction instructs to remove at least one application layer protocol in the application layer protocol list stored in the server
  • a second notification frame is generated, and the second notification frame is used to instruct the client to remove the first QUIC stored in the client
  • the server sends the first notification frame or the second notification frame to the client.
  • the update module is further configured to, when the second application layer protocol is not an application layer protocol in the application layer protocol list corresponding to the first QUIC session, the server generates an update instruction of the application layer protocol list, and the update instruction is used to Write the second application layer protocol into the application layer protocol list corresponding to the first QUIC session stored in the server.
  • the server responds to the update instruction and generates the first notification frame.
  • the establishing module is further configured to establish a second data stream with the client in the first QUIC session after the server sends the first notification frame to the client through the first QUIC session.
  • an embodiment of the present application provides a QUIC client, including a memory, a processor, and a computer program stored in the memory and running on the processor, and the method provided in the first aspect is implemented when the processor executes the computer program .
  • an embodiment of the present application provides a QUIC server, including a memory, a processor, and a computer program stored in the memory and running on the processor, and the method provided in the second aspect is implemented when the processor executes the computer program.
  • an embodiment of the present application provides a data transmission system, including at least one QUIC client provided by the fifth aspect and at least one QUIC server provided by the sixth aspect, where the QUIC client and the QUIC server are connected through network communication , the QUIC client and the QUIC server in the data transmission system can transmit data through the QUIC data transmission methods provided in the first aspect and the second aspect.
  • an embodiment of the present application provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method provided in the first aspect is implemented.
  • an embodiment of the present application provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, wherein the method provided in the second aspect is implemented when the computer program is executed by a processor.
  • an embodiment of the present application provides a computer program product, which when the computer program product runs on a client, enables the client to execute the method provided in the first aspect.
  • an embodiment of the present application provides a computer program product, which when the computer program product runs on a server, causes the server to execute the method provided in the second aspect.
  • an embodiment of the present application provides a chip system, the chip system includes a memory and a processor, and the processor executes a computer program stored in the memory to implement the method provided in the first aspect.
  • an embodiment of the present application provides a chip system, where the chip system includes a memory and a processor, and the processor executes a computer program stored in the memory to implement the method provided in the second aspect.
  • an embodiment of the present application provides a chip system, the chip system includes a processor, the processor is coupled to the computer-readable storage medium provided in the eighth aspect, and the processor executes a computer program stored in the computer-readable storage medium , so as to realize the method provided by the first aspect.
  • an embodiment of the present application provides a chip system, the chip system includes a processor, the processor is coupled to the computer-readable storage medium provided in the ninth aspect, and the processor executes a computer program stored in the computer-readable storage medium , so as to realize the method provided by the first aspect.
  • Figure 1 shows an application scenario of QUIC data transmission
  • FIG. 2 is a schematic structural diagram of a client according to an embodiment of the present application.
  • FIG. 3 is a schematic diagram of a software structure of a client according to an embodiment of the present application.
  • FIG. 4 is a schematic flowchart of a QUIC data transmission method provided by an embodiment of the present application.
  • FIG. 5 is a schematic flowchart of another QUIC data transmission method provided by an embodiment of the present application.
  • FIG. 6 is a schematic flowchart of another QUIC data transmission method provided by an embodiment of the present application.
  • FIG. 7 is a schematic flowchart of another QUIC data transmission method provided by an embodiment of the present application.
  • FIG. 8 is a data flow diagram provided by an embodiment of the present application when the data transmission method provided by the present application is used;
  • FIG. 9 is a structural block diagram of a QUIC data transmission apparatus provided by an embodiment of the present application.
  • FIG. 10 is a structural block diagram of another QUIC data transmission apparatus provided by an embodiment of the present application.
  • FIG. 11 is a structural block diagram of another QUIC data transmission apparatus provided by an embodiment of the application.
  • FIG. 12 is a structural block diagram of another QUIC data transmission apparatus provided by an embodiment of the present application.
  • FIG. 13 is a structural block diagram of a QUIC data transmission apparatus provided by an embodiment of the present application.
  • FIG. 14 is a structural block diagram of another QUIC data transmission apparatus provided by an embodiment of the present application.
  • 15 is a structural block diagram of another QUIC data transmission apparatus provided by an embodiment of the application.
  • FIG. 16 is a structural block diagram of another QUIC data transmission apparatus provided by an embodiment of the application.
  • FIG. 17 is a schematic structural diagram of a QUIC client provided by an embodiment of the application.
  • FIG. 18 is a schematic structural diagram of a QUIC server provided by an embodiment of the present application.
  • the term “if” may be contextually interpreted as “when” or “once” or “in response to determining” or “in response to detecting “.
  • the phrases “if determined” or “if detected” may be interpreted contextually to mean “once determined” or “in response to determining” or “once detected” or “in response to detecting.”
  • references in this specification to "one embodiment” or “some embodiments” and the like mean that a particular feature, structure or characteristic described in connection with the embodiment is included in one or more embodiments of the present application.
  • appearances of the phrases “in one embodiment,” “in some embodiments,” “in other embodiments,” “in other embodiments,” etc. in various places in this specification are not necessarily All refer to the same embodiment, but mean “one or more but not all embodiments” unless specifically emphasized otherwise.
  • the terms “including”, “including”, “having” and their variants mean “including but not limited to” unless specifically emphasized otherwise.
  • Figure 1 shows an application scenario of QUIC data transmission.
  • the scenario includes a client 11 and a server 12 , and the client 11 and the server 12 previously performed data transmission through the network.
  • the network may be a wired network or a wireless network.
  • the wireless network may include a global system for mobile communications (GSM), a general packet radio service (GPRS), a code division multiple access ( code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE) ), New Radio (NR), BT, GNSS, WLAN, NFC, FM, and/or IR technology, etc.
  • GSM global system for mobile communications
  • GPRS general packet radio service
  • CDMA code division multiple access
  • WCDMA wideband code division multiple access
  • TD-SCDMA time-division code division multiple access
  • LTE long term evolution
  • NR New Radio
  • GNSS may include global positioning system (GPS), global navigation satellite system (GLONASS), Beidou navigation satellite system (BDS), quasi-zenith satellite system (quasi-zenith) satellite system, QZSS) and/or satellite based augmentation systems (SBAS).
  • the wired network may include a Local Area Network (LAN), a Wide Area Network (WAN), and the like.
  • QUIC is a transport layer protocol based on UDP, which can replace Transmission Control Protocol (TCP) to improve problems such as head-of-line blocking.
  • TCP Transmission Control Protocol
  • the QUIC protocol implements multiplexing at the transport layer for the protocol packets carried on it.
  • the client 11 runs a browser program, and the webpage browsed by the browser program includes multiple elements, such as text, images, and videos.
  • a QUIC session can be established between the client 11 and the server 12, and multiple data streams can be established under each QUIC session, and each data stream is used to transmit the data requested by one element. Under a QUIC session, multiple data streams can transmit data requested by multiple elements at the same time.
  • each QUIC session can only support one application layer protocol.
  • multiple QUIC sessions need to be established for transmission.
  • elements such as text and images can be transmitted using Hyper Text Transfer Protocol (HTTP) 3.0
  • live video elements can be transmitted through Real-time Transport Protocol (RTP) or Real-time Transport Control Protocol ( Real-time Transport Control Protocol, RTCP) for transmission.
  • RTP Real-time Transport Protocol
  • RTCP Real-time Transport Control Protocol
  • a QUIC session needs to be established between the client 11 and the server 12 for each application layer protocol for transmitting elements using the corresponding application layer protocol.
  • a QUIC session can be used between the client 11 and the server 12 to transmit elements using the HTTP 3.0 protocol, and another QUIC session can be established to transmit elements using the RTP/RTCP protocol.
  • QUIC data transmission method which, when applied to the client, includes:
  • the client determines the second application layer protocol used by the second data request when performing data transmission between the client and the server in response to the second data request.
  • the second application layer protocol is an application layer protocol in the application layer protocol list corresponding to the first QUIC session
  • a second data stream is established in the first QUIC session, and the second data stream is used to carry the data requested to be transmitted in the second data request.
  • the first QUIC session is the QUIC session established with the server when the client responds to the first data request
  • the list of application layer protocols corresponding to the first QUIC session includes the application layer protocols supported by both the client and the server.
  • the server determines the second application layer protocol used by the second data request when performing data transmission between the server and the client in response to the second data request.
  • the second application layer protocol is an application layer protocol in the application layer protocol list corresponding to the first QUIC session
  • a second data stream is established in the first QUIC session, and the second data stream is used to carry the data requested to be transmitted in the second data request.
  • the first QUIC session is the QUIC session established with the server when the client responds to the first data request
  • the list of application layer protocols corresponding to the first QUIC session includes the application layer protocols supported by both the client and the server.
  • the QUIC data transmission method provided in this application obtains the application layer protocol list corresponding to the first QUIC session through negotiation when the client and the server establish the first QUIC session.
  • the client or server responds to the second data request and performs data transmission between the server, if the second application layer protocol used by the second data request is in the list of application layer protocols corresponding to the first QUIC session, no need
  • the QUIC session is created again, but a second data stream using the second application layer protocol is established under the first QUIC session to carry the data requested to be transmitted in the second data request. Since there is no need to establish multiple QUIC sessions, the first QUIC session is reused, which can save network bandwidth and QUIC session resources, reduce data transmission delay, and improve chain construction efficiency.
  • the client of the data transmission method provided in the embodiment of the present application may be a mobile phone (mobile phone), a tablet computer (Pad), a computer with a transceiver function, a virtual reality (virtual reality, VR) terminal device, an augmented reality (augmented reality, AR) ) terminal equipment, wireless terminal in industrial control, wireless terminal in self driving, wireless terminal in remote medical, wireless terminal in smart grid, transportation Wireless terminals in transportation safety, wireless terminals in smart cities, wireless terminals in smart homes, wearable devices, in-vehicle devices, ultra-mobile personal computers, UMPC), netbook, personal digital assistant (personal digital assistant, PDA), the embodiment of this application does not impose any limitation on the specific type of the client.
  • a virtual reality (virtual reality, VR) terminal device an augmented reality (augmented reality, AR) terminal equipment
  • wireless terminal in industrial control wireless terminal in self driving
  • wireless terminal in remote medical wireless terminal in smart grid
  • transportation Wireless terminals in transportation safety wireless terminals in smart cities, wireless terminals in smart homes, wearable devices,
  • the server can be a device serving the client.
  • the server can provide resources to the client and save the data from the client.
  • the server may be a server or a network device
  • the server may be a blade server, a rack server, a cloud server, etc.
  • the network device includes a three-layer switch, a router, a broadband gateway, a firewall, a load balancer, and the like.
  • the specific type of the server does not impose any restrictions.
  • FIG. 2 shows a schematic structural diagram of a client, where the client is an electronic device 200 .
  • the electronic device 200 may include a processor 210, an external memory interface 220, an internal memory 221, a universal serial bus (USB) interface 230, a charge management module 240, a power management module 241, a battery 242, an antenna 1, an antenna 2 , mobile communication module 250, wireless communication module 260, audio module 270, speaker 270A, receiver 270B, microphone 270C, headphone jack 270D, sensor module 280, buttons 290, motor 291, indicator 292, camera 293, display screen 294, and Subscriber identification module (subscriber identification module, SIM) card interface 295 and so on.
  • SIM Subscriber identification module
  • the sensor module 280 may include a pressure sensor 280A, a gyroscope sensor 280B, an air pressure sensor 280C, a magnetic sensor 280D, an acceleration sensor 280E, a distance sensor 280F, a proximity light sensor 280G, a fingerprint sensor 280H, a temperature sensor 280J, a touch sensor 280K, and ambient light.
  • Sensor 280L Bone Conduction Sensor 280M, etc.
  • the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 200 .
  • the electronic device 200 may include more or less components than shown, or combine some components, or separate some components, or arrange different components.
  • the illustrated components may be implemented in hardware, software, or a combination of software and hardware.
  • the electronic device 200 when the electronic device 200 is a mobile phone or a tablet computer, it may include all the components in the figure, or only some components in the figure.
  • the processor 210 may include one or more processing units, for example, the processor 210 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (NPU) Wait. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.
  • application processor application processor, AP
  • modem processor graphics processor
  • ISP image signal processor
  • controller memory
  • video codec digital signal processor
  • DSP digital signal processor
  • NPU neural-network processing unit
  • the controller may be the nerve center and command center of the electronic device 200 .
  • the controller can generate an operation control signal according to the instruction operation code and timing signal, and complete the control of fetching and executing instructions.
  • a memory may also be provided in the processor 210 for storing instructions and data.
  • the memory in processor 210 is cache memory.
  • the memory may hold instructions or data that have just been used or recycled by the processor 210 . If the processor 210 needs to use the instruction or data again, it can be called directly from memory. Repeated accesses are avoided, and the waiting time of the processor 210 is reduced, thereby improving the efficiency of the system.
  • the processor 210 may include one or more interfaces.
  • the interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous transceiver (universal asynchronous transmitter) receiver/transmitter, UART) interface, mobile industry processor interface (MIPI), general-purpose input/output (GPIO) interface, subscriber identity module (SIM) interface, and / or universal serial bus (universal serial bus, USB) interface, etc.
  • I2C integrated circuit
  • I2S integrated circuit built-in audio
  • PCM pulse code modulation
  • PCM pulse code modulation
  • UART universal asynchronous transceiver
  • MIPI mobile industry processor interface
  • GPIO general-purpose input/output
  • SIM subscriber identity module
  • USB universal serial bus
  • the I2C interface is a bidirectional synchronous serial bus that includes a serial data line (SDA) and a serial clock line (SCL).
  • the processor 210 may contain multiple sets of I2C buses.
  • the processor 210 can be respectively coupled to the touch sensor 280K, the charger, the flash, the camera 293 and the like through different I2C bus interfaces.
  • the processor 210 can couple the touch sensor 280K through the I2C interface, so that the processor 210 communicates with the touch sensor 280K through the I2C bus interface, so as to realize the touch function of the electronic device 200 .
  • the I2S interface can be used for audio communication.
  • the processor 210 may contain multiple sets of I2S buses.
  • the processor 210 may be coupled with the audio module 270 through an I2S bus to implement communication between the processor 210 and the audio module 270 .
  • the audio module 270 may communicate audio signals to the wireless communication module 260 through the I2S interface.
  • the PCM interface can also be used for audio communications, sampling, quantizing and encoding analog signals.
  • the audio module 270 and the wireless communication module 260 may be coupled through a PCM bus interface.
  • the audio module 270 may also transmit audio signals to the wireless communication module 260 through the PCM interface. Both the I2S interface and the PCM interface can be used for audio communication.
  • the UART interface is a universal serial data bus used for asynchronous communication.
  • the bus may be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication.
  • a UART interface is typically used to connect the processor 210 with the wireless communication module 260 .
  • the processor 210 communicates with the Bluetooth module in the wireless communication module 260 through the UART interface to implement the Bluetooth function.
  • the audio module 270 can transmit audio signals to the wireless communication module 260 through the UART interface, so as to realize the function of playing music through the Bluetooth headset.
  • the MIPI interface can be used to connect the processor 210 with peripheral devices such as the display screen 294 and the camera 293 .
  • MIPI interfaces include camera serial interface (CSI), display serial interface (DSI), etc.
  • the processor 210 communicates with the camera 293 through a CSI interface, so as to implement the photographing function of the electronic device 200 .
  • the processor 210 communicates with the display screen 294 through the DSI interface to implement the display function of the electronic device 200 .
  • the GPIO interface can be configured by software.
  • the GPIO interface can be configured as a control signal or as a data signal.
  • the GPIO interface may be used to connect the processor 210 with the camera 293, the display screen 294, the wireless communication module 260, the audio module 270, the sensor module 280, and the like.
  • the GPIO interface can also be configured as I2C interface, I2S interface, UART interface, MIPI interface, etc.
  • the USB interface 230 is an interface that conforms to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, and the like.
  • the USB interface 230 can be used to connect a charger to charge the electronic device 200, and can also be used to transmit data between the electronic device 200 and peripheral devices. It can also be used to connect headphones to play audio through the headphones.
  • the interface can also be used to connect other electronic devices, such as AR devices.
  • the interface connection relationship between the modules illustrated in the embodiments of the present application is only a schematic illustration, and does not constitute a structural limitation of the electronic device 200 .
  • the electronic device 200 may also adopt different interface connection manners in the foregoing embodiments, or a combination of multiple interface connection manners.
  • the charging management module 240 is used to receive charging input from the charger.
  • the charger may be a wireless charger or a wired charger.
  • the charging management module 240 may receive charging input from the wired charger through the USB interface 230 .
  • the charging management module 240 may receive wireless charging input through the wireless charging coil of the electronic device 200 . While the charging management module 240 charges the battery 242, it can also supply power to the electronic device through the power management module 241.
  • the power management module 241 is used to connect the battery 242 , the charging management module 240 and the processor 210 .
  • the power management module 241 receives input from the battery 242 and/or the charging management module 240, and supplies power to the processor 210, the internal memory 221, the external memory, the display screen 294, the camera 293, and the wireless communication module 260.
  • the power management module 241 can also be used to monitor parameters such as battery capacity, battery cycle times, battery health status (leakage, impedance).
  • the power management module 241 may also be provided in the processor 210 . In other embodiments, the power management module 241 and the charging management module 240 may also be provided in the same device.
  • the wireless communication function of the electronic device 200 may be implemented by the antenna 1, the antenna 2, the mobile communication module 250, the wireless communication module 260, the modulation and demodulation processor, the baseband processor, and the like.
  • Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in electronic device 200 may be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization.
  • the antenna 1 can be multiplexed as a diversity antenna of the wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
  • the mobile communication module 250 may provide a wireless communication solution including 2G/3G/4G/5G, etc. applied on the electronic device 200 .
  • the mobile communication module 250 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), and the like.
  • the mobile communication module 250 can receive electromagnetic waves from the antenna 1, filter and amplify the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation.
  • the mobile communication module 250 can also amplify the signal modulated by the modulation and demodulation processor, and then convert it into electromagnetic waves for radiation through the antenna 1 .
  • At least part of the functional modules of the mobile communication module 250 may be provided in the processor 210 . In some embodiments, at least part of the functional modules of the mobile communication module 250 may be provided in the same device as at least part of the modules of the processor 210 .
  • the modem processor may include a modulator and a demodulator.
  • the modulator is used to modulate the low frequency baseband signal to be sent into a medium and high frequency signal.
  • the demodulator is used to demodulate the received electromagnetic wave signal into a low frequency baseband signal. Then the demodulator transmits the demodulated low-frequency baseband signal to the baseband processor for processing.
  • the low frequency baseband signal is processed by the baseband processor and passed to the application processor.
  • the application processor outputs sound signals through audio devices (not limited to the speaker 270A, the receiver 270B, etc.), or displays images or videos through the display screen 294 .
  • the modem processor may be a stand-alone device.
  • the modem processor may be independent of the processor 210, and may be provided in the same device as the mobile communication module 250 or other functional modules.
  • the wireless communication module 260 can provide applications on the electronic device 200 including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellites Wireless communication solutions such as global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared technology (IR).
  • WLAN wireless local area networks
  • BT Bluetooth
  • GNSS global navigation satellite system
  • FM frequency modulation
  • NFC near field communication
  • IR infrared technology
  • the wireless communication module 260 may be one or more devices integrating at least one communication processing module.
  • the wireless communication module 260 receives electromagnetic waves via the antenna 2 , modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 210 .
  • the wireless communication module 260 can also receive the signal to be sent from the processor 210 , perform frequency modulation on the signal, amplify the signal, and then convert it into an electromagnetic wave for radiation through the antenna 2 .
  • the antenna 1 of the electronic device 200 is coupled with the mobile communication module 250, and the antenna 2 is coupled with the wireless communication module 260, so that the electronic device 200 can communicate with the network and other devices through wireless communication technology.
  • Wireless communication technologies may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), broadband code division Multiple access (wideband code division multiple access, WCDMA), time division code division multiple access (time-division code division multiple access, TD-SCDMA), long term evolution (long term evolution, LTE), BT, GNSS, WLAN, NFC, FM , and/or IR technology, etc.
  • GNSS may include global positioning system (GPS), global navigation satellite system (GLONASS), Beidou navigation satellite system (BDS), quasi-zenith satellite system (quasi-zenith) satellite system, QZSS) and/or satellite based augmentation systems (SBAS).
  • GPS global positioning system
  • GLONASS global navigation satellite system
  • BDS Beidou navigation satellite system
  • QZSS quasi-zenith satellite system
  • SBAS satellite based augmentation systems
  • the electronic device 200 implements a display function through a GPU, a display screen 294, an application processor, and the like.
  • the GPU is a microprocessor for image processing, and is connected to the display screen 294 and the application processor.
  • the GPU is used to perform mathematical and geometric calculations for graphics rendering.
  • Processor 210 may include one or more GPUs that execute program instructions to generate or alter display information.
  • Display screen 294 is used to display images, videos, and the like.
  • the display screen 294 includes a display panel.
  • the display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (active-matrix organic light).
  • LED diode AMOLED
  • flexible light-emitting diode flexible light-emitting diode (flex light-emitting diode, FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diode (quantum dot light emitting diodes, QLED) and so on.
  • the electronic device 200 may include one or N display screens 294 , where N is a positive integer greater than one.
  • the electronic device 200 can realize the shooting function through the ISP, the camera 293, the video codec, the GPU, the display screen 294 and the application processor.
  • the ISP is used to process the data fed back by the camera 293 .
  • the shutter is opened, the light is transmitted to the camera photosensitive element through the lens, the light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing, converting it into an image visible to the naked eye.
  • ISP can also perform algorithm optimization on image noise, brightness, and skin tone.
  • ISP can also optimize the exposure, color temperature and other parameters of the shooting scene.
  • the ISP may be provided in the camera 293 .
  • Camera 293 is used to capture still images or video.
  • the object is projected through the lens to generate an optical image onto the photosensitive element.
  • the focal length of the lens can be used to indicate the viewing range of the camera. The smaller the focal length of the lens, the larger the viewing range of the lens.
  • the photosensitive element may be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor.
  • CMOS complementary metal-oxide-semiconductor
  • the photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it into a digital image signal.
  • the ISP outputs the digital image signal to the DSP for processing.
  • DSP converts digital image signals into standard RGB, YUV and other formats of image signals.
  • the electronic device 200 may include cameras 293 with two or more focal lengths.
  • a digital signal processor is used to process digital signals, in addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 200 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy, and the like.
  • Video codecs are used to compress or decompress digital video.
  • the electronic device 200 may support one or more video codecs.
  • the electronic device 200 can play or record videos in various encoding formats, such as: moving picture experts group (moving picture experts group, MPEG) 1, MPEG2, MPEG3, MPEG4, and so on.
  • MPEG moving picture experts group
  • the NPU is a neural-network (NN) computing processor.
  • NN neural-network
  • Applications such as intelligent cognition of the electronic device 200 can be implemented through the NPU, for example: image recognition, face recognition, speech recognition, text understanding, and the like.
  • the NPU or other processors may be used to perform operations such as analysis and processing on images in the video stored by the electronic device 200 .
  • the external memory interface 220 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 200.
  • the external memory card communicates with the processor 210 through the external memory interface 220 to realize the data storage function. For example to save files like music, video etc in external memory card.
  • Internal memory 221 may be used to store computer executable program code, which includes instructions.
  • the processor 210 executes various functional applications and data processing of the electronic device 200 by executing the instructions stored in the internal memory 221 .
  • the internal memory 221 may include a storage program area and a storage data area.
  • the storage program area can store an operating system and an application program required for at least one function (such as a sound playback function, an image playback function, etc.).
  • the storage data area can store data (such as audio data, phone book, etc.) created during the use of the electronic device 200 .
  • the internal memory 221 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, universal flash storage (UFS), and the like.
  • non-volatile memory such as at least one magnetic disk storage device, flash memory device, universal flash storage (UFS), and the like.
  • the electronic device 200 may implement audio functions through an audio module 270, a speaker 270A, a receiver 270B, a microphone 270C, an earphone interface 270D, and an application processor.
  • the audio module 270 is used for converting digital audio signals into analog audio signal outputs, and also for converting analog audio inputs into digital audio signals. Audio module 270 may also be used to encode and decode audio signals. In some embodiments, the audio module 270 may be provided in the processor 210 , or some functional modules of the audio module 270 may be provided in the processor 210 .
  • Speaker 270A also referred to as a "speaker" is used to convert audio electrical signals into sound signals.
  • the electronic device 200 can listen to music through the speaker 270A, or listen to a hands-free call.
  • the speaker can play the comparison analysis result provided by the embodiment of the present application.
  • the receiver 270B also referred to as an "earpiece" is used to convert audio electrical signals into sound signals.
  • the voice can be answered by placing the receiver 270B close to the human ear.
  • the microphone 270C also called “microphone” or “microphone” is used to convert sound signals into electrical signals.
  • the user can make a sound by approaching the microphone 270C through the human mouth, and input the sound signal into the microphone 270C.
  • the electronic device 200 may be provided with at least one microphone 270C. In other embodiments, the electronic device 200 may be provided with two microphones 270C, which may implement a noise reduction function in addition to collecting sound signals. In other embodiments, the electronic device 200 may further be provided with three, four or more microphones 270C to collect sound signals, reduce noise, identify sound sources, and implement directional recording functions.
  • the headphone jack 270D is used to connect wired headphones.
  • the earphone interface 270D can be a USB interface 230, or can be a 3.5mm open mobile terminal platform (OMTP) standard interface, a cellular telecommunications industry association of the USA (CTIA) standard interface.
  • OMTP open mobile terminal platform
  • CTIA cellular telecommunications industry association of the USA
  • the pressure sensor 280A is used to sense pressure signals, and can convert the pressure signals into electrical signals.
  • the pressure sensor 280A may be provided on the display screen 294 .
  • the capacitive pressure sensor may be comprised of at least two parallel plates of conductive material. When a force is applied to pressure sensor 280A, the capacitance between the electrodes changes.
  • the electronic device 200 determines the intensity of the pressure according to the change in capacitance. When a touch operation acts on the display screen 294, the electronic device 200 detects the intensity of the touch operation according to the pressure sensor 280A.
  • the electronic device 200 may also calculate the touched position according to the detection signal of the pressure sensor 280A.
  • touch operations acting on the same touch position but with different touch operation intensities may correspond to different operation instructions. For example, when a touch operation whose intensity is less than the first pressure threshold acts on the short message application icon, the instruction for viewing the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, the instruction to create a new short message is executed.
  • the gyro sensor 280B may be used to determine the motion attitude of the electronic device 200 .
  • the angular velocity of electronic device 200 about three axes ie, x, y, and z axes
  • the gyro sensor 280B can be used for image stabilization.
  • the gyro sensor 280B detects the shaking angle of the electronic device 200, calculates the distance that the lens module needs to compensate according to the angle, and allows the lens to counteract the shaking of the electronic device 200 through reverse motion to achieve anti-shake.
  • the gyro sensor 280B can also be used for navigation and somatosensory game scenarios.
  • Air pressure sensor 280C is used to measure air pressure. In some embodiments, the electronic device 200 calculates the altitude through the air pressure value measured by the air pressure sensor 280C to assist in positioning and navigation.
  • Magnetic sensor 280D includes a Hall sensor.
  • the electronic device 200 can detect the opening and closing of the flip holster using the magnetic sensor 280D.
  • the electronic device 200 can detect the opening and closing of the flip according to the magnetic sensor 280D. Further, according to the detected opening and closing state of the leather case or the opening and closing state of the flip cover, characteristics such as automatic unlocking of the flip cover are set.
  • the acceleration sensor 280E can detect the magnitude of the acceleration of the electronic device 200 in various directions (generally three axes).
  • the magnitude and direction of gravity can be detected when the electronic device 200 is stationary. It can also be used to identify the posture of electronic devices, and can be used in applications such as horizontal and vertical screen switching, pedometers, etc.
  • the electronic device 200 can measure the distance through infrared or laser. In some embodiments, when shooting a scene, the electronic device 200 can use the distance sensor 280F to measure the distance to achieve fast focusing.
  • Proximity light sensor 280G may include, for example, light emitting diodes (LEDs) and light detectors, such as photodiodes.
  • the light emitting diodes may be infrared light emitting diodes.
  • the electronic device 200 emits infrared light to the outside through the light emitting diode.
  • Electronic device 200 uses photodiodes to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it may be determined that there is an object near the electronic device 200 . When insufficient reflected light is detected, the electronic device 200 may determine that there is no object near the electronic device 200 .
  • the electronic device 200 can use the proximity light sensor 280G to detect that the user holds the electronic device 200 close to the ear to talk, so as to automatically turn off the screen to save power.
  • Proximity light sensor 280G can also be used in holster mode, pocket mode automatically unlocks and locks the screen.
  • the ambient light sensor 280L is used to sense ambient light brightness.
  • the electronic device 200 can adaptively adjust the brightness of the display screen 294 according to the perceived ambient light brightness.
  • the ambient light sensor 280L can also be used to automatically adjust the white balance when taking pictures.
  • the ambient light sensor 280L can also cooperate with the proximity light sensor 280G to detect whether the electronic device 200 is in the pocket, so as to prevent accidental touch.
  • the fingerprint sensor 280H is used to collect fingerprints.
  • the electronic device 200 can use the collected fingerprint characteristics to realize fingerprint unlocking, accessing application locks, taking pictures with fingerprints, answering incoming calls with fingerprints, and the like.
  • the temperature sensor 280J is used to detect the temperature.
  • the electronic device 200 utilizes the temperature detected by the temperature sensor 280J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 280J exceeds a threshold value, the electronic device 200 reduces the performance of the processor located near the temperature sensor 280J in order to reduce power consumption and implement thermal protection.
  • the electronic device 200 heats the battery 242 to avoid abnormal shutdown of the electronic device 200 caused by the low temperature.
  • the electronic device 200 boosts the output voltage of the battery 242 to avoid abnormal shutdown caused by low temperature.
  • Touch sensor 280K also called “touch panel”.
  • the touch sensor 280K may be disposed on the display screen 294, and the touch sensor 280K and the display screen 294 form a touch screen, also called a "touch screen”.
  • the touch sensor 280K is used to detect a touch operation on or near it.
  • the touch sensor can pass the detected touch operation to the application processor to determine the type of touch event.
  • Visual output related to touch operations may be provided through display screen 294 .
  • the touch sensor 280K may also be disposed on the surface of the electronic device 200 , which is different from the location where the display screen 294 is located.
  • the bone conduction sensor 280M can acquire vibration signals.
  • the bone conduction sensor 280M can acquire the vibration signal of the vibrating bone mass of the human voice.
  • the bone conduction sensor 280M can also contact the pulse of the human body and receive the blood pressure beating signal.
  • the bone conduction sensor 280M can also be disposed in the earphone, combined with the bone conduction earphone.
  • the audio module 270 can analyze the voice signal based on the vibration signal of the vocal vibration bone mass obtained by the bone conduction sensor 280M, so as to realize the voice function.
  • the application processor can analyze the heart rate information based on the blood pressure beat signal obtained by the bone conduction sensor 280M, and realize the function of heart rate detection.
  • the keys 290 include a power-on key, a volume key, and the like. Keys 290 may be mechanical keys. It can also be a touch key.
  • the electronic device 200 may receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 200 .
  • Motor 291 can generate vibrating cues.
  • the motor 291 can be used for vibrating alerts for incoming calls, and can also be used for touch vibration feedback.
  • touch operations acting on different applications can correspond to different vibration feedback effects.
  • the motor 291 can also correspond to different vibration feedback effects for touch operations on different areas of the display screen 294 .
  • Different application scenarios for example: time reminder, receiving information, alarm clock, games, etc.
  • the touch vibration feedback effect can also support customization.
  • the indicator 292 can be an indicator light, which can be used to indicate the charging status, the change of power, and can also be used to indicate messages, missed calls, notifications, and the like.
  • the SIM card interface 295 is used to connect a SIM card.
  • the SIM card can be contacted and separated from the electronic device 200 by inserting into the SIM card interface 295 or pulling out from the SIM card interface 295 .
  • the electronic device 200 may support 1 or N SIM card interfaces, where N is a positive integer greater than 1.
  • the SIM card interface 295 can support Nano SIM card, Micro SIM card, SIM card and so on.
  • the same SIM card interface 295 can insert multiple cards at the same time. Multiple cards can be of the same type or different.
  • the SIM card interface 295 can also be compatible with different types of SIM cards.
  • the SIM card interface 295 is also compatible with external memory cards.
  • the electronic device 200 interacts with the network through the SIM card to implement functions such as call and data communication.
  • the electronic device 200 employs an eSIM, ie: an embedded SIM card.
  • the eSIM card can be embedded in the electronic device 200 and cannot be separated from the electronic device 200 .
  • FIG. 3 is a schematic diagram of a software structure of a client according to an embodiment of the present application.
  • the operating system in the client can be Android (Android) system, Microsoft Windows system (Windows), Apple mobile operating system (iOS) or Harmony OS (Harmony OS).
  • Android Android
  • Microsoft Windows system Windows
  • iOS Apple mobile operating system
  • Harmony OS Harmony OS
  • the operating system of the client is Hongmeng system as an example for description.
  • the Hongmeng system can be divided into four layers, including a kernel layer, a system service layer, a framework layer, and an application layer, and the layers communicate with each other through a software interface.
  • the kernel layer includes a kernel abstraction layer (Kernel Abstract Layer, KAL) and a driver subsystem.
  • KAL Kernel Abstract Layer
  • the driver subsystem may include a hardware driver framework (Hardware Driver Foundation, HDF).
  • HDF Hardware Driver Foundation
  • the hardware driver framework can provide unified peripheral access capability and driver development and management framework.
  • the multi-kernel kernel layer can select the corresponding kernel for processing according to the needs of the system.
  • the system service layer is the core capability set of the Hongmeng system, and the system service layer provides services to applications through the framework layer.
  • This layer can include:
  • System Basic Capability Subsystem Set Provides basic capabilities for the operation, scheduling, and migration of distributed applications on multiple devices in the HarmonyOS system. It can include subsystems such as distributed soft bus, distributed data management, distributed task scheduling, Ark multi-language runtime, common base library, multi-mode input, graphics, security, artificial intelligence (AI), user program framework, etc. .
  • Ark multi-language runtime provides C or C++ or JavaScript (JS) multi-language runtime and basic system class library, and it can also be used for static Java programs using Ark compiler (that is, using Java in the application or framework layer). part of the language development) to provide the runtime.
  • Ark multi-language runtime provides C or C++ or JavaScript (JS) multi-language runtime and basic system class library, and it can also be used for static Java programs using Ark compiler (that is, using Java in the application or framework layer). part of the language development) to provide the runtime.
  • Ark compiler that is, using Java in the application or framework layer. part of the language development
  • Basic software service subsystem set Provide public and general software services for Hongmeng system. It can include subsystems such as event notification, telephony, multimedia, Design For X (DFX), MSDP&DV, etc.
  • Enhanced software service subsystem set Provide Hongmeng system with differentiated capability-enhanced software services for different devices. It can include smart screen proprietary business, wearable proprietary business, and Internet of Things (Internet of Things, IoT) proprietary business subsystems.
  • IoT Internet of Things
  • Hardware service subsystem set Provide hardware services for Hongmeng system. It can include subsystems such as location services, biometric identification, wear-specific hardware services, and IoT-specific hardware services.
  • the framework layer provides multi-language user program frameworks and ability (Ability) frameworks such as Java, C, C++, JS, etc. for Hongmeng system application development, and two user interface (User Interface, UI) frameworks (including Java UI for Java language).
  • framework, JS UI framework for JS language as well as a variety of software and hardware services open to the outside world, the multi-language framework application programming interface (Application Programming Interface, API).
  • API Application Programming Interface
  • the application layer includes system applications and third-party non-system applications.
  • System applications may include applications that are installed by default on electronic devices such as the desktop, control bar, settings, and phone.
  • Extended applications can be non-essential applications developed and designed by manufacturers of electronic equipment, such as applications such as electronic equipment housekeeper, replacement migration, sticky notes, weather and other applications.
  • third-party non-system applications can be developed by other manufacturers, but can run applications in the Hongmeng system, such as games, navigation, social or shopping applications.
  • the application of Hongmeng system consists of one or more meta-programs (Feature Ability, FA) or meta-services (Particle Ability, PA).
  • FA has a UI interface that provides the ability to interact with users.
  • PA has no UI interface, it provides the ability to run tasks in the background and a unified data access abstraction.
  • PA mainly provides support for FA, such as providing computing power as a background service, or providing data access capabilities as a data warehouse.
  • Applications developed based on FA or PA can implement specific business functions, support cross-device scheduling and distribution, and provide users with a consistent and efficient application experience.
  • Multiple electronic devices running the Hongmeng system can achieve hardware mutual assistance and resource sharing through distributed soft bus, distributed device virtualization, distributed data management and distributed task scheduling.
  • FIG. 4 shows a schematic flowchart of the QUIC data transmission method provided by the present application.
  • the method can be applied to the above-mentioned client and server.
  • the client can obtain the application layer protocol supported by the client by querying the application layer protocol recorded in the protocol stack (Protocol Stack).
  • the application layer protocol in the protocol stack can be recorded through static configuration or through application startup registration of an application layer protocol (Application Layer Protocol, ALP).
  • Application layer protocols define how application processes running on different end systems pass messages to each other.
  • the application layer protocol is implemented based on the application layer, and the application layer is the seventh layer in the Open Systems Interconnection reference (OSI) model.
  • SASE SASE
  • One or more common application service elements Computer Application Service Element, CASE.
  • Each SASE can provide specific application services, such as File Transfer Access Method (FTAM), Message Handling System (MHS), Virtual Terminal Protocol (VAP), etc.
  • CASE can provide a set of common application services, such as Association Control Service Element (ACSE), Reliable Transfer Service Element (RTSE) and Remote Operations Service Element (ROSE) )Wait.
  • ALP Application Layer Protocol
  • ALP Application Layer Protocol
  • Common application layer protocols include HTTP, RTP/RTCP, Domain Name System (DNS), File Transfer Protocol (FTP), Simple Mail Transfer Protocol (Simple Mail Transfer Protocol, SMTP), Simple Network Management Protocol (simple Network Management Protocol, SNMP), Remote Login Protocol (Telnet), Routing Information Protocol (Routing Information Protocol, RIP) and Network File System (Network File System, NFS), etc.
  • static configuration means that when QUIC is deployed in the client, the application layer protocol that the client can support is written in the QUIC protocol stack through configuration instructions.
  • the ALP application startup registration is that when an application in the client supports QUIC as its transport layer protocol, it actively registers the protocol type used by itself with the local QUIC protocol stack module.
  • the QUIC protocol stack module records the protocol registration information according to the application. The corresponding protocol type.
  • the server can also obtain the application layer protocol supported by the server by querying the application layer protocol recorded in the protocol stack.
  • the acquisition method is the same as that in S301, and will not be repeated here.
  • the client responds to the first data request, initiates a handshake to the server, and requests to establish a first QUIC session.
  • the first data request may come from an application in the client.
  • the first data request may be a data request sent by the client to the server corresponding to the shopping application to obtain data in the starting interface of the shopping application.
  • the application-side protocol used by the first data request may be determined according to the type of data obtained by the first data request. For example, for text and picture data, HTTP3.0 can be used, and for live video data, RTP/RTCP can be used.
  • a socket (Socket) connection corresponding to each application layer protocol of QUIC may be created before the client responds to the first data request.
  • the handshake request sent by the client to the server can be an initial (Initial) data packet.
  • the Initial data packet contains a long header (type value 0x0), data packet length and packet number fields, It can carry the first CRYPTO frame sent by the client and the server for key exchange, and carry the two-way Acknowledge character (ACK) between the client and the server.
  • the server responds to the handshake request, and returns a handshake packet, where the handshake packet includes the application layer protocol supported by the server.
  • the server After the server receives the Initial[0]:CRYPTO[CH], it generates an Initial data packet, a handshake (Handshake) data packet and a 0.5-RTT data packet of the server according to the COPYTO frame, and converts these The data packets are combined into a handshake message and sent to the client.
  • a handshake Handshake
  • the structure of the initial data packet of the server is consistent with that of the server.
  • the packet number of the initial data packet of the server is 0, which includes the COPYTO frame of ServerHello and the ACK of Initial[0]:CRYPTO[CH]. It can be represented by Initial[0]:CRYPTO[SH]ACK[0].
  • the Handshake packet contains a long header (type value 0x2), packet length and packet number fields to carry encrypted handshake messages and ACKs from the server and client.
  • the encrypted handshake message includes an application layer protocol negotiation (Application Layer Protocol Negotiation, ALPN) field, and the application layer protocol supported by the server can be recorded in the ALPN field.
  • ALPN Application Layer Protocol Negotiation
  • the packet number of the Handshake data packet is 0, and the packet carries a CRYPTO frame. It can be represented by Handshake[0]:CRYPTO[EE,CERT,CV,FIN].
  • the EE is an extension element (Extend Element, EE), and the EE can carry additionally advertised parameters. For example, ALPN can be carried through the EE and advertised in the EE.
  • CERT refers to the certificate (Certificate, CERT)
  • CV refers to the check code
  • FIN is the end mark.
  • CERT and CV can be used for verification when the QUIC session is established.
  • the 0.5-RTT data packet refers to the 1-RTT data packet that is only sent from the server to the client. Since it is sent from the 0.5th RTT cycle, it is called 0.5-RTT data.
  • 0.5-RTT data packets include reliable data stream (Stream) frames, STREAM frames can implicitly create data streams and carry stream data. Implicitly creating a data stream means that when the client or server creates a STREAM frame, if the stream ID indicated in the STREAM frame does not exist, a data stream using the stream ID is created, and the STREAM frame is sent through the data stream. It can be represented by 1-RTT[0]: STREAM[1, "!].
  • the client generates an application layer protocol list corresponding to the first QUIC session according to the application layer protocol supported by the client and the application layer protocol supported by the server.
  • the client after receiving the handshake message sent by the server, the client obtains the application layer protocol supported by the server in the Handshake data packet. Then, the client determines the application layer protocols supported by both the server and the client, records these application layer protocols, and generates an application layer protocol list. For example, if the application layer protocols supported by the client include HTTP3.0, RTP/RTCP, and DND, and the application layer protocols supported by the server include HTTP3.0, RTP/RTCP, and FTP, the application layer protocol list includes HTTP3.0 and RTP /RTCP.
  • a first QUIC session is established between the client and the server, and the client sends the application layer protocol list corresponding to the first QUIC session to the server.
  • the client generates a corresponding data packet according to the data in each data packet of the handshake message.
  • Initial[1]:ACK[0] can be generated. That is, the Initial data packet with the packet number 1 includes the ACK of the received Initial data packet.
  • Handshake[0]:CRYPTO[EE,CERT,CV,FIN] the client can generate Handshake[0]:CRYPTO[FIN],ACK[0].
  • the client can obtain the application layer protocol supported by the server according to the EE field in the CRYPTO in Handshake[0]. Then, according to the application layer protocol supported by the local end and the application layer protocol supported by the server, a list of application layer protocols corresponding to the first QUIC session is generated.
  • the list of application layer protocols corresponding to the first QUIC session includes the protocols supported by both the client and the server. Application layer protocol.
  • the generated application layer protocol list corresponding to the first QUIC session may be recorded in the protocol stacks of the client and the server. Recording the application layer list corresponding to the first QUIC session may be implemented by establishing a first application layer list in the protocol stack, and associating the first QUIC session with the first application layer list. For example, when the first QUIC session and the first application layer list are "h3" and "qrt", it can be recorded as the first QUIC session corresponding to the first application layer list, and "h3" and "qrt" are recorded in the first application layer list .
  • recording the application layer list corresponding to the first QUIC session may also be implemented by associating the first QUIC session with the application layer protocol.
  • application layer protocols such as "h3”, “qrt”, and “Doq” are recorded in the protocol stack.
  • the application layer protocol list corresponding to the first QUIC session may be based on at least two application layer protocols supported by the client and the server at the same time. For example, when the client does not use DNS for a long time, the client and server support "h3", “qrt” and "Doq” at the same time, the generated application layer list corresponding to the first QUIC session can only include “h3” and "Doq” qrt".
  • the application layer protocols that are supported by both the client and the server but are used infrequently are ignored, and only commonly used application layer protocols are recorded in the application layer protocol list corresponding to the first QUIC session. It can reduce the storage load for the server to record the application layer protocol list and save resources.
  • the client can generate the ACK of Handshake[0], and write the application layer protocol list corresponding to the first QUIC session into the ALPN field in the Handshake encrypted handshake message to obtain Handshake[0]:CRYPTO[FIN],ACK[ 0].
  • the client can also generate 1-RTT[0]:STREAM[0,”!],ACK[0] according to 1-RTT[0]:STREAM[1,"!], which includes STREAM frame and ACK for STREAM[0, ""].
  • the client sends the plurality of correspondingly generated data packets to the server as one message.
  • the server After receiving the message, the server generates Handshake[1]:ACK[0] and 1-RTT[1]:HANDSHAKE_DONE,STREAM[3,"!],ACK[ 0], confirm the completion of the handshake, and return the ACK of the completion of the handshake to the client, and the establishment of the first QUIC session is completed.
  • the first QUIC session After the first QUIC session is established, it includes a first data stream, and the first data stream is used to carry data corresponding to the first data request.
  • the data stream includes a reliable data stream (Stream) or an unreliable data stream (Flow).
  • Stream reliable data stream
  • Flow unreliable data stream
  • the specific form of the data stream needs to be determined according to the data type carried by the data stream. For example, if the data of live video needs to be reliable, then It can be transmitted in the form of Stream. In some scenarios, DNS data does not need to be reliable and can be transmitted in the form of Flow.
  • the first data stream is a unidirectional or bidirectional data stream initiated by the client.
  • Each data stream corresponds to a fixed stream ID, and the stream ID is a 62-bit number, that is, 0 to 2 62 -1 in decimal.
  • the lowest bit (0x1) of the stream ID identifies the originator of the stream.
  • the stream ID of the stream initiated by the client is even (the bit is set to 0), and the stream ID of the stream initiated by the server is odd (the bit is set to 1).
  • the second low-order bit (0x2) of the stream ID is used to distinguish bidirectional data streams (bits set to 0) and unidirectional data streams (bits set to 1).
  • Each stream corresponds to a stream ID space, which is used to record the corresponding stream ID.
  • Each type of stream space records the stream ID from the minimum value (that is, the third low-order bit starts from 0), and each type of continuous stream is is created with a numerically increasing stream ID.
  • the bidirectional data stream initiated by the client starts to record the stream ID from 0x0 (the first three low-order bits are all 0), and the bidirectional data stream initiated by the server starts to record the stream ID from 0x1 (the first low-order 1 is 1, the second and The third low-order bit is 0), the unidirectional data stream initiated by the client starts from 0x2 (the first and third low-order bits are 0, and the second low-order bit is 1) to record the stream ID, and the one-way data flow initiated by the server starts from 0x2 0x3 (the first and second low-order bits are 1, and the third low-order bit is 0) to start recording the stream ID.
  • the first data stream is a unidirectional data stream initiated by the client, its stream ID is 0x2, and if the first data stream is a bidirectional data stream initiated by the client, its stream ID is 0x0.
  • the first frame sent to the server may be an ALP_STREAM frame
  • the ALP_STREAM frame is used to implicitly create a Stream and carry the data of the Stream.
  • the ALP_STREAM frame is the first type of data frame
  • the STREAM frame is the second type of data frame.
  • the ALP_STREAM frame has an increased ALP field.
  • the ALP field is used to carry the ALP field, and the ALP field is a structure used to indicate the application layer protocol corresponding to the ALP_STREAM frame.
  • the ALP field could be:
  • Alp length identifies the length of the Alp field field.
  • Alp next Protocol((7) is the application layer protocol identification string, which records the ALPN protocol ID corresponding to the application layer protocol.
  • the format of an ALP_STREAM frame could be:
  • the ALP_STREAM frame type field may be assigned by the Internet Assigned Numbers Authority (IANA). As an example, 0b00 can be used? ? ? XXX, for example, a set of values from 0x20 to 0x27 shown in the example above.
  • IANA Internet Assigned Numbers Authority
  • the application layer protocol used by the Stream is the protocol declared in the ALP domain, and the protocol declared in the ALP domain must be the protocol supported by the QUIC session ALPN negotiation (that is, the list of application layer protocols corresponding to the first QUIC session).
  • the application layer protocol in otherwise the creation of Stream fails and STREAM_ALP_ERROR is generated. Discard the ALP_STREAM frame or notify to close the Stream, and clear the associated information of the corresponding Stream ID and application layer protocol.
  • the client and server associate the Stream ID of the Stream with the application layer protocol corresponding to the Stream. Since ALP_STREAM frames and STREAM frames share the Stream ID space, ALP_STREAM frames and STREAM frames with the same Stream ID are frame data under the same Stream. Therefore, the subsequent packets of the Stream may not use the ALP_STREAM frame, but only carry the STREAM frame.
  • the client or server receives the STREAM frame, the STREAM frame can be sent to the corresponding application layer protocol according to the Stream ID in the STREAM frame.
  • the protocol application or module further parses and processes.
  • the application layer protocol corresponding to the STREAM frame can be accurately obtained without using the ALP_STREAM frame, so that the Stream can also use the STREAM frame in a QUIC frame subsequently.
  • Data streams of different application layer protocols are transmitted under the session.
  • the Stream ID created by the ALP_STREAM frame is 0x2, and the string recorded in the ALP field is "h3"
  • the application layer protocol carried by the Stream whose Stream ID is 0x2 is HTTP3.0.
  • the STREAM frame is sent to a protocol application or module corresponding to HTTP 3.0 for further analysis and processing.
  • the protocol declared in the ALP field must be the same as the application-layer protocol identified when the Stream is created. If inconsistent, the client or server MAY generate a "STREAM_ALP_ERROR" error indicating an application-layer protocol error, and log STREAM_ALP_ERROR.
  • STREAM_ALP_ERROR can be suppressed.
  • multiple STREAM_ALP_ERROR occurring within a preset duration can be recorded only 5 times, and the method of suppressing STREAM_ALP_ERROR error is not limited in this application.
  • Streams can also be created using STREAM frames.
  • the default application carried by the Stream is the first application layer protocol in the ALPN negotiation when the QUIC session is created, that is, the first application layer protocol in the application layer protocol list.
  • the order of the application layer protocols in the application layer protocol list is "h3", "qrt”.
  • the application layer protocol carried by the Stream is "h3”.
  • the STREAM frame is sent to the corresponding HTTP3.0
  • the protocol application or module further parses and processes.
  • the lower three bits of the ALP_STREAM frame type determine the fields present in the frame.
  • the OFF bit (0x04) in the ALP_STREAM frame type is used to indicate whether there is an Offset field.
  • the Offset field is used to indicate the offset of the ALP_STREAM frame. When the OFF bit is set to 1, the Offset field ([Offset(i)] in the ALP_STREAM frame) is present. When the OFF bit is set to 0, the Offset field does not exist. When the Offset field is not present, the stream data starts with an offset of 0 (ie an ALP_STREAM frame contains the first byte of the stream, or the end of a stream that contains no data).
  • the LEN bit (0x02) in the ALP_STREAM frame type is used to indicate whether there is a Length field.
  • the Length field is used to indicate the length of Stream Data(..) in the ALP_STREAM frame.
  • the Length field [Length(i)] in the ALP_STREAM frame) is present.
  • the Length field is absent.
  • the Stream Data field extends to the end of the message.
  • the FIN bit (0x01) in the ALP_STREAM frame type is used to indicate that the ALP_STREAM frame identifies the end of the code stream.
  • the final size of the Stream is the sum of the offset and the length of this frame.
  • the first frame sent to the server may be an ALP_DATAGRAM frame
  • the ALP_DATAGRAM frame is used to implicitly create a Flow and carry the data of the Flow.
  • the ALP_DATAGRAM frame is the first type of data frame
  • the DATAGRAM frame is the second type of data frame.
  • the ALP_DATAGRAM frame has an increased ALP field.
  • the ALP field is the same as in the ALP_STREAM frame.
  • the format of an ALP_DATAGRAM frame could be:
  • the ALP_DATAGRAM frame type field may be allocated by IANA. As an example, 0b00 can be used? ? ? ? ? ? X in the form of, for example, a set of values from 0x40 to 0x41 shown in the example above.
  • the application layer protocol used by the Flow is the protocol declared in the ALP domain, and the protocol declared in the ALP domain must be a protocol supported by the QUIC session ALPN negotiation (that is, the application layer protocol in the application layer protocol list) , otherwise the flow creation fails and DATAGRAM_ALP_ERROR is generated. Discard the ALP_DATAGRAM frame or notify to close the Flow.
  • the DATAGRAM frame may not include the Flow ID, and accordingly, the ALP_DATAGRAM frame does not include the Flow ID.
  • the ALP_DATAGRAM frame needs to be used , to ensure that the application layer protocol used by the transmitted data can be accurately obtained.
  • the packets under each Flow are carried by the same type of frame, that is, the packets of the same Flow are all carried by the ALP_DATAGRAM frame or all of them are carried by the DATAGRAM frame.
  • the DATAGRAM frame may contain the Flow ID.
  • the client and the server can associate the Flow ID of the Flow with the application layer protocol corresponding to the Flow. Since the ALP_DATAGRAM frame and the DATAGRAM frame share the Flow ID space, it can be determined that the ALP_DATAGRAM frame and the DATAGRAM frame using the same Flow ID are frame data under the same Flow. Therefore, the subsequent packets of the Flow may not use the ALP_DATAGRAM frame, but only carry the DATAGRAM frame.
  • the client or server receives the DATAGRAM frame, the DATAGRAM frame can be sent to the corresponding application layer protocol according to the Flow ID in the DATAGRAM frame.
  • the protocol application or module further parses and processes.
  • the application layer protocol corresponding to the DATAGRAM frame can be accurately obtained without using the ALP_DATAGRAM frame, so that the DATAGRAM frame can also be used in a QUIC session.
  • Transport data streams of different application layer protocols are possible.
  • the Flow ID created by the ALP_DATAGRAM frame is 0x2, and the string recorded in the ALP field is "h3"
  • the application layer protocol carried by the Flow whose Flow ID is 0x2 is HTTP3.0.
  • the DATAGRAM frame is sent to a protocol application or module corresponding to HTTP3.0 for further analysis and processing.
  • the protocol declared in the ALP field must be consistent with the application layer protocol identified when the Flow is created. If inconsistent, the client or server can generate a "DATAGRAM_ALP_ERROR" error indicating an application layer protocol error, and log DATAGRAM_ALP_ERROR.
  • DATAGRAM_ALP_ERROR can be suppressed, for example, multiple DATAGRAM_ALP_ERROR occurring within a preset time period can be recorded only 5 times, and the method of suppressing DATAGRAM_ALP_ERROR error is not limited in this application.
  • the Flow may also be created using the DATAGRAM frame.
  • the application carried by the default Flow is the first application layer protocol in the ALPN negotiation when the QUIC session is created, that is, the first application layer protocol in the application layer protocol list.
  • the order of the application layer protocols in the application layer protocol list is "h3", "qrt”.
  • the application layer protocol carried by the DATAGRAM is "h3”.
  • the DATAGRAM frame is sent to the corresponding HTTP3.0
  • the protocol application or module further parses and processes.
  • the least significant bits of the ALP_DATAGRAM frame type determine the fields present in the frame.
  • the LEN bit (0x01) in the ALP_DATAGRAM frame type is used to indicate whether there is a Length field.
  • the Length field is used to indicate the length of the Datagram Data(..) in the ALP_DATAGRAM frame. When the LEN bit is set to 1, the Length field ([Length(i)] in the ALP_DATAGRAM frame) is present. When the LEN bit is set to 0, the Length field is absent. When the Length field does not exist, the Datagram Data field extends to the end of the message.
  • the server and the client may also dynamically negotiate the bearer application layer protocol.
  • a new extension frame may be created to implement dynamic negotiation of the application layer protocol of the bearer. For example, a first notification frame for notifying the client or the server to add at least one application layer protocol to the locally stored application layer protocol list is created.
  • a second notification frame for notifying the client or the server to add at least one application layer protocol to the locally stored application layer protocol list is created.
  • the first notification frame may be a NEW_ALPN frame.
  • the first notification frame may be a NEW_ALPN frame.
  • the second notification frame may be a REMOVE_ALPN frame. For example, after removing at least one application layer protocol in the application layer protocol list in the local QUIC protocol stack of the client, send a REMOVE_ALPN frame to the server to notify the server that the local end supports application layer protocols are reduced.
  • client and the server also record the application layer protocols that the local end can support.
  • the application layer protocol when adding at least one application layer protocol to the application layer protocol list, if the added at least one application layer protocol is an application layer protocol not yet supported by the local end, the application layer protocol may also be recorded as this The application layer protocol that the terminal can support. When at least one application layer protocol in the application layer protocol list is removed, the application layer protocol may also be removed from the application layer protocols that the local end can support.
  • the format of a NEW_ALPN frame could be:
  • the type field of the NEW_ALPN frame may be allocated by IANA, which is represented by "to be done (TBD) 1" in the example.
  • the NEW_ALPN frame can include two fields, namely the [Length(i)] field and the [Alp list(i)] field, the [Length(i)] field is used to indicate the length of the NEW_ALPN frame, and the [Alp list(i)] field At least one application layer protocol added to the application layer protocol list is recorded in . Recording the application layer protocol in [Alp list(i)] can be achieved by recording the ALPN protocol ID corresponding to the application layer protocol.
  • the format of the REMOVE_ALPN frame can be:
  • the type field of the REMOVE_ALPN frame can be allocated by IANA, which is represented by "TBD2" in the example.
  • REMOVE_ALPN frame can include two fields, namely [Length(i)] field and [Alp list(i)] field, [Length(i)] field is used to indicate the length of REMOVE_ALPN frame, and [Alp list(i)] At least one application-layer protocol removed from the application-layer protocol list is recorded in . Recording the application layer protocol in [Alp list(i)] can be achieved by recording the ALPN protocol ID corresponding to the application layer protocol.
  • both ends of the QUIC protocol remove the application layer protocol through the REMOVE_ALPN frame, if the receiving end finds that there is a corresponding Stream or Flow, it should actively revoke the corresponding Stream or Flow.
  • the corresponding frame After receiving a STREAM frame or ALP_SREAM frame corresponding to the Stream ID, or receiving a DATAGRAM frame or ALP_DATAGRAM frame corresponding to the Flow ID, the corresponding frame should be discarded, and a corresponding error code should be generated.
  • This error code can also suppress the frequency of generation.
  • the method of suppressing the generation frequency may refer to the method of suppressing the generation frequency of STREAM_ALP_ERROR or suppressing the generation frequency of DATAGRAM_ALP_ERROR.
  • NEW_ALPN or REMOVE_ALPN frame is generally advertised to the client by the QUIC server, but the QUIC client is also allowed to notify the server, which is not limited in this application.
  • extension frames can also be used to implement, for example, the corresponding relationship between Stream ID or Flow ID and application layer protocol (application layer protocol not recorded in the application layer protocol list) is recorded by the extension frame.
  • application layer protocol application layer protocol not recorded in the application layer protocol list
  • the receiver receives the extended frame, the corresponding relationship is recorded.
  • the STREAM or DATAGRAM frame of the Stream ID or Flow ID is received again, the data frame is sent to the corresponding protocol application or module for further analysis and processing according to the recorded correspondence.
  • the client responds to the second data request, and obtains the second application layer protocol used by the second data request.
  • the second data request may be generated by the client in response to a user operation, and the second data request is the same as the Internet Protocol (Internet Protocol, ip) address of the destination end of the first data request.
  • the second application layer protocol may be the same as or different from the first application layer protocol, which is not limited herein.
  • the shopping application when the client receives an operation instruction from the user indicating to enable live video in the shopping application, the shopping application responds to the user's operation instruction, generates a second data request, and requests the server for live video resources.
  • the live video resource may be transmitted using the RTP protocol, that is, the second application layer protocol may be the RTP protocol.
  • the client determines whether the second application layer protocol used by the second data request is in the application layer protocol list corresponding to the first QUIC session. If the second application layer protocol is in the application layer protocol list corresponding to the first QUIC session, then Go to S310, otherwise go to S309.
  • the client establishes a second QUIC session with the server.
  • the second data request cannot reuse the first QUIC session, and a re-handshake is required to establish a second QUIC session to Bearing the RTP protocol data corresponding to the second data request.
  • the client establishes a second data stream in the first QUIC session.
  • the second data request may multiplex the first QUIC session, and the client generates and sends an ALP_STREAM frame to the server. .
  • the ALP_STREAM frame instructs the client and the server to generate a new Stream (ie, the second data stream).
  • the Stream ID of the Stream is associated with the RTP protocol.
  • the server or client receives the STREAM frame of the Stream ID, it will The received STREAM frame is sent to the protocol application or module corresponding to RTP for further analysis and processing.
  • the number of data streams in each QUIC session in the protocol stack may be recorded, and the change in the number of data streams may be recorded when a data stream is generated or destroyed under the QUIC session.
  • the number of data streams in the QUIC session is 0, and there is no new data stream in the QUIC session after a preset duration, the QUIC session can be disconnected and the connection is no longer maintained.
  • the number of data streams in the first QUIC session is 1.
  • the second data stream is established under the first QUIC session, add 1 to the number of data streams in the first QUIC session, that is, the number of data streams in the first QUIC session is 2.
  • the first data stream may be destroyed, and the number of data streams in the first QUIC session becomes 1.
  • the number of data streams in the first QUIC session becomes 0. If the number of data streams in the first QUIC session is 0 for more than 60 seconds, the first QUIC session can be disconnected.
  • FIG. 5 shows a schematic flowchart of another QUIC data transmission method provided by the present application.
  • the second application layer protocol can be The layer protocol is added to the application layer protocol list, and then the first QUIC session is multiplexed to transmit the data corresponding to the second data request.
  • the client determines whether the second application layer protocol used by the second data request is in the application layer protocol list corresponding to the first QUIC session. If the second application layer protocol is in the application layer protocol list corresponding to the first QUIC session, then Go to S310, otherwise go to S311.
  • the client establishes a second data stream in the first QUIC session.
  • S310 is consistent with the above-mentioned embodiment, and details are not described here.
  • the client adds the second application layer protocol to the application layer protocol list corresponding to the first QUIC session.
  • the second application layer protocol when the second application layer protocol is not in the application layer protocol list corresponding to the first QUIC session, the second QUIC session between the client and the server is not established, but the second application layer protocol is not established.
  • the application layer protocol list corresponding to the first QUIC session stored locally on the client. For example, if the current client's local application layer protocol list includes "h3" and "qrt", and the second application layer protocol is DNS, then "Doq" can be written into the client's local application layer protocol list.
  • the local application layer protocol list includes "h3", "qrt" and "Doq".
  • the server adds the second application layer protocol to the application layer protocol list corresponding to the first QUIC session according to the application layer protocol list update instruction corresponding to the first QUIC session.
  • the client can send the NEW_APLN frame shown in S306 to the server, where the [Alp list(i)] field in the frame includes the first Two application layer protocols.
  • the [Alp list(i)] field in the frame may include "Doq".
  • the server After receiving the NEW_APLN frame, the server writes "Doq” into the application layer protocol list corresponding to the first QUIC session stored locally on the server side. After the update, the server side writes "Doq” into the application layer protocol list corresponding to the first QUIC session locally on the server side. Includes “h3”, “qrt”, and "Doq”.
  • S311 , S312 and S313 are consecutive steps.
  • S311, S312 and S313 can be deployed and executed separately.
  • S311 can be executed after S307
  • S312 needs to be executed after S311, but the remaining steps can be inserted between S311.
  • S313 needs to be executed after S312, but other steps can be inserted between S313.
  • sequence of steps of the QUIC data transmission method may be: S301, S302, S303, S304, S305, S306, S307, S311, S312, S308, S313, S310.
  • sequence of steps of the QUIC data transmission method may also be: S301, S302, S303, S304, S305, S306, S307, S311, S308, S312, S313, and S310, which are not limited here.
  • both the client and the server can dynamically negotiate the application layer protocol carried, so that both the client and the server support the second application layer protocol, and the client executes S310 to establish the first QUIC session in the first QUIC session.
  • the second data stream is used to transmit the data corresponding to the second data request.
  • the client when the second application layer protocol is not in the application layer protocol list corresponding to the first QUIC session, the client can also multiplex the first QUIC session to transmit data corresponding to the second data request, and a data transmission method is added. It can further reduce the data transmission delay and improve the efficiency of chain construction.
  • FIG. 6 shows a schematic flowchart of another QUIC data transmission method provided by the present application.
  • the second data request is initiated by the server.
  • the method includes:
  • the client responds to the first data request, initiates a handshake to the server, and requests to establish a first QUIC session.
  • the server responds to the session establishment request, and returns a handshake request, where the handshake request includes an application layer protocol supported by the server.
  • the client generates an application layer protocol list corresponding to the first QUIC session according to the application layer protocol supported by the client and the application layer protocol supported by the server.
  • a first QUIC session is established between the client and the server, and the client sends the application layer protocol list corresponding to the first QUIC session to the server.
  • the server responds to the second data request, and obtains the second application layer protocol used by the second data request.
  • the second data request may be initiated by the server to the client based on the requirements of the application. For example, when the server dynamically pushes a broadcast or unicast notification or message (such as a live video scene) to the client, the server will initiate a second data request to the client.
  • a broadcast or unicast notification or message such as a live video scene
  • the server when the server needs to push the live video to the client based on the requirements of the application, the server may generate a second data request, and request the client to transmit the live video resource. Since the live video resource can be transmitted using the RTP protocol, that is, the second application layer protocol can be the RTP protocol.
  • the server determines whether the second application layer protocol used by the second data request is in the application layer protocol list corresponding to the first QUIC session. If the second application layer protocol is in the application layer protocol list corresponding to the first QUIC session, then Go to S410, otherwise go to S409.
  • the server establishes a second QUIC session with the client.
  • the second data request if the RTP protocol is not in the application layer protocol list corresponding to the first QUIC session, the second data request cannot reuse the first QUIC session, and needs to re-handshake with the client to establish the second QUIC session. session to carry the RTP protocol data corresponding to the second data request.
  • the server establishes a second data stream in the first QUIC session.
  • the second data request may multiplex the first QUIC session, and the server generates and sends the client an ALP_STREAM frame.
  • the ALP_STREAM frame instructs the server and the client to generate a new Stream (ie, the second data stream).
  • the Stream ID of the Stream is associated with the RTP protocol.
  • the server or client receives the STREAM frame of the Stream ID, it will The received STREAM frame is sent to the protocol application or module corresponding to RTP for further analysis and processing.
  • the number of data streams in each QUIC session in the protocol stack can be recorded, and when a data stream is generated or destroyed under the QUIC session, the change in the number of data streams is recorded.
  • the number of data streams in the QUIC session is 0, and there is no new data stream in the QUIC session after a preset duration, the QUIC session can be disconnected and the connection is no longer maintained.
  • FIG. 7 shows a schematic flowchart of another data transmission method provided by the present application.
  • the server initiates a second data request, and when the second application layer protocol is not in the application layer protocol list, the second application layer protocol is added to the application layer protocol list, and then reused The step of transmitting the data corresponding to the second data request in the first QUIC session.
  • the server determines whether the second application layer protocol used by the second data request is in the application layer protocol list corresponding to the first QUIC session. If the second application layer protocol is in the application layer protocol list corresponding to the first QUIC session, then Go to S310, otherwise go to S311.
  • the server establishes a second data stream in the first QUIC session.
  • S410 is consistent with the above-mentioned embodiment, and details are not described here.
  • the server adds the second application layer protocol to the application layer protocol list corresponding to the first QUIC session.
  • the server when the second application layer protocol is not in the application layer protocol list corresponding to the first QUIC session, the server does not establish a second QUIC session with the client, but uses the second application layer protocol Added to the application layer protocol list corresponding to the first QUIC session stored locally on the server. For example, if the current server's local application layer protocol list includes "h3" and "qrt", and the second application layer protocol is DNS, then "Doq" can be written into the server's local application layer protocol list, and the updated service The local application layer protocol list includes "h3", "qrt” and "Doq".
  • the server adds the second application layer protocol to the application layer protocol list according to the application layer protocol list update instruction.
  • the server can send the NEW_APLN frame shown in S306 to the client, where the [Alp list(i)] field in the frame includes the first Two application layer protocols.
  • the [Alp list(i)] field in the frame may include "Doq".
  • the client After receiving the NEW_APLN frame, the client writes "Doq" into the application layer protocol list corresponding to the first QUIC session stored in the client's local area. After the update, the client's local application layer protocol list includes "h3", "" qrt" and "Doq".
  • S411 , S412 and S413 are consecutive steps.
  • S411, S412 and S413 can be deployed and executed separately.
  • S411 can be executed after S407
  • S412 needs to be executed after S411, but the remaining steps can be inserted between S411.
  • S413 needs to be executed after S412, but other steps can be inserted between S413.
  • sequence of steps of the QUIC data transmission method may be: S401, S402, S403, S404, S405, S406, S407, S411, S412, S408, S413, S410.
  • sequence of steps of the QUIC data transmission method may also be: S401, S402, S403, S404, S405, S406, S407, S411, S408, S412, S413, and S410, which are not limited here.
  • both the server and the client can dynamically negotiate the application layer protocol carried, so that both the client and the server support the second application layer protocol, and the server executes S410 to establish the first QUIC session in the first QUIC session.
  • the second data stream is used to transmit the data corresponding to the second data request.
  • both the server and the client can support the second application layer protocol, and the server then executes S410 to establish a second data stream in the first QUIC session for transmitting the data corresponding to the second data request.
  • the server when the second application layer protocol is not in the application layer protocol list corresponding to the first QUIC session, the server can also multiplex the first QUIC session to transmit the data corresponding to the second data request, and a data transmission method is added. It can further reduce the data transmission delay and improve the efficiency of chain construction.
  • FIG. 8 shows a data flow diagram when using the data transmission method provided by the present application, and the application of the data transmission method is described here according to the scenario shown in FIG. 8 .
  • the multiplexing of the QUIC session between the HTTP 3.0 session request and the RTP session request is taken as an example for description.
  • the client is connected to the Internet through a wireless network
  • the server is connected to the Internet through the Ethernet, so as to realize the communication connection between the client and the server.
  • the QUIC server When the QUIC server starts the service of the application (Application, APP) 1, it triggers the start of the QUIC server monitoring, and obtains the application layer protocols supported by the server. In this scenario, the server supports HTTP3.0 and RTP.
  • the QUIC client When a user operation is received on the QUIC client, the QUIC client is instructed to start APP1, and use HTTP3.0 to access the World Wide Web (Web) service on the QUIC server to browse web pages.
  • the module corresponding to APP1 creates the HTTP 3.0 socket (Socket) application program interface (Application Programming Interface, API).
  • Socket API triggers the QUIC protocol module to initiate the creation of a QUIC session to the QUIC server through the client's local protocol stack, and starts handshake negotiation.
  • both parties also notify each other of the supported application-layer protocols, and determine the application-layer protocol list.
  • the application layer protocol list indicates that the QUIC session supports HTTP 3.0 and RTP.
  • a QUIC session (Session) 51 is generated.
  • the QUIC client and the QUIC server continue to complete the handshake of the HTTP 3.0 protocol session HTTP 3.0 data stream 52 on the basis of the QUIC session 51 (that is, to create a Stream for carrying HTTP 3.0 data).
  • the server can encapsulate the first HTTP 3.0 SETTINGS frame (the SETTINGS frame is used to transmit HTTP 3.0 configuration parameters that affect the communication method between the client and the server) in the establishment of the HTTP 3.0 session into an ALP_STREAM frame with an application Stream ID of 4 In the Stream Data field of the ALP_STREAM frame, the protocol string in the ALP field of the ALP_STREAM frame is "h3".
  • the QUIC server receives the ALP_STREAM frame, it creates a Stream with a Stream ID of 4, and caches the corresponding relationship between the Stream ID of the Stream and HTTP 3.0.
  • the server sends the HTTP 3.0 SETTINGS frame parsed from the ALP_STREAM frame to the server HTTP 3.0 protocol module for processing.
  • the QUIC server When the QUIC server subsequently receives a STREAM frame with a Stream ID of 4, it sends the parsed payload data to the HTTP 3.0 protocol module of the server for processing according to the corresponding relationship between the Stream ID and HTTP 3.0. Implement the QUIC client and QUIC server based on the QUIC session 51 to complete the handshake of the HTTP 3.0 data stream 52 and subsequent resource access.
  • the module corresponding to APP1 creates an RTP socket interface.
  • the Socket API checks and finds that the QUIC client has a QUIC session 51 that supports the RTP protocol, and the QUIC session 51 can carry the RTP protocol.
  • RTP data stream 53 of the session is a QUIC session 51 that supports the RTP protocol.
  • the client no longer triggers a new QUIC session handshake, but directly reuses the QUIC session 51, and performs the handshake of the RTP data stream 53 based on the QUIC session 51 (ie, creates a Stream for carrying RTP or RTCP data).
  • the server can encapsulate the first RTP or RTCP packet into the Stream Data field of the ALP_STREAM frame with the applied Stream ID of 8.
  • the protocol string in the ALP field in the ALP_STREAM frame is "qrt", and the QUIC server receives the ALP_STREAM frame. Then, create a Stream with a Stream ID of 8, and cache the correspondence between the Stream ID of the Stream and the RTP.
  • the server sends the RTP or RTCP session handshake message parsed from the ALP_STREAM frame to the RTP/RTCP protocol module of the server for processing.
  • the QUIC server When the QUIC server subsequently receives a STREAM frame with a Stream ID of 8, it sends the parsed payload data to the RTP/RTCP protocol module of the QUIC server for processing according to the correspondence between the Stream ID and RTP. Implement the QUIC client and QUIC server to complete the RTP/RTCP handshake and subsequent resource access based on the QUIC session 51.
  • FIG. 9 shows a structural block diagram of the QUIC data transmission device provided by the embodiment of the present application. For the convenience of description, it only shows the relevant embodiments of the present application. part.
  • the device is applied to a client, including:
  • the determining module 61 is configured to determine the second application layer protocol used by the second data request in response to the data transmission between the second data request and the server.
  • the establishment module 62 is configured to establish a second data stream in the first QUIC session when the second application layer protocol is an application layer protocol in the application layer protocol list corresponding to the first QUIC session, and the second data stream is used to carry the second data stream The data requested to be transmitted in the data request.
  • the first QUIC session is the QUIC session established with the server when the client responds to the first data request.
  • the list of application layer protocols corresponding to the first QUIC session includes the applications supported by both the client and the server. layer protocol.
  • the establishment module 62 is specifically configured to generate a first type of data frame in response to the second data request, and the first type of data frame includes the second application layer protocol, the identification information of the second data stream, and the corresponding data of the second data request.
  • the data information records the correspondence between the identification information of the second data stream and the second application layer protocol.
  • the first type of data frame is sent to the server, and the server is instructed to establish a second data stream according to the second application layer protocol in the first type of data frame.
  • FIG. 10 shows a structural block diagram of another QUIC data transmission apparatus provided by an embodiment of the present application.
  • the apparatus further includes a receiving module 63 for receiving the first type of data frame from the server.
  • the apparatus further includes a processing module 64, configured to determine the correspondence between the identification information of the second data stream in the first type of data frame and the second application layer protocol, and the identification information of the second data stream recorded by the client and the second data stream.
  • the first type of data frame is sent to the processing module corresponding to the second application layer protocol for processing.
  • the second type of data frame includes identification information of the second data stream and data information corresponding to the second data request.
  • the receiving module 63 is further configured to receive the second type of data frame from the server.
  • the processing module 64 is further configured to send the second type of data frame to the second application according to the identification information of the second data stream in the second type of data frame and the corresponding relationship between the identification information of the second data stream and the second application layer protocol.
  • the processing module corresponding to the layer protocol performs processing.
  • the second type of data frame includes identification information of the second data stream and data information corresponding to the second data request.
  • the establishing module 62 is specifically configured to determine that the second application layer protocol is the first application layer protocol in the application layer protocol list corresponding to the first QUIC session.
  • the client generates a second type of data frame in response to the second data request, and records the correspondence between the identification information of the second data stream and the second application layer protocol.
  • the client sends the second type of data frame to the server, instructing the server to respond to the second type of data frame and establish the second data stream according to the first application layer protocol in the application layer protocol list corresponding to the first QUIC session.
  • FIG. 11 shows a structural block diagram of another QUIC data transmission apparatus provided by an embodiment of the present application.
  • the apparatus further includes a recording module 65 for recording the number of citations of the first QUIC session after the first QUIC session is established, where the number of citations is the number of data streams in the first QUIC session.
  • the reference count is incremented by one.
  • the reference count is decremented by one.
  • the recording module 65 is further configured to close the first QUIC session when the number of citations decreases to zero and the number of citations does not change after a preset period of time.
  • the establishing module 62 is further configured to establish a first QUIC session with the server in response to the first data request, and generate a list of application layer protocols corresponding to the first QUIC session.
  • a first data stream is established in the first QUIC session, the first data stream is used to carry the data requested to be transmitted in the first data request, the first data request uses the first application layer protocol, and the first application layer protocol corresponds to the first QUIC session The application layer protocol in the list of application layer protocols.
  • the establishment module 62 is specifically configured to send a session handshake request for establishing the first QUIC session to the server in response to the first data request.
  • the client receives a handshake message from the server, the handshake message is generated by the server according to the session handshake request, and the handshake message includes the application layer protocol supported by the server.
  • the client establishes the first QUIC session according to the handshake message, and sends the application layer protocol list corresponding to the first QUIC session and the confirmation message for establishing the first QUIC session to the server through the first QUIC session.
  • FIG. 12 shows a structural block diagram of another QUIC data transmission apparatus provided by an embodiment of the present application.
  • the receiving module 63 is further configured to receive the first notification frame or the second notification frame from the server, where the first notification frame is used to instruct the client to send the application layer protocol corresponding to the first QUIC session stored in the client. At least one application layer protocol is added to the list, and the second notification frame is used to instruct the client to remove at least one application layer protocol stored in the application layer protocol list corresponding to the first QUIC session in the client.
  • the apparatus further includes an update module 66, configured to update the application layer protocol list according to the received first notification frame or the second notification frame.
  • the update module 66 is further configured to update the application layer protocol list stored in the client in response to the update instruction of the application layer protocol list.
  • the update instruction instructs to add at least one application layer protocol to the application layer protocol list stored in the client
  • a first notification frame is generated, and the first notification frame is used to instruct the server to correspond to the first QUIC session stored in the server
  • the update instruction instructs to remove at least one application layer protocol in the application layer protocol list stored in the client, a second notification frame is generated, and the second notification frame is used to instruct the server to remove the first QUIC stored in the server.
  • At least one application layer protocol in the application layer protocol list corresponding to the session. Send the first notification frame or the second notification frame to the server.
  • the update module 66 is further configured to generate an update instruction of the application layer protocol list when the second application layer protocol is not an application layer protocol in the application layer protocol list corresponding to the first QUIC session, and the update instruction is used to update the application layer protocol list.
  • the second application layer protocol is written into the application layer protocol list corresponding to the first QUIC session stored in the client. Respond to the update instruction and generate a first notification frame.
  • the establishing module 62 is further configured to establish a second data stream with the server in the first QUIC session after the client sends the first notification frame to the server through the first QUIC session.
  • FIG. 13 shows a structural block diagram of the QUIC data transmission device provided by the embodiment of the present application. For the convenience of description, it only shows the relevant embodiments of the present application. part.
  • the device is applied to the server, including:
  • the determining module 71 is configured to determine the second application layer protocol used by the second data request during data transmission between the client and the second data request in response to the second data request.
  • the establishment module 72 is configured to establish a second data stream in the first QUIC session when the second application layer protocol is an application layer protocol in the application layer protocol list corresponding to the first QUIC session, and the second data stream is used to carry the second data stream The data requested to be transmitted in the data request.
  • the first QUIC session is the QUIC session established with the server when the client responds to the first data request.
  • the list of application layer protocols corresponding to the first QUIC session includes the applications supported by both the client and the server. layer protocol.
  • the establishment module 72 is specifically configured to generate a first type of data frame in response to the second data request, and the first type of data frame includes the second application layer protocol, the identification information of the second data stream, and the corresponding data of the second data request.
  • the data information records the correspondence between the identification information of the second data stream and the second application layer protocol.
  • the server sends the first type of data frame to the client, and instructs the client to establish a second data stream according to the second application layer protocol in the first type of data frame.
  • FIG. 14 shows a structural block diagram of another QUIC data transmission apparatus provided by an embodiment of the present application.
  • the apparatus further includes a receiving module 73 for receiving the first type of data frame from the client.
  • the device further includes a processing module 74, configured to determine the correspondence between the identification information of the second data stream in the first type of data frame and the second application layer protocol, and the identification information of the second data stream recorded by the server and the second data stream.
  • the first type of data frame is sent to the processing module corresponding to the second application layer protocol for processing.
  • the second type of data frame includes identification information of the second data stream and data information corresponding to the second data request.
  • the receiving module 73 is further configured to receive the second type of data frame from the client.
  • the processing module 74 is further configured to send the second type of data frame to the second application according to the identification information of the second data stream in the second type of data frame and the corresponding relationship between the identification information of the second data stream and the second application layer protocol
  • the processing module corresponding to the layer protocol performs processing.
  • the second type of data frame includes identification information of the second data stream and data information corresponding to the second data request.
  • the establishing module 72 is specifically configured to determine that the second application layer protocol is the first application layer protocol in the application layer protocol list corresponding to the first QUIC session.
  • the server generates a second type of data frame in response to the second data request, and records the correspondence between the identification information of the second data stream and the second application layer protocol.
  • the server sends the second type of data frame to the client, instructing the client to respond to the second type of data frame and establish the second data stream according to the first application layer protocol in the application layer protocol list corresponding to the first QUIC session.
  • FIG. 15 shows a structural block diagram of another QUIC data transmission apparatus provided by an embodiment of the present application.
  • the apparatus further includes a recording module 75, configured to record the number of citations of the first QUIC session after the first QUIC session is established, where the number of citations is the number of data streams in the first QUIC session.
  • a recording module 75 configured to record the number of citations of the first QUIC session after the first QUIC session is established, where the number of citations is the number of data streams in the first QUIC session.
  • the recording module 75 is further configured to close the first QUIC session when the number of citations decreases to zero and the number of citations does not change after a preset duration.
  • the establishing module 72 is further configured to establish the first QUIC session between the server and the client.
  • the server responds to the first data request from the client, and establishes a first data stream with the client, where the first data stream is used to carry the data requested to be transmitted in the first data request, and the first data request uses the first application layer protocol,
  • the first application layer protocol is an application layer protocol in the application layer protocol list corresponding to the first QUIC session.
  • the establishment module 72 is specifically configured to receive a session handshake request from the client, where the session handshake request is used to instruct the server and the client to establish a first QUIC session.
  • a handshake packet is generated according to the session handshake request and sent to the client.
  • the handshake packet includes the application layer protocol supported by the server. Receive the application layer protocol list from the client and the confirmation message for the establishment of the first QUIC session. The server confirms the establishment of the first QUIC session according to the confirmation message.
  • FIG. 16 shows a structural block diagram of another QUIC data transmission apparatus provided by an embodiment of the present application.
  • the receiving module 73 is further configured to receive the first notification frame or the second notification frame from the client, where the first notification frame is used to instruct the server to send the application layer protocol corresponding to the first QUIC session stored in the server. At least one application layer protocol is added to the list, and the second notification frame is used to instruct the server to remove at least one application layer protocol in the application layer protocol list corresponding to the first QUIC session stored in the server.
  • the apparatus further includes an update module 76 for updating the application layer protocol list according to the received first notification frame or the second notification frame.
  • the update module 76 is further configured to update the application layer protocol list stored in the server in response to the update instruction of the application layer protocol list.
  • the update instruction instructs to add at least one application layer protocol to the application layer protocol list stored in the server
  • a first notification frame is generated, and the first notification frame is used to instruct the client to correspond to the first QUIC session stored in the client
  • the update instruction instructs to remove at least one application layer protocol in the application layer protocol list stored in the server
  • a second notification frame is generated, and the second notification frame is used to instruct the client to remove the first QUIC stored in the client
  • the server sends the first notification frame or the second notification frame to the client.
  • the update module 76 is further configured to, when the second application layer protocol is not an application layer protocol in the application layer protocol list corresponding to the first QUIC session, the server generates an update instruction of the application layer protocol list, and the update instruction uses for writing the second application layer protocol into the application layer protocol list corresponding to the first QUIC session stored in the server.
  • the server responds to the update instruction and generates a first notification frame.
  • the establishing module 72 is further configured to establish a second data stream with the client in the first QUIC session after the server sends the first notification frame to the client through the first QUIC session.
  • FIG. 17 is a schematic structural diagram of a QUIC client provided by an embodiment of the present application.
  • the QUIC client 800 of this embodiment includes: at least one processor 801 (only one is shown in FIG. 17 ), a memory 802 , and a processor 802 stored in the memory 802 and available on the at least one processor 801
  • the running computer program 803, when the processor 801 executes the computer program 803, implements the steps in the above-mentioned embodiment of the QUIC data transmission method applied to the client.
  • the QUIC client 800 may be a server, such as a computing device such as a desktop server, a rack server, a rack server, a blade server, and the like.
  • the electronic device may include, but is not limited to, the processor 801 and the memory 802 .
  • FIG. 17 is only an example of the QUIC client 800, and does not constitute a limitation on the QUIC client 800, and may include more or less components than the one shown, or combine some components, or different components, for example, may also include input and output devices, network access devices, and so on.
  • the so-called processor 801 may be a central processing unit (Central Processing Unit, CPU), and the processor 801 may also be other general-purpose processors, digital signal processors (Digital Signal Processors, DSP), application specific integrated circuits (Application Specific Integrated Circuits) , ASIC), off-the-shelf programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
  • the memory 802 may in some embodiments be an internal storage unit of the QUIC client 800, such as a hard disk or memory of the QUIC client 800.
  • the memory 802 may also be an external storage device of the QUIC client 800 in other embodiments, such as a pluggable hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, flash memory card (Flash Card), etc.
  • the memory 802 may also include both an internal storage unit of the QUIC client 800 and an external storage device.
  • the memory 802 is used to store an operating system, application programs, a boot loader (Boot Loader), data, and other programs, such as program codes of computer programs, and the like.
  • the memory 802 may also be used to temporarily store data that has been or will be output.
  • FIG. 18 is a schematic structural diagram of a QUIC server provided by an embodiment of the present application.
  • the QUIC server 900 of this embodiment includes: at least one processor 901 (only one is shown in FIG. 18 ), a memory 902 , and a processor 902 stored in the memory 902 and available on the at least one processor 901
  • the running computer program 903, when the processor 901 executes the computer program 903, implements the steps in the foregoing embodiment of the QUIC data transmission method applied to the server.
  • the QUIC server 900 may be a server, such as a computing device such as a desktop server, a rack server, a rack server, and a blade server.
  • the electronic device may include, but is not limited to, a processor 901 and a memory 902 .
  • FIG. 18 is only an example of the QUIC server 900, and does not constitute a limitation on the QUIC server 900. It may include more or less components than the one shown, or combine some components, or different components, for example, may also include input and output devices, network access devices, and so on.
  • the so-called processor 901 may be a central processing unit (Central Processing Unit, CPU), and the processor 901 may also be other general-purpose processors, digital signal processors (Digital Signal Processors, DSP), application specific integrated circuits (Application Specific Integrated Circuits) , ASIC), off-the-shelf programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
  • the memory 902 may be an internal storage unit of the QUIC server 900 in some embodiments, such as a hard disk or a memory of the QUIC server 900 .
  • the memory 902 may also be an external storage device of the QUIC server 900, such as a pluggable hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, flash memory card (Flash Card), etc.
  • the memory 902 may also include both an internal storage unit of the QUIC server 900 and an external storage device.
  • the memory 902 is used to store an operating system, application programs, a boot loader (Boot Loader), data, and other programs, such as program codes of computer programs, and the like.
  • the memory 902 may also be used to temporarily store data that has been or will be output.
  • the embodiment of the present application also provides a data transmission system, including at least one QUIC client provided by the fifth aspect and at least one QUIC server provided by the sixth aspect, where the QUIC client and the QUIC server are connected through network communication.
  • the QUIC client and QUIC server in the data transmission system can transmit data through the QUIC data transmission method provided in this application.
  • Embodiments of the present application further provide a computer-readable storage medium, and embodiments of the present application provide a computer program product, when the computer program product runs on a client, the client executes the above-mentioned QUIC data transmission applied to the client method.
  • Embodiments of the present application also provide a computer-readable storage medium, and embodiments of the present application provide a computer program product, which, when the computer program product runs on a server, enables the server to perform the above-mentioned QUIC data transmission applied to the server method.
  • the embodiments of the present application provide a computer program product, when the computer program product runs on a mobile terminal, the steps in the above-mentioned QUIC data transmission method applied to a client can be implemented when the mobile terminal executes the computer program product.
  • the embodiment of the present application provides a computer program product, when the computer program product runs on a mobile terminal, the steps in the above-mentioned QUIC data transmission method applied to a server can be implemented when the mobile terminal is executed.
  • An embodiment of the present application provides a chip system, the chip system includes a memory and a processor, and the processor executes a computer program stored in the memory to implement the steps in the above-mentioned QUIC data transmission method applied to a client.
  • An embodiment of the present application provides a chip system, where the chip system includes a memory and a processor, and the processor executes a computer program stored in the memory to implement the steps in the above-mentioned QUIC data transmission method applied to a server.
  • An embodiment of the present application provides a chip system, the chip system includes a processor, the processor is coupled to a computer-readable storage medium, and the processor executes a computer program stored in the computer-readable storage medium, so as to realize the above-mentioned QUIC data applied to a client Steps in the transfer method.
  • An embodiment of the present application provides a chip system, the chip system includes a processor, the processor is coupled to a computer-readable storage medium, and the processor executes a computer program stored in the computer-readable storage medium, so as to realize the above-mentioned QUIC data applied to the server Steps in the transfer method.
  • the QUIC data transmission method provided in this application is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium.
  • the present application realizes all or part of the processes in the methods of the above-mentioned embodiments, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and the computer program is stored in a computer-readable storage medium.
  • the steps of the foregoing method embodiments may be implemented.
  • the computer program includes computer program code
  • the computer program code may be in the form of source code, object code, executable file or some intermediate form.
  • the computer-readable medium may include at least: any entity or device capable of carrying computer program codes to an electronic device, a recording medium, a computer memory, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access). Memory), electrical carrier signals, telecommunications signals, and software distribution media.
  • ROM read-only memory
  • RAM random access memory
  • Memory electrical carrier signals
  • telecommunications signals and software distribution media.
  • computer readable media may not be electrical carrier signals and telecommunications signals.
  • the disclosed method, apparatus, client and server may be implemented in other manners.
  • the apparatus embodiments described above are only illustrative.
  • the division of modules or units is only a logical function division. In actual implementation, there may be other division methods.
  • multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not implemented.
  • the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
  • Units described as separate components may or may not be physically separated, and components shown as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer And Data Communications (AREA)
  • Communication Control (AREA)

Abstract

The present application is applicable to the technical field of terminals, and provides a method and apparatus for data transmission using QUIC, a client, and a server. The method comprises: when performing data transmission with a server in response to a second data request, a client determining a second application layer protocol used by the second data request; and when the second application layer protocol is an application layer protocol in an application layer protocol list corresponding to a first QUIC session, establishing a second data stream in the first QUIC session. The second data stream is used to carry the data requested to be transmitted in the second data request, the first QUIC session is a QUIC session established with the server by the client in response to the first data request, and the application layer protocol list corresponding to the first QUIC session comprises an application layer protocol that is supported by the client and the server at the same time. Since multiple QUIC sessions do not need to be established, the first QUIC session is multiplexed to transmit the data requested to be transmitted in the second data request, thus network bandwidth can be saved and QUIC session resources are saved, while data transmission delay is reduced, and link efficiency is improved.

Description

QUIC数据传输方法、装置、客户端及服务端QUIC data transmission method, device, client and server
本申请要求于2021年04月26日提交国家知识产权局、申请号为202110456892.6、申请名称为“QUIC数据传输方法、装置、客户端及服务端”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application filed with the State Intellectual Property Office on April 26, 2021, the application number is 202110456892.6, and the application name is "QUIC data transmission method, device, client and server". Reference is incorporated in this application.
技术领域technical field
本申请涉及终端领域,尤其涉及一种QUIC数据传输方法、装置、客户端及服务端。The present application relates to the field of terminals, and in particular, to a QUIC data transmission method, device, client and server.
背景技术Background technique
快速用户数据报协议(UDP,User Datagram Protocol)网络连接(Quick UDP Internet Connection,QUIC)是一种基于UDP的低时延的互联网传输层协议。QUIC可以应用于网页或应用程序等需要进行数据传输的场景中。Quick UDP Internet Connection (QUIC) is a low-latency Internet transport layer protocol based on UDP. QUIC can be used in scenarios that require data transmission, such as web pages or applications.
QUIC协议可以对传输层进行多路复用,即在建立客户端与服务器之间的会话后,对于每个需要传输的元素,可以单独使用一个可靠数据流(stream)或不可靠数据流(flow)进行数据传输。The QUIC protocol can multiplex the transport layer, that is, after establishing a session between the client and the server, for each element that needs to be transmitted, a reliable data stream (stream) or an unreliable data stream (flow) can be used separately. ) for data transfer.
但是,传输不同的元素可能会使用不同的应用层协议。当存在多种应用层协议时,需要为每个应用层协议建立一个独立的会话,以传输对应的元素。而建立多个会话,会浪费网络带宽、浪费QUIC会话资源,降低QUIC会话建链的效率。However, different application layer protocols may be used to transport different elements. When there are multiple application layer protocols, an independent session needs to be established for each application layer protocol to transmit corresponding elements. Establishing multiple sessions will waste network bandwidth, waste QUIC session resources, and reduce the efficiency of QUIC session chain building.
发明内容SUMMARY OF THE INVENTION
本申请实施例提供了一种QUIC数据传输方法、装置、客户端及服务端,可以改善当存在多种应用层协议时,需要为每个应用层协议建立一个独立的会话而导致的浪费网络带宽、浪费QUIC会话资源,降低QUIC会话建链效率的问题。The embodiments of the present application provide a QUIC data transmission method, device, client and server, which can improve the waste of network bandwidth caused by the need to establish an independent session for each application layer protocol when there are multiple application layer protocols. , waste QUIC session resources and reduce the efficiency of QUIC session chain building.
第一方面,本申请实施例提供了应用于客户端的QUIC数据传输方法,该方法包括:In a first aspect, an embodiment of the present application provides a QUIC data transmission method applied to a client, the method comprising:
客户端响应于第二数据请求与服务端之间进行数据传输时,确定第二数据请求所使用的第二应用层协议。当第二应用层协议为第一QUIC会话对应的应用层协议列表中的应用层协议时,在第一QUIC会话中建立第二数据流,第二数据流用于承载第二数据请求中请求传输的数据,第一QUIC会话为客户端响应第一数据请求时,与服务端建立的QUIC会话,第一QUIC会话对应的应用层协议列表包括客户端和服务端同时支持的应用层协议。The client determines the second application layer protocol used by the second data request when performing data transmission between the client and the server in response to the second data request. When the second application layer protocol is an application layer protocol in the application layer protocol list corresponding to the first QUIC session, a second data stream is established in the first QUIC session, and the second data stream is used to carry the data requested to be transmitted in the second data request. Data, the first QUIC session is the QUIC session established with the server when the client responds to the first data request, and the list of application layer protocols corresponding to the first QUIC session includes the application layer protocols supported by both the client and the server.
在第一方面中,客户端可以是手机(mobile phone)、平板电脑(Pad)、带收发功能的电脑、虚拟现实(virtual reality,VR)终端设备、增强现实(augmented reality,AR)终端设备、工业控制(industrial control)中的无线终端、无人驾驶(self driving)中的无线终端、远程医疗(remote medical)中的无线终端、智能电网(smart grid)中的无线终端、运输安全(transportation safety)中的无线终端、智慧城市(smart city)中的无线终端、智慧家庭(smart home)中的无线终端、可穿戴设备、车载设备、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本、个人数字助理(personal digital assistant,PDA)等电子设备。In the first aspect, the client may be a mobile phone (mobile phone), a tablet computer (Pad), a computer with a transceiver function, a virtual reality (VR) terminal device, an augmented reality (AR) terminal device, Wireless terminals in industrial control, wireless terminals in self-driving, wireless terminals in remote medical, wireless terminals in smart grid, transportation safety ), wireless terminals in smart cities, wireless terminals in smart homes, wearable devices, in-vehicle devices, ultra-mobile personal computers (UMPCs), netbooks , personal digital assistant (personal digital assistant, PDA) and other electronic equipment.
第一方面提供的QUIC数据传输方法通过在客户端与服务端建立第一QUIC会话时, 协商获得第一QUIC会话对应的应用层协议列表。当客户端响应第二数据请求与服务端之间进行数据传输时,若第二数据请求所使用的第二应用层协议是第一QUIC会话对应的应用层协议列表中的,则无需再创建QUIC会话,而是在第一QUIC会话下建立使用第二应用层协议的第二数据流承载第二数据请求中请求传输的数据。由于无需建立多个QUIC会话,而是复用了第一QUIC会话,可以节省网络带宽,节省QUIC会话资源,同时降低数据传输延迟,提高建链效率。The QUIC data transmission method provided by the first aspect obtains the application layer protocol list corresponding to the first QUIC session through negotiation when the client and the server establish the first QUIC session. When the client responds to the second data request and performs data transmission between the server, if the second application layer protocol used by the second data request is in the application layer protocol list corresponding to the first QUIC session, there is no need to create QUIC again. Instead, a second data stream using the second application layer protocol is established under the first QUIC session to carry the data requested to be transmitted in the second data request. Since there is no need to establish multiple QUIC sessions, the first QUIC session is reused, which can save network bandwidth and QUIC session resources, reduce data transmission delay, and improve chain construction efficiency.
一些实施方式中,在第一QUIC会话中与服务端建立第二数据流,包括:客户端响应第二数据请求生成第一类数据帧,第一类数据帧包括第二应用层协议、第二数据流的标识信息以及第二数据请求对应的数据信息,记录第二数据流的标识信息与第二应用层协议的对应关系。客户端向服务端发送第一类数据帧,指示服务端根据第一类数据帧中的第二应用层协议建立第二数据流。In some embodiments, establishing a second data stream with the server in the first QUIC session includes: the client generating a first type of data frame in response to the second data request, where the first type of data frame includes a second application layer protocol, a second The identification information of the data stream and the data information corresponding to the second data request are recorded, and the corresponding relationship between the identification information of the second data stream and the second application layer protocol is recorded. The client sends the first type of data frame to the server, instructing the server to establish a second data stream according to the second application layer protocol in the first type of data frame.
一些实施方式中,在客户端向服务端发送第一类数据帧之后,还包括:客户端接收来自服务端的第一类数据帧。当客户端确定第一类数据帧中第二数据流的标识信息与第二应用层协议的对应关系,与客户端记录的第二数据流的标识信息与第二应用层协议的对应关系一致时,将第一类数据帧发送给第二应用层协议对应的处理模块进行处理。In some embodiments, after the client sends the first type of data frame to the server, the method further includes: the client receives the first type of data frame from the server. When the client determines that the correspondence between the identification information of the second data stream in the first type of data frame and the second application layer protocol is consistent with the correspondence between the identification information of the second data stream recorded by the client and the second application layer protocol , and send the first type of data frame to the processing module corresponding to the second application layer protocol for processing.
在本实施方式中,通过将数据流的标识信息与应用层协议关联,实现了在不使用第一类数据帧时,也可以准确的获得第二类数据帧对应的应用层协议,使得该数据流后续使用第二类数据帧帧也可以在一个QUIC会话下传输不同应用层协议的数据流。In this embodiment, by associating the identification information of the data stream with the application layer protocol, it is achieved that the application layer protocol corresponding to the second type of data frame can be accurately obtained when the first type of data frame is not used, so that the data Subsequent use of the second type of data frame frame can also transmit data streams of different application layer protocols under a QUIC session.
一些实施方式中,第二类数据帧包括第二数据流的标识信息以及第二数据请求对应的数据信息。In some embodiments, the second type of data frame includes identification information of the second data stream and data information corresponding to the second data request.
在客户端向服务端发送第一类数据帧之后,还包括:客户端接收来自服务端的第二类数据帧。客户端根据第二类数据帧中第二数据流的标识信息以及第二数据流的标识信息与第二应用层协议的对应关系,将第二类数据帧发送给第二应用层协议对应的处理模块进行处理。After the client sends the first type of data frame to the server, the method further includes: the client receives the second type of data frame from the server. The client sends the second type of data frame to the processing corresponding to the second application layer protocol according to the identification information of the second data stream in the second type of data frame and the corresponding relationship between the identification information of the second data stream and the second application layer protocol module for processing.
一些实施方式中,第二类数据帧包括第二数据流的标识信息以及第二数据请求对应的数据信息。In some embodiments, the second type of data frame includes identification information of the second data stream and data information corresponding to the second data request.
客户端在第一QUIC会话中与服务端建立第二数据流,包括:客户端确定第二应用层协议为第一QUIC会话对应的应用层协议列表中的首个应用层协议。客户端响应第二数据请求生成第二类数据帧,记录第二数据流的标识信息与第二应用层协议的对应关系。客户端向服务端发送第二类数据帧,指示服务端响应第二类数据帧,根据第一QUIC会话对应的应用层协议列表中的首个应用层协议建立第二数据流。The client establishing the second data stream with the server in the first QUIC session includes: the client determining that the second application layer protocol is the first application layer protocol in the application layer protocol list corresponding to the first QUIC session. The client generates a second type of data frame in response to the second data request, and records the correspondence between the identification information of the second data stream and the second application layer protocol. The client sends the second type of data frame to the server, instructing the server to respond to the second type of data frame and establish the second data stream according to the first application layer protocol in the application layer protocol list corresponding to the first QUIC session.
在本实施方式中,约定通过第二类数据帧建立的数据流使用应用层协议列表中的首个应用层协议,使得当第二应用层协议为应用层协议列表中的首个应用层协议时,客户端可以通过第二类数据帧建立第二数据流,增加了QUIC数据传输方法应用场景。In this embodiment, it is agreed that the data stream established by the second type of data frame uses the first application layer protocol in the application layer protocol list, so that when the second application layer protocol is the first application layer protocol in the application layer protocol list , the client can establish a second data stream through the second type of data frame, adding the application scenario of the QUIC data transmission method.
一些实施方式中,QUIC数据传输方法还包括:当建立第一QUIC会话后,客户端记录第一QUIC会话的引用次数,引用次数为第一QUIC会话中数据流的数量。当第一QUIC会话中建立一个数据流时,将引用次数加一。当第一QUIC会话中的一个数据流关闭时,将引用次数减一。In some embodiments, the QUIC data transmission method further includes: after establishing the first QUIC session, the client records the number of citations of the first QUIC session, where the number of citations is the number of data streams in the first QUIC session. When a data stream is established in the first QUIC session, the reference count is incremented by one. When a stream in the first QUIC session is closed, the reference count is decremented by one.
一些实施方式中,QUIC数据传输方法还包括:当引用次数减为零,且经过预设的时 长后引用次数未发生变化时,客户端将第一QUIC会话关闭。In some embodiments, the QUIC data transmission method further includes: when the number of references is reduced to zero, and the number of references does not change after a preset duration, the client closes the first QUIC session.
在本实施方式中,通过记录第一QUIC会话中的数据流的数量,使得当第一QUIC会话中没有数据流,且预设时长内再无新建数据流时,可以关闭第一QUIC会话,节约网络资源和QUIC会话资源。In this embodiment, by recording the number of data streams in the first QUIC session, when there is no data stream in the first QUIC session and no new data stream is created within the preset time period, the first QUIC session can be closed, saving energy Network resources and QUIC session resources.
一些实施方式中,在客户端响应于第二数据请求之前,该方法还包括:响应第一数据请求与服务端建立第一QUIC会话,并生成第一QUIC会话对应的应用层协议列表。在第一QUIC会话中建立第一数据流,第一数据流用于承载第一数据请求中请求传输的数据,第一数据请求使用第一应用层协议,第一应用层协议为第一QUIC会话对应的应用层协议列表中的应用层协议。In some embodiments, before the client responds to the second data request, the method further includes: establishing a first QUIC session with the server in response to the first data request, and generating an application layer protocol list corresponding to the first QUIC session. A first data stream is established in the first QUIC session, the first data stream is used to carry the data requested to be transmitted in the first data request, the first data request uses the first application layer protocol, and the first application layer protocol corresponds to the first QUIC session The application layer protocol in the list of application layer protocols.
一些实施方式中,响应第一数据请求与服务端建立第一QUIC会话,并生成第一QUIC会话对应的应用层协议列表,包括:客户端响应第一数据请求,向服务端发送建立第一QUIC会话的会话握手请求。客户端接收来自服务端的握手报文,握手报文是服务端根据会话握手请求生成的,握手报文包括服务端支持的应用层协议。根据客户端支持的应用层协议和服务端支持的应用层协议,生成第一QUIC会话对应的应用层协议列表。客户端根据握手报文建立第一QUIC会话,并将第一QUIC会话对应的应用层协议列表和第一QUIC会话建立的确认报文通过第一QUCI会话发送给服务端。In some embodiments, establishing a first QUIC session with the server in response to the first data request, and generating a list of application layer protocols corresponding to the first QUIC session, includes: the client responding to the first data request and sending the server to establish the first QUIC session. The session handshake request for the session. The client receives a handshake message from the server, the handshake message is generated by the server according to the session handshake request, and the handshake message includes the application layer protocol supported by the server. Generate an application layer protocol list corresponding to the first QUIC session according to the application layer protocol supported by the client and the application layer protocol supported by the server. The client establishes the first QUIC session according to the handshake message, and sends the application layer protocol list corresponding to the first QUIC session and the confirmation message for establishment of the first QUIC session to the server through the first QUIC session.
一些实施方式中,QUIC数据传输方法还包括:客户端接收来自服务端的第一通知帧或第二通知帧,第一通知帧用于指示客户端向存储于客户端内第一QUIC会话对应的应用层协议列表中添加至少一个应用层协议,第二通知帧用于指示客户端移除存储于客户端内第一QUIC会话对应的应用层协议列表中的至少一个应用层协议。客户端根据接收到的第一通知帧或第二通知帧,更新应用层协议列表。In some embodiments, the QUIC data transmission method further includes: the client receives a first notification frame or a second notification frame from the server, where the first notification frame is used to instruct the client to send an application corresponding to the first QUIC session stored in the client. At least one application layer protocol is added to the layer protocol list, and the second notification frame is used to instruct the client to remove at least one application layer protocol stored in the application layer protocol list corresponding to the first QUIC session in the client. The client updates the application layer protocol list according to the received first notification frame or the second notification frame.
一些实施方式中,QUIC数据传输方法还包括:客户端响应应用层协议列表的更新指令,更新存储于客户端内的应用层协议列表。当更新指令指示向存储于客户端内的应用层协议列表中添加至少一个应用层协议时,生成第一通知帧,第一通知帧用于指示服务端向存储于服务端内第一QUIC会话对应的应用层协议列表中添加至少一个应用层协议。当更新指令指示移除存储于客户端内的应用层协议列表中的至少一个应用层协议时,生成第二通知帧,第二通知帧用于指示服务端移除存储于服务端内第一QUIC会话对应的应用层协议列表中的至少一个应用层协议。客户端将第一通知帧或第二通知帧发送给服务端。In some embodiments, the QUIC data transmission method further includes: the client responds to an update instruction of the application layer protocol list, and updates the application layer protocol list stored in the client. When the update instruction instructs to add at least one application layer protocol to the application layer protocol list stored in the client, a first notification frame is generated, and the first notification frame is used to instruct the server to correspond to the first QUIC session stored in the server Add at least one application layer protocol to the list of application layer protocols. When the update instruction instructs to remove at least one application layer protocol in the application layer protocol list stored in the client, a second notification frame is generated, and the second notification frame is used to instruct the server to remove the first QUIC stored in the server. At least one application layer protocol in the application layer protocol list corresponding to the session. The client sends the first notification frame or the second notification frame to the server.
一些实施方式中,QUIC数据传输方法还包括:当第二应用层协议不是第一QUIC会话对应的应用层协议列表中的应用层协议时,客户端生成应用层协议列表的更新指令,更新指令用于将第二应用层协议写入存储于客户端内第一QUIC会话对应的应用层协议列表。客户端响应更新指令,并生成第一通知帧。当客户端将第一通知帧通过第一QUIC会话发送给服务端后,在第一QUIC会话中与服务端建立第二数据流。In some embodiments, the QUIC data transmission method further includes: when the second application layer protocol is not an application layer protocol in the application layer protocol list corresponding to the first QUIC session, the client generates an update instruction of the application layer protocol list, and the update instruction uses for writing the second application layer protocol into the application layer protocol list corresponding to the first QUIC session stored in the client. The client responds to the update instruction and generates the first notification frame. After the client sends the first notification frame to the server through the first QUIC session, a second data stream is established with the server in the first QUIC session.
在本实施方式中,通过第一通知帧和第二通知帧,服务端和客户端还可以动态协商承载的应用层协议,当数据请求使用的应用层协议不在应用层协议列表中时,也可以建立数据流,增加了QUIC数据传输方法的应用场景。In this embodiment, through the first notification frame and the second notification frame, the server and the client can also dynamically negotiate the application layer protocol carried by the bearer. When the application layer protocol used by the data request is not in the application layer protocol list, the Establishing a data stream increases the application scenarios of the QUIC data transmission method.
第二方面,本申请实施例提供了应用于服务端的QUIC数据传输方法,该方法包括:In the second aspect, the embodiments of the present application provide a QUIC data transmission method applied to a server, the method comprising:
服务端响应于第二数据请求与客户端之间进行数据传输时,确定第二数据请求所使用的第二应用层协议。当第二应用层协议为第一QUIC会话对应的应用层协议列表中的应用 层协议时,在第一QUIC会话中建立第二数据流,第二数据流用于承载第二数据请求中请求传输的数据,第一QUIC会话为客户端响应第一数据请求时,与服务端建立的QUIC会话,第一QUIC会话对应的应用层协议列表包括客户端和服务端同时支持的应用层协议。The server determines the second application layer protocol used by the second data request when performing data transmission between the server and the client in response to the second data request. When the second application layer protocol is an application layer protocol in the application layer protocol list corresponding to the first QUIC session, a second data stream is established in the first QUIC session, and the second data stream is used to carry the data requested to be transmitted in the second data request. Data, the first QUIC session is the QUIC session established with the server when the client responds to the first data request, and the list of application layer protocols corresponding to the first QUIC session includes the application layer protocols supported by both the client and the server.
在第二方面中,服务端可以是为客户端服务的设备,服务端可以向客户端提供资源以及保存来自客户端的数据等。例如,服务端可以是服务器或网络设备,服务器可以是刀片服务器、机架式服务器、云服务器等,网络设备包括三层交换机、路由器、宽带网关、防火墙、负载均衡器等。In the second aspect, the server may be a device serving the client, and the server may provide resources to the client, save data from the client, and the like. For example, the server can be a server or a network device, the server can be a blade server, a rack server, a cloud server, etc., and the network device includes a Layer 3 switch, a router, a broadband gateway, a firewall, a load balancer, and the like.
第二方面提供的QUIC数据传输方法通过在服务端与客户端建立第一QUIC会话时,协商获得第一QUIC会话的应用层协议列表。当服务端响应第二数据请求时,若第二数据请求所使用的第二应用层协议是应用层协议列表中的,则无需再创建QUIC会话,而是在第一QUIC会话下建立承载使用第二应用层协议的第二数据流。由于无需建立多个QUIC会话,而是复用了第一QUIC会话,可以节省网络带宽,节省QUIC会话资源,同时降低数据传输延迟,提高建链效率。The QUIC data transmission method provided by the second aspect obtains the application layer protocol list of the first QUIC session through negotiation when the server and the client establish the first QUIC session. When the server responds to the second data request, if the second application layer protocol used by the second data request is in the application layer protocol list, there is no need to create a QUIC session, but a bearer is established under the first QUIC session using the first QUIC session. The second data stream of the second application layer protocol. Since there is no need to establish multiple QUIC sessions, the first QUIC session is reused, which can save network bandwidth and QUIC session resources, reduce data transmission delay, and improve chain construction efficiency.
一些实施方式中,服务端在第一QUIC会话中与客户端建立第二数据流,包括:服务端响应第二数据请求生成第一类数据帧,第一类数据帧包括第二应用层协议、第二数据流的标识信息以及第二数据请求对应的数据信息,记录第二数据流的标识信息与第二应用层协议的对应关系。服务端向客户端发送第一类数据帧,指示客户端根据第一类数据帧中的第二应用层协议建立第二数据流。In some embodiments, the server establishes a second data stream with the client in the first QUIC session, including: the server responds to the second data request to generate a first type of data frame, and the first type of data frame includes the second application layer protocol, The identification information of the second data stream and the data information corresponding to the second data request are recorded, and the correspondence between the identification information of the second data stream and the second application layer protocol is recorded. The server sends the first type of data frame to the client, and instructs the client to establish a second data stream according to the second application layer protocol in the first type of data frame.
一些实施方式中,在服务端向客户端发送第一类数据帧之后,还包括:服务端接收来自客户端的第一类数据帧。当服务端确定第一类数据帧中第二数据流的标识信息与第二应用层协议的对应关系,与服务端记录的第二数据流的标识信息与第二应用层协议的对应关系一致时,将第一类数据帧发送给第二应用层协议对应的处理模块进行处理。In some embodiments, after the server sends the first type of data frame to the client, the method further includes: the server receives the first type of data frame from the client. When the server determines that the corresponding relationship between the identification information of the second data stream in the first type of data frame and the second application layer protocol is consistent with the corresponding relationship between the identification information of the second data stream recorded by the server and the second application layer protocol , and send the first type of data frame to the processing module corresponding to the second application layer protocol for processing.
一些实施方式中,第二类数据帧包括第二数据流的标识信息以及第二数据请求对应的数据信息。In some embodiments, the second type of data frame includes identification information of the second data stream and data information corresponding to the second data request.
在服务端向客户端发送第一类数据帧之后,还包括:服务端接收来自客户端的第二类数据帧。服务端根据第二类数据帧中第二数据流的标识信息以及第二数据流的标识信息与第二应用层协议的对应关系,将第二类数据帧发送给第二应用层协议对应的处理模块进行处理。After the server sends the first type of data frame to the client, the method further includes: the server receives the second type of data frame from the client. The server sends the second type of data frame to the processing corresponding to the second application layer protocol according to the identification information of the second data stream in the second type of data frame and the corresponding relationship between the identification information of the second data stream and the second application layer protocol module for processing.
一些实施方式中,第二类数据帧包括第二数据流的标识信息以及第二数据请求对应的数据信息。In some embodiments, the second type of data frame includes identification information of the second data stream and data information corresponding to the second data request.
服务端在第一QUIC会话中与客户端建立第二数据流,包括:服务端确定第二应用层协议为第一QUIC会话对应的应用层协议列表中的首个应用层协议。服务端响应第二数据请求生成第二类数据帧,记录第二数据流的标识信息与第二应用层协议的对应关系。服务端向客户端发送第二类数据帧,指示客户端响应第二类数据帧,根据第一QUIC会话对应的应用层协议列表中的首个应用层协议建立第二数据流。The server establishing the second data stream with the client in the first QUIC session includes: the server determining that the second application layer protocol is the first application layer protocol in the application layer protocol list corresponding to the first QUIC session. The server generates a second type of data frame in response to the second data request, and records the correspondence between the identification information of the second data stream and the second application layer protocol. The server sends the second type of data frame to the client, instructing the client to respond to the second type of data frame and establish the second data stream according to the first application layer protocol in the application layer protocol list corresponding to the first QUIC session.
一些实施方式中,QUIC数据传输方法还包括:建立第一QUIC会话后,服务端记录第一QUIC会话的引用次数,引用次数为第一QUIC会话中数据流的数量。当第一QUIC会话中建立一个数据流时,将引用次数加一。当第一QUIC会话中的一个数据流关闭时,将引用次数减一。In some embodiments, the QUIC data transmission method further includes: after establishing the first QUIC session, the server records the number of citations of the first QUIC session, where the number of citations is the number of data streams in the first QUIC session. When a data stream is established in the first QUIC session, the reference count is incremented by one. When a stream in the first QUIC session is closed, the reference count is decremented by one.
一些实施方式中,QUIC数据传输方法还包括:当引用次数减为零,且经过预设的时长后引用次数未发生变化时,服务端将第一QUIC会话关闭。In some embodiments, the QUIC data transmission method further includes: when the number of references decreases to zero and the number of references does not change after a preset time period, the server closes the first QUIC session.
一些实施方式中,在服务端响应于第二数据请求之前,该方法还包括:服务端与客户端建立第一QUIC会话。服务端响应来自客户的第一数据请求,建立与客户端之间的第一数据流,第一数据流用于承载第一数据请求中请求传输的数据,第一数据请求使用第一应用层协议,第一应用层协议为第一QUIC会话对应的应用层协议列表中的应用层协议。In some embodiments, before the server responds to the second data request, the method further includes: establishing a first QUIC session between the server and the client. The server responds to the first data request from the client, and establishes a first data stream with the client, where the first data stream is used to carry the data requested to be transmitted in the first data request, and the first data request uses the first application layer protocol, The first application layer protocol is an application layer protocol in the application layer protocol list corresponding to the first QUIC session.
一些实施方式中,服务端与客户端建立第一QUIC会话,包括:接收来自客户端的会话握手请求,会话握手请求用于指示服务端与客户端之间建立第一QUIC会话。根据会话握手请求生成握手报文并发送给客户端,握手报文包括服务端支持的应用层协议。接收来自客户端的应用层协议列表和第一QUIC会话建立的确认报文。服务端根据确认报文确认建立第一QUIC会话。In some embodiments, establishing the first QUIC session between the server and the client includes: receiving a session handshake request from the client, where the session handshake request is used to instruct the server and the client to establish the first QUIC session. A handshake packet is generated according to the session handshake request and sent to the client. The handshake packet includes the application layer protocol supported by the server. Receive the application layer protocol list from the client and the confirmation message for the establishment of the first QUIC session. The server confirms the establishment of the first QUIC session according to the confirmation message.
一些实施方式中,QUIC数据传输方法还包括:服务端接收来自客户端的第一通知帧或第二通知帧,第一通知帧用于指示服务端向存储于服务端内第一QUIC会话对应的应用层协议列表中添加至少一个应用层协议,第二通知帧用于指示服务端移除存储于服务端内第一QUIC会话对应的应用层协议列表中的至少一个应用层协议。服务端根据接收到的第一通知帧或第二通知帧,更新应用层协议列表。In some embodiments, the QUIC data transmission method further includes: the server receiving a first notification frame or a second notification frame from the client, where the first notification frame is used to instruct the server to send the application corresponding to the first QUIC session stored in the server. At least one application layer protocol is added to the layer protocol list, and the second notification frame is used to instruct the server to remove at least one application layer protocol in the application layer protocol list corresponding to the first QUIC session stored in the server. The server updates the application layer protocol list according to the received first notification frame or the second notification frame.
一些实施方式中,QUIC数据传输方法还包括:服务端响应应用层协议列表的更新指令,更新存储于服务端内的应用层协议列表。当更新指令指示向存储于服务端内的应用层协议列表中添加至少一个应用层协议时,生成第一通知帧,第一通知帧用于指示客户端向存储于客户端内第一QUIC会话对应的应用层协议列表中添加至少一个应用层协议。当更新指令指示移除存储于服务端内的应用层协议列表中的至少一个应用层协议时,生成第二通知帧,第二通知帧用于指示客户端移除存储于客户端内第一QUIC会话对应的应用层协议列表中的至少一个应用层协议。服务端将第一通知帧或第二通知帧发送给客户端。In some embodiments, the QUIC data transmission method further includes: the server responds to an update instruction of the application layer protocol list, and updates the application layer protocol list stored in the server. When the update instruction instructs to add at least one application layer protocol to the application layer protocol list stored in the server, a first notification frame is generated, and the first notification frame is used to instruct the client to correspond to the first QUIC session stored in the client Add at least one application layer protocol to the list of application layer protocols. When the update instruction instructs to remove at least one application layer protocol in the application layer protocol list stored in the server, a second notification frame is generated, and the second notification frame is used to instruct the client to remove the first QUIC stored in the client At least one application layer protocol in the application layer protocol list corresponding to the session. The server sends the first notification frame or the second notification frame to the client.
一些实施方式中,QUIC数据传输方法还包括:当第二应用层协议不是第一QUIC会话对应的应用层协议列表中的应用层协议时,服务端生成应用层协议列表的更新指令,更新指令用于将第二应用层协议写入存储于服务端内第一QUIC会话对应的应用层协议列表。服务端响应更新指令,并生成第一通知帧。当服务端将第一通知帧通过第一QUIC会话发送给客户端后,在第一QUIC会话中与客户端建立第二数据流。In some embodiments, the QUIC data transmission method further includes: when the second application layer protocol is not an application layer protocol in the application layer protocol list corresponding to the first QUIC session, the server generates an update instruction of the application layer protocol list, and the update instruction uses for writing the second application layer protocol into the application layer protocol list corresponding to the first QUIC session stored in the server. The server responds to the update instruction and generates a first notification frame. After the server sends the first notification frame to the client through the first QUIC session, a second data stream is established with the client in the first QUIC session.
第三方面,本申请实施例提供了一种应用于客户端的QUIC数据传输装置,包括:In a third aspect, an embodiment of the present application provides a QUIC data transmission device applied to a client, including:
确定模块,用于响应于第二数据请求与服务端之间进行数据传输时,确定第二数据请求所使用的第二应用层协议。The determining module is configured to determine the second application layer protocol used by the second data request in response to the data transmission between the second data request and the server.
建立模块,用于当第二应用层协议为第一QUIC会话对应的应用层协议列表中的应用层协议时,在第一QUIC会话中建立第二数据流,第二数据流用于承载第二数据请求中请求传输的数据,第一QUIC会话为客户端响应第一数据请求时,与服务端建立的QUIC会话,第一QUIC会话对应的应用层协议列表包括客户端和服务端同时支持的应用层协议。The establishment module is configured to establish a second data stream in the first QUIC session when the second application layer protocol is an application layer protocol in the application layer protocol list corresponding to the first QUIC session, and the second data stream is used to carry the second data The data requested to be transmitted in the request. The first QUIC session is the QUIC session established with the server when the client responds to the first data request. The list of application layer protocols corresponding to the first QUIC session includes the application layer supported by both the client and the server. protocol.
一些实施方式中,建立模块,具体用于响应第二数据请求生成第一类数据帧,第一类数据帧包括第二应用层协议、第二数据流的标识信息以及第二数据请求对应的数据信息,记录第二数据流的标识信息与第二应用层协议的对应关系。向服务端发送第一类数据帧,指示服务端根据第一类数据帧中的第二应用层协议建立第二数据流。In some embodiments, the establishment module is specifically configured to generate a first type of data frame in response to the second data request, where the first type of data frame includes the second application layer protocol, the identification information of the second data stream, and the data corresponding to the second data request. information, recording the correspondence between the identification information of the second data stream and the second application layer protocol. The first type of data frame is sent to the server, and the server is instructed to establish a second data stream according to the second application layer protocol in the first type of data frame.
一些实施方式中,该装置还包括接收模块,用于接收来自服务端的第一类数据帧。该装置还包括处理模块,用于当确定第一类数据帧中第二数据流的标识信息与第二应用层协议的对应关系,与客户端记录的第二数据流的标识信息与第二应用层协议的对应关系一致时,将第一类数据帧发送给第二应用层协议对应的处理模块进行处理。In some embodiments, the apparatus further includes a receiving module for receiving the first type of data frame from the server. The device further includes a processing module for determining the correspondence between the identification information of the second data stream in the first type of data frame and the second application layer protocol, and the identification information of the second data stream recorded by the client and the second application layer protocol. When the corresponding relationship between the layer protocols is consistent, the first type of data frame is sent to the processing module corresponding to the second application layer protocol for processing.
一些实施方式中,第二类数据帧包括第二数据流的标识信息以及第二数据请求对应的数据信息。In some embodiments, the second type of data frame includes identification information of the second data stream and data information corresponding to the second data request.
接收模块,还用于接收来自服务端的第二类数据帧。处理模块,还用于根据第二类数据帧中第二数据流的标识信息以及第二数据流的标识信息与第二应用层协议的对应关系,将第二类数据帧发送给第二应用层协议对应的处理模块进行处理。The receiving module is further configured to receive the second type of data frame from the server. The processing module is further configured to send the second type of data frame to the second application layer according to the identification information of the second data stream in the second type of data frame and the corresponding relationship between the identification information of the second data stream and the second application layer protocol The processing module corresponding to the protocol performs processing.
一些实施方式中,第二类数据帧包括第二数据流的标识信息以及第二数据请求对应的数据信息。In some embodiments, the second type of data frame includes identification information of the second data stream and data information corresponding to the second data request.
建立模块,具体用于确定第二应用层协议为第一QUIC会话对应的应用层协议列表中的首个应用层协议。客户端响应第二数据请求生成第二类数据帧,记录第二数据流的标识信息与第二应用层协议的对应关系。客户端向服务端发送第二类数据帧,指示服务端响应第二类数据帧,根据第一QUIC会话对应的应用层协议列表中的首个应用层协议建立第二数据流。The establishment module is specifically configured to determine that the second application layer protocol is the first application layer protocol in the application layer protocol list corresponding to the first QUIC session. The client generates a second type of data frame in response to the second data request, and records the correspondence between the identification information of the second data stream and the second application layer protocol. The client sends the second type of data frame to the server, instructing the server to respond to the second type of data frame and establish the second data stream according to the first application layer protocol in the application layer protocol list corresponding to the first QUIC session.
一些实施方式中,该装置还包括记录模块,用于当建立第一QUIC会话后,记录第一QUIC会话的引用次数,引用次数为第一QUIC会话中数据流的数量。当第一QUIC会话中建立一个数据流时,将引用次数加一。当第一QUIC会话中的一个数据流关闭时,将引用次数减一。In some embodiments, the apparatus further includes a recording module configured to record the number of citations of the first QUIC session after the first QUIC session is established, where the number of citations is the number of data streams in the first QUIC session. When a data stream is established in the first QUIC session, the reference count is incremented by one. When a stream in the first QUIC session is closed, the reference count is decremented by one.
一些实施方式中,记录模块,还用于当引用次数减为零,且经过预设的时长后引用次数未发生变化时,将第一QUIC会话关闭。In some embodiments, the recording module is further configured to close the first QUIC session when the number of references is reduced to zero and the number of references does not change after a preset duration.
一些实施方式中,建立模块,还用于响应第一数据请求与服务端建立第一QUIC会话,并生成第一QUIC会话对应的应用层协议列表。在第一QUIC会话中建立第一数据流,第一数据流用于承载第一数据请求中请求传输的数据,第一数据请求使用第一应用层协议,第一应用层协议为第一QUIC会话对应的应用层协议列表中的应用层协议。In some embodiments, the establishment module is further configured to establish a first QUIC session with the server in response to the first data request, and generate a list of application layer protocols corresponding to the first QUIC session. A first data stream is established in the first QUIC session, the first data stream is used to carry the data requested to be transmitted in the first data request, the first data request uses the first application layer protocol, and the first application layer protocol corresponds to the first QUIC session The application layer protocol in the list of application layer protocols.
一些实施方式中,建立模块,具体用于响应第一数据请求,向服务端发送建立第一QUIC会话的会话握手请求。客户端接收来自服务端的握手报文,握手报文是服务端根据会话握手请求生成的,握手报文包括服务端支持的应用层协议。根据客户端支持的应用层协议和服务端支持的应用层协议,生成第一QUIC会话对应的应用层协议列表。客户端根据握手报文建立第一QUIC会话,并将第一QUIC会话对应的应用层协议列表和第一QUIC会话建立的确认报文通过第一QUCI会话发送给服务端。In some embodiments, the establishment module is specifically configured to send a session handshake request for establishing the first QUIC session to the server in response to the first data request. The client receives a handshake message from the server, the handshake message is generated by the server according to the session handshake request, and the handshake message includes the application layer protocol supported by the server. Generate an application layer protocol list corresponding to the first QUIC session according to the application layer protocol supported by the client and the application layer protocol supported by the server. The client establishes the first QUIC session according to the handshake message, and sends the application layer protocol list corresponding to the first QUIC session and the confirmation message for establishment of the first QUIC session to the server through the first QUIC session.
一些实施方式中,接收模块,还用于接收来自服务端的第一通知帧或第二通知帧,第一通知帧用于指示客户端向存储于客户端内第一QUIC会话对应的应用层协议列表中添加至少一个应用层协议,第二通知帧用于指示客户端移除存储于客户端内第一QUIC会话对应的应用层协议列表中的至少一个应用层协议。该装置还包括更新模块,用于根据接收到的第一通知帧或第二通知帧,更新应用层协议列表。In some embodiments, the receiving module is further configured to receive a first notification frame or a second notification frame from the server, where the first notification frame is used to instruct the client to send the application layer protocol list corresponding to the first QUIC session stored in the client. At least one application layer protocol is added in the second notification frame, and the second notification frame is used to instruct the client to remove at least one application layer protocol stored in the application layer protocol list corresponding to the first QUIC session in the client. The apparatus further includes an update module, configured to update the application layer protocol list according to the received first notification frame or the second notification frame.
一些实施方式中,更新模块,还用于响应应用层协议列表的更新指令,更新存储于客户端内的应用层协议列表。当更新指令指示向存储于客户端内的应用层协议列表中添加至 少一个应用层协议时,生成第一通知帧,第一通知帧用于指示服务端向存储于服务端内第一QUIC会话对应的应用层协议列表中添加至少一个应用层协议。当更新指令指示移除存储于客户端内的应用层协议列表中的至少一个应用层协议时,生成第二通知帧,第二通知帧用于指示服务端移除存储于服务端内第一QUIC会话对应的应用层协议列表中的至少一个应用层协议。将第一通知帧或第二通知帧发送给服务端。In some embodiments, the update module is further configured to update the application layer protocol list stored in the client in response to the update instruction of the application layer protocol list. When the update instruction instructs to add at least one application layer protocol to the application layer protocol list stored in the client, a first notification frame is generated, and the first notification frame is used to instruct the server to correspond to the first QUIC session stored in the server Add at least one application layer protocol to the list of application layer protocols. When the update instruction instructs to remove at least one application layer protocol in the application layer protocol list stored in the client, a second notification frame is generated, and the second notification frame is used to instruct the server to remove the first QUIC stored in the server. At least one application layer protocol in the application layer protocol list corresponding to the session. Send the first notification frame or the second notification frame to the server.
一些实施方式中,更新模块,还用于当第二应用层协议不是第一QUIC会话对应的应用层协议列表中的应用层协议时,生成应用层协议列表的更新指令,更新指令用于将第二应用层协议写入存储于客户端内第一QUIC会话对应的应用层协议列表。响应更新指令,并生成第一通知帧。建立模块,还用于当客户端将第一通知帧通过第一QUIC会话发送给服务端后,在第一QUIC会话中与服务端建立第二数据流。In some embodiments, the update module is further configured to generate an update instruction of the application layer protocol list when the second application layer protocol is not an application layer protocol in the application layer protocol list corresponding to the first QUIC session, and the update instruction is used to update the first QUIC session. The second application layer protocol is written into the application layer protocol list corresponding to the first QUIC session stored in the client. Respond to the update instruction and generate a first notification frame. The establishing module is further configured to establish a second data stream with the server in the first QUIC session after the client sends the first notification frame to the server through the first QUIC session.
第四方面,本申请实施例提供了一种应用于服务端的QUIC数据传输装置,包括:In a fourth aspect, an embodiment of the present application provides a QUIC data transmission device applied to a server, including:
确定模块,用于响应于第二数据请求与客户端之间进行数据传输时,确定第二数据请求所使用的第二应用层协议。The determining module is configured to determine the second application layer protocol used by the second data request when performing data transmission between the client and the second data request in response to the second data request.
建立模块,用于当第二应用层协议为第一QUIC会话对应的应用层协议列表中的应用层协议时,在第一QUIC会话中建立第二数据流,第二数据流用于承载第二数据请求中请求传输的数据,第一QUIC会话为客户端响应第一数据请求时,与服务端建立的QUIC会话,第一QUIC会话对应的应用层协议列表包括客户端和服务端同时支持的应用层协议。The establishment module is configured to establish a second data stream in the first QUIC session when the second application layer protocol is an application layer protocol in the application layer protocol list corresponding to the first QUIC session, and the second data stream is used to carry the second data The data requested to be transmitted in the request. The first QUIC session is the QUIC session established with the server when the client responds to the first data request. The list of application layer protocols corresponding to the first QUIC session includes the application layer supported by both the client and the server. protocol.
一些实施方式中,建立模块,具体用于响应第二数据请求生成第一类数据帧,第一类数据帧包括第二应用层协议、第二数据流的标识信息以及第二数据请求对应的数据信息,记录第二数据流的标识信息与第二应用层协议的对应关系。服务端向客户端发送第一类数据帧,指示客户端根据第一类数据帧中的第二应用层协议建立第二数据流。In some embodiments, the establishment module is specifically configured to generate a first type of data frame in response to the second data request, where the first type of data frame includes the second application layer protocol, the identification information of the second data stream, and the data corresponding to the second data request. information, recording the correspondence between the identification information of the second data stream and the second application layer protocol. The server sends the first type of data frame to the client, and instructs the client to establish a second data stream according to the second application layer protocol in the first type of data frame.
一些实施方式中,该装置还包括接收模块,用于接收来自客户端的第一类数据帧。该装置还包括处理模块,用于当确定第一类数据帧中第二数据流的标识信息与第二应用层协议的对应关系,与服务端记录的第二数据流的标识信息与第二应用层协议的对应关系一致时,将第一类数据帧发送给第二应用层协议对应的处理模块进行处理。In some embodiments, the apparatus further includes a receiving module for receiving the first type of data frame from the client. The device further includes a processing module for determining the correspondence between the identification information of the second data stream in the first type of data frame and the second application layer protocol, and the identification information of the second data stream recorded by the server and the second application layer protocol. When the corresponding relationship between the layer protocols is consistent, the first type of data frame is sent to the processing module corresponding to the second application layer protocol for processing.
一些实施方式中,第二类数据帧包括第二数据流的标识信息以及第二数据请求对应的数据信息。In some embodiments, the second type of data frame includes identification information of the second data stream and data information corresponding to the second data request.
接收模块,还用于接收来自客户端的第二类数据帧。处理模块,还用于根据第二类数据帧中第二数据流的标识信息以及第二数据流的标识信息与第二应用层协议的对应关系,将第二类数据帧发送给第二应用层协议对应的处理模块进行处理。The receiving module is further configured to receive the second type of data frame from the client. The processing module is further configured to send the second type of data frame to the second application layer according to the identification information of the second data stream in the second type of data frame and the corresponding relationship between the identification information of the second data stream and the second application layer protocol The processing module corresponding to the protocol performs processing.
一些实施方式中,第二类数据帧包括第二数据流的标识信息以及第二数据请求对应的数据信息。In some embodiments, the second type of data frame includes identification information of the second data stream and data information corresponding to the second data request.
建立模块,具体用于确定第二应用层协议为第一QUIC会话对应的应用层协议列表中的首个应用层协议。服务端响应第二数据请求生成第二类数据帧,记录第二数据流的标识信息与第二应用层协议的对应关系。服务端向客户端发送第二类数据帧,指示客户端响应第二类数据帧,根据第一QUIC会话对应的应用层协议列表中的首个应用层协议建立第二数据流。The establishment module is specifically configured to determine that the second application layer protocol is the first application layer protocol in the application layer protocol list corresponding to the first QUIC session. The server generates a second type of data frame in response to the second data request, and records the correspondence between the identification information of the second data stream and the second application layer protocol. The server sends the second type of data frame to the client, instructing the client to respond to the second type of data frame and establish the second data stream according to the first application layer protocol in the application layer protocol list corresponding to the first QUIC session.
一些实施方式中,该装置还包括记录模块,用于建立第一QUIC会话后,记录第一QUIC会话的引用次数,引用次数为第一QUIC会话中数据流的数量。当第一QUIC会话 中建立一个数据流时,将引用次数加一。当第一QUIC会话中的一个数据流关闭时,将引用次数减一。In some embodiments, the apparatus further includes a recording module configured to record the number of citations of the first QUIC session after the first QUIC session is established, where the number of citations is the number of data streams in the first QUIC session. When a data stream is established in the first QUIC session, the reference count is incremented by one. When a stream in the first QUIC session is closed, the reference count is decremented by one.
一些实施方式中,记录模块,还用于当引用次数减为零,且经过预设的时长后引用次数未发生变化时,将第一QUIC会话关闭。In some embodiments, the recording module is further configured to close the first QUIC session when the number of references is reduced to zero and the number of references does not change after a preset duration.
一些实施方式中,建立模块,还用于服务端与客户端建立第一QUIC会话。服务端响应来自客户的第一数据请求,建立与客户端之间的第一数据流,第一数据流用于承载第一数据请求中请求传输的数据,第一数据请求使用第一应用层协议,第一应用层协议为第一QUIC会话对应的应用层协议列表中的应用层协议。In some embodiments, the establishing module is further configured to establish the first QUIC session between the server and the client. The server responds to the first data request from the client, and establishes a first data stream with the client, where the first data stream is used to carry the data requested to be transmitted in the first data request, and the first data request uses the first application layer protocol, The first application layer protocol is an application layer protocol in the application layer protocol list corresponding to the first QUIC session.
一些实施方式中,建立模块,具体用于接收来自客户端的会话握手请求,会话握手请求用于指示服务端与客户端之间建立第一QUIC会话。根据会话握手请求生成握手报文并发送给客户端,握手报文包括服务端支持的应用层协议。接收来自客户端的应用层协议列表和第一QUIC会话建立的确认报文。服务端根据确认报文确认建立第一QUIC会话。In some embodiments, the establishment module is specifically configured to receive a session handshake request from the client, where the session handshake request is used to instruct the server and the client to establish a first QUIC session. A handshake packet is generated according to the session handshake request and sent to the client. The handshake packet includes the application layer protocol supported by the server. Receive the application layer protocol list from the client and the confirmation message for the establishment of the first QUIC session. The server confirms the establishment of the first QUIC session according to the confirmation message.
一些实施方式中,接收模块,还用于接收来自客户端的第一通知帧或第二通知帧,第一通知帧用于指示服务端向存储于服务端内第一QUIC会话对应的应用层协议列表中添加至少一个应用层协议,第二通知帧用于指示服务端移除存储于服务端内第一QUIC会话对应的应用层协议列表中的至少一个应用层协议。该装置还包括更新模块,用于根据接收到的第一通知帧或第二通知帧,更新应用层协议列表。In some embodiments, the receiving module is further configured to receive the first notification frame or the second notification frame from the client, where the first notification frame is used to instruct the server to send the application layer protocol list corresponding to the first QUIC session stored in the server. At least one application layer protocol is added in the second notification frame, and the second notification frame is used to instruct the server to remove at least one application layer protocol stored in the application layer protocol list corresponding to the first QUIC session in the server. The apparatus further includes an update module, configured to update the application layer protocol list according to the received first notification frame or the second notification frame.
一些实施方式中,更新模块,还用于响应应用层协议列表的更新指令,更新存储于服务端内的应用层协议列表。当更新指令指示向存储于服务端内的应用层协议列表中添加至少一个应用层协议时,生成第一通知帧,第一通知帧用于指示客户端向存储于客户端内第一QUIC会话对应的应用层协议列表中添加至少一个应用层协议。当更新指令指示移除存储于服务端内的应用层协议列表中的至少一个应用层协议时,生成第二通知帧,第二通知帧用于指示客户端移除存储于客户端内第一QUIC会话对应的应用层协议列表中的至少一个应用层协议。服务端将第一通知帧或第二通知帧发送给客户端。In some embodiments, the update module is further configured to update the application layer protocol list stored in the server in response to the update instruction of the application layer protocol list. When the update instruction instructs to add at least one application layer protocol to the application layer protocol list stored in the server, a first notification frame is generated, and the first notification frame is used to instruct the client to correspond to the first QUIC session stored in the client Add at least one application layer protocol to the list of application layer protocols. When the update instruction instructs to remove at least one application layer protocol in the application layer protocol list stored in the server, a second notification frame is generated, and the second notification frame is used to instruct the client to remove the first QUIC stored in the client At least one application layer protocol in the application layer protocol list corresponding to the session. The server sends the first notification frame or the second notification frame to the client.
一些实施方式中,更新模块,还用于当第二应用层协议不是第一QUIC会话对应的应用层协议列表中的应用层协议时,服务端生成应用层协议列表的更新指令,更新指令用于将第二应用层协议写入存储于服务端内第一QUIC会话对应的应用层协议列表。服务端响应更新指令,并生成第一通知帧。建立模块,还用于当服务端将第一通知帧通过第一QUIC会话发送给客户端后,在第一QUIC会话中与客户端建立第二数据流。In some embodiments, the update module is further configured to, when the second application layer protocol is not an application layer protocol in the application layer protocol list corresponding to the first QUIC session, the server generates an update instruction of the application layer protocol list, and the update instruction is used to Write the second application layer protocol into the application layer protocol list corresponding to the first QUIC session stored in the server. The server responds to the update instruction and generates the first notification frame. The establishing module is further configured to establish a second data stream with the client in the first QUIC session after the server sends the first notification frame to the client through the first QUIC session.
第五方面,本申请实施例提供了一种QUIC客户端,包括存储器、处理器以及存储在存储器中并可在处理器上运行的计算机程序,处理器执行计算机程序时实现第一方面提供的方法。In a fifth aspect, an embodiment of the present application provides a QUIC client, including a memory, a processor, and a computer program stored in the memory and running on the processor, and the method provided in the first aspect is implemented when the processor executes the computer program .
第六方面,本申请实施例提供了一种QUIC服务端,包括存储器、处理器以及存储在存储器中并可在处理器上运行的计算机程序,处理器执行计算机程序时实现第二方面提供方法。In a sixth aspect, an embodiment of the present application provides a QUIC server, including a memory, a processor, and a computer program stored in the memory and running on the processor, and the method provided in the second aspect is implemented when the processor executes the computer program.
第七方面,本申请实施例提供了一种数据传输系统,包括至少一个第五方面提供的QUIC客户端和至少一个第六方面提供的QUIC服务端,QUIC客户端和QUIC服务端通过网络通信连接,数据传输系统中的QUIC客户端和QUIC服务端可通过第一方面和第二方面提供的QUIC数据传输方法进行数据传输。In a seventh aspect, an embodiment of the present application provides a data transmission system, including at least one QUIC client provided by the fifth aspect and at least one QUIC server provided by the sixth aspect, where the QUIC client and the QUIC server are connected through network communication , the QUIC client and the QUIC server in the data transmission system can transmit data through the QUIC data transmission methods provided in the first aspect and the second aspect.
第八方面,本申请实施例提供了一种计算机可读存储介质,计算机可读存储介质存储有计算机程序,计算机程序被处理器执行时实现第一方面提供的方法。In an eighth aspect, an embodiment of the present application provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method provided in the first aspect is implemented.
第九方面,本申请实施例提供了一种计算机可读存储介质,计算机可读存储介质存储有计算机程序,其特征在于,计算机程序被处理器执行时实现第二方面提供的方法。In a ninth aspect, an embodiment of the present application provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, wherein the method provided in the second aspect is implemented when the computer program is executed by a processor.
第十方面,本申请实施例提供了一种计算机程序产品,当计算机程序产品在客户端上运行时,使得客户端执行上述第一方面提供的方法。In a tenth aspect, an embodiment of the present application provides a computer program product, which when the computer program product runs on a client, enables the client to execute the method provided in the first aspect.
第十一方面,本申请实施例提供了一种计算机程序产品,当计算机程序产品在服务端上运行时,使得服务端执行上述第二方面提供的方法。In an eleventh aspect, an embodiment of the present application provides a computer program product, which when the computer program product runs on a server, causes the server to execute the method provided in the second aspect.
第十二方面,本申请实施例提供了一种芯片系统,芯片系统包括存储器和处理器,处理器执行存储器中存储的计算机程序,以实现第一方面提供的方法。In a twelfth aspect, an embodiment of the present application provides a chip system, the chip system includes a memory and a processor, and the processor executes a computer program stored in the memory to implement the method provided in the first aspect.
第十三方面,本申请实施例提供了一种芯片系统,芯片系统包括存储器和处理器,处理器执行存储器中存储的计算机程序,以实现第二方面提供的方法。In a thirteenth aspect, an embodiment of the present application provides a chip system, where the chip system includes a memory and a processor, and the processor executes a computer program stored in the memory to implement the method provided in the second aspect.
第十四方面,本申请实施例提供了一种芯片系统,芯片系统包括处理器,处理器与第八方面提供的计算机可读存储介质耦合,处理器执行计算机可读存储介质中存储的计算机程序,以实现第一方面提供的方法。In a fourteenth aspect, an embodiment of the present application provides a chip system, the chip system includes a processor, the processor is coupled to the computer-readable storage medium provided in the eighth aspect, and the processor executes a computer program stored in the computer-readable storage medium , so as to realize the method provided by the first aspect.
第十五方面,本申请实施例提供了一种芯片系统,芯片系统包括处理器,处理器与第九方面提供的计算机可读存储介质耦合,处理器执行计算机可读存储介质中存储的计算机程序,以实现第一方面提供的方法。In a fifteenth aspect, an embodiment of the present application provides a chip system, the chip system includes a processor, the processor is coupled to the computer-readable storage medium provided in the ninth aspect, and the processor executes a computer program stored in the computer-readable storage medium , so as to realize the method provided by the first aspect.
可以理解的是,上述第二方面至第十五方面的有益效果可以参见上述第一方面中的相关描述,在此不再赘述。It can be understood that, for the beneficial effects of the foregoing second aspect to the fifteenth aspect, reference may be made to the relevant description in the foregoing first aspect, and details are not described herein again.
附图说明Description of drawings
图1为一种QUIC数据传输的应用场景;Figure 1 shows an application scenario of QUIC data transmission;
图2为本申请实施例提供的一种客户端的结构示意图;FIG. 2 is a schematic structural diagram of a client according to an embodiment of the present application;
图3为本申请实施例提供的一种客户端的软件结构示意图;3 is a schematic diagram of a software structure of a client according to an embodiment of the present application;
图4为本申请实施例提供的一种QUIC数据传输方法的示意性流程图;FIG. 4 is a schematic flowchart of a QUIC data transmission method provided by an embodiment of the present application;
图5为本申请实施例提供的另一种QUIC数据传输方法的示意性流程图;FIG. 5 is a schematic flowchart of another QUIC data transmission method provided by an embodiment of the present application;
图6为本申请实施例提供的另一种QUIC数据传输方法的示意性流程图;FIG. 6 is a schematic flowchart of another QUIC data transmission method provided by an embodiment of the present application;
图7为本申请实施例提供的另一种QUIC数据传输方法的示意性流程图;FIG. 7 is a schematic flowchart of another QUIC data transmission method provided by an embodiment of the present application;
图8为本申请实施例提供的一种使用本申请提供的数据传输方法时的数据流向图;FIG. 8 is a data flow diagram provided by an embodiment of the present application when the data transmission method provided by the present application is used;
图9为本申请实施例提供的一种QUIC数据传输装置的结构框图;9 is a structural block diagram of a QUIC data transmission apparatus provided by an embodiment of the present application;
图10为本申请实施例提供的另一种QUIC数据传输装置的结构框图;10 is a structural block diagram of another QUIC data transmission apparatus provided by an embodiment of the present application;
图11为本申请实施例提供的另一种QUIC数据传输装置的结构框图;FIG. 11 is a structural block diagram of another QUIC data transmission apparatus provided by an embodiment of the application;
图12为本申请实施例提供的另一种QUIC数据传输装置的结构框图;FIG. 12 is a structural block diagram of another QUIC data transmission apparatus provided by an embodiment of the present application;
图13为本申请实施例提供的一种QUIC数据传输装置的结构框图;13 is a structural block diagram of a QUIC data transmission apparatus provided by an embodiment of the present application;
图14为本申请实施例提供的另一种QUIC数据传输装置的结构框图;FIG. 14 is a structural block diagram of another QUIC data transmission apparatus provided by an embodiment of the present application;
图15为本申请实施例提供的另一种QUIC数据传输装置的结构框图;15 is a structural block diagram of another QUIC data transmission apparatus provided by an embodiment of the application;
图16为本申请实施例提供的另一种QUIC数据传输装置的结构框图;FIG. 16 is a structural block diagram of another QUIC data transmission apparatus provided by an embodiment of the application;
图17为本申请实施例提供的一种QUIC客户端的结构示意图;FIG. 17 is a schematic structural diagram of a QUIC client provided by an embodiment of the application;
图18为本申请实施例提供的一种QUIC服务端的结构示意图。FIG. 18 is a schematic structural diagram of a QUIC server provided by an embodiment of the present application.
具体实施方式Detailed ways
以下描述中,为了说明而不是为了限定,提出了诸如特定系统结构、技术之类的具体细节,以便透彻理解本申请实施例。然而,本领域的技术人员应当清楚,在没有这些具体细节的其它实施例中也可以实现本申请。在其它情况中,省略对众所周知的系统、装置、电路以及方法的详细说明,以免不必要的细节妨碍本申请的描述。In the following description, for the purpose of illustration rather than limitation, specific details such as a specific system structure and technology are set forth in order to provide a thorough understanding of the embodiments of the present application. However, it will be apparent to those skilled in the art that the present application may be practiced in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
应当理解,在本申请说明书和所附权利要求书中使用的术语“和/或”是指相关联列出的项中的一个或多个的任何组合以及所有可能组合,并且包括这些组合。It should be understood that, as used in this specification and the appended claims, the term "and/or" refers to and including any and all possible combinations of one or more of the associated listed items.
如在本申请说明书和所附权利要求书中所使用的那样,术语“如果”可以依据上下文被解释为“当...时”或“一旦”或“响应于确定”或“响应于检测到”。类似地,短语“如果确定”或“如果检测到”可以依据上下文被解释为意指“一旦确定”或“响应于确定”或“一旦检测到”或“响应于检测到”。As used in the specification of this application and the appended claims, the term "if" may be contextually interpreted as "when" or "once" or "in response to determining" or "in response to detecting ". Similarly, the phrases "if determined" or "if detected" may be interpreted contextually to mean "once determined" or "in response to determining" or "once detected" or "in response to detecting."
另外,在本申请说明书和所附权利要求书的描述中,术语“第一”、“第二”、“第三”等仅用于区分描述,而不能理解为指示或暗示相对重要性。In addition, in the description of the specification of the present application and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the description, and should not be construed as indicating or implying relative importance.
在本申请说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。References in this specification to "one embodiment" or "some embodiments" and the like mean that a particular feature, structure or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in other embodiments," etc. in various places in this specification are not necessarily All refer to the same embodiment, but mean "one or more but not all embodiments" unless specifically emphasized otherwise. The terms "including", "including", "having" and their variants mean "including but not limited to" unless specifically emphasized otherwise.
图1示出了一种QUIC数据传输的应用场景。Figure 1 shows an application scenario of QUIC data transmission.
参考图1,该场景中包括客户端11、服务端12,客户端11和服务端12之前通过网络进行数据传输。Referring to FIG. 1 , the scenario includes a client 11 and a server 12 , and the client 11 and the server 12 previously performed data transmission through the network.
网络可以是有线网络或者无线网络,作为示例,无线网络可以包括全球移动通讯系统(global system for mobile communications,GSM),通用分组无线服务(general packet radio service,GPRS),码分多址接入(code division multiple access,CDMA),宽带码分多址(wideband code division multiple access,WCDMA),时分码分多址(time-division code division multiple access,TD-SCDMA),长期演进(long term evolution,LTE),新空口(New Radio,NR),BT,GNSS,WLAN,NFC,FM,和/或IR技术等。GNSS可以包括全球卫星定位系统(global positioning system,GPS),全球导航卫星系统(global navigation satellite system,GLONASS),北斗卫星导航系统(beidou navigation satellite system,BDS),准天顶卫星系统(quasi-zenith satellite system,QZSS)和/或星基增强系统(satellite based augmentation systems,SBAS)。而有线网络则可以包括局域网(Local Area Network,LAN)、广域网(Wide Area Network,WAN)等。The network may be a wired network or a wireless network. As an example, the wireless network may include a global system for mobile communications (GSM), a general packet radio service (GPRS), a code division multiple access ( code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE) ), New Radio (NR), BT, GNSS, WLAN, NFC, FM, and/or IR technology, etc. GNSS may include global positioning system (GPS), global navigation satellite system (GLONASS), Beidou navigation satellite system (BDS), quasi-zenith satellite system (quasi-zenith) satellite system, QZSS) and/or satellite based augmentation systems (SBAS). The wired network may include a Local Area Network (LAN), a Wide Area Network (WAN), and the like.
客户端11和服务端12之间进行数据交换时,可以使用QUIC协议。QUIC是基于UDP的一种传输层协议,可以替代传输控制协议(Transmission Control Protocol,TCP),以改善队头阻塞等问题。QUIC协议对承载其上的协议报文实现了传输层的多路复用。例如,客户端11运行有浏览器程序,浏览器程序浏览的网页中包括多个元素,如文本、图像以及视频等。客户端11可以与服务端12之间建立QUIC会话,每个QUIC会话下可建立多个数据流,每个数据流用于传输一个元素请求的数据。在一个QUIC会话下,多个数据流可以同时传输多个元素请求的数据。When exchanging data between the client 11 and the server 12, the QUIC protocol can be used. QUIC is a transport layer protocol based on UDP, which can replace Transmission Control Protocol (TCP) to improve problems such as head-of-line blocking. The QUIC protocol implements multiplexing at the transport layer for the protocol packets carried on it. For example, the client 11 runs a browser program, and the webpage browsed by the browser program includes multiple elements, such as text, images, and videos. A QUIC session can be established between the client 11 and the server 12, and multiple data streams can be established under each QUIC session, and each data stream is used to transmit the data requested by one element. Under a QUIC session, multiple data streams can transmit data requested by multiple elements at the same time.
现有技术中,每个QUIC会话只能支持一个应用层协议,对于采用不同应用层协议的元素,需要建立多个QUIC会话进行传输。In the prior art, each QUIC session can only support one application layer protocol. For elements using different application layer protocols, multiple QUIC sessions need to be established for transmission.
例如,文本、图像等元素可以使用超文本传输协议(Hyper Text Transfer Protocol,HTTP)3.0进行传输,而直播视频元素则可以通过实时传输协议(Real-time Transport Protocol,RTP)或实时传输控制协议(Real-time Transport Control Protocol,RTCP)进行传输。这个情况下,为了同时传输采用了不同应用层协议的元素,客户端11与服务端12之间需要为每个应用层协议建立一个QUIC会话,用于传输采用了对应应用层协议的元素。例如,客户端11与服务端12之间可以一个QUIC会话用于传输采用HTTP 3.0协议的元素,再建立另一个QUIC会话,用于传输采用RTP/RTCP协议的元素。For example, elements such as text and images can be transmitted using Hyper Text Transfer Protocol (HTTP) 3.0, while live video elements can be transmitted through Real-time Transport Protocol (RTP) or Real-time Transport Control Protocol ( Real-time Transport Control Protocol, RTCP) for transmission. In this case, in order to transmit elements using different application layer protocols at the same time, a QUIC session needs to be established between the client 11 and the server 12 for each application layer protocol for transmitting elements using the corresponding application layer protocol. For example, a QUIC session can be used between the client 11 and the server 12 to transmit elements using the HTTP 3.0 protocol, and another QUIC session can be established to transmit elements using the RTP/RTCP protocol.
但是,客户端11与服务端12之间每次建立QUIC会话时都需要进行握手,建立多个QUIC会话则需要进行多次握手,进而导致数据传输延迟增加,建链效率低。However, each time a QUIC session is established between the client 11 and the server 12, a handshake needs to be performed, and multiple handshakes are required to establish multiple QUIC sessions, resulting in increased data transmission delay and low chain building efficiency.
对此,本身请提供了一种QUIC数据传输方法,该方法应用于客户端时,包括:In this regard, please provide a QUIC data transmission method, which, when applied to the client, includes:
客户端响应于第二数据请求与服务端之间进行数据传输时,确定第二数据请求所使用的第二应用层协议。当第二应用层协议为第一QUIC会话对应的应用层协议列表中的应用层协议时,在第一QUIC会话中建立第二数据流,第二数据流用于承载第二数据请求中请求传输的数据,第一QUIC会话为客户端响应第一数据请求时,与服务端建立的QUIC会话,第一QUIC会话对应的应用层协议列表包括客户端和服务端同时支持的应用层协议。The client determines the second application layer protocol used by the second data request when performing data transmission between the client and the server in response to the second data request. When the second application layer protocol is an application layer protocol in the application layer protocol list corresponding to the first QUIC session, a second data stream is established in the first QUIC session, and the second data stream is used to carry the data requested to be transmitted in the second data request. Data, the first QUIC session is the QUIC session established with the server when the client responds to the first data request, and the list of application layer protocols corresponding to the first QUIC session includes the application layer protocols supported by both the client and the server.
该方法应用于服务端时,包括:When this method is applied to the server, it includes:
服务端响应于第二数据请求与客户端之间进行数据传输时,确定第二数据请求所使用的第二应用层协议。当第二应用层协议为第一QUIC会话对应的应用层协议列表中的应用层协议时,在第一QUIC会话中建立第二数据流,第二数据流用于承载第二数据请求中请求传输的数据,第一QUIC会话为客户端响应第一数据请求时,与服务端建立的QUIC会话,第一QUIC会话对应的应用层协议列表包括客户端和服务端同时支持的应用层协议。The server determines the second application layer protocol used by the second data request when performing data transmission between the server and the client in response to the second data request. When the second application layer protocol is an application layer protocol in the application layer protocol list corresponding to the first QUIC session, a second data stream is established in the first QUIC session, and the second data stream is used to carry the data requested to be transmitted in the second data request. Data, the first QUIC session is the QUIC session established with the server when the client responds to the first data request, and the list of application layer protocols corresponding to the first QUIC session includes the application layer protocols supported by both the client and the server.
本申请中提供的QUIC数据传输方法通过在客户端与服务端建立第一QUIC会话时,协商获得第一QUIC会话对应的应用层协议列表。当客户端或服务端响应第二数据请求与服务端之间进行数据传输时,若第二数据请求所使用的第二应用层协议是第一QUIC会话对应的应用层协议列表中的,则无需再创建QUIC会话,而是在第一QUIC会话下建立使用第二应用层协议的第二数据流承载第二数据请求中请求传输的数据。由于无需建立多个QUIC会话,而是复用了第一QUIC会话,可以节省网络带宽,节省QUIC会话资源,同时降低数据传输延迟,提高建链效率。The QUIC data transmission method provided in this application obtains the application layer protocol list corresponding to the first QUIC session through negotiation when the client and the server establish the first QUIC session. When the client or server responds to the second data request and performs data transmission between the server, if the second application layer protocol used by the second data request is in the list of application layer protocols corresponding to the first QUIC session, no need The QUIC session is created again, but a second data stream using the second application layer protocol is established under the first QUIC session to carry the data requested to be transmitted in the second data request. Since there is no need to establish multiple QUIC sessions, the first QUIC session is reused, which can save network bandwidth and QUIC session resources, reduce data transmission delay, and improve chain construction efficiency.
本申请实施例提供的数据传输方法的客户端可以是手机(mobile phone)、平板电脑(Pad)、带收发功能的电脑、虚拟现实(virtual reality,VR)终端设备、增强现实(augmented reality,AR)终端设备、工业控制(industrial control)中的无线终端、无人驾驶(self driving)中的无线终端、远程医疗(remote medical)中的无线终端、智能电网(smart grid)中的无线终端、运输安全(transportation safety)中的无线终端、智慧城市(smart city)中的无线终端、智慧家庭(smart home)中的无线终端、可穿戴设备、车载设备、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本、个人数字助理(personal digital assistant,PDA),本申请实施例对客户端的具体类型不作任何限制。The client of the data transmission method provided in the embodiment of the present application may be a mobile phone (mobile phone), a tablet computer (Pad), a computer with a transceiver function, a virtual reality (virtual reality, VR) terminal device, an augmented reality (augmented reality, AR) ) terminal equipment, wireless terminal in industrial control, wireless terminal in self driving, wireless terminal in remote medical, wireless terminal in smart grid, transportation Wireless terminals in transportation safety, wireless terminals in smart cities, wireless terminals in smart homes, wearable devices, in-vehicle devices, ultra-mobile personal computers, UMPC), netbook, personal digital assistant (personal digital assistant, PDA), the embodiment of this application does not impose any limitation on the specific type of the client.
服务端则可以是为客户端服务的设备,服务端可以向客户端提供资源以及保存来自客 户端的数据等。例如,服务端可以是服务器或网络设备,服务器可以是刀片服务器、机架式服务器、云服务器等,网络设备包括三层交换机、路由器、宽带网关、防火墙、负载均衡器等,本申请实施例对服务端的具体类型不作任何限制。The server can be a device serving the client. The server can provide resources to the client and save the data from the client. For example, the server may be a server or a network device, the server may be a blade server, a rack server, a cloud server, etc., and the network device includes a three-layer switch, a router, a broadband gateway, a firewall, a load balancer, and the like. The specific type of the server does not impose any restrictions.
图2示出了一种客户端的结构示意图,客户端为电子设备200。电子设备200可以包括处理器210,外部存储器接口220,内部存储器221,通用串行总线(universal serial bus,USB)接口230,充电管理模块240,电源管理模块241,电池242,天线1,天线2,移动通信模块250,无线通信模块260,音频模块270,扬声器270A,受话器270B,麦克风270C,耳机接口270D,传感器模块280,按键290,马达291,指示器292,摄像头293,显示屏294,以及用户标识模块(subscriber identification module,SIM)卡接口295等。其中传感器模块280可以包括压力传感器280A,陀螺仪传感器280B,气压传感器280C,磁传感器280D,加速度传感器280E,距离传感器280F,接近光传感器280G,指纹传感器280H,温度传感器280J,触摸传感器280K,环境光传感器280L,骨传导传感器280M等。FIG. 2 shows a schematic structural diagram of a client, where the client is an electronic device 200 . The electronic device 200 may include a processor 210, an external memory interface 220, an internal memory 221, a universal serial bus (USB) interface 230, a charge management module 240, a power management module 241, a battery 242, an antenna 1, an antenna 2 , mobile communication module 250, wireless communication module 260, audio module 270, speaker 270A, receiver 270B, microphone 270C, headphone jack 270D, sensor module 280, buttons 290, motor 291, indicator 292, camera 293, display screen 294, and Subscriber identification module (subscriber identification module, SIM) card interface 295 and so on. The sensor module 280 may include a pressure sensor 280A, a gyroscope sensor 280B, an air pressure sensor 280C, a magnetic sensor 280D, an acceleration sensor 280E, a distance sensor 280F, a proximity light sensor 280G, a fingerprint sensor 280H, a temperature sensor 280J, a touch sensor 280K, and ambient light. Sensor 280L, Bone Conduction Sensor 280M, etc.
可以理解的是,本申请实施例示意的结构并不构成对电子设备200的具体限定。在本申请另一些实施例中,电子设备200可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It can be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 200 . In other embodiments of the present application, the electronic device 200 may include more or less components than shown, or combine some components, or separate some components, or arrange different components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
作为举例,当电子设备200为手机或平板电脑时,可以包括图示中的全部部件,也可以仅包括图示中的部分部件。As an example, when the electronic device 200 is a mobile phone or a tablet computer, it may include all the components in the figure, or only some components in the figure.
处理器210可以包括一个或多个处理单元,例如:处理器210可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。The processor 210 may include one or more processing units, for example, the processor 210 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (NPU) Wait. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.
其中,控制器可以是电子设备200的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。The controller may be the nerve center and command center of the electronic device 200 . The controller can generate an operation control signal according to the instruction operation code and timing signal, and complete the control of fetching and executing instructions.
处理器210中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器210中的存储器为高速缓冲存储器。该存储器可以保存处理器210刚用过或循环使用的指令或数据。如果处理器210需要再次使用该指令或数据,可从存储器中直接调用。避免了重复存取,减少了处理器210的等待时间,因而提高了系统的效率。A memory may also be provided in the processor 210 for storing instructions and data. In some embodiments, the memory in processor 210 is cache memory. The memory may hold instructions or data that have just been used or recycled by the processor 210 . If the processor 210 needs to use the instruction or data again, it can be called directly from memory. Repeated accesses are avoided, and the waiting time of the processor 210 is reduced, thereby improving the efficiency of the system.
在一些实施例中,处理器210可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。In some embodiments, the processor 210 may include one or more interfaces. The interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous transceiver (universal asynchronous transmitter) receiver/transmitter, UART) interface, mobile industry processor interface (MIPI), general-purpose input/output (GPIO) interface, subscriber identity module (SIM) interface, and / or universal serial bus (universal serial bus, USB) interface, etc.
I2C接口是一种双向同步串行总线,包括一根串行数据线(serial data line,SDA) 和一根串行时钟线(derail clock line,SCL)。在一些实施例中,处理器210可以包含多组I2C总线。处理器210可以通过不同的I2C总线接口分别耦合触摸传感器280K,充电器,闪光灯,摄像头293等。例如:处理器210可以通过I2C接口耦合触摸传感器280K,使处理器210与触摸传感器280K通过I2C总线接口通信,实现电子设备200的触摸功能。The I2C interface is a bidirectional synchronous serial bus that includes a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 210 may contain multiple sets of I2C buses. The processor 210 can be respectively coupled to the touch sensor 280K, the charger, the flash, the camera 293 and the like through different I2C bus interfaces. For example, the processor 210 can couple the touch sensor 280K through the I2C interface, so that the processor 210 communicates with the touch sensor 280K through the I2C bus interface, so as to realize the touch function of the electronic device 200 .
I2S接口可以用于音频通信。在一些实施例中,处理器210可以包含多组I2S总线。处理器210可以通过I2S总线与音频模块270耦合,实现处理器210与音频模块270之间的通信。在一些实施例中,音频模块270可以通过I2S接口向无线通信模块260传递音频信号。The I2S interface can be used for audio communication. In some embodiments, the processor 210 may contain multiple sets of I2S buses. The processor 210 may be coupled with the audio module 270 through an I2S bus to implement communication between the processor 210 and the audio module 270 . In some embodiments, the audio module 270 may communicate audio signals to the wireless communication module 260 through the I2S interface.
PCM接口也可以用于音频通信,将模拟信号抽样,量化和编码。在一些实施例中,音频模块270与无线通信模块260可以通过PCM总线接口耦合。The PCM interface can also be used for audio communications, sampling, quantizing and encoding analog signals. In some embodiments, the audio module 270 and the wireless communication module 260 may be coupled through a PCM bus interface.
在一些实施例中,音频模块270也可以通过PCM接口向无线通信模块260传递音频信号。I2S接口和PCM接口都可以用于音频通信。In some embodiments, the audio module 270 may also transmit audio signals to the wireless communication module 260 through the PCM interface. Both the I2S interface and the PCM interface can be used for audio communication.
UART接口是一种通用串行数据总线,用于异步通信。该总线可以为双向通信总线。它将要传输的数据在串行通信与并行通信之间转换。The UART interface is a universal serial data bus used for asynchronous communication. The bus may be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication.
在一些实施例中,UART接口通常被用于连接处理器210与无线通信模块260。例如:处理器210通过UART接口与无线通信模块260中的蓝牙模块通信,实现蓝牙功能。在一些实施例中,音频模块270可以通过UART接口向无线通信模块260传递音频信号,实现通过蓝牙耳机播放音乐的功能。In some embodiments, a UART interface is typically used to connect the processor 210 with the wireless communication module 260 . For example, the processor 210 communicates with the Bluetooth module in the wireless communication module 260 through the UART interface to implement the Bluetooth function. In some embodiments, the audio module 270 can transmit audio signals to the wireless communication module 260 through the UART interface, so as to realize the function of playing music through the Bluetooth headset.
MIPI接口可以被用于连接处理器210与显示屏294,摄像头293等外围器件。MIPI接口包括摄像头串行接口(camera serial interface,CSI),显示屏串行接口(display serial interface,DSI)等。在一些实施例中,处理器210和摄像头293通过CSI接口通信,实现电子设备200的拍摄功能。处理器210和显示屏294通过DSI接口通信,实现电子设备200的显示功能。The MIPI interface can be used to connect the processor 210 with peripheral devices such as the display screen 294 and the camera 293 . MIPI interfaces include camera serial interface (CSI), display serial interface (DSI), etc. In some embodiments, the processor 210 communicates with the camera 293 through a CSI interface, so as to implement the photographing function of the electronic device 200 . The processor 210 communicates with the display screen 294 through the DSI interface to implement the display function of the electronic device 200 .
GPIO接口可以通过软件配置。GPIO接口可以被配置为控制信号,也可被配置为数据信号。在一些实施例中,GPIO接口可以用于连接处理器210与摄像头293,显示屏294,无线通信模块260,音频模块270,传感器模块280等。GPIO接口还可以被配置为I2C接口,I2S接口,UART接口,MIPI接口等。The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface may be used to connect the processor 210 with the camera 293, the display screen 294, the wireless communication module 260, the audio module 270, the sensor module 280, and the like. The GPIO interface can also be configured as I2C interface, I2S interface, UART interface, MIPI interface, etc.
USB接口230是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。USB接口230可以用于连接充电器为电子设备200充电,也可以用于电子设备200与外围设备之间传输数据。也可以用于连接耳机,通过耳机播放音频。该接口还可以用于连接其他电子设备,例如AR设备等。The USB interface 230 is an interface that conforms to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, and the like. The USB interface 230 can be used to connect a charger to charge the electronic device 200, and can also be used to transmit data between the electronic device 200 and peripheral devices. It can also be used to connect headphones to play audio through the headphones. The interface can also be used to connect other electronic devices, such as AR devices.
可以理解的是,本申请实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备200的结构限定。在本申请另一些实施例中,电子设备200也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。It can be understood that the interface connection relationship between the modules illustrated in the embodiments of the present application is only a schematic illustration, and does not constitute a structural limitation of the electronic device 200 . In other embodiments of the present application, the electronic device 200 may also adopt different interface connection manners in the foregoing embodiments, or a combination of multiple interface connection manners.
充电管理模块240用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。在一些有线充电的实施例中,充电管理模块240可以通过USB接口230接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块240可以通过电子设备200的无线充电线圈接收无线充电输入。充电管理模块240为电池 242充电的同时,还可以通过电源管理模块241为电子设备供电。The charging management module 240 is used to receive charging input from the charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 240 may receive charging input from the wired charger through the USB interface 230 . In some wireless charging embodiments, the charging management module 240 may receive wireless charging input through the wireless charging coil of the electronic device 200 . While the charging management module 240 charges the battery 242, it can also supply power to the electronic device through the power management module 241.
电源管理模块241用于连接电池242,充电管理模块240与处理器210。电源管理模块241接收电池242和/或充电管理模块240的输入,为处理器210,内部存储器221,外部存储器,显示屏294,摄像头293,和无线通信模块260等供电。电源管理模块241还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。The power management module 241 is used to connect the battery 242 , the charging management module 240 and the processor 210 . The power management module 241 receives input from the battery 242 and/or the charging management module 240, and supplies power to the processor 210, the internal memory 221, the external memory, the display screen 294, the camera 293, and the wireless communication module 260. The power management module 241 can also be used to monitor parameters such as battery capacity, battery cycle times, battery health status (leakage, impedance).
在其他一些实施例中,电源管理模块241也可以设置于处理器210中。在另一些实施例中,电源管理模块241和充电管理模块240也可以设置于同一个器件中。In some other embodiments, the power management module 241 may also be provided in the processor 210 . In other embodiments, the power management module 241 and the charging management module 240 may also be provided in the same device.
电子设备200的无线通信功能可以通过天线1,天线2,移动通信模块250,无线通信模块260,调制解调处理器以及基带处理器等实现。The wireless communication function of the electronic device 200 may be implemented by the antenna 1, the antenna 2, the mobile communication module 250, the wireless communication module 260, the modulation and demodulation processor, the baseband processor, and the like.
天线1和天线2用于发射和接收电磁波信号。电子设备200中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 200 may be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, the antenna 1 can be multiplexed as a diversity antenna of the wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
移动通信模块250可以提供应用在电子设备200上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块250可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块250可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块250还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。The mobile communication module 250 may provide a wireless communication solution including 2G/3G/4G/5G, etc. applied on the electronic device 200 . The mobile communication module 250 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), and the like. The mobile communication module 250 can receive electromagnetic waves from the antenna 1, filter and amplify the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 250 can also amplify the signal modulated by the modulation and demodulation processor, and then convert it into electromagnetic waves for radiation through the antenna 1 .
在一些实施例中,移动通信模块250的至少部分功能模块可以被设置于处理器210中。在一些实施例中,移动通信模块250的至少部分功能模块可以与处理器210的至少部分模块被设置在同一个器件中。In some embodiments, at least part of the functional modules of the mobile communication module 250 may be provided in the processor 210 . In some embodiments, at least part of the functional modules of the mobile communication module 250 may be provided in the same device as at least part of the modules of the processor 210 .
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器270A,受话器270B等)输出声音信号,或通过显示屏294显示图像或视频。在一些实施例中,调制解调处理器可以是独立的器件。在另一些实施例中,调制解调处理器可以独立于处理器210,与移动通信模块250或其他功能模块设置在同一个器件中。The modem processor may include a modulator and a demodulator. Wherein, the modulator is used to modulate the low frequency baseband signal to be sent into a medium and high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low frequency baseband signal. Then the demodulator transmits the demodulated low-frequency baseband signal to the baseband processor for processing. The low frequency baseband signal is processed by the baseband processor and passed to the application processor. The application processor outputs sound signals through audio devices (not limited to the speaker 270A, the receiver 270B, etc.), or displays images or videos through the display screen 294 . In some embodiments, the modem processor may be a stand-alone device. In other embodiments, the modem processor may be independent of the processor 210, and may be provided in the same device as the mobile communication module 250 or other functional modules.
无线通信模块260可以提供应用在电子设备200上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块260可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块260经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器210。无线通信模块260还可以从处理器210接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。The wireless communication module 260 can provide applications on the electronic device 200 including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellites Wireless communication solutions such as global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared technology (IR). The wireless communication module 260 may be one or more devices integrating at least one communication processing module. The wireless communication module 260 receives electromagnetic waves via the antenna 2 , modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 210 . The wireless communication module 260 can also receive the signal to be sent from the processor 210 , perform frequency modulation on the signal, amplify the signal, and then convert it into an electromagnetic wave for radiation through the antenna 2 .
在一些实施例中,电子设备200的天线1和移动通信模块250耦合,天线2和无 线通信模块260耦合,使得电子设备200可以通过无线通信技术与网络以及其他设备通信。无线通信技术可以包括全球移动通讯系统(global system for mobile communications,GSM),通用分组无线服务(general packet radio service,GPRS),码分多址接入(code division multiple access,CDMA),宽带码分多址(wideband code division multiple access,WCDMA),时分码分多址(time-division code division multiple access,TD-SCDMA),长期演进(long term evolution,LTE),BT,GNSS,WLAN,NFC,FM,和/或IR技术等。GNSS可以包括全球卫星定位系统(global positioning system,GPS),全球导航卫星系统(global navigation satellite system,GLONASS),北斗卫星导航系统(beidou navigation satellite system,BDS),准天顶卫星系统(quasi-zenith satellite system,QZSS)和/或星基增强系统(satellite based augmentation systems,SBAS)。In some embodiments, the antenna 1 of the electronic device 200 is coupled with the mobile communication module 250, and the antenna 2 is coupled with the wireless communication module 260, so that the electronic device 200 can communicate with the network and other devices through wireless communication technology. Wireless communication technologies may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), broadband code division Multiple access (wideband code division multiple access, WCDMA), time division code division multiple access (time-division code division multiple access, TD-SCDMA), long term evolution (long term evolution, LTE), BT, GNSS, WLAN, NFC, FM , and/or IR technology, etc. GNSS may include global positioning system (GPS), global navigation satellite system (GLONASS), Beidou navigation satellite system (BDS), quasi-zenith satellite system (quasi-zenith) satellite system, QZSS) and/or satellite based augmentation systems (SBAS).
电子设备200通过GPU,显示屏294,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏294和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器210可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The electronic device 200 implements a display function through a GPU, a display screen 294, an application processor, and the like. The GPU is a microprocessor for image processing, and is connected to the display screen 294 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 210 may include one or more GPUs that execute program instructions to generate or alter display information.
显示屏294用于显示图像,视频等。例如本申请实施例中的教学视频和用户动作画面视频,显示屏294包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode的,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,电子设备200可以包括1个或N个显示屏294,N为大于1的正整数。Display screen 294 is used to display images, videos, and the like. For example, in the teaching video and the user action picture video in the embodiment of the present application, the display screen 294 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (active-matrix organic light). emitting diode, AMOLED), flexible light-emitting diode (flex light-emitting diode, FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diode (quantum dot light emitting diodes, QLED) and so on. In some embodiments, the electronic device 200 may include one or N display screens 294 , where N is a positive integer greater than one.
电子设备200可以通过ISP,摄像头293,视频编解码器,GPU,显示屏294以及应用处理器等实现拍摄功能。The electronic device 200 can realize the shooting function through the ISP, the camera 293, the video codec, the GPU, the display screen 294 and the application processor.
ISP用于处理摄像头293反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度,肤色进行算法优化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头293中。The ISP is used to process the data fed back by the camera 293 . For example, when taking a photo, the shutter is opened, the light is transmitted to the camera photosensitive element through the lens, the light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing, converting it into an image visible to the naked eye. ISP can also perform algorithm optimization on image noise, brightness, and skin tone. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, the ISP may be provided in the camera 293 .
摄像头293用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。镜头的焦段可以用于表示摄像头的取景范围,镜头的焦段越小,表示镜头的取景范围越大。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。Camera 293 is used to capture still images or video. The object is projected through the lens to generate an optical image onto the photosensitive element. The focal length of the lens can be used to indicate the viewing range of the camera. The smaller the focal length of the lens, the larger the viewing range of the lens. The photosensitive element may be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. DSP converts digital image signals into standard RGB, YUV and other formats of image signals.
在本申请中,电子设备200可以包括2个或2个以上焦段的摄像头293。In this application, the electronic device 200 may include cameras 293 with two or more focal lengths.
数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。例如,当电子设备200在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。A digital signal processor is used to process digital signals, in addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 200 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy, and the like.
视频编解码器用于对数字视频压缩或解压缩。电子设备200可以支持一种或多种视频编解码器。这样,电子设备200可以播放或录制多种编码格式的视频,例如:动态图像专家组(moving picture experts group,MPEG)1,MPEG2,MPEG3,MPEG4等。Video codecs are used to compress or decompress digital video. The electronic device 200 may support one or more video codecs. In this way, the electronic device 200 can play or record videos in various encoding formats, such as: moving picture experts group (moving picture experts group, MPEG) 1, MPEG2, MPEG3, MPEG4, and so on.
NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现电子设备200的智能认知等应用,例如:图像识别,人脸识别,语音识别,文本理解等。The NPU is a neural-network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transfer mode between neurons in the human brain, it can quickly process the input information and can continuously learn by itself. Applications such as intelligent cognition of the electronic device 200 can be implemented through the NPU, for example: image recognition, face recognition, speech recognition, text understanding, and the like.
在本申请实施例中,NPU或其他处理器可以用于对电子设备200存储的视频中的图像进行分析处理等操作。In this embodiment of the present application, the NPU or other processors may be used to perform operations such as analysis and processing on images in the video stored by the electronic device 200 .
外部存储器接口220可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备200的存储能力。外部存储卡通过外部存储器接口220与处理器210通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。The external memory interface 220 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 200. The external memory card communicates with the processor 210 through the external memory interface 220 to realize the data storage function. For example to save files like music, video etc in external memory card.
内部存储器221可以用于存储计算机可执行程序代码,可执行程序代码包括指令。处理器210通过运行存储在内部存储器221的指令,从而执行电子设备200的各种功能应用以及数据处理。内部存储器221可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)。存储数据区可存储电子设备200使用过程中所创建的数据(比如音频数据,电话本等)。Internal memory 221 may be used to store computer executable program code, which includes instructions. The processor 210 executes various functional applications and data processing of the electronic device 200 by executing the instructions stored in the internal memory 221 . The internal memory 221 may include a storage program area and a storage data area. The storage program area can store an operating system and an application program required for at least one function (such as a sound playback function, an image playback function, etc.). The storage data area can store data (such as audio data, phone book, etc.) created during the use of the electronic device 200 .
此外,内部存储器221可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。In addition, the internal memory 221 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, universal flash storage (UFS), and the like.
电子设备200可以通过音频模块270,扬声器270A,受话器270B,麦克风270C,耳机接口270D,以及应用处理器等实现音频功能。The electronic device 200 may implement audio functions through an audio module 270, a speaker 270A, a receiver 270B, a microphone 270C, an earphone interface 270D, and an application processor.
音频模块270用于将数字音频信号转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块270还可以用于对音频信号编码和解码。在一些实施例中,音频模块270可以设置于处理器210中,或将音频模块270的部分功能模块设置于处理器210中。The audio module 270 is used for converting digital audio signals into analog audio signal outputs, and also for converting analog audio inputs into digital audio signals. Audio module 270 may also be used to encode and decode audio signals. In some embodiments, the audio module 270 may be provided in the processor 210 , or some functional modules of the audio module 270 may be provided in the processor 210 .
扬声器270A,也称“喇叭”,用于将音频电信号转换为声音信号。电子设备200可以通过扬声器270A收听音乐,或收听免提通话,例如扬声器可以播放本申请实施例提供的比对分析结果。 Speaker 270A, also referred to as a "speaker", is used to convert audio electrical signals into sound signals. The electronic device 200 can listen to music through the speaker 270A, or listen to a hands-free call. For example, the speaker can play the comparison analysis result provided by the embodiment of the present application.
受话器270B,也称“听筒”,用于将音频电信号转换成声音信号。当电子设备200接听电话或语音信息时,可以通过将受话器270B靠近人耳接听语音。The receiver 270B, also referred to as an "earpiece", is used to convert audio electrical signals into sound signals. When the electronic device 200 answers a call or a voice message, the voice can be answered by placing the receiver 270B close to the human ear.
麦克风270C,也称“话筒”,“传声器”,用于将声音信号转换为电信号。当拨打电话或发送语音信息时,用户可以通过人嘴靠近麦克风270C发声,将声音信号输入到麦克风270C。电子设备200可以设置至少一个麦克风270C。在另一些实施例中,电子设备200可以设置两个麦克风270C,除了采集声音信号,还可以实现降噪功能。在另一些实施例中,电子设备200还可以设置三个,四个或更多麦克风270C,实现采集声音信号,降噪,还可以识别声音来源,实现定向录音功能等。The microphone 270C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can make a sound by approaching the microphone 270C through the human mouth, and input the sound signal into the microphone 270C. The electronic device 200 may be provided with at least one microphone 270C. In other embodiments, the electronic device 200 may be provided with two microphones 270C, which may implement a noise reduction function in addition to collecting sound signals. In other embodiments, the electronic device 200 may further be provided with three, four or more microphones 270C to collect sound signals, reduce noise, identify sound sources, and implement directional recording functions.
耳机接口270D用于连接有线耳机。耳机接口270D可以是USB接口230,也可以是3.5mm的开放移动电子设备平台(open mobile terminal platform,OMTP)标准接口,美国蜂窝电信工业协会(cellular telecommunications industry association of the USA,CTIA)标准接口。The headphone jack 270D is used to connect wired headphones. The earphone interface 270D can be a USB interface 230, or can be a 3.5mm open mobile terminal platform (OMTP) standard interface, a cellular telecommunications industry association of the USA (CTIA) standard interface.
压力传感器280A用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器280A可以设置于显示屏294。压力传感器280A的种类很多,如电阻式压力传感器,电感式压力传感器,电容式压力传感器等。电容式压力传感器可以是包括至少两个具有导电材料的平行板。当有力作用于压力传感器280A,电极之间的电容改变。电子设备200根据电容的变化确定压力的强度。当有触摸操作作用于显示屏294,电子设备200根据压力传感器280A检测触摸操作强度。电子设备200也可以根据压力传感器280A的检测信号计算触摸的位置。The pressure sensor 280A is used to sense pressure signals, and can convert the pressure signals into electrical signals. In some embodiments, the pressure sensor 280A may be provided on the display screen 294 . There are many types of pressure sensors 280A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, and the like. The capacitive pressure sensor may be comprised of at least two parallel plates of conductive material. When a force is applied to pressure sensor 280A, the capacitance between the electrodes changes. The electronic device 200 determines the intensity of the pressure according to the change in capacitance. When a touch operation acts on the display screen 294, the electronic device 200 detects the intensity of the touch operation according to the pressure sensor 280A. The electronic device 200 may also calculate the touched position according to the detection signal of the pressure sensor 280A.
在一些实施例中,作用于相同触摸位置,但不同触摸操作强度的触摸操作,可以对应不同的操作指令。例如:当有触摸操作强度小于第一压力阈值的触摸操作作用于短消息应用图标时,执行查看短消息的指令。当有触摸操作强度大于或等于第一压力阈值的触摸操作作用于短消息应用图标时,执行新建短消息的指令。In some embodiments, touch operations acting on the same touch position but with different touch operation intensities may correspond to different operation instructions. For example, when a touch operation whose intensity is less than the first pressure threshold acts on the short message application icon, the instruction for viewing the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, the instruction to create a new short message is executed.
陀螺仪传感器280B可以用于确定电子设备200的运动姿态。在一些实施例中,可以通过陀螺仪传感器280B确定电子设备200围绕三个轴(即,x,y和z轴)的角速度。陀螺仪传感器280B可以用于拍摄防抖。示例性的,当按下快门,陀螺仪传感器280B检测电子设备200抖动的角度,根据角度计算出镜头模组需要补偿的距离,让镜头通过反向运动抵消电子设备200的抖动,实现防抖。陀螺仪传感器280B还可以用于导航,体感游戏场景。The gyro sensor 280B may be used to determine the motion attitude of the electronic device 200 . In some embodiments, the angular velocity of electronic device 200 about three axes (ie, x, y, and z axes) may be determined by gyro sensor 280B. The gyro sensor 280B can be used for image stabilization. Exemplarily, when the shutter is pressed, the gyro sensor 280B detects the shaking angle of the electronic device 200, calculates the distance that the lens module needs to compensate according to the angle, and allows the lens to counteract the shaking of the electronic device 200 through reverse motion to achieve anti-shake. The gyro sensor 280B can also be used for navigation and somatosensory game scenarios.
气压传感器280C用于测量气压。在一些实施例中,电子设备200通过气压传感器280C测得的气压值计算海拔高度,辅助定位和导航。Air pressure sensor 280C is used to measure air pressure. In some embodiments, the electronic device 200 calculates the altitude through the air pressure value measured by the air pressure sensor 280C to assist in positioning and navigation.
磁传感器280D包括霍尔传感器。电子设备200可以利用磁传感器280D检测翻盖皮套的开合。在一些实施例中,当电子设备200是翻盖机时,电子设备200可以根据磁传感器280D检测翻盖的开合。进而根据检测到的皮套的开合状态或翻盖的开合状态,设置翻盖自动解锁等特性。Magnetic sensor 280D includes a Hall sensor. The electronic device 200 can detect the opening and closing of the flip holster using the magnetic sensor 280D. In some embodiments, when the electronic device 200 is a flip machine, the electronic device 200 can detect the opening and closing of the flip according to the magnetic sensor 280D. Further, according to the detected opening and closing state of the leather case or the opening and closing state of the flip cover, characteristics such as automatic unlocking of the flip cover are set.
加速度传感器280E可检测电子设备200在各个方向上(一般为三轴)加速度的大小。当电子设备200静止时可检测出重力的大小及方向。还可以用于识别电子设备姿态,应用于横竖屏切换,计步器等应用。The acceleration sensor 280E can detect the magnitude of the acceleration of the electronic device 200 in various directions (generally three axes). The magnitude and direction of gravity can be detected when the electronic device 200 is stationary. It can also be used to identify the posture of electronic devices, and can be used in applications such as horizontal and vertical screen switching, pedometers, etc.
距离传感器280F,用于测量距离。电子设备200可以通过红外或激光测量距离。在一些实施例中,拍摄场景,电子设备200可以利用距离传感器280F测距以实现快速对焦。Distance sensor 280F for measuring distance. The electronic device 200 can measure the distance through infrared or laser. In some embodiments, when shooting a scene, the electronic device 200 can use the distance sensor 280F to measure the distance to achieve fast focusing.
接近光传感器280G可以包括例如发光二极管(LED)和光检测器,例如光电二极管。发光二极管可以是红外发光二极管。电子设备200通过发光二极管向外发射红外光。电子设备200使用光电二极管检测来自附近物体的红外反射光。当检测到充分的反射光时,可以确定电子设备200附近有物体。当检测到不充分的反射光时,电子设备200可以确定电子设备200附近没有物体。电子设备200可以利用接近光传感器280G检测用户手持电子设备200贴近耳朵通话,以便自动熄灭屏幕达到省电的目的。接近光传感器280G也可用于皮套模式,口袋模式自动解锁与锁屏。Proximity light sensor 280G may include, for example, light emitting diodes (LEDs) and light detectors, such as photodiodes. The light emitting diodes may be infrared light emitting diodes. The electronic device 200 emits infrared light to the outside through the light emitting diode. Electronic device 200 uses photodiodes to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it may be determined that there is an object near the electronic device 200 . When insufficient reflected light is detected, the electronic device 200 may determine that there is no object near the electronic device 200 . The electronic device 200 can use the proximity light sensor 280G to detect that the user holds the electronic device 200 close to the ear to talk, so as to automatically turn off the screen to save power. Proximity light sensor 280G can also be used in holster mode, pocket mode automatically unlocks and locks the screen.
环境光传感器280L用于感知环境光亮度。电子设备200可以根据感知的环境光亮度自适应调节显示屏294亮度。环境光传感器280L也可用于拍照时自动调节白平衡。环境光传感器280L还可以与接近光传感器280G配合,检测电子设备200是否在口袋里,以防误触。The ambient light sensor 280L is used to sense ambient light brightness. The electronic device 200 can adaptively adjust the brightness of the display screen 294 according to the perceived ambient light brightness. The ambient light sensor 280L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 280L can also cooperate with the proximity light sensor 280G to detect whether the electronic device 200 is in the pocket, so as to prevent accidental touch.
指纹传感器280H用于采集指纹。电子设备200可以利用采集的指纹特性实现指纹解锁,访问应用锁,指纹拍照,指纹接听来电等。The fingerprint sensor 280H is used to collect fingerprints. The electronic device 200 can use the collected fingerprint characteristics to realize fingerprint unlocking, accessing application locks, taking pictures with fingerprints, answering incoming calls with fingerprints, and the like.
温度传感器280J用于检测温度。在一些实施例中,电子设备200利用温度传感器280J检测的温度,执行温度处理策略。例如,当温度传感器280J上报的温度超过阈值,电子设备200执行降低位于温度传感器280J附近的处理器的性能,以便降低功耗实施热保护。在另一些实施例中,当温度低于另一阈值时,电子设备200对电池242加热,以避免低温导致电子设备200异常关机。在其他一些实施例中,当温度低于又一阈值时,电子设备200对电池242的输出电压执行升压,以避免低温导致的异常关机。The temperature sensor 280J is used to detect the temperature. In some embodiments, the electronic device 200 utilizes the temperature detected by the temperature sensor 280J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 280J exceeds a threshold value, the electronic device 200 reduces the performance of the processor located near the temperature sensor 280J in order to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold, the electronic device 200 heats the battery 242 to avoid abnormal shutdown of the electronic device 200 caused by the low temperature. In some other embodiments, when the temperature is lower than another threshold, the electronic device 200 boosts the output voltage of the battery 242 to avoid abnormal shutdown caused by low temperature.
触摸传感器280K,也称“触控面板”。触摸传感器280K可以设置于显示屏294,由触摸传感器280K与显示屏294组成触摸屏,也称“触控屏”。触摸传感器280K用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏294提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器280K也可以设置于电子设备200的表面,与显示屏294所处的位置不同。Touch sensor 280K, also called "touch panel". The touch sensor 280K may be disposed on the display screen 294, and the touch sensor 280K and the display screen 294 form a touch screen, also called a "touch screen". The touch sensor 280K is used to detect a touch operation on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to touch operations may be provided through display screen 294 . In other embodiments, the touch sensor 280K may also be disposed on the surface of the electronic device 200 , which is different from the location where the display screen 294 is located.
骨传导传感器280M可以获取振动信号。在一些实施例中,骨传导传感器280M可以获取人体声部振动骨块的振动信号。骨传导传感器280M也可以接触人体脉搏,接收血压跳动信号。The bone conduction sensor 280M can acquire vibration signals. In some embodiments, the bone conduction sensor 280M can acquire the vibration signal of the vibrating bone mass of the human voice. The bone conduction sensor 280M can also contact the pulse of the human body and receive the blood pressure beating signal.
在一些实施例中,骨传导传感器280M也可以设置于耳机中,结合成骨传导耳机。音频模块270可以基于骨传导传感器280M获取的声部振动骨块的振动信号,解析出语音信号,实现语音功能。应用处理器可以基于骨传导传感器280M获取的血压跳动信号解析心率信息,实现心率检测功能。In some embodiments, the bone conduction sensor 280M can also be disposed in the earphone, combined with the bone conduction earphone. The audio module 270 can analyze the voice signal based on the vibration signal of the vocal vibration bone mass obtained by the bone conduction sensor 280M, so as to realize the voice function. The application processor can analyze the heart rate information based on the blood pressure beat signal obtained by the bone conduction sensor 280M, and realize the function of heart rate detection.
按键290包括开机键,音量键等。按键290可以是机械按键。也可以是触摸式按键。电子设备200可以接收按键输入,产生与电子设备200的用户设置以及功能控制有关的键信号输入。The keys 290 include a power-on key, a volume key, and the like. Keys 290 may be mechanical keys. It can also be a touch key. The electronic device 200 may receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 200 .
马达291可以产生振动提示。马达291可以用于来电振动提示,也可以用于触摸振动反馈。例如,作用于不同应用(例如拍照,音频播放等)的触摸操作,可以对应不同的振动反馈效果。作用于显示屏294不同区域的触摸操作,马达291也可对应不同的振动反馈效果。不同的应用场景(例如:时间提醒,接收信息,闹钟,游戏等)也可以对应不同的振动反馈效果。触摸振动反馈效果还可以支持自定义。Motor 291 can generate vibrating cues. The motor 291 can be used for vibrating alerts for incoming calls, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, playing audio, etc.) can correspond to different vibration feedback effects. The motor 291 can also correspond to different vibration feedback effects for touch operations on different areas of the display screen 294 . Different application scenarios (for example: time reminder, receiving information, alarm clock, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.
指示器292可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。The indicator 292 can be an indicator light, which can be used to indicate the charging status, the change of power, and can also be used to indicate messages, missed calls, notifications, and the like.
SIM卡接口295用于连接SIM卡。SIM卡可以通过插入SIM卡接口295,或从SIM卡接口295拔出,实现和电子设备200的接触和分离。电子设备200可以支持1个或N个SIM卡接口,N为大于1的正整数。SIM卡接口295可以支持Nano SIM卡,Micro SIM卡,SIM卡等。同一个SIM卡接口295可以同时插入多张卡。多张卡的类型可以相同, 也可以不同。SIM卡接口295也可以兼容不同类型的SIM卡。SIM卡接口295也可以兼容外部存储卡。电子设备200通过SIM卡和网络交互,实现通话以及数据通信等功能。在一些实施例中,电子设备200采用eSIM,即:嵌入式SIM卡。eSIM卡可以嵌在电子设备200中,不能和电子设备200分离。The SIM card interface 295 is used to connect a SIM card. The SIM card can be contacted and separated from the electronic device 200 by inserting into the SIM card interface 295 or pulling out from the SIM card interface 295 . The electronic device 200 may support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 295 can support Nano SIM card, Micro SIM card, SIM card and so on. The same SIM card interface 295 can insert multiple cards at the same time. Multiple cards can be of the same type or different. The SIM card interface 295 can also be compatible with different types of SIM cards. The SIM card interface 295 is also compatible with external memory cards. The electronic device 200 interacts with the network through the SIM card to implement functions such as call and data communication. In some embodiments, the electronic device 200 employs an eSIM, ie: an embedded SIM card. The eSIM card can be embedded in the electronic device 200 and cannot be separated from the electronic device 200 .
图3是本申请实施例的客户端的软件结构示意图。客户端中的操作系统可以是安卓(Android)系统,微软窗口系统(Windows),苹果移动操作系统(iOS)或者鸿蒙系统(Harmony OS)等。在此,以客户端的操作系统为鸿蒙系统为例进行说明。FIG. 3 is a schematic diagram of a software structure of a client according to an embodiment of the present application. The operating system in the client can be Android (Android) system, Microsoft Windows system (Windows), Apple mobile operating system (iOS) or Harmony OS (Harmony OS). Here, the operating system of the client is Hongmeng system as an example for description.
在一些实施例中,可将鸿蒙系统分为四层,包括内核层、系统服务层、框架层以及应用层,层与层之间通过软件接口通信。In some embodiments, the Hongmeng system can be divided into four layers, including a kernel layer, a system service layer, a framework layer, and an application layer, and the layers communicate with each other through a software interface.
如图3所示,内核层包括内核抽象层(Kernel Abstract Layer,KAL)和驱动子系统。KAL下包括多个内核,如Linux系统的内核Linux Kernel、轻量级物联网系统内核LiteOS等。驱动子系统则可以包括硬件驱动框架(Hardware Driver Foundation,HDF)。硬件驱动框架能够提供统一外设访问能力和驱动开发、管理框架。多内核的内核层可以根据系统的需求选择相应的内核进行处理。As shown in Figure 3, the kernel layer includes a kernel abstraction layer (Kernel Abstract Layer, KAL) and a driver subsystem. There are multiple kernels under KAL, such as Linux Kernel of Linux system, LiteOS of lightweight IoT system kernel, etc. The driver subsystem may include a hardware driver framework (Hardware Driver Foundation, HDF). The hardware driver framework can provide unified peripheral access capability and driver development and management framework. The multi-kernel kernel layer can select the corresponding kernel for processing according to the needs of the system.
系统服务层是鸿蒙系统的核心能力集合,系统服务层通过框架层对应用程序提供服务。该层可包括:The system service layer is the core capability set of the Hongmeng system, and the system service layer provides services to applications through the framework layer. This layer can include:
系统基本能力子系统集:为分布式应用在鸿蒙系统多设备上的运行、调度、迁移等操作提供了基础能力。可包括分布式软总线、分布式数据管理、分布式任务调度、方舟多语言运行时、公共基础库、多模输入、图形、安全、人工智能(Artificial Intelligence,AI)、用户程序框架等子系统。其中,方舟多语言运行时提供了C或C++或JavaScript(JS)多语言运行时和基础的系统类库,也可以为使用方舟编译器静态化的Java程序(即应用程序或框架层中使用Java语言开发的部分)提供运行时。System Basic Capability Subsystem Set: Provides basic capabilities for the operation, scheduling, and migration of distributed applications on multiple devices in the HarmonyOS system. It can include subsystems such as distributed soft bus, distributed data management, distributed task scheduling, Ark multi-language runtime, common base library, multi-mode input, graphics, security, artificial intelligence (AI), user program framework, etc. . Among them, Ark multi-language runtime provides C or C++ or JavaScript (JS) multi-language runtime and basic system class library, and it can also be used for static Java programs using Ark compiler (that is, using Java in the application or framework layer). part of the language development) to provide the runtime.
基础软件服务子系统集:为鸿蒙系统提供公共的、通用的软件服务。可包括事件通知、电话、多媒体、面向X设计(Design For X,DFX)、MSDP&DV等子系统。Basic software service subsystem set: Provide public and general software services for Hongmeng system. It can include subsystems such as event notification, telephony, multimedia, Design For X (DFX), MSDP&DV, etc.
增强软件服务子系统集:为鸿蒙系统提供针对不同设备的、差异化的能力增强型软件服务。可包括智慧屏专有业务、穿戴专有业务、物联网(Internet of Things,IoT)专有业务子系统组成。Enhanced software service subsystem set: Provide Hongmeng system with differentiated capability-enhanced software services for different devices. It can include smart screen proprietary business, wearable proprietary business, and Internet of Things (Internet of Things, IoT) proprietary business subsystems.
硬件服务子系统集:为鸿蒙系统提供硬件服务。可包括位置服务、生物特征识别、穿戴专有硬件服务、IoT专有硬件服务等子系统。Hardware service subsystem set: Provide hardware services for Hongmeng system. It can include subsystems such as location services, biometric identification, wear-specific hardware services, and IoT-specific hardware services.
框架层为鸿蒙系统应用开发提供了Java、C、C++、JS等多语言的用户程序框架和能力(Ability)框架,两种用户界面(User Interface,UI)框架(包括适用于Java语言的Java UI框架、适用于JS语言的JS UI框架),以及各种软硬件服务对外开放的多语言框架应用程序接口(Application Programming Interface,API)。根据系统的组件化裁剪程度,鸿蒙系统设备支持的API也会有所不同。The framework layer provides multi-language user program frameworks and ability (Ability) frameworks such as Java, C, C++, JS, etc. for Hongmeng system application development, and two user interface (User Interface, UI) frameworks (including Java UI for Java language). framework, JS UI framework for JS language), as well as a variety of software and hardware services open to the outside world, the multi-language framework application programming interface (Application Programming Interface, API). According to the degree of componentization and tailoring of the system, the APIs supported by Hongmeng system devices will also be different.
应用层包括系统应用和第三方非系统应用。系统应用可包括桌面、控制栏、设置、电话等电子设备默认安装的应用程序。扩展应用可以是由电子设备的制造商开发设计的、非必要的应用,如电子设备管家、换机迁移、便签、天气等应用程序。而第三方非系统应用则可以是由其他厂商开发,但是可以在鸿蒙系统中运行应用程序,如游戏、导航、社交或购物等应用程序。The application layer includes system applications and third-party non-system applications. System applications may include applications that are installed by default on electronic devices such as the desktop, control bar, settings, and phone. Extended applications can be non-essential applications developed and designed by manufacturers of electronic equipment, such as applications such as electronic equipment housekeeper, replacement migration, sticky notes, weather and other applications. And third-party non-system applications can be developed by other manufacturers, but can run applications in the Hongmeng system, such as games, navigation, social or shopping applications.
鸿蒙系统的应用由一个或多个元程序(Feature Ability,FA)或元服务(Particle Ability,PA)组成。其中,FA有UI界面,提供与用户交互的能力。而PA无UI界面,提供后台运行任务的能力以及统一的数据访问抽象。PA主要为FA提供支持,例如作为后台服务提供计算能力,或作为数据仓库提供数据访问能力。基于FA或PA开发的应用,能够实现特定的业务功能,支持跨设备调度与分发,为用户提供一致、高效的应用体验。The application of Hongmeng system consists of one or more meta-programs (Feature Ability, FA) or meta-services (Particle Ability, PA). Among them, FA has a UI interface that provides the ability to interact with users. While PA has no UI interface, it provides the ability to run tasks in the background and a unified data access abstraction. PA mainly provides support for FA, such as providing computing power as a background service, or providing data access capabilities as a data warehouse. Applications developed based on FA or PA can implement specific business functions, support cross-device scheduling and distribution, and provide users with a consistent and efficient application experience.
多个运行鸿蒙系统的电子设备之间可以通过分布式软总线、分布式设备虚拟化、分布式数据管理和分布式任务调度实现硬件互助和资源共享。Multiple electronic devices running the Hongmeng system can achieve hardware mutual assistance and resource sharing through distributed soft bus, distributed device virtualization, distributed data management and distributed task scheduling.
图4示出了本申请提供的QUIC数据传输方法的示意性流程图,作为示例而非限定,该方法可以应用于上述客户端和服务端中。FIG. 4 shows a schematic flowchart of the QUIC data transmission method provided by the present application. As an example and not a limitation, the method can be applied to the above-mentioned client and server.
S301、获取客户端支持的应用层协议。S301. Obtain an application layer protocol supported by a client.
一些实施方式中,客户端可以通过查询协议栈(Protocol Stack)中记录的应用层协议,获取客户端支持的应用层协议。协议栈中的应用层协议可以通过静态配置或者通过应用层协议(Application Layer Protocol,ALP)应用启动注册的方式进行记录。应用层协议定义运行在不同端系统上的应用程序进程如何相互传递报文。应用层协议是基于应用层(Application Layer)实现的,而应用层是开放式系统互连(Open Systems Interconnection reference,OSI)模型中的第七层,由多个特定应用服务元素(Specific Application Service Element,SASE)和一个或多个公用应用服务元素(Computer Application Service Element,CASE)组成。每个SASE可以提供特定的应用服务,例如文件运输访问和管理(File Transfer Access Method,FTAM)、电子文电处理(Message Handing System,MHS)、虚拟终端协议(Virtual Terminal Protocol,VAP)等。而CASE则可以提供一组公用的应用服务,例如联系控制服务元素(Association Control Service Element,ACSE)、可靠运输服务元素(Reliable Transfer Service Element,RTSE)和远程操作服务元素(Remote Operations Service Element,ROSE)等。In some embodiments, the client can obtain the application layer protocol supported by the client by querying the application layer protocol recorded in the protocol stack (Protocol Stack). The application layer protocol in the protocol stack can be recorded through static configuration or through application startup registration of an application layer protocol (Application Layer Protocol, ALP). Application layer protocols define how application processes running on different end systems pass messages to each other. The application layer protocol is implemented based on the application layer, and the application layer is the seventh layer in the Open Systems Interconnection reference (OSI) model. , SASE) and one or more common application service elements (Computer Application Service Element, CASE). Each SASE can provide specific application services, such as File Transfer Access Method (FTAM), Message Handling System (MHS), Virtual Terminal Protocol (VAP), etc. CASE can provide a set of common application services, such as Association Control Service Element (ACSE), Reliable Transfer Service Element (RTSE) and Remote Operations Service Element (ROSE) )Wait.
常见的应用层协议包括HTTP、RTP/RTCP、域名系统(Domain Name System,DNS)、文件传输协议(File Transfer Protocol,FTP)、简单邮件传输协议(Simple Mail Transfer Protocol,SMTP)、简单网络管理协议(simple Network Management Protocol,SNMP)、远程登录协议(Telnet)、路由信息协议(Routing Information Protocol,RIP)和网络文件系统(Network File System,NFS)等。Common application layer protocols include HTTP, RTP/RTCP, Domain Name System (DNS), File Transfer Protocol (FTP), Simple Mail Transfer Protocol (Simple Mail Transfer Protocol, SMTP), Simple Network Management Protocol (simple Network Management Protocol, SNMP), Remote Login Protocol (Telnet), Routing Information Protocol (Routing Information Protocol, RIP) and Network File System (Network File System, NFS), etc.
其中,静态配置是指在客户端中部署QUIC时,通过配置指令在QUIC的协议栈中写入客户端能够支持的应用层协议。Among them, static configuration means that when QUIC is deployed in the client, the application layer protocol that the client can support is written in the QUIC protocol stack through configuration instructions.
而ALP应用启动注册则是当客户端中的一个应用支持QUIC作为其传输层协议时,主动向本地的QUIC协议栈模块注册自身使用的协议类型,QUIC协议栈模块根据应用的协议注册信息,记录对应的协议类型。The ALP application startup registration is that when an application in the client supports QUIC as its transport layer protocol, it actively registers the protocol type used by itself with the local QUIC protocol stack module. The QUIC protocol stack module records the protocol registration information according to the application. The corresponding protocol type.
S302、获取服务端支持的应用层协议。S302. Obtain an application layer protocol supported by the server.
一些实施方式中,参照S301中的示例,服务端也可以通过查询协议栈中记录的应用层协议,获取服务端支持的应用层协议。其获取的方式与S301中相同,在此不做赘述。In some embodiments, referring to the example in S301, the server can also obtain the application layer protocol supported by the server by querying the application layer protocol recorded in the protocol stack. The acquisition method is the same as that in S301, and will not be repeated here.
S303、客户端响应第一数据请求,向服务端发起握手,请求建立第一QUIC会话。S303. The client responds to the first data request, initiates a handshake to the server, and requests to establish a first QUIC session.
一些实施方式中,第一数据请求可以来自客户端中的应用程序。作为示例,客户端响应用户操作,开启购物应用时,第一数据请求可以是客户端向购物应用对应的服务端发 送的用于获取购物应用启动界面中数据的数据请求。第一数据请求所使用的应用端协议可根据第一数据请求所获取数据的类型确定。例如,对于文本、图片数据,可以使用HTTP3.0,对于视频直播数据,则可以使用RTP/RTCP。In some implementations, the first data request may come from an application in the client. As an example, when the client starts the shopping application in response to the user operation, the first data request may be a data request sent by the client to the server corresponding to the shopping application to obtain data in the starting interface of the shopping application. The application-side protocol used by the first data request may be determined according to the type of data obtained by the first data request. For example, for text and picture data, HTTP3.0 can be used, and for live video data, RTP/RTCP can be used.
一些实施方式中,在客户端响应第一数据请求之前,可以先创建QUIC的每个应用层协议对应的套接字(Socket)连接,当客户端响应第一数据请求时,可以根据第一数据请求使用的应用层协议对应的Socket连接,向服务端发起握手,请求建立第一QUIC会话。In some embodiments, before the client responds to the first data request, a socket (Socket) connection corresponding to each application layer protocol of QUIC may be created. Request the Socket connection corresponding to the application layer protocol used, initiate a handshake to the server, and request to establish the first QUIC session.
当通过Socket连接与服务端握手时,可以使用0-往返时间(Round-Trip Time,RTT)握手或1-RTT握手。例如,当使用1-RTT握手时,客户端向服务端发送的握手请求可以是初始(Initial)数据包,Initial数据包包含一个长报头(类型值为0x0)、数据包长度和包号字段,可携带客户端和服务器发送的首个CRYPTO帧进行密钥交换,并携带客户端和服务器的之间双向的确认字符(Acknowledge character,ACK)。When shaking hands with the server through a socket connection, you can use a 0-round-trip time (RTT) handshake or a 1-RTT handshake. For example, when using the 1-RTT handshake, the handshake request sent by the client to the server can be an initial (Initial) data packet. The Initial data packet contains a long header (type value 0x0), data packet length and packet number fields, It can carry the first CRYPTO frame sent by the client and the server for key exchange, and carry the two-way Acknowledge character (ACK) between the client and the server.
作为示例,Initial数据包的包号为0,包内携带ClientHello的CRYPTO帧,CRYPTO帧(type=0x06)用于传输加密握手消息。可以使用Initial[0]:CRYPTO[CH]来表示。As an example, the packet number of the Initial data packet is 0, the CRYPTO frame of ClientHello is carried in the packet, and the CRYPTO frame (type=0x06) is used to transmit an encryption handshake message. It can be represented by Initial[0]:CRYPTO[CH].
S304、服务端响应握手请求,返回握手报文,握手报文包括服务端支持的应用层协议。S304, the server responds to the handshake request, and returns a handshake packet, where the handshake packet includes the application layer protocol supported by the server.
一些实施方式中,参考S303,当服务端接收到Initial[0]:CRYPTO[CH]后,根据COPYTO帧生成服务端的Initial数据包、握手(Handshake)数据包和0.5-RTT数据包,并将这些数据包合并为一个握手报文,发送给客户端。In some embodiments, referring to S303, after the server receives the Initial[0]:CRYPTO[CH], it generates an Initial data packet, a handshake (Handshake) data packet and a 0.5-RTT data packet of the server according to the COPYTO frame, and converts these The data packets are combined into a handshake message and sent to the client.
其中,服务端的Initial数据包结构与服务端的一致,作为示例,服务端的Initial数据包的包号为0,其中包括ServerHello的COPYTO帧,以及Initial[0]:CRYPTO[CH]的ACK。可以用Initial[0]:CRYPTO[SH]ACK[0]表示。The structure of the initial data packet of the server is consistent with that of the server. As an example, the packet number of the initial data packet of the server is 0, which includes the COPYTO frame of ServerHello and the ACK of Initial[0]:CRYPTO[CH]. It can be represented by Initial[0]:CRYPTO[SH]ACK[0].
Handshake数据包包含一个长报头(类型值为0x2)、数据包长度和包号字段,用于携带来自服务器和客户端的加密握手消息和ACK。其中,加密握手消息中包括了应用层协议协商(Application Layer Protocol Negotiation,ALPN)字段,服务端支持的应用层协议可以记录在ALPN字段中。记录时,可以通过互联网工程任务组(The Internet Engineering Task Force,IETF)规定的“ALPN协议身份标识号(Identity document,ID)”注册表中,每个应用层协议对应的字符串进行记录。例如,通过“HTTP3.0对应的ALPN协议ID为h3”,DNS对应的ALPN协议ID为“Doq”,RTP/RTCP对应的ALPN协议ID为“qrt”等。The Handshake packet contains a long header (type value 0x2), packet length and packet number fields to carry encrypted handshake messages and ACKs from the server and client. The encrypted handshake message includes an application layer protocol negotiation (Application Layer Protocol Negotiation, ALPN) field, and the application layer protocol supported by the server can be recorded in the ALPN field. When recording, it can be recorded through the string corresponding to each application layer protocol in the "ALPN Protocol Identity Document (ID)" registry specified by the Internet Engineering Task Force (IETF). For example, "the ALPN protocol ID corresponding to HTTP3.0 is h3", the ALPN protocol ID corresponding to DNS is "Doq", and the ALPN protocol ID corresponding to RTP/RTCP is "qrt", etc.
作为示例,Handshake数据包的包号为0,包内携带CRYPTO帧。可以使用Handshake[0]:CRYPTO[EE,CERT,CV,FIN]来表示。其中,EE是扩展元素(Extend Element,EE),EE中可以携带附加通告的参数,例如,ALPN可通过EE携带,并在EE中进行通告。As an example, the packet number of the Handshake data packet is 0, and the packet carries a CRYPTO frame. It can be represented by Handshake[0]:CRYPTO[EE,CERT,CV,FIN]. The EE is an extension element (Extend Element, EE), and the EE can carry additionally advertised parameters. For example, ALPN can be carried through the EE and advertised in the EE.
CERT指的是证书(Certificate,CERT),CV指的是校验码,FIN则是结束标志。其中,CERT和CV可以用于QUIC会话建立时的验证。CERT refers to the certificate (Certificate, CERT), CV refers to the check code, and FIN is the end mark. Among them, CERT and CV can be used for verification when the QUIC session is established.
0.5-RTT数据包指的是仅从服务端发送给客户端的1-RTT数据包,由于是从第0.5个RTT周期开始发送的,所以称之为0.5-RTT数据吧。0.5-RTT数据包包括可靠数据流(Stream)帧,STREAM帧可以隐式创建数据流并携带流数据。隐式创建数据流指的是当客户端或服务端创建STREAM帧时,若STREAM帧中指示的流ID不存在,则创建一个使用该流ID数据流,并通过该数据流发送STREAM帧。可以使用1-RTT[0]: STREAM[1,“…”]来表示。The 0.5-RTT data packet refers to the 1-RTT data packet that is only sent from the server to the client. Since it is sent from the 0.5th RTT cycle, it is called 0.5-RTT data. 0.5-RTT data packets include reliable data stream (Stream) frames, STREAM frames can implicitly create data streams and carry stream data. Implicitly creating a data stream means that when the client or server creates a STREAM frame, if the stream ID indicated in the STREAM frame does not exist, a data stream using the stream ID is created, and the STREAM frame is sent through the data stream. It can be represented by 1-RTT[0]: STREAM[1, "..."].
S305、客户端根据客户端支持的应用层协议和服务端支持的应用层协议,生成第一QUIC会话对应的应用层协议列表。S305. The client generates an application layer protocol list corresponding to the first QUIC session according to the application layer protocol supported by the client and the application layer protocol supported by the server.
一些实施方式中,客户端在接收到服务端发送的握手报文后,获取Handshake数据包中服务端支持的应用层协议。然后,客户端确定服务端与客户端同时支持的应用层协议,并将这些应用层协议记录,生成应用层协议列表。例如,若客户端支持的应用层协议包括HTTP3.0、RTP/RTCP、DND,服务端支持的应用层协议包括HTTP3.0、RTP/RTCP、FTP,则应用层协议列表包括HTTP3.0和RTP/RTCP。In some embodiments, after receiving the handshake message sent by the server, the client obtains the application layer protocol supported by the server in the Handshake data packet. Then, the client determines the application layer protocols supported by both the server and the client, records these application layer protocols, and generates an application layer protocol list. For example, if the application layer protocols supported by the client include HTTP3.0, RTP/RTCP, and DND, and the application layer protocols supported by the server include HTTP3.0, RTP/RTCP, and FTP, the application layer protocol list includes HTTP3.0 and RTP /RTCP.
S306、客户端与服务端之间建立第一QUIC会话,客户端发送第一QUIC会话对应的应用层协议列表给服务端。S306. A first QUIC session is established between the client and the server, and the client sends the application layer protocol list corresponding to the first QUIC session to the server.
一些实施方式中,客户端根据握手报文的每个数据包中的数据,生成对应的数据包。In some embodiments, the client generates a corresponding data packet according to the data in each data packet of the handshake message.
例如,根据Initial[0]:CRYPTO[SH]ACK[0],可以生成Initial[1]:ACK[0]。即包号为1的Initial数据包,其中包括接收到Initial数据包的ACK。For example, from Initial[0]:CRYPTO[SH]ACK[0], Initial[1]:ACK[0] can be generated. That is, the Initial data packet with the packet number 1 includes the ACK of the received Initial data packet.
根据Handshake[0]:CRYPTO[EE,CERT,CV,FIN],客户端可以生成Handshake[0]:CRYPTO[FIN],ACK[0]。According to Handshake[0]:CRYPTO[EE,CERT,CV,FIN], the client can generate Handshake[0]:CRYPTO[FIN],ACK[0].
其中,客户端可以根据Handshake[0]中CRYPTO内的EE字段,获取得到服务端支持应用层协议。然后,根据本端支持的应用层协议和服务端支持的应用层协议,生成第一QUIC会话对应的应用层协议列表,第一QUIC会话对应的应用层协议列表包括客户端和服务端同时支持的应用层协议。Among them, the client can obtain the application layer protocol supported by the server according to the EE field in the CRYPTO in Handshake[0]. Then, according to the application layer protocol supported by the local end and the application layer protocol supported by the server, a list of application layer protocols corresponding to the first QUIC session is generated. The list of application layer protocols corresponding to the first QUIC session includes the protocols supported by both the client and the server. Application layer protocol.
需要说明的是,生成的第一QUIC会话对应的应用层协议列表可以记录在客户端和服务端的协议栈中。记录第一QUIC会话对应的应用层列表可以通过在协议栈中建立第一应用层列表,并将第一QUIC会话与第一应用层列表关联实现。例如,第一QUIC会话与第一应用层列表为“h3”和“qrt”时,可以记录为第一QUIC会话对应第一应用层列表,第一应用层列表中记录“h3”和“qrt”。It should be noted that the generated application layer protocol list corresponding to the first QUIC session may be recorded in the protocol stacks of the client and the server. Recording the application layer list corresponding to the first QUIC session may be implemented by establishing a first application layer list in the protocol stack, and associating the first QUIC session with the first application layer list. For example, when the first QUIC session and the first application layer list are "h3" and "qrt", it can be recorded as the first QUIC session corresponding to the first application layer list, and "h3" and "qrt" are recorded in the first application layer list .
或者,记录第一QUIC会话对应的应用层列表还可以通过将第一QUIC会话与应用层协议进行关联实现。例如,协议栈中记录有“h3”、“qrt”、“Doq”等应用层协议,当第一QUIC会话与第一应用层列表为“h3”和“qrt”时,可以将第一QUIC会话与“h3”和“qrt”关联。Alternatively, recording the application layer list corresponding to the first QUIC session may also be implemented by associating the first QUIC session with the application layer protocol. For example, application layer protocols such as "h3", "qrt", and "Doq" are recorded in the protocol stack. When the first QUIC session and the first application layer list are "h3" and "qrt", the first QUIC session can be Associated with "h3" and "qrt".
在一种可能的实现方式中,第一QUIC会话对应的应用层协议列表可以基于包括客户端和服务端同时支持的至少两种应用层协议。例如,当客户端长时间未使用DNS时,客户端和服务端同时支持“h3”、“qrt”和“Doq”,生成的第一QUIC会话对应的应用层列表可以仅包括“h3”和“qrt”。In a possible implementation manner, the application layer protocol list corresponding to the first QUIC session may be based on at least two application layer protocols supported by the client and the server at the same time. For example, when the client does not use DNS for a long time, the client and server support "h3", "qrt" and "Doq" at the same time, the generated application layer list corresponding to the first QUIC session can only include "h3" and "Doq" qrt".
在这种实现方式中,将客户端和服务端同时支持但是使用频率低的应用层协议忽略,仅将常用的应用层协议记录在第一QUIC会话对应的应用层协议列表中。可以减少服务端记录应用层协议列表的存储负载,节省资源。In this implementation, the application layer protocols that are supported by both the client and the server but are used infrequently are ignored, and only commonly used application layer protocols are recorded in the application layer protocol list corresponding to the first QUIC session. It can reduce the storage load for the server to record the application layer protocol list and save resources.
作为示例,客户端可以生成Handshake[0]的ACK,并将第一QUIC会话对应的应用层协议列表写入Handshake加密握手消息中的ALPN字段,得到Handshake[0]:CRYPTO[FIN],ACK[0]。As an example, the client can generate the ACK of Handshake[0], and write the application layer protocol list corresponding to the first QUIC session into the ALPN field in the Handshake encrypted handshake message to obtain Handshake[0]:CRYPTO[FIN],ACK[ 0].
然后,客户端还可以根据1-RTT[0]:STREAM[1,“…”],生成1-RTT[0]:STREAM[0,"..."],ACK[0],其中包括了STREAM帧和STREAM[0,“…”]的ACK。Then, the client can also generate 1-RTT[0]:STREAM[0,"..."],ACK[0] according to 1-RTT[0]:STREAM[1,"..."], which includes STREAM frame and ACK for STREAM[0, "..."].
最后,客户端将多个对应生成的数据包作为一个报文,发送给服务端。服务端在接收到报文后,根据报文中的数据包,生成Handshake[1]:ACK[0]和1-RTT[1]:HANDSHAKE_DONE,STREAM[3,"..."],ACK[0],确认完成握手,并向客户端返回握手完成的ACK,第一QUIC会话建立完成。Finally, the client sends the plurality of correspondingly generated data packets to the server as one message. After receiving the message, the server generates Handshake[1]:ACK[0] and 1-RTT[1]:HANDSHAKE_DONE,STREAM[3,"..."],ACK[ 0], confirm the completion of the handshake, and return the ACK of the completion of the handshake to the client, and the establishment of the first QUIC session is completed.
第一QUIC会话建立后,其中包括第一数据流,第一数据流用于承载第一数据请求对应的数据。其中,数据流包括可靠数据流(Stream)或不可靠数据流(Flow),数据流具体采用哪种形式,需根据数据流承载的数据类型确定,例如,直播视频的数据需要保证可靠性,则可以使用Stream的形式传输。而在部分场景中,DNS数据无需保证可靠性,可以通过Flow的形式传输。After the first QUIC session is established, it includes a first data stream, and the first data stream is used to carry data corresponding to the first data request. Among them, the data stream includes a reliable data stream (Stream) or an unreliable data stream (Flow). The specific form of the data stream needs to be determined according to the data type carried by the data stream. For example, if the data of live video needs to be reliable, then It can be transmitted in the form of Stream. In some scenarios, DNS data does not need to be reliable and can be transmitted in the form of Flow.
以Stream为例,第一数据流是客户端发起的单向或双向的数据流。每个数据流对应一个固定的流ID,流ID是一个62比特位的数,即十进制的0~2 62-1。流ID的最低位(0x1)标识该流的发起者,客户端发起流的流ID为偶数(比特位设置为0),服务端发起流的流ID为奇数(比特位设置为1)。流ID的第二个低位(0x2)用于区分双向数据流(比特位设置为0)和单向数据流(比特位设置为1)。每种流对应有流ID空间,用于记录对应的流ID,每种类型的流空间均从最小值开始记录流ID(即第三个低位从0开始计数),每种类型的连续流都是以数字递增的流ID创建。例如,客户端发起的双向数据流从0x0(前三个低位均为0)开始记录流ID,服务端发起的双向数据流从0x1开始记录流ID(第一个低位1为1,第二和第三个低位为0),客户端发起的单向数据流从0x2(第一和第三个低位为0,第二个低位为1)开始记录流ID,服务端发起的单向数据流从0x3(第一和第二个低位为1,第三个低位为0)开始记录流ID。 Taking Stream as an example, the first data stream is a unidirectional or bidirectional data stream initiated by the client. Each data stream corresponds to a fixed stream ID, and the stream ID is a 62-bit number, that is, 0 to 2 62 -1 in decimal. The lowest bit (0x1) of the stream ID identifies the originator of the stream. The stream ID of the stream initiated by the client is even (the bit is set to 0), and the stream ID of the stream initiated by the server is odd (the bit is set to 1). The second low-order bit (0x2) of the stream ID is used to distinguish bidirectional data streams (bits set to 0) and unidirectional data streams (bits set to 1). Each stream corresponds to a stream ID space, which is used to record the corresponding stream ID. Each type of stream space records the stream ID from the minimum value (that is, the third low-order bit starts from 0), and each type of continuous stream is is created with a numerically increasing stream ID. For example, the bidirectional data stream initiated by the client starts to record the stream ID from 0x0 (the first three low-order bits are all 0), and the bidirectional data stream initiated by the server starts to record the stream ID from 0x1 (the first low-order 1 is 1, the second and The third low-order bit is 0), the unidirectional data stream initiated by the client starts from 0x2 (the first and third low-order bits are 0, and the second low-order bit is 1) to record the stream ID, and the one-way data flow initiated by the server starts from 0x2 0x3 (the first and second low-order bits are 1, and the third low-order bit is 0) to start recording the stream ID.
在本实施例中,第一数据流如果是客户端发起的单向数据流,则其流ID为0x2,第一数据流如果是客户端发起的双向数据流,则其流ID为0x0。In this embodiment, if the first data stream is a unidirectional data stream initiated by the client, its stream ID is 0x2, and if the first data stream is a bidirectional data stream initiated by the client, its stream ID is 0x0.
一些实施方式中,客户端发起与服务端之间的Stream时,向服务端发送的首帧可以是ALP_STREAM帧,并通过ALP_STREAM帧实现隐式创建Stream并携带Stream的数据。在本实施方式中,ALP_STREAM帧为第一类数据帧,STREAM帧为第二类数据帧。In some embodiments, when the client initiates a Stream with the server, the first frame sent to the server may be an ALP_STREAM frame, and the ALP_STREAM frame is used to implicitly create a Stream and carry the data of the Stream. In this embodiment, the ALP_STREAM frame is the first type of data frame, and the STREAM frame is the second type of data frame.
ALP_STREAM帧与STREAM帧相比,增加了ALP字段。ALP字段用于承载ALP域,ALP域是一个结构体,用于指示ALP_STREAM帧对应的应用层协议。Compared with the STREAM frame, the ALP_STREAM frame has an increased ALP field. The ALP field is used to carry the ALP field, and the ALP field is a structure used to indicate the application layer protocol corresponding to the ALP_STREAM frame.
作为示例,ALP字段可以为:As an example, the ALP field could be:
Figure PCTCN2022084139-appb-000001
Figure PCTCN2022084139-appb-000001
其中,Alp length标识Alp域字段的长度。Alp next Protocol(…)为应用层协议标识字符串,其中记录了应用层协议对应的ALPN协议ID。Among them, Alp length identifies the length of the Alp field field. Alp next Protocol(...) is the application layer protocol identification string, which records the ALPN protocol ID corresponding to the application layer protocol.
作为示例,ALP_STREAM帧的格式可以为:As an example, the format of an ALP_STREAM frame could be:
Figure PCTCN2022084139-appb-000002
Figure PCTCN2022084139-appb-000002
Figure PCTCN2022084139-appb-000003
Figure PCTCN2022084139-appb-000003
ALP_STREAM帧类型字段可以由互联网数字分配机构(Internet Assigned Numbers Authority,IANA)进行分配。作为示例,可以采用0b00???XXX的形式,例如,上例中示出的0x20到0x27的一组值。The ALP_STREAM frame type field may be assigned by the Internet Assigned Numbers Authority (IANA). As an example, 0b00 can be used? ? ? XXX, for example, a set of values from 0x20 to 0x27 shown in the example above.
使用ALP_STREAM帧创建Stream时,Stream使用的应用层协议是ALP域中声明的协议,并且该ALP域中声明的协议必须是QUIC会话ALPN协商支持的协议(即第一QUIC会话对应的应用层协议列表中的应用层协议),否则创建Stream失败,生成STREAM_ALP_ERROR。丢弃该ALP_STREAM帧或通知关闭该Stream,清除对应Stream ID和应用层协议的关联信息。When using the ALP_STREAM frame to create a Stream, the application layer protocol used by the Stream is the protocol declared in the ALP domain, and the protocol declared in the ALP domain must be the protocol supported by the QUIC session ALPN negotiation (that is, the list of application layer protocols corresponding to the first QUIC session). The application layer protocol in ), otherwise the creation of Stream fails and STREAM_ALP_ERROR is generated. Discard the ALP_STREAM frame or notify to close the Stream, and clear the associated information of the corresponding Stream ID and application layer protocol.
Stream创建后,客户端和服务端将该Stream的Stream ID与该Stream对应的应用层协议关联。由于ALP_STREAM帧和STREAM帧共享Stream ID空间,相同Stream ID的ALP_STREAM帧和STREAM帧都是同一个Stream下的帧数据。所以,该Stream后续报文可以不使用ALP_STREAM帧,只用STREAM帧承载,当客户端或服务端接收到的STREAM帧时,可根据STREAM帧中的Stream ID将STREAM帧发送给对应应用层协议的协议应用或模块进一步解析处理。After the Stream is created, the client and server associate the Stream ID of the Stream with the application layer protocol corresponding to the Stream. Since ALP_STREAM frames and STREAM frames share the Stream ID space, ALP_STREAM frames and STREAM frames with the same Stream ID are frame data under the same Stream. Therefore, the subsequent packets of the Stream may not use the ALP_STREAM frame, but only carry the STREAM frame. When the client or server receives the STREAM frame, the STREAM frame can be sent to the corresponding application layer protocol according to the Stream ID in the STREAM frame. The protocol application or module further parses and processes.
在本实施例中,通过将Stream ID与应用层协议关联,实现了在不使用ALP_STREAM帧时,也可以准确的获得STREAM帧对应的应用层协议,使得该Stream后续使用STREAM帧也可以在一个QUIC会话下传输不同应用层协议的数据流。In this embodiment, by associating the Stream ID with the application layer protocol, it is realized that the application layer protocol corresponding to the STREAM frame can be accurately obtained without using the ALP_STREAM frame, so that the Stream can also use the STREAM frame in a QUIC frame subsequently. Data streams of different application layer protocols are transmitted under the session.
作为示例,假设通过ALP_STREAM帧创建的Stream ID为0x2,ALP域中记录的字符串为“h3”,则说明Stream ID为0x2的Stream承载的应用层协议为HTTP3.0。当后续接收到流ID为0x2的STREAM帧时,将该STREAM帧发送给HTTP3.0对应的协议应用或模块进一步解析处理。As an example, assuming that the Stream ID created by the ALP_STREAM frame is 0x2, and the string recorded in the ALP field is "h3", it means that the application layer protocol carried by the Stream whose Stream ID is 0x2 is HTTP3.0. When a STREAM frame with a stream ID of 0x2 is subsequently received, the STREAM frame is sent to a protocol application or module corresponding to HTTP 3.0 for further analysis and processing.
如果该Stream后续报文使用ALP_STREAM帧承载,其ALP域中声明的协议必须和Stream创建时标识的应用层协议一致。如果不一致,客户端或服务端可以生成用于指示应用层协议错误的“STREAM_ALP_ERROR”错误,并在日志中记录STREAM_ALP_ERROR。If the subsequent packets of the Stream are carried by the ALP_STREAM frame, the protocol declared in the ALP field must be the same as the application-layer protocol identified when the Stream is created. If inconsistent, the client or server MAY generate a "STREAM_ALP_ERROR" error indicating an application-layer protocol error, and log STREAM_ALP_ERROR.
需要说明的是,STREAM_ALP_ERROR可以被抑制,例如,在预设时长内出现的多次STREAM_ALP_ERROR可以仅记录5次,抑制STREAM_ALP_ERROR错误的方式本申请不做限制。It should be noted that STREAM_ALP_ERROR can be suppressed. For example, multiple STREAM_ALP_ERROR occurring within a preset duration can be recorded only 5 times, and the method of suppressing STREAM_ALP_ERROR error is not limited in this application.
还有一些实施方式中,也可以使用STREAM帧创建Stream。In still other implementations, Streams can also be created using STREAM frames.
当使用STREAM帧创建Stream时,默认Stream承载的应用是QUIC会话创建时,ALPN协商中的首个应用层协议,即应用层协议列表中的第一个应用层协议。When a Stream is created using a STREAM frame, the default application carried by the Stream is the first application layer protocol in the ALPN negotiation when the QUIC session is created, that is, the first application layer protocol in the application layer protocol list.
作为示例,若应用层协议列表中应用层协议的顺序为“h3”、“qrt”。当通过STREAM帧创建了Stream ID为0x3的Stream,则该Stream承载的应用层协议为“h3”,当后续接收到Stream ID为0x3的STREAM帧时,将该STREAM帧发送给HTTP3.0对应的协议应用或模块进一步解析处理。As an example, if the order of the application layer protocols in the application layer protocol list is "h3", "qrt". When a Stream with a Stream ID of 0x3 is created through a STREAM frame, the application layer protocol carried by the Stream is "h3". When a STREAM frame with a Stream ID of 0x3 is subsequently received, the STREAM frame is sent to the corresponding HTTP3.0 The protocol application or module further parses and processes.
ALP_STREAM帧类型的低三个比特决定了帧中存在的字段。The lower three bits of the ALP_STREAM frame type determine the fields present in the frame.
ALP_STREAM帧类型中的OFF位(0x04),用于表示是否存在Offset域。Offset域用于指示ALP_STREAM帧的偏移量。当OFF位设置为1时,Offset字段(ALP_STREAM帧中的[Offset(i)])出现。当OFF位设置为0时,Offset字段不存在。当Offset字段不存在时,流数据以0的偏移量开始(即ALP_STREAM帧包含流的第一个字节,或不包含数据的流的结尾)。The OFF bit (0x04) in the ALP_STREAM frame type is used to indicate whether there is an Offset field. The Offset field is used to indicate the offset of the ALP_STREAM frame. When the OFF bit is set to 1, the Offset field ([Offset(i)] in the ALP_STREAM frame) is present. When the OFF bit is set to 0, the Offset field does not exist. When the Offset field is not present, the stream data starts with an offset of 0 (ie an ALP_STREAM frame contains the first byte of the stream, or the end of a stream that contains no data).
ALP_STREAM帧类型中的LEN位(0x02),用于表示是否存在Length字段。Length字段用于指示ALP_STREAM帧中Stream Data(..)的长度。当LEN位设置为1时,Length字段(ALP_STREAM帧中的[Length(i)])出现。当LEN位设置为0时,Length字段不存在。当Length字段不存在时,Stream Data字段扩展到报文尾部。The LEN bit (0x02) in the ALP_STREAM frame type is used to indicate whether there is a Length field. The Length field is used to indicate the length of Stream Data(..) in the ALP_STREAM frame. When the LEN bit is set to 1, the Length field ([Length(i)] in the ALP_STREAM frame) is present. When the LEN bit is set to 0, the Length field is absent. When the Length field does not exist, the Stream Data field extends to the end of the message.
ALP_STREAM帧类型中的FIN位(0x01)用于表示该ALP_STREAM帧标识码流结束。Stream的最终大小是偏移量和此帧的长度之和。The FIN bit (0x01) in the ALP_STREAM frame type is used to indicate that the ALP_STREAM frame identifies the end of the code stream. The final size of the Stream is the sum of the offset and the length of this frame.
另外一些实施方式中,客户端发起与服务端之间的Flow时,向服务端发送的首帧可以是ALP_DATAGRAM帧,并通过ALP_DATAGRAM帧实现隐式创建Flow并携带Flow的数据。在本实施方式中,ALP_DATAGRAM帧为第一类数据帧,DATAGRAM帧为第二类数据帧。In other embodiments, when the client initiates a Flow with the server, the first frame sent to the server may be an ALP_DATAGRAM frame, and the ALP_DATAGRAM frame is used to implicitly create a Flow and carry the data of the Flow. In this embodiment, the ALP_DATAGRAM frame is the first type of data frame, and the DATAGRAM frame is the second type of data frame.
ALP_DATAGRAM帧与DATAGRAM帧相比,增加了ALP字段。ALP字段与ALP_STREAM帧中的相同。Compared with the DATAGRAM frame, the ALP_DATAGRAM frame has an increased ALP field. The ALP field is the same as in the ALP_STREAM frame.
作为示例,ALP_DATAGRAM帧的格式可以为:As an example, the format of an ALP_DATAGRAM frame could be:
Figure PCTCN2022084139-appb-000004
Figure PCTCN2022084139-appb-000004
ALP_DATAGRAM帧类型字段可以由IANA进行分配。作为示例,可以采用0b00?????X的形式,例如,上例中示出的0x40到0x41的一组值。The ALP_DATAGRAM frame type field may be allocated by IANA. As an example, 0b00 can be used? ? ? ? ? X in the form of, for example, a set of values from 0x40 to 0x41 shown in the example above.
使用ALP_DATAGRAM帧创建Flow时,Flow使用的应用层协议是ALP域中声明的协议,并且该ALP域中声明的协议必须是QUIC会话ALPN协商支持的协议(即应用层协议列表中的应用层协议),否则创建Flow失败,生成DATAGRAM_ALP_ERROR。丢弃该ALP_DATAGRAM帧或通知关闭该Flow。When creating a Flow with an ALP_DATAGRAM frame, the application layer protocol used by the Flow is the protocol declared in the ALP domain, and the protocol declared in the ALP domain must be a protocol supported by the QUIC session ALPN negotiation (that is, the application layer protocol in the application layer protocol list) , otherwise the flow creation fails and DATAGRAM_ALP_ERROR is generated. Discard the ALP_DATAGRAM frame or notify to close the Flow.
在一些可能的实现方式中,根据QUIC的协议标准,DATAGRAM帧可能不包含Flow ID,相应的,ALP_DATAGRAM帧也不包括Flow ID,在这个情况下,通过该Flow传输后续数据时,需要使用ALP_DATAGRAM帧,以保证能够准确获取传输的数据所使用的应用层协议。每个Flow下的报文使用相同类型的帧承载,即同一个Flow的报文都由ALP_DATAGRAM帧承载或都由DATAGRAM帧承载。In some possible implementations, according to the QUIC protocol standard, the DATAGRAM frame may not include the Flow ID, and accordingly, the ALP_DATAGRAM frame does not include the Flow ID. In this case, when transmitting subsequent data through the Flow, the ALP_DATAGRAM frame needs to be used , to ensure that the application layer protocol used by the transmitted data can be accurately obtained. The packets under each Flow are carried by the same type of frame, that is, the packets of the same Flow are all carried by the ALP_DATAGRAM frame or all of them are carried by the DATAGRAM frame.
在另一些可能的实现方式中,DATAGRAM帧可以包含Flow ID。这个情况下,Flow创建后,客户端和服务端可以将该Flow的Flow ID与该Flow对应的应用层协议关联。由 于ALP_DATAGRAM帧和DATAGRAM帧共享Flow ID空间,可以确定使用了相同Flow ID的ALP_DATAGRAM帧和DATAGRAM帧都是同一个Flow下的帧数据。所以,该Flow后续报文可以不使用ALP_DATAGRAM帧,只用DATAGRAM帧承载,当客户端或服务端接收到的DATAGRAM帧时,可根据DATAGRAM帧中的Flow ID将DATAGRAM帧发送给对应应用层协议的协议应用或模块进一步解析处理。In other possible implementations, the DATAGRAM frame may contain the Flow ID. In this case, after the Flow is created, the client and the server can associate the Flow ID of the Flow with the application layer protocol corresponding to the Flow. Since the ALP_DATAGRAM frame and the DATAGRAM frame share the Flow ID space, it can be determined that the ALP_DATAGRAM frame and the DATAGRAM frame using the same Flow ID are frame data under the same Flow. Therefore, the subsequent packets of the Flow may not use the ALP_DATAGRAM frame, but only carry the DATAGRAM frame. When the client or server receives the DATAGRAM frame, the DATAGRAM frame can be sent to the corresponding application layer protocol according to the Flow ID in the DATAGRAM frame. The protocol application or module further parses and processes.
在这种实现方式中,通过将Flow ID与应用层协议关联,实现了在不使用ALP_DATAGRAM帧时,也可以准确的获得DATAGRAM帧对应的应用层协议,使得使用DATAGRAM帧也可以在一个QUIC会话下传输不同应用层协议的数据流。In this implementation, by associating the Flow ID with the application layer protocol, the application layer protocol corresponding to the DATAGRAM frame can be accurately obtained without using the ALP_DATAGRAM frame, so that the DATAGRAM frame can also be used in a QUIC session. Transport data streams of different application layer protocols.
作为示例,假设通过ALP_DATAGRAM帧创建的Flow ID为0x2,ALP域中记录的字符串为“h3”,则说明Flow ID为0x2的Flow承载的应用层协议为HTTP3.0。当后续接收到流ID为0x2的DATAGRAM帧时,将该DATAGRAM帧发送给HTTP3.0对应的协议应用或模块进一步解析处理。As an example, assuming that the Flow ID created by the ALP_DATAGRAM frame is 0x2, and the string recorded in the ALP field is "h3", it means that the application layer protocol carried by the Flow whose Flow ID is 0x2 is HTTP3.0. When a DATAGRAM frame with a stream ID of 0x2 is subsequently received, the DATAGRAM frame is sent to a protocol application or module corresponding to HTTP3.0 for further analysis and processing.
如果该Flow后续报文使用ALP_DATAGRAM帧承载,其ALP域中声明的协议必须和Flow创建时标识的应用层协议一致。如果不一致,客户端或服务端可以生成用于指示应用层协议错误的“DATAGRAM_ALP_ERROR”错误,并在日志中记录DATAGRAM_ALP_ERROR。If the subsequent packets of the Flow are carried by the ALP_DATAGRAM frame, the protocol declared in the ALP field must be consistent with the application layer protocol identified when the Flow is created. If inconsistent, the client or server can generate a "DATAGRAM_ALP_ERROR" error indicating an application layer protocol error, and log DATAGRAM_ALP_ERROR.
需要说明的是,DATAGRAM_ALP_ERROR可以被抑制,例如,在预设时长内出现的多次DATAGRAM_ALP_ERROR可以仅记录5次,抑制DATAGRAM_ALP_ERROR错误的方式本申请不做限制。It should be noted that DATAGRAM_ALP_ERROR can be suppressed, for example, multiple DATAGRAM_ALP_ERROR occurring within a preset time period can be recorded only 5 times, and the method of suppressing DATAGRAM_ALP_ERROR error is not limited in this application.
还有一些实施方式中,也可以使用DATAGRAM帧创建Flow。In still other embodiments, the Flow may also be created using the DATAGRAM frame.
当使用DATAGRAM帧创建Flow时,默认Flow承载的应用是QUIC会话创建时,ALPN协商中的首个应用层协议,即应用层协议列表中的第一个应用层协议。When a Flow is created using a DATAGRAM frame, the application carried by the default Flow is the first application layer protocol in the ALPN negotiation when the QUIC session is created, that is, the first application layer protocol in the application layer protocol list.
作为示例,若应用层协议列表中应用层协议的顺序为“h3”、“qrt”。当通过DATAGRAM帧创建了Flow ID为0x3的DATAGRAM,则该DATAGRAM承载的应用层协议为“h3”,当后续接收到Flow ID为0x3的DATAGRAM帧时,将该DATAGRAM帧发送给HTTP3.0对应的协议应用或模块进一步解析处理。As an example, if the order of the application layer protocols in the application layer protocol list is "h3", "qrt". When a DATAGRAM with a Flow ID of 0x3 is created through a DATAGRAM frame, the application layer protocol carried by the DATAGRAM is "h3". When a DATAGRAM frame with a Flow ID of 0x3 is subsequently received, the DATAGRAM frame is sent to the corresponding HTTP3.0 The protocol application or module further parses and processes.
ALP_DATAGRAM帧类型的最低比特决定了帧中存在的字段。ALP_DATAGRAM帧类型中的LEN位(0x01),用于表示是否存在Length字段。Length字段用于指示ALP_DATAGRAM帧中Datagram Data(..)的长度。当LEN位设置为1时,Length字段(ALP_DATAGRAM帧中的[Length(i)])出现。当LEN位设置为0时,Length字段不存在。当Length字段不存在时,Datagram Data字段扩展到报文尾部。The least significant bits of the ALP_DATAGRAM frame type determine the fields present in the frame. The LEN bit (0x01) in the ALP_DATAGRAM frame type is used to indicate whether there is a Length field. The Length field is used to indicate the length of the Datagram Data(..) in the ALP_DATAGRAM frame. When the LEN bit is set to 1, the Length field ([Length(i)] in the ALP_DATAGRAM frame) is present. When the LEN bit is set to 0, the Length field is absent. When the Length field does not exist, the Datagram Data field extends to the end of the message.
还有一些实施例中,在QUIC会话建立后,服务端和客户端还可以动态协商承载的应用层协议。In still other embodiments, after the QUIC session is established, the server and the client may also dynamically negotiate the bearer application layer protocol.
在一种可能实施方式中,可以创建新的扩展帧实现动态协商承载的应用层协议。如创建用于通知客户端或服务端向存储于本地的应用层协议列表中添加至少一个应用层协议的第一通知帧。In a possible implementation, a new extension frame may be created to implement dynamic negotiation of the application layer protocol of the bearer. For example, a first notification frame for notifying the client or the server to add at least one application layer protocol to the locally stored application layer protocol list is created.
或者,创建用于通知客户端或服务端向存储于本地的应用层协议列表中添加至少一个应用层协议的第二通知帧。Alternatively, a second notification frame for notifying the client or the server to add at least one application layer protocol to the locally stored application layer protocol list is created.
在本实施方式中,第一通知帧可以是NEW_ALPN帧,例如,可以在向客户端本地 的QUIC协议栈中的应用层协议列表中添加至少一个应用层协议后,通过向服务端发送NEW_ALPN帧,通知服务端本端支持的应用层协议增加了。In this embodiment, the first notification frame may be a NEW_ALPN frame. For example, after adding at least one application layer protocol to the application layer protocol list in the local QUIC protocol stack of the client, by sending a NEW_ALPN frame to the server, The application layer protocols supported by the notification server have been added.
第二通知帧可以是REMOVE_ALPN帧,例如,在移除客户端本地的QUIC协议栈中的应用层协议列表中的至少一个应用层协议后,通过向服务端发送REMOVE_ALPN帧,通知服务端本端支持的应用层协议减少了。The second notification frame may be a REMOVE_ALPN frame. For example, after removing at least one application layer protocol in the application layer protocol list in the local QUIC protocol stack of the client, send a REMOVE_ALPN frame to the server to notify the server that the local end supports application layer protocols are reduced.
需要说明的是,客户端和服务端还记录了本端能够支持的应用层协议。It should be noted that the client and the server also record the application layer protocols that the local end can support.
在一些实施方式中,当向应用层协议列表中添加至少一个应用层协议时,若添加的至少一个应用层协议是本端尚未支持的应用层协议,则还可以将该应用层协议记录为本端能够支持的应用层协议。当移除应用层协议列表中至少一个应用层协议时,还可以将该应用层协议从本端能够支持的应用层协议中移除。In some embodiments, when adding at least one application layer protocol to the application layer protocol list, if the added at least one application layer protocol is an application layer protocol not yet supported by the local end, the application layer protocol may also be recorded as this The application layer protocol that the terminal can support. When at least one application layer protocol in the application layer protocol list is removed, the application layer protocol may also be removed from the application layer protocols that the local end can support.
作为示例,NEW_ALPN帧的格式可以为:As an example, the format of a NEW_ALPN frame could be:
Figure PCTCN2022084139-appb-000005
Figure PCTCN2022084139-appb-000005
其中,NEW_ALPN帧的类型字段可以由IANA进行分配,在示例中以“待定(to be done,TBD)1”表示。Among them, the type field of the NEW_ALPN frame may be allocated by IANA, which is represented by "to be done (TBD) 1" in the example.
NEW_ALPN帧中可以包括两个字段,即[Length(i)]字段和[Alp list(i)]字段,[Length(i)]字段用于表示NEW_ALPN帧的长度,而[Alp list(i)]中则记录了至少一个添加至应用层协议列表中的应用层协议。[Alp list(i)]中记录应用层协议可以通过记录应用层协议对应的ALPN协议ID实现。The NEW_ALPN frame can include two fields, namely the [Length(i)] field and the [Alp list(i)] field, the [Length(i)] field is used to indicate the length of the NEW_ALPN frame, and the [Alp list(i)] field At least one application layer protocol added to the application layer protocol list is recorded in . Recording the application layer protocol in [Alp list(i)] can be achieved by recording the ALPN protocol ID corresponding to the application layer protocol.
而REMOVE_ALPN帧的格式可以为:The format of the REMOVE_ALPN frame can be:
Figure PCTCN2022084139-appb-000006
Figure PCTCN2022084139-appb-000006
其中,REMOVE_ALPN帧的类型字段可以由IANA进行分配,在示例中以“TBD2”表示。Among them, the type field of the REMOVE_ALPN frame can be allocated by IANA, which is represented by "TBD2" in the example.
REMOVE_ALPN帧中可以包括两个字段,即[Length(i)]字段和[Alp list(i)]字段,[Length(i)]字段用于表示REMOVE_ALPN帧的长度,而[Alp list(i)]中则记录了至少一个从应用层协议列表中移除的应用层协议。[Alp list(i)]中记录应用层协议可以通过记录应用层协议对应的ALPN协议ID实现。REMOVE_ALPN frame can include two fields, namely [Length(i)] field and [Alp list(i)] field, [Length(i)] field is used to indicate the length of REMOVE_ALPN frame, and [Alp list(i)] At least one application-layer protocol removed from the application-layer protocol list is recorded in . Recording the application layer protocol in [Alp list(i)] can be achieved by recording the ALPN protocol ID corresponding to the application layer protocol.
需要说明的是,当QUIC协议两端通过REMOVE_ALPN帧移除应用层协议时,如果接收端发现还有对应的Stream或Flow存在,应主动撤销对应的Stream或Flow。后续收到对应Stream ID的STREAM帧或ALP_SREAM帧,或者,收到对应Flow ID的DATAGRAM帧或ALP_DATAGRAM帧,则应丢弃对应的帧,并生成对应的错误码,该错误码也可以抑制生成的频次。在本实施例中,抑制生成频次的方式可以参考抑制 STREAM_ALP_ERROR或抑制DATAGRAM_ALP_ERROR生成频次的方式。It should be noted that when both ends of the QUIC protocol remove the application layer protocol through the REMOVE_ALPN frame, if the receiving end finds that there is a corresponding Stream or Flow, it should actively revoke the corresponding Stream or Flow. After receiving a STREAM frame or ALP_SREAM frame corresponding to the Stream ID, or receiving a DATAGRAM frame or ALP_DATAGRAM frame corresponding to the Flow ID, the corresponding frame should be discarded, and a corresponding error code should be generated. This error code can also suppress the frequency of generation. . In this embodiment, the method of suppressing the generation frequency may refer to the method of suppressing the generation frequency of STREAM_ALP_ERROR or suppressing the generation frequency of DATAGRAM_ALP_ERROR.
需要说明的是,NEW_ALPN或REMOVE_ALPN帧一般由QUIC的服务端通告给客户端的,但是也允许QUIC的客户端通知给服务端,本申请对此不作限制。It should be noted that the NEW_ALPN or REMOVE_ALPN frame is generally advertised to the client by the QUIC server, but the QUIC client is also allowed to notify the server, which is not limited in this application.
在另一些实施方式中,还可以使用其他的扩展帧实现,例如,通过扩展帧记录Stream ID或Flow ID与应用层协议(未记录在应用层协议列表中的应用层协议)的对应关系。当接收方收到该扩展帧后,记录该对应关系。当再次接收到该Stream ID或Flow ID的STREAM或DATAGRAM帧时,根据记录的对应关系将该数据帧发送给对应的协议应用或模块进一步解析处理。In other embodiments, other extension frames can also be used to implement, for example, the corresponding relationship between Stream ID or Flow ID and application layer protocol (application layer protocol not recorded in the application layer protocol list) is recorded by the extension frame. When the receiver receives the extended frame, the corresponding relationship is recorded. When the STREAM or DATAGRAM frame of the Stream ID or Flow ID is received again, the data frame is sent to the corresponding protocol application or module for further analysis and processing according to the recorded correspondence.
S307、客户端响应第二数据请求,获取第二数据请求使用的第二应用层协议。S307. The client responds to the second data request, and obtains the second application layer protocol used by the second data request.
一些实施方式中,第二数据请求可以是客户端响应用户操作生成的,第二数据请求与第一数据请求目的端的网际互连协议(Internet Protocol,ip)地址相同。第二应用层协议可以与第一应用层协议相同,也可以不同,在此不做限制。In some embodiments, the second data request may be generated by the client in response to a user operation, and the second data request is the same as the Internet Protocol (Internet Protocol, ip) address of the destination end of the first data request. The second application layer protocol may be the same as or different from the first application layer protocol, which is not limited herein.
例如,参考S303,当客户端接收到用户的操作指令,指示在购物应用中打开视频直播时,购物应用响应用户的操作指令,生成第二数据请求,向服务端请求直播视频资源。直播视频资源可以使用RTP协议进行传输,即第二应用层协议可以是RTP协议。For example, referring to S303, when the client receives an operation instruction from the user indicating to enable live video in the shopping application, the shopping application responds to the user's operation instruction, generates a second data request, and requests the server for live video resources. The live video resource may be transmitted using the RTP protocol, that is, the second application layer protocol may be the RTP protocol.
S308、客户端确定第二数据请求使用的第二应用层协议是否在第一QUIC会话对应的应用层协议列表中,若第二应用层协议在第一QUIC会话对应的应用层协议列表中,则执行S310,否则执行S309。S308. The client determines whether the second application layer protocol used by the second data request is in the application layer protocol list corresponding to the first QUIC session. If the second application layer protocol is in the application layer protocol list corresponding to the first QUIC session, then Go to S310, otherwise go to S309.
S309、客户端建立与服务端之间的第二QUIC会话。S309, the client establishes a second QUIC session with the server.
一些实施方式中,参考S307中的示例,若RTP协议不在第一QUIC会话对应的应用层协议列表中,则第二数据请求无法复用第一QUIC会话,需要重新握手建立第二QUIC会话,以承载第二数据请求对应的RTP协议数据。In some embodiments, referring to the example in S307, if the RTP protocol is not in the application layer protocol list corresponding to the first QUIC session, the second data request cannot reuse the first QUIC session, and a re-handshake is required to establish a second QUIC session to Bearing the RTP protocol data corresponding to the second data request.
S310、客户端在第一QUIC会话中建立第二数据流。S310. The client establishes a second data stream in the first QUIC session.
一些实施方式中,参考S307中的示例,若RTP协议在第一QUIC会话对应的应用层协议列表中,则第二数据请求可以复用第一QUIC会话,客户端生成并向服务端发送ALP_STREAM帧。ALP_STREAM帧指示客户端与服务端之间生成一个新的Stream(即第二数据流),该Stream的Stream ID与RTP协议关联,当服务端或客户端接收到该Stream ID的STREAM帧时,将接收到的STREAM帧发送给RTP对应的协议应用或模块进一步解析处理。In some embodiments, referring to the example in S307, if the RTP protocol is in the application layer protocol list corresponding to the first QUIC session, the second data request may multiplex the first QUIC session, and the client generates and sends an ALP_STREAM frame to the server. . The ALP_STREAM frame instructs the client and the server to generate a new Stream (ie, the second data stream). The Stream ID of the Stream is associated with the RTP protocol. When the server or client receives the STREAM frame of the Stream ID, it will The received STREAM frame is sent to the protocol application or module corresponding to RTP for further analysis and processing.
还有一些实施方式中,可以在协议栈中每个QUIC会话中数据流的数量,并在QUIC会话下生成或销毁数据流时,记录数据流数量的变化。当QUIC会话中数据流的数量为0,且经过预设的时长后QUIC会话中再无新增的数据流时,可以将QUIC会话断开,不再保持链接。In some other implementations, the number of data streams in each QUIC session in the protocol stack may be recorded, and the change in the number of data streams may be recorded when a data stream is generated or destroyed under the QUIC session. When the number of data streams in the QUIC session is 0, and there is no new data stream in the QUIC session after a preset duration, the QUIC session can be disconnected and the connection is no longer maintained.
作为示例,参考S303和S307中的示例,当第一QUIC会话建立后,建立了第一数据流,则第一QUIC会话中数据流的数量为1。当在第一QUIC会话下建立第二数据流时,将第一QUIC会话中数据流的数量加1,即第一QUIC会话中数据流的数量为2。As an example, referring to the examples in S303 and S307, when the first QUIC session is established and the first data stream is established, the number of data streams in the first QUIC session is 1. When the second data stream is established under the first QUIC session, add 1 to the number of data streams in the first QUIC session, that is, the number of data streams in the first QUIC session is 2.
当第一数据流中的数据传输完毕(接收到的STREAM帧中的FIN位为1)后,可以将第一数据流销毁,第一QUIC会话中的数据流数量变为1。当第二数据流中的数据也完成了传输,销毁第二数据流后,第一QUIC会话中的数据流数量变为0。若第一QUIC会 话中的数据流数量为0保持超过60秒,则可以将第一QUIC会话断开。After the data transmission in the first data stream is completed (the FIN bit in the received STREAM frame is 1), the first data stream may be destroyed, and the number of data streams in the first QUIC session becomes 1. When the data in the second data stream is also transmitted and the second data stream is destroyed, the number of data streams in the first QUIC session becomes 0. If the number of data streams in the first QUIC session is 0 for more than 60 seconds, the first QUIC session can be disconnected.
图5示出了本申请提供的另一种QUIC数据传输方法的示意性流程图,在图5示出的流程中,当第二应用层协议不在应用层协议列表中时,可以将第二应用层协议添加至应用层协议列表,然后再复用第一QUIC会话传输第二数据请求对应的数据。FIG. 5 shows a schematic flowchart of another QUIC data transmission method provided by the present application. In the process shown in FIG. 5, when the second application layer protocol is not in the application layer protocol list, the second application layer protocol can be The layer protocol is added to the application layer protocol list, and then the first QUIC session is multiplexed to transmit the data corresponding to the second data request.
参考图5,由于本实施例中数据传输方法的S301至S307与上述实施例一致,在此不做赘述。所以从S308开始,对本实施例中的方法进行说明。Referring to FIG. 5 , since S301 to S307 of the data transmission method in this embodiment are the same as those in the above-mentioned embodiment, details are not described here. Therefore, starting from S308, the method in this embodiment will be described.
S308、客户端确定第二数据请求使用的第二应用层协议是否在第一QUIC会话对应的应用层协议列表中,若第二应用层协议在第一QUIC会话对应的应用层协议列表中,则执行S310,否则执行S311。S308. The client determines whether the second application layer protocol used by the second data request is in the application layer protocol list corresponding to the first QUIC session. If the second application layer protocol is in the application layer protocol list corresponding to the first QUIC session, then Go to S310, otherwise go to S311.
S310、客户端在第一QUIC会话中建立第二数据流。S310. The client establishes a second data stream in the first QUIC session.
在本实施例中,S310与上述实施例一致,在此不做赘述。In this embodiment, S310 is consistent with the above-mentioned embodiment, and details are not described here.
S311、客户端将第二应用层协议添加至第一QUIC会话对应的应用层协议列表中。S311. The client adds the second application layer protocol to the application layer protocol list corresponding to the first QUIC session.
在本实施例中,当第二应用层协议不在第一QUIC会话对应的应用层协议列表中时,不建立客户端建立与服务端之间的第二QUIC会话,而是将第二应用层协议添加至存储在客户端本地的第一QUIC会话对应的应用层协议列表中。例如,若当前客户端本地的应用层协议列表中包括“h3”和“qrt”,第二应用层协议为DNS,则可以将“Doq”写入客户端本地的应用层协议列表,更新后客户端本地的应用层协议列表中包括“h3”、“qrt”和“Doq”。In this embodiment, when the second application layer protocol is not in the application layer protocol list corresponding to the first QUIC session, the second QUIC session between the client and the server is not established, but the second application layer protocol is not established. Added to the application layer protocol list corresponding to the first QUIC session stored locally on the client. For example, if the current client's local application layer protocol list includes "h3" and "qrt", and the second application layer protocol is DNS, then "Doq" can be written into the client's local application layer protocol list. The local application layer protocol list includes "h3", "qrt" and "Doq".
S312、客户端发送第一QUIC会话对应的应用层协议列表更新指令给服务端后,执行S310。S312: After the client sends the application layer protocol list update instruction corresponding to the first QUIC session to the server, execute S310.
S313、服务端根据第一QUIC会话对应的应用层协议列表更新指令,将第二应用层协议添加至第一QUIC会话对应的应用层协议列表中。S313. The server adds the second application layer protocol to the application layer protocol list corresponding to the first QUIC session according to the application layer protocol list update instruction corresponding to the first QUIC session.
一些实施方式中,客户端更新完本地的第一QUIC会话对应的应用层协议列表后,可以向服务端发送S306中示出的NEW_APLN帧,该帧中的[Alp list(i)]字段包括第二应用层协议。参考S311的示例,该帧中的[Alp list(i)]字段可以包括“Doq”。In some embodiments, after updating the application layer protocol list corresponding to the local first QUIC session, the client can send the NEW_APLN frame shown in S306 to the server, where the [Alp list(i)] field in the frame includes the first Two application layer protocols. Referring to the example of S311, the [Alp list(i)] field in the frame may include "Doq".
服务端在接收到NEW_APLN帧后,将“Doq”写入存储在服务端本地的第一QUIC会话对应的应用层协议列表中,更新后服务端本地的第一QUIC会话对应的应用层协议列表中包括“h3”、“qrt”和“Doq”。After receiving the NEW_APLN frame, the server writes "Doq" into the application layer protocol list corresponding to the first QUIC session stored locally on the server side. After the update, the server side writes "Doq" into the application layer protocol list corresponding to the first QUIC session locally on the server side. Includes "h3", "qrt", and "Doq".
需要说明的是,虽然本申请的附图中显示,S311、S312和S313为连续步骤。但是,S311、S312和S313可以分别部署执行。例如,S311可以在S307之后执行,S312需要在S311之后执行,但与S311之间可以插入其余的步骤。类似的,S313需要在S312之后执行,但与S313之间可以插入其余的步骤。It should be noted that, although shown in the drawings of the present application, S311 , S312 and S313 are consecutive steps. However, S311, S312 and S313 can be deployed and executed separately. For example, S311 can be executed after S307, S312 needs to be executed after S311, but the remaining steps can be inserted between S311. Similarly, S313 needs to be executed after S312, but other steps can be inserted between S313.
作为示例,QUIC数据传输方法的步骤顺序可以是:S301、S302、S303、S304、S305、S306、S307、S311、S312、S308、S313、S310。或者,QUIC数据传输方法的步骤顺序还可以是:S301、S302、S303、S304、S305、S306、S307、S311、S308、S312、S313、S310,在此不做限制。As an example, the sequence of steps of the QUIC data transmission method may be: S301, S302, S303, S304, S305, S306, S307, S311, S312, S308, S313, S310. Alternatively, the sequence of steps of the QUIC data transmission method may also be: S301, S302, S303, S304, S305, S306, S307, S311, S308, S312, S313, and S310, which are not limited here.
这个情况下,客户端和服务端均可通过动态协商承载的应用层协议,使得客户端和服务端均支持第二应用层协议,客户端再执行S310,即可在第一QUIC会话中建立第二数据流,用于传输第二数据请求对应的数据。In this case, both the client and the server can dynamically negotiate the application layer protocol carried, so that both the client and the server support the second application layer protocol, and the client executes S310 to establish the first QUIC session in the first QUIC session. The second data stream is used to transmit the data corresponding to the second data request.
在本实施例中,当第二应用层协议不在第一QUIC会话对应的应用层协议列表中时, 客户端也可以复用第一QUIC会话传输第二数据请求对应的数据,增加了数据传输方法的应用场景,进一步的降低数据传输延迟,提高建链效率。In this embodiment, when the second application layer protocol is not in the application layer protocol list corresponding to the first QUIC session, the client can also multiplex the first QUIC session to transmit data corresponding to the second data request, and a data transmission method is added. It can further reduce the data transmission delay and improve the efficiency of chain construction.
图6示出了本申请提供的另一种QUIC数据传输方法的示意性流程图,在图6示出的流程中,第二数据请求是服务端发起的。FIG. 6 shows a schematic flowchart of another QUIC data transmission method provided by the present application. In the process shown in FIG. 6 , the second data request is initiated by the server.
参考图6,该方法包括:Referring to Figure 6, the method includes:
S401、获取客户端支持的应用层协议。S401. Obtain an application layer protocol supported by a client.
S402、获取服务端支持的应用层协议。S402. Obtain an application layer protocol supported by the server.
S403、客户端响应第一数据请求,向服务端发起握手,请求建立第一QUIC会话。S403. The client responds to the first data request, initiates a handshake to the server, and requests to establish a first QUIC session.
S404、服务端响应会话建立请求,返回握手请求,握手请求包括服务端支持的应用层协议。S404, the server responds to the session establishment request, and returns a handshake request, where the handshake request includes an application layer protocol supported by the server.
S405、客户端根据客户端支持的应用层协议和服务端支持的应用层协议,生成第一QUIC会话对应的应用层协议列表。S405. The client generates an application layer protocol list corresponding to the first QUIC session according to the application layer protocol supported by the client and the application layer protocol supported by the server.
S406、客户端与服务端之间建立第一QUIC会话,客户端发送第一QUIC会话对应的应用层协议列表给服务端。S406. A first QUIC session is established between the client and the server, and the client sends the application layer protocol list corresponding to the first QUIC session to the server.
在本实施例中,S401至S406与S301至S306的实现方式一致,在此不做赘述。In this embodiment, the implementation manners of S401 to S406 are the same as those of S301 to S306, which will not be repeated here.
S407、服务端响应第二数据请求,获取第二数据请求使用的第二应用层协议。S407. The server responds to the second data request, and obtains the second application layer protocol used by the second data request.
一些实施方式中,第二数据请求可以是服务端基于应用的需求向客户端发起的。例如,服务端向客户端动态推送广播或单播通知或消息(例如直播视频场景)时,服务端会向客户端发起第二数据请求。In some embodiments, the second data request may be initiated by the server to the client based on the requirements of the application. For example, when the server dynamically pushes a broadcast or unicast notification or message (such as a live video scene) to the client, the server will initiate a second data request to the client.
例如,参考S303,当服务端基于应用的需求,需要向客户端推送直播视频时,服务端可以生成第二数据请求,向客户端请求传输直播视频资源。由于直播视频资源可以使用RTP协议进行传输,即第二应用层协议可以是RTP协议。For example, referring to S303, when the server needs to push the live video to the client based on the requirements of the application, the server may generate a second data request, and request the client to transmit the live video resource. Since the live video resource can be transmitted using the RTP protocol, that is, the second application layer protocol can be the RTP protocol.
S408、服务端确定第二数据请求使用的第二应用层协议是否在第一QUIC会话对应的应用层协议列表中,若第二应用层协议在第一QUIC会话对应的应用层协议列表中,则执行S410,否则执行S409。S408. The server determines whether the second application layer protocol used by the second data request is in the application layer protocol list corresponding to the first QUIC session. If the second application layer protocol is in the application layer protocol list corresponding to the first QUIC session, then Go to S410, otherwise go to S409.
S409、服务端建立与客户端之间的第二QUIC会话。S409, the server establishes a second QUIC session with the client.
一些实施方式中,参考S407中的示例,若RTP协议不在第一QUIC会话对应的应用层协议列表中,则第二数据请求无法复用第一QUIC会话,需要与客户端重新握手建立第二QUIC会话,以承载第二数据请求对应的RTP协议数据。In some embodiments, referring to the example in S407, if the RTP protocol is not in the application layer protocol list corresponding to the first QUIC session, the second data request cannot reuse the first QUIC session, and needs to re-handshake with the client to establish the second QUIC session. session to carry the RTP protocol data corresponding to the second data request.
S410、服务端在第一QUIC会话中建立第二数据流。S410. The server establishes a second data stream in the first QUIC session.
一些实施方式中,参考S407中的示例,若RTP协议在第一QUIC会话对应的应用层协议列表中,则第二数据请求可以复用第一QUIC会话,服务端生成并向客户端发送ALP_STREAM帧。ALP_STREAM帧指示服务端与客户端之间生成一个新的Stream(即第二数据流),该Stream的Stream ID与RTP协议关联,当服务端或客户端接收到该Stream ID的STREAM帧时,将接收到的STREAM帧发送给RTP对应的协议应用或模块进一步解析处理。In some embodiments, referring to the example in S407, if the RTP protocol is in the application layer protocol list corresponding to the first QUIC session, the second data request may multiplex the first QUIC session, and the server generates and sends the client an ALP_STREAM frame. . The ALP_STREAM frame instructs the server and the client to generate a new Stream (ie, the second data stream). The Stream ID of the Stream is associated with the RTP protocol. When the server or client receives the STREAM frame of the Stream ID, it will The received STREAM frame is sent to the protocol application or module corresponding to RTP for further analysis and processing.
还有一些实施方式中,可以记录在协议栈中每个QUIC会话中数据流的数量,并在QUIC会话下生成或销毁数据流时,记录数据流数量的变化。当QUIC会话中数据流的数量为0,且经过预设的时长后QUIC会话中再无新增的数据流时,可以将QUIC会话断开, 不再保持链接。具体的实现方式可以参照S310中的示例,在此不做赘述。In still other implementations, the number of data streams in each QUIC session in the protocol stack can be recorded, and when a data stream is generated or destroyed under the QUIC session, the change in the number of data streams is recorded. When the number of data streams in the QUIC session is 0, and there is no new data stream in the QUIC session after a preset duration, the QUIC session can be disconnected and the connection is no longer maintained. For a specific implementation manner, reference may be made to the example in S310, which is not repeated here.
图7示出了本申请提供的另一种数据传输方法的示意性流程图。在图7示出的流程中,示出了服务端发起第二数据请求,第二应用层协议不在应用层协议列表中时,将第二应用层协议添加至应用层协议列表,然后再复用第一QUIC会话传输第二数据请求对应的数据的步骤。FIG. 7 shows a schematic flowchart of another data transmission method provided by the present application. In the process shown in FIG. 7, it shows that the server initiates a second data request, and when the second application layer protocol is not in the application layer protocol list, the second application layer protocol is added to the application layer protocol list, and then reused The step of transmitting the data corresponding to the second data request in the first QUIC session.
参考图7,由于本实施例中数据传输方法的S401至S407与上述实施例一致,在此不做赘述。所以从S408开始,对本实施例中的方法进行说明。Referring to FIG. 7 , since S401 to S407 of the data transmission method in this embodiment are the same as those in the above-mentioned embodiment, detailed descriptions are omitted here. Therefore, starting from S408, the method in this embodiment will be described.
S408、服务端确定第二数据请求使用的第二应用层协议是否在第一QUIC会话对应的应用层协议列表中,若第二应用层协议在第一QUIC会话对应的应用层协议列表中,则执行S310,否则执行S311。S408. The server determines whether the second application layer protocol used by the second data request is in the application layer protocol list corresponding to the first QUIC session. If the second application layer protocol is in the application layer protocol list corresponding to the first QUIC session, then Go to S310, otherwise go to S311.
S410、服务端端在第一QUIC会话中建立第二数据流。S410. The server establishes a second data stream in the first QUIC session.
在本实施例中,S410与上述实施例一致,在此不做赘述。In this embodiment, S410 is consistent with the above-mentioned embodiment, and details are not described here.
S411、服务端将第二应用层协议添加至第一QUIC会话对应的应用层协议列表中。S411. The server adds the second application layer protocol to the application layer protocol list corresponding to the first QUIC session.
在本实施例中,当第二应用层协议不在第一QUIC会话对应的应用层协议列表中时,不建立服务端建立与客户端之间的第二QUIC会话,而是将第二应用层协议添加至存储在服务端本地的第一QUIC会话对应的应用层协议列表中。例如,若当前服务端本地的应用层协议列表中包括“h3”和“qrt”,第二应用层协议为DNS,则可以将“Doq”写入服务端本地的应用层协议列表,更新后服务端本地的应用层协议列表中包括“h3”、“qrt”和“Doq”。In this embodiment, when the second application layer protocol is not in the application layer protocol list corresponding to the first QUIC session, the server does not establish a second QUIC session with the client, but uses the second application layer protocol Added to the application layer protocol list corresponding to the first QUIC session stored locally on the server. For example, if the current server's local application layer protocol list includes "h3" and "qrt", and the second application layer protocol is DNS, then "Doq" can be written into the server's local application layer protocol list, and the updated service The local application layer protocol list includes "h3", "qrt" and "Doq".
S412、客户端发送应用层协议列表更新指令给服务端后,执行S410。S412: After the client sends an application layer protocol list update instruction to the server, execute S410.
S413、服务端根据应用层协议列表更新指令,将第二应用层协议添加至应用层协议列表中。S413. The server adds the second application layer protocol to the application layer protocol list according to the application layer protocol list update instruction.
一些实施方式中,服务端更新完本地的第一QUIC会话对应的应用层协议列表后,可以向客户端发送S306中示出的NEW_APLN帧,该帧中的[Alp list(i)]字段包括第二应用层协议。参考S311的示例,该帧中的[Alp list(i)]字段可以包括“Doq”。In some embodiments, after updating the application layer protocol list corresponding to the local first QUIC session, the server can send the NEW_APLN frame shown in S306 to the client, where the [Alp list(i)] field in the frame includes the first Two application layer protocols. Referring to the example of S311, the [Alp list(i)] field in the frame may include "Doq".
客户端在接收到NEW_APLN帧后,将“Doq”写入存储在客户端本地的第一QUIC会话对应的应用层协议列表中,更新后客户端本地的应用层协议列表中包括“h3”、“qrt”和“Doq”。After receiving the NEW_APLN frame, the client writes "Doq" into the application layer protocol list corresponding to the first QUIC session stored in the client's local area. After the update, the client's local application layer protocol list includes "h3", "" qrt" and "Doq".
需要说明的是,虽然本申请的附图中显示,S411、S412和S413为连续步骤。但是,S411、S412和S413可以分别部署执行。例如,S411可以在S407之后执行,S412需要在S411之后执行,但与S411之间可以插入其余的步骤。类似的,S413需要在S412之后执行,但与S413之间可以插入其余的步骤。It should be noted that, although shown in the drawings of the present application, S411 , S412 and S413 are consecutive steps. However, S411, S412 and S413 can be deployed and executed separately. For example, S411 can be executed after S407, S412 needs to be executed after S411, but the remaining steps can be inserted between S411. Similarly, S413 needs to be executed after S412, but other steps can be inserted between S413.
作为示例,QUIC数据传输方法的步骤顺序可以是:S401、S402、S403、S404、S405、S406、S407、S411、S412、S408、S413、S410。或者,QUIC数据传输方法的步骤顺序还可以是:S401、S402、S403、S404、S405、S406、S407、S411、S408、S412、S413、S410,在此不做限制。As an example, the sequence of steps of the QUIC data transmission method may be: S401, S402, S403, S404, S405, S406, S407, S411, S412, S408, S413, S410. Alternatively, the sequence of steps of the QUIC data transmission method may also be: S401, S402, S403, S404, S405, S406, S407, S411, S408, S412, S413, and S410, which are not limited here.
这个情况下,服务端和客户端均可通过动态协商承载的应用层协议,使得客户端和服务端均支持第二应用层协议,服务端再执行S410,即可在第一QUIC会话中建立第二数据流,用于传输第二数据请求对应的数据。In this case, both the server and the client can dynamically negotiate the application layer protocol carried, so that both the client and the server support the second application layer protocol, and the server executes S410 to establish the first QUIC session in the first QUIC session. The second data stream is used to transmit the data corresponding to the second data request.
这个情况下,服务端和客户端均可支持第二应用层协议,服务端再执行S410,即可 在第一QUIC会话中建立第二数据流,用于传输第二数据请求对应的数据。In this case, both the server and the client can support the second application layer protocol, and the server then executes S410 to establish a second data stream in the first QUIC session for transmitting the data corresponding to the second data request.
在本实施例中,当第二应用层协议不在第一QUIC会话对应的应用层协议列表中时,服务端也可以复用第一QUIC会话传输第二数据请求对应的数据,增加了数据传输方法的应用场景,进一步的降低数据传输延迟,提高建链效率。In this embodiment, when the second application layer protocol is not in the application layer protocol list corresponding to the first QUIC session, the server can also multiplex the first QUIC session to transmit the data corresponding to the second data request, and a data transmission method is added. It can further reduce the data transmission delay and improve the efficiency of chain construction.
图8示出了一种使用本申请提供的数据传输方法时的数据流向图,在此根据图8示出的场景,对数据传输方法的应用进行说明。FIG. 8 shows a data flow diagram when using the data transmission method provided by the present application, and the application of the data transmission method is described here according to the scenario shown in FIG. 8 .
在图8示出的场景中,以HTTP3.0会话请求和RTP会话请求复用QUIC会话为例进行说明。其中,客户端通过无线网络与英特网连接,服务端通过以太网与英特网连接,进而实现客户端与服务端的通信连接。In the scenario shown in FIG. 8 , the multiplexing of the QUIC session between the HTTP 3.0 session request and the RTP session request is taken as an example for description. The client is connected to the Internet through a wireless network, and the server is connected to the Internet through the Ethernet, so as to realize the communication connection between the client and the server.
当QUIC服务端开启应用程序(Application,APP)1的服务时,触发启动QUIC服务端监听,并获取服务端支持的应用层协议,在本场景中,服务端支持HTTP3.0和RTP。When the QUIC server starts the service of the application (Application, APP) 1, it triggers the start of the QUIC server monitoring, and obtains the application layer protocols supported by the server. In this scenario, the server supports HTTP3.0 and RTP.
当QUIC客户端上接收到用户操作,指示QUIC客户端启动APP1,并使用HTTP3.0访问QUIC服务端上的全球广域网(World Wide Web,Web)服务,浏览网页。APP1对应的模块创建HTTP 3.0的套接字(Socket)应用程序接口(Application Programming Interface,API)。该Socket API通过客户端本地的协议栈触发QUIC协议模块向QUIC服务端发起创建QUIC会话,开始握手协商,在握手过程中,双方也相互通告支持的应用层协议,确定了应用层协议列表,在本场景中,应用层协议列表指示QUIC会话支持HTTP3.0和RTP。握手成功后生成QUIC会话(Session)51。When a user operation is received on the QUIC client, the QUIC client is instructed to start APP1, and use HTTP3.0 to access the World Wide Web (Web) service on the QUIC server to browse web pages. The module corresponding to APP1 creates the HTTP 3.0 socket (Socket) application program interface (Application Programming Interface, API). The Socket API triggers the QUIC protocol module to initiate the creation of a QUIC session to the QUIC server through the client's local protocol stack, and starts handshake negotiation. During the handshake process, both parties also notify each other of the supported application-layer protocols, and determine the application-layer protocol list. In this scenario, the application layer protocol list indicates that the QUIC session supports HTTP 3.0 and RTP. After the handshake is successful, a QUIC session (Session) 51 is generated.
QUIC客户端和QUIC服务端继续在QUIC会话51的基础上完成HTTP 3.0的协议会话HTTP 3.0数据流52的握手(即创建用于承载HTTP3.0数据的Stream)。The QUIC client and the QUIC server continue to complete the handshake of the HTTP 3.0 protocol session HTTP 3.0 data stream 52 on the basis of the QUIC session 51 (that is, to create a Stream for carrying HTTP 3.0 data).
服务端可以将HTTP 3.0会话建链的首个HTTP 3.0的SETTINGS帧(SETTINGS帧用于传输影响客户端和服务端之间通信方式的HTTP3.0配置参数)封装到申请Stream ID为4的ALP_STREAM帧的Stream Data字段中,该ALP_STREAM帧中ALP域内的协议字符串为“h3”。QUIC服务端收到该ALP_STREAM帧后,创建Stream ID为4的Stream,并缓存该Stream的Stream ID与HTTP 3.0对应关系。服务端将从该ALP_STREAM帧中解析出来的HTTP 3.0的SETTINGS帧发送给服务端HTTP 3.0协议模块处理。The server can encapsulate the first HTTP 3.0 SETTINGS frame (the SETTINGS frame is used to transmit HTTP 3.0 configuration parameters that affect the communication method between the client and the server) in the establishment of the HTTP 3.0 session into an ALP_STREAM frame with an application Stream ID of 4 In the Stream Data field of the ALP_STREAM frame, the protocol string in the ALP field of the ALP_STREAM frame is "h3". After the QUIC server receives the ALP_STREAM frame, it creates a Stream with a Stream ID of 4, and caches the corresponding relationship between the Stream ID of the Stream and HTTP 3.0. The server sends the HTTP 3.0 SETTINGS frame parsed from the ALP_STREAM frame to the server HTTP 3.0 protocol module for processing.
QUIC服务端后续收到Stream ID为4的STREAM帧时,根据Stream ID与HTTP 3.0对应关系,将解析后得到的负载数据发送给服务端的HTTP 3.0协议模块处理。实现QUIC客户端和QUIC服务端基于QUIC会话51完成HTTP 3.0数据流52的握手和后续的资源访问。When the QUIC server subsequently receives a STREAM frame with a Stream ID of 4, it sends the parsed payload data to the HTTP 3.0 protocol module of the server for processing according to the corresponding relationship between the Stream ID and HTTP 3.0. Implement the QUIC client and QUIC server based on the QUIC session 51 to complete the handshake of the HTTP 3.0 data stream 52 and subsequent resource access.
当QUIC客户端接收到用户指令,指示APP1开启视频直播,APP1对应的模块创建RTP的Socket接口,该Socket API检查发现QUIC客户端有支持RTP协议的QUIC会话51存在,QUIC会话51可以承载RTP协议会话的RTP数据流53。When the QUIC client receives a user instruction and instructs APP1 to start live video, the module corresponding to APP1 creates an RTP socket interface. The Socket API checks and finds that the QUIC client has a QUIC session 51 that supports the RTP protocol, and the QUIC session 51 can carry the RTP protocol. RTP data stream 53 of the session.
所以,客户端不再触发新的QUIC会话握手,而是直接复用QUIC会话51,基于QUIC会话51进行RTP数据流53的握手(即创建用于承载RTP或RTCP数据的Stream)。Therefore, the client no longer triggers a new QUIC session handshake, but directly reuses the QUIC session 51, and performs the handshake of the RTP data stream 53 based on the QUIC session 51 (ie, creates a Stream for carrying RTP or RTCP data).
服务端可以将首个RTP或RTCP报文封装到申请的Stream ID为8的ALP_STREAM帧的Stream Data字段中,该ALP_STREAM帧中ALP域内的协议字符串为“qrt”,QUIC服务器收到该ALP_STREAM帧后,创建Stream ID为8的Stream,并缓存该Stream的Stream ID与RTP的对应关系。The server can encapsulate the first RTP or RTCP packet into the Stream Data field of the ALP_STREAM frame with the applied Stream ID of 8. The protocol string in the ALP field in the ALP_STREAM frame is "qrt", and the QUIC server receives the ALP_STREAM frame. Then, create a Stream with a Stream ID of 8, and cache the correspondence between the Stream ID of the Stream and the RTP.
然后,服务端将从该ALP_STREAM帧中解析出来的RTP或RTCP的会话握手报文发送给服务端的RTP/RTCP协议模块处理。Then, the server sends the RTP or RTCP session handshake message parsed from the ALP_STREAM frame to the RTP/RTCP protocol module of the server for processing.
QUIC服务端后续收到Stream ID为8的STREAM帧时,根据Stream ID与RTP的对应关系,将解析后得到的负载数据发送给QUIC服务端的RTP/RTCP协议模块处理。实现QUIC客户端和QUIC服务端基于QUIC会话51完成RTP/RTCP的握手和后续的资源访问。When the QUIC server subsequently receives a STREAM frame with a Stream ID of 8, it sends the parsed payload data to the RTP/RTCP protocol module of the QUIC server for processing according to the correspondence between the Stream ID and RTP. Implement the QUIC client and QUIC server to complete the RTP/RTCP handshake and subsequent resource access based on the QUIC session 51.
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should be understood that the size of the sequence numbers of the steps in the above embodiments does not mean the sequence of execution, and the execution sequence of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
对应于上文实施例提供的应用于客户端的QUIC数据传输方法,图9示出了本申请实施例提供的QUIC数据传输装置的结构框图,为了便于说明,仅示出了与本申请实施例相关的部分。Corresponding to the QUIC data transmission method applied to the client provided by the above embodiment, FIG. 9 shows a structural block diagram of the QUIC data transmission device provided by the embodiment of the present application. For the convenience of description, it only shows the relevant embodiments of the present application. part.
参照图9,该装置应用于客户端,包括:Referring to Figure 9, the device is applied to a client, including:
确定模块61,用于响应于第二数据请求与服务端之间进行数据传输时,确定第二数据请求所使用的第二应用层协议。The determining module 61 is configured to determine the second application layer protocol used by the second data request in response to the data transmission between the second data request and the server.
建立模块62,用于当第二应用层协议为第一QUIC会话对应的应用层协议列表中的应用层协议时,在第一QUIC会话中建立第二数据流,第二数据流用于承载第二数据请求中请求传输的数据,第一QUIC会话为客户端响应第一数据请求时,与服务端建立的QUIC会话,第一QUIC会话对应的应用层协议列表包括客户端和服务端同时支持的应用层协议。The establishment module 62 is configured to establish a second data stream in the first QUIC session when the second application layer protocol is an application layer protocol in the application layer protocol list corresponding to the first QUIC session, and the second data stream is used to carry the second data stream The data requested to be transmitted in the data request. The first QUIC session is the QUIC session established with the server when the client responds to the first data request. The list of application layer protocols corresponding to the first QUIC session includes the applications supported by both the client and the server. layer protocol.
一些实施方式中,建立模块62,具体用于响应第二数据请求生成第一类数据帧,第一类数据帧包括第二应用层协议、第二数据流的标识信息以及第二数据请求对应的数据信息,记录第二数据流的标识信息与第二应用层协议的对应关系。向服务端发送第一类数据帧,指示服务端根据第一类数据帧中的第二应用层协议建立第二数据流。In some embodiments, the establishment module 62 is specifically configured to generate a first type of data frame in response to the second data request, and the first type of data frame includes the second application layer protocol, the identification information of the second data stream, and the corresponding data of the second data request. The data information records the correspondence between the identification information of the second data stream and the second application layer protocol. The first type of data frame is sent to the server, and the server is instructed to establish a second data stream according to the second application layer protocol in the first type of data frame.
图10示出了本申请实施例提供的另一种QUIC数据传输装置的结构框图。FIG. 10 shows a structural block diagram of another QUIC data transmission apparatus provided by an embodiment of the present application.
一些实施方式中,参考图10,该装置还包括接收模块63,用于接收来自服务端的第一类数据帧。该装置还包括处理模块64,用于当确定第一类数据帧中第二数据流的标识信息与第二应用层协议的对应关系,与客户端记录的第二数据流的标识信息与第二应用层协议的对应关系一致时,将第一类数据帧发送给第二应用层协议对应的处理模块进行处理。In some embodiments, referring to FIG. 10 , the apparatus further includes a receiving module 63 for receiving the first type of data frame from the server. The apparatus further includes a processing module 64, configured to determine the correspondence between the identification information of the second data stream in the first type of data frame and the second application layer protocol, and the identification information of the second data stream recorded by the client and the second data stream. When the corresponding relationship between the application layer protocols is consistent, the first type of data frame is sent to the processing module corresponding to the second application layer protocol for processing.
一些实施方式中,第二类数据帧包括第二数据流的标识信息以及第二数据请求对应的数据信息。In some embodiments, the second type of data frame includes identification information of the second data stream and data information corresponding to the second data request.
接收模块63,还用于接收来自服务端的第二类数据帧。处理模块64,还用于根据第二类数据帧中第二数据流的标识信息以及第二数据流的标识信息与第二应用层协议的对应关系,将第二类数据帧发送给第二应用层协议对应的处理模块进行处理。The receiving module 63 is further configured to receive the second type of data frame from the server. The processing module 64 is further configured to send the second type of data frame to the second application according to the identification information of the second data stream in the second type of data frame and the corresponding relationship between the identification information of the second data stream and the second application layer protocol The processing module corresponding to the layer protocol performs processing.
一些实施方式中,第二类数据帧包括第二数据流的标识信息以及第二数据请求对应的数据信息。In some embodiments, the second type of data frame includes identification information of the second data stream and data information corresponding to the second data request.
建立模块62,具体用于确定第二应用层协议为第一QUIC会话对应的应用层协议列表中的首个应用层协议。客户端响应第二数据请求生成第二类数据帧,记录第二数据流的标识信息与第二应用层协议的对应关系。客户端向服务端发送第二类数据帧,指示服务端响应第二类数据帧,根据第一QUIC会话对应的应用层协议列表中的首个应用层协议建立第 二数据流。The establishing module 62 is specifically configured to determine that the second application layer protocol is the first application layer protocol in the application layer protocol list corresponding to the first QUIC session. The client generates a second type of data frame in response to the second data request, and records the correspondence between the identification information of the second data stream and the second application layer protocol. The client sends the second type of data frame to the server, instructing the server to respond to the second type of data frame and establish the second data stream according to the first application layer protocol in the application layer protocol list corresponding to the first QUIC session.
图11示出了本申请实施例提供的另一种QUIC数据传输装置的结构框图。FIG. 11 shows a structural block diagram of another QUIC data transmission apparatus provided by an embodiment of the present application.
一些实施方式中,参考图11,该装置还包括记录模块65,用于当建立第一QUIC会话后,记录第一QUIC会话的引用次数,引用次数为第一QUIC会话中数据流的数量。当第一QUIC会话中建立一个数据流时,将引用次数加一。当第一QUIC会话中的一个数据流关闭时,将引用次数减一。In some embodiments, referring to FIG. 11 , the apparatus further includes a recording module 65 for recording the number of citations of the first QUIC session after the first QUIC session is established, where the number of citations is the number of data streams in the first QUIC session. When a data stream is established in the first QUIC session, the reference count is incremented by one. When a stream in the first QUIC session is closed, the reference count is decremented by one.
一些实施方式中,记录模块65,还用于当引用次数减为零,且经过预设的时长后引用次数未发生变化时,将第一QUIC会话关闭。In some embodiments, the recording module 65 is further configured to close the first QUIC session when the number of citations decreases to zero and the number of citations does not change after a preset period of time.
一些实施方式中,建立模块62,还用于响应第一数据请求与服务端建立第一QUIC会话,并生成第一QUIC会话对应的应用层协议列表。在第一QUIC会话中建立第一数据流,第一数据流用于承载第一数据请求中请求传输的数据,第一数据请求使用第一应用层协议,第一应用层协议为第一QUIC会话对应的应用层协议列表中的应用层协议。In some embodiments, the establishing module 62 is further configured to establish a first QUIC session with the server in response to the first data request, and generate a list of application layer protocols corresponding to the first QUIC session. A first data stream is established in the first QUIC session, the first data stream is used to carry the data requested to be transmitted in the first data request, the first data request uses the first application layer protocol, and the first application layer protocol corresponds to the first QUIC session The application layer protocol in the list of application layer protocols.
一些实施方式中,建立模块62,具体用于响应第一数据请求,向服务端发送建立第一QUIC会话的会话握手请求。客户端接收来自服务端的握手报文,握手报文是服务端根据会话握手请求生成的,握手报文包括服务端支持的应用层协议。根据客户端支持的应用层协议和服务端支持的应用层协议,生成第一QUIC会话对应的应用层协议列表。客户端根据握手报文建立第一QUIC会话,并将第一QUIC会话对应的应用层协议列表和第一QUIC会话建立的确认报文通过第一QUCI会话发送给服务端。In some embodiments, the establishment module 62 is specifically configured to send a session handshake request for establishing the first QUIC session to the server in response to the first data request. The client receives a handshake message from the server, the handshake message is generated by the server according to the session handshake request, and the handshake message includes the application layer protocol supported by the server. Generate an application layer protocol list corresponding to the first QUIC session according to the application layer protocol supported by the client and the application layer protocol supported by the server. The client establishes the first QUIC session according to the handshake message, and sends the application layer protocol list corresponding to the first QUIC session and the confirmation message for establishing the first QUIC session to the server through the first QUIC session.
图12示出了本申请实施例提供的另一种QUIC数据传输装置的结构框图。FIG. 12 shows a structural block diagram of another QUIC data transmission apparatus provided by an embodiment of the present application.
一些实施方式中,接收模块63,还用于接收来自服务端的第一通知帧或第二通知帧,第一通知帧用于指示客户端向存储于客户端内第一QUIC会话对应的应用层协议列表中添加至少一个应用层协议,第二通知帧用于指示客户端移除存储于客户端内第一QUIC会话对应的应用层协议列表中的至少一个应用层协议。参考图12,该装置还包括更新模块66,用于根据接收到的第一通知帧或第二通知帧,更新应用层协议列表。In some embodiments, the receiving module 63 is further configured to receive the first notification frame or the second notification frame from the server, where the first notification frame is used to instruct the client to send the application layer protocol corresponding to the first QUIC session stored in the client. At least one application layer protocol is added to the list, and the second notification frame is used to instruct the client to remove at least one application layer protocol stored in the application layer protocol list corresponding to the first QUIC session in the client. Referring to FIG. 12, the apparatus further includes an update module 66, configured to update the application layer protocol list according to the received first notification frame or the second notification frame.
一些实施方式中,更新模块66,还用于响应应用层协议列表的更新指令,更新存储于客户端内的应用层协议列表。当更新指令指示向存储于客户端内的应用层协议列表中添加至少一个应用层协议时,生成第一通知帧,第一通知帧用于指示服务端向存储于服务端内第一QUIC会话对应的应用层协议列表中添加至少一个应用层协议。当更新指令指示移除存储于客户端内的应用层协议列表中的至少一个应用层协议时,生成第二通知帧,第二通知帧用于指示服务端移除存储于服务端内第一QUIC会话对应的应用层协议列表中的至少一个应用层协议。将第一通知帧或第二通知帧发送给服务端。In some embodiments, the update module 66 is further configured to update the application layer protocol list stored in the client in response to the update instruction of the application layer protocol list. When the update instruction instructs to add at least one application layer protocol to the application layer protocol list stored in the client, a first notification frame is generated, and the first notification frame is used to instruct the server to correspond to the first QUIC session stored in the server Add at least one application layer protocol to the list of application layer protocols. When the update instruction instructs to remove at least one application layer protocol in the application layer protocol list stored in the client, a second notification frame is generated, and the second notification frame is used to instruct the server to remove the first QUIC stored in the server. At least one application layer protocol in the application layer protocol list corresponding to the session. Send the first notification frame or the second notification frame to the server.
一些实施方式中,更新模块66,还用于当第二应用层协议不是第一QUIC会话对应的应用层协议列表中的应用层协议时,生成应用层协议列表的更新指令,更新指令用于将第二应用层协议写入存储于客户端内的第一QUIC会话对应的应用层协议列表。响应更新指令,并生成第一通知帧。建立模块62,还用于当客户端将第一通知帧通过第一QUIC会话发送给服务端后,在第一QUIC会话中与服务端建立第二数据流。In some embodiments, the update module 66 is further configured to generate an update instruction of the application layer protocol list when the second application layer protocol is not an application layer protocol in the application layer protocol list corresponding to the first QUIC session, and the update instruction is used to update the application layer protocol list. The second application layer protocol is written into the application layer protocol list corresponding to the first QUIC session stored in the client. Respond to the update instruction and generate a first notification frame. The establishing module 62 is further configured to establish a second data stream with the server in the first QUIC session after the client sends the first notification frame to the server through the first QUIC session.
对应于上文实施例提供的应用于服务端的QUIC数据传输方法,图13示出了本申请实施例提供的QUIC数据传输装置的结构框图,为了便于说明,仅示出了与本申请实施例相关的部分。Corresponding to the QUIC data transmission method applied to the server provided by the above embodiment, FIG. 13 shows a structural block diagram of the QUIC data transmission device provided by the embodiment of the present application. For the convenience of description, it only shows the relevant embodiments of the present application. part.
参照图13,该装置应用于服务端,包括:Referring to Figure 13, the device is applied to the server, including:
确定模块71,用于响应于第二数据请求与客户端之间进行数据传输时,确定第二数据请求所使用的第二应用层协议。The determining module 71 is configured to determine the second application layer protocol used by the second data request during data transmission between the client and the second data request in response to the second data request.
建立模块72,用于当第二应用层协议为第一QUIC会话对应的应用层协议列表中的应用层协议时,在第一QUIC会话中建立第二数据流,第二数据流用于承载第二数据请求中请求传输的数据,第一QUIC会话为客户端响应第一数据请求时,与服务端建立的QUIC会话,第一QUIC会话对应的应用层协议列表包括客户端和服务端同时支持的应用层协议。The establishment module 72 is configured to establish a second data stream in the first QUIC session when the second application layer protocol is an application layer protocol in the application layer protocol list corresponding to the first QUIC session, and the second data stream is used to carry the second data stream The data requested to be transmitted in the data request. The first QUIC session is the QUIC session established with the server when the client responds to the first data request. The list of application layer protocols corresponding to the first QUIC session includes the applications supported by both the client and the server. layer protocol.
一些实施方式中,建立模块72,具体用于响应第二数据请求生成第一类数据帧,第一类数据帧包括第二应用层协议、第二数据流的标识信息以及第二数据请求对应的数据信息,记录第二数据流的标识信息与第二应用层协议的对应关系。服务端向客户端发送第一类数据帧,指示客户端根据第一类数据帧中的第二应用层协议建立第二数据流。In some embodiments, the establishment module 72 is specifically configured to generate a first type of data frame in response to the second data request, and the first type of data frame includes the second application layer protocol, the identification information of the second data stream, and the corresponding data of the second data request. The data information records the correspondence between the identification information of the second data stream and the second application layer protocol. The server sends the first type of data frame to the client, and instructs the client to establish a second data stream according to the second application layer protocol in the first type of data frame.
图14示出了本申请实施例提供的另一种QUIC数据传输装置的结构框图。FIG. 14 shows a structural block diagram of another QUIC data transmission apparatus provided by an embodiment of the present application.
一些实施方式中,参考图14,该装置还包括接收模块73,用于接收来自客户端的第一类数据帧。该装置还包括处理模块74,用于当确定第一类数据帧中第二数据流的标识信息与第二应用层协议的对应关系,与服务端记录的第二数据流的标识信息与第二应用层协议的对应关系一致时,将第一类数据帧发送给第二应用层协议对应的处理模块进行处理。In some embodiments, referring to FIG. 14 , the apparatus further includes a receiving module 73 for receiving the first type of data frame from the client. The device further includes a processing module 74, configured to determine the correspondence between the identification information of the second data stream in the first type of data frame and the second application layer protocol, and the identification information of the second data stream recorded by the server and the second data stream. When the corresponding relationship between the application layer protocols is consistent, the first type of data frame is sent to the processing module corresponding to the second application layer protocol for processing.
一些实施方式中,第二类数据帧包括第二数据流的标识信息以及第二数据请求对应的数据信息。In some embodiments, the second type of data frame includes identification information of the second data stream and data information corresponding to the second data request.
接收模块73,还用于接收来自客户端的第二类数据帧。处理模块74,还用于根据第二类数据帧中第二数据流的标识信息以及第二数据流的标识信息与第二应用层协议的对应关系,将第二类数据帧发送给第二应用层协议对应的处理模块进行处理。The receiving module 73 is further configured to receive the second type of data frame from the client. The processing module 74 is further configured to send the second type of data frame to the second application according to the identification information of the second data stream in the second type of data frame and the corresponding relationship between the identification information of the second data stream and the second application layer protocol The processing module corresponding to the layer protocol performs processing.
一些实施方式中,第二类数据帧包括第二数据流的标识信息以及第二数据请求对应的数据信息。In some embodiments, the second type of data frame includes identification information of the second data stream and data information corresponding to the second data request.
建立模块72,具体用于确定第二应用层协议为第一QUIC会话对应的应用层协议列表中的首个应用层协议。服务端响应第二数据请求生成第二类数据帧,记录第二数据流的标识信息与第二应用层协议的对应关系。服务端向客户端发送第二类数据帧,指示客户端响应第二类数据帧,根据第一QUIC会话对应的应用层协议列表中的首个应用层协议建立第二数据流。The establishing module 72 is specifically configured to determine that the second application layer protocol is the first application layer protocol in the application layer protocol list corresponding to the first QUIC session. The server generates a second type of data frame in response to the second data request, and records the correspondence between the identification information of the second data stream and the second application layer protocol. The server sends the second type of data frame to the client, instructing the client to respond to the second type of data frame and establish the second data stream according to the first application layer protocol in the application layer protocol list corresponding to the first QUIC session.
图15示出了本申请实施例提供的另一种QUIC数据传输装置的结构框图。FIG. 15 shows a structural block diagram of another QUIC data transmission apparatus provided by an embodiment of the present application.
一些实施方式中,该装置还包括记录模块75,用于建立第一QUIC会话后,记录第一QUIC会话的引用次数,引用次数为第一QUIC会话中数据流的数量。当第一QUIC会话中建立一个数据流时,将引用次数加一。当第一QUIC会话中的一个数据流关闭时,将引用次数减一。In some embodiments, the apparatus further includes a recording module 75, configured to record the number of citations of the first QUIC session after the first QUIC session is established, where the number of citations is the number of data streams in the first QUIC session. When a data stream is established in the first QUIC session, the reference count is incremented by one. When a stream in the first QUIC session is closed, the reference count is decremented by one.
一些实施方式中,记录模块75,还用于当引用次数减为零,且经过预设的时长后引用次数未发生变化时,将第一QUIC会话关闭。In some embodiments, the recording module 75 is further configured to close the first QUIC session when the number of citations decreases to zero and the number of citations does not change after a preset duration.
一些实施方式中,建立模块72,还用于服务端与客户端建立第一QUIC会话。服务端响应来自客户的第一数据请求,建立与客户端之间的第一数据流,第一数据流用于承载第一数据请求中请求传输的数据,第一数据请求使用第一应用层协议,第一应用层协议为第 一QUIC会话对应的应用层协议列表中的应用层协议。In some embodiments, the establishing module 72 is further configured to establish the first QUIC session between the server and the client. The server responds to the first data request from the client, and establishes a first data stream with the client, where the first data stream is used to carry the data requested to be transmitted in the first data request, and the first data request uses the first application layer protocol, The first application layer protocol is an application layer protocol in the application layer protocol list corresponding to the first QUIC session.
一些实施方式中,建立模块72,具体用于接收来自客户端的会话握手请求,会话握手请求用于指示服务端与客户端之间建立第一QUIC会话。根据会话握手请求生成握手报文并发送给客户端,握手报文包括服务端支持的应用层协议。接收来自客户端的应用层协议列表和第一QUIC会话建立的确认报文。服务端根据确认报文确认建立第一QUIC会话。In some embodiments, the establishment module 72 is specifically configured to receive a session handshake request from the client, where the session handshake request is used to instruct the server and the client to establish a first QUIC session. A handshake packet is generated according to the session handshake request and sent to the client. The handshake packet includes the application layer protocol supported by the server. Receive the application layer protocol list from the client and the confirmation message for the establishment of the first QUIC session. The server confirms the establishment of the first QUIC session according to the confirmation message.
图16示出了本申请实施例提供的另一种QUIC数据传输装置的结构框图。FIG. 16 shows a structural block diagram of another QUIC data transmission apparatus provided by an embodiment of the present application.
一些实施方式中,接收模块73,还用于接收来自客户端的第一通知帧或第二通知帧,第一通知帧用于指示服务端向存储于服务端内第一QUIC会话对应的应用层协议列表中添加至少一个应用层协议,第二通知帧用于指示服务端移除存储于服务端内第一QUIC会话对应的应用层协议列表中的至少一个应用层协议。参考图16,该装置还包括更新模块76,用于根据接收到的第一通知帧或第二通知帧,更新应用层协议列表。In some embodiments, the receiving module 73 is further configured to receive the first notification frame or the second notification frame from the client, where the first notification frame is used to instruct the server to send the application layer protocol corresponding to the first QUIC session stored in the server. At least one application layer protocol is added to the list, and the second notification frame is used to instruct the server to remove at least one application layer protocol in the application layer protocol list corresponding to the first QUIC session stored in the server. Referring to FIG. 16 , the apparatus further includes an update module 76 for updating the application layer protocol list according to the received first notification frame or the second notification frame.
一些实施方式中,更新模块76,还用于响应应用层协议列表的更新指令,更新存储于服务端内的应用层协议列表。当更新指令指示向存储于服务端内的应用层协议列表中添加至少一个应用层协议时,生成第一通知帧,第一通知帧用于指示客户端向存储于客户端内第一QUIC会话对应的应用层协议列表中添加至少一个应用层协议。当更新指令指示移除存储于服务端内的应用层协议列表中的至少一个应用层协议时,生成第二通知帧,第二通知帧用于指示客户端移除存储于客户端内第一QUIC会话对应的应用层协议列表中的至少一个应用层协议。服务端将第一通知帧或第二通知帧发送给客户端。In some embodiments, the update module 76 is further configured to update the application layer protocol list stored in the server in response to the update instruction of the application layer protocol list. When the update instruction instructs to add at least one application layer protocol to the application layer protocol list stored in the server, a first notification frame is generated, and the first notification frame is used to instruct the client to correspond to the first QUIC session stored in the client Add at least one application layer protocol to the list of application layer protocols. When the update instruction instructs to remove at least one application layer protocol in the application layer protocol list stored in the server, a second notification frame is generated, and the second notification frame is used to instruct the client to remove the first QUIC stored in the client At least one application layer protocol in the application layer protocol list corresponding to the session. The server sends the first notification frame or the second notification frame to the client.
一些实施方式中,更新模块76,还用于当第二应用层协议不是第一QUIC会话对应的应用层协议列表中的应用层协议时,服务端生成应用层协议列表的更新指令,更新指令用于将第二应用层协议写入存储于服务端内第一QUIC会话对应的应用层协议列表。服务端响应更新指令,并生成第一通知帧。建立模块72,还用于当服务端将第一通知帧通过第一QUIC会话发送给客户端后,在第一QUIC会话中与客户端建立第二数据流。In some embodiments, the update module 76 is further configured to, when the second application layer protocol is not an application layer protocol in the application layer protocol list corresponding to the first QUIC session, the server generates an update instruction of the application layer protocol list, and the update instruction uses for writing the second application layer protocol into the application layer protocol list corresponding to the first QUIC session stored in the server. The server responds to the update instruction and generates a first notification frame. The establishing module 72 is further configured to establish a second data stream with the client in the first QUIC session after the server sends the first notification frame to the client through the first QUIC session.
需要说明的是,上述模块之间的信息交互、执行过程等内容,由于与本申请方法实施例基于同一构思,其具体功能及带来的技术效果,具体可参见方法实施例部分,此处不再赘述。It should be noted that the information exchange, execution process and other contents between the above modules are based on the same concept as the method embodiments of the present application, and the specific functions and technical effects brought by them can be found in the method embodiments section for details. Repeat.
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。实施例中的各功能单元、模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元、模块的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。上述系统中单元、模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. Module completion, that is, dividing the internal structure of the device into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiment may be integrated in one processing unit, or each unit may exist physically alone, or two or more units may be integrated in one unit, and the above-mentioned integrated units may adopt hardware. It can also be realized in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing from each other, and are not used to limit the protection scope of the present application. For the specific working processes of the units and modules in the above-mentioned system, reference may be made to the corresponding processes in the foregoing method embodiments, which will not be repeated here.
图17为本申请一实施例提供的QUIC客户端的结构示意图。如图17所示,该实施例的QUIC客户端800包括:至少一个处理器801(图17中仅示出一个)处理器、存储器802以及存储在存储器802中并可在至少一个处理器801上运行的计算机程序803,处理器801执行计算机程序803时实现上述应用于客户端的QUIC数据传输方法实施例中的步 骤。FIG. 17 is a schematic structural diagram of a QUIC client provided by an embodiment of the present application. As shown in FIG. 17 , the QUIC client 800 of this embodiment includes: at least one processor 801 (only one is shown in FIG. 17 ), a memory 802 , and a processor 802 stored in the memory 802 and available on the at least one processor 801 The running computer program 803, when the processor 801 executes the computer program 803, implements the steps in the above-mentioned embodiment of the QUIC data transmission method applied to the client.
QUIC客户端800可以是服务器,如台式服务器、机架式服务器、机柜式服务器、刀片式服务器等计算设备。该电子设备可包括,但不仅限于,处理器801、存储器802。本领域技术人员可以理解,图17仅仅是QUIC客户端800的举例,并不构成对QUIC客户端800的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如还可以包括输入输出设备、网络接入设备等。The QUIC client 800 may be a server, such as a computing device such as a desktop server, a rack server, a rack server, a blade server, and the like. The electronic device may include, but is not limited to, the processor 801 and the memory 802 . Those skilled in the art can understand that FIG. 17 is only an example of the QUIC client 800, and does not constitute a limitation on the QUIC client 800, and may include more or less components than the one shown, or combine some components, or different components, for example, may also include input and output devices, network access devices, and so on.
所称处理器801可以是中央处理单元(Central Processing Unit,CPU),该处理器801还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。The so-called processor 801 may be a central processing unit (Central Processing Unit, CPU), and the processor 801 may also be other general-purpose processors, digital signal processors (Digital Signal Processors, DSP), application specific integrated circuits (Application Specific Integrated Circuits) , ASIC), off-the-shelf programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
存储器802在一些实施例中可以是QUIC客户端800的内部存储单元,例如QUIC客户端800的硬盘或内存。存储器802在另一些实施例中也可以是QUIC客户端800的外部存储设备,例如QUIC客户端800上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,存储器802还可以既包括QUIC客户端800的内部存储单元也包括外部存储设备。存储器802用于存储操作系统、应用程序、引导装载程序(BootLoader)、数据以及其他程序等,例如计算机程序的程序代码等。存储器802还可以用于暂时地存储已经输出或者将要输出的数据。The memory 802 may in some embodiments be an internal storage unit of the QUIC client 800, such as a hard disk or memory of the QUIC client 800. The memory 802 may also be an external storage device of the QUIC client 800 in other embodiments, such as a pluggable hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, flash memory card (Flash Card), etc. Further, the memory 802 may also include both an internal storage unit of the QUIC client 800 and an external storage device. The memory 802 is used to store an operating system, application programs, a boot loader (Boot Loader), data, and other programs, such as program codes of computer programs, and the like. The memory 802 may also be used to temporarily store data that has been or will be output.
图18为本申请一实施例提供的QUIC服务端的结构示意图。如图18所示,该实施例的QUIC服务端900包括:至少一个处理器901(图18中仅示出一个)处理器、存储器902以及存储在存储器902中并可在至少一个处理器901上运行的计算机程序903,处理器901执行计算机程序903时实现上述应用于服务端的QUIC数据传输方法实施例中的步骤。FIG. 18 is a schematic structural diagram of a QUIC server provided by an embodiment of the present application. As shown in FIG. 18 , the QUIC server 900 of this embodiment includes: at least one processor 901 (only one is shown in FIG. 18 ), a memory 902 , and a processor 902 stored in the memory 902 and available on the at least one processor 901 The running computer program 903, when the processor 901 executes the computer program 903, implements the steps in the foregoing embodiment of the QUIC data transmission method applied to the server.
QUIC服务端900可以是服务器,如台式服务器、机架式服务器、机柜式服务器、刀片式服务器等计算设备。该电子设备可包括,但不仅限于,处理器901、存储器902。本领域技术人员可以理解,图18仅仅是QUIC服务端900的举例,并不构成对QUIC服务端900的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如还可以包括输入输出设备、网络接入设备等。The QUIC server 900 may be a server, such as a computing device such as a desktop server, a rack server, a rack server, and a blade server. The electronic device may include, but is not limited to, a processor 901 and a memory 902 . Those skilled in the art can understand that FIG. 18 is only an example of the QUIC server 900, and does not constitute a limitation on the QUIC server 900. It may include more or less components than the one shown, or combine some components, or different components, for example, may also include input and output devices, network access devices, and so on.
所称处理器901可以是中央处理单元(Central Processing Unit,CPU),该处理器901还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。The so-called processor 901 may be a central processing unit (Central Processing Unit, CPU), and the processor 901 may also be other general-purpose processors, digital signal processors (Digital Signal Processors, DSP), application specific integrated circuits (Application Specific Integrated Circuits) , ASIC), off-the-shelf programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
存储器902在一些实施例中可以是QUIC服务端900的内部存储单元,例如QUIC服务端900的硬盘或内存。存储器902在另一些实施例中也可以是QUIC服务端900的外部存储设备,例如QUIC服务端900上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,存储器902还可以既包括QUIC服务端900的内部存储单元也包括外部存储设备。存储器902用 于存储操作系统、应用程序、引导装载程序(BootLoader)、数据以及其他程序等,例如计算机程序的程序代码等。存储器902还可以用于暂时地存储已经输出或者将要输出的数据。The memory 902 may be an internal storage unit of the QUIC server 900 in some embodiments, such as a hard disk or a memory of the QUIC server 900 . In other embodiments, the memory 902 may also be an external storage device of the QUIC server 900, such as a pluggable hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, flash memory card (Flash Card), etc. Further, the memory 902 may also include both an internal storage unit of the QUIC server 900 and an external storage device. The memory 902 is used to store an operating system, application programs, a boot loader (Boot Loader), data, and other programs, such as program codes of computer programs, and the like. The memory 902 may also be used to temporarily store data that has been or will be output.
本申请实施例还提供了一种数据传输系统,包括至少一个第五方面提供的QUIC客户端和至少一个第六方面提供的QUIC服务端,QUIC客户端和QUIC服务端通过网络通信连接。数据传输系统中的QUIC客户端和QUIC服务端可通过本申请提供的QUIC数据传输方法进行数据传输。The embodiment of the present application also provides a data transmission system, including at least one QUIC client provided by the fifth aspect and at least one QUIC server provided by the sixth aspect, where the QUIC client and the QUIC server are connected through network communication. The QUIC client and QUIC server in the data transmission system can transmit data through the QUIC data transmission method provided in this application.
本申请实施例还提供了一种计算机可读存储介质,本申请实施例提供了一种计算机程序产品,当计算机程序产品在客户端上运行时,使得客户端执行上述应用于客户端的QUIC数据传输方法。Embodiments of the present application further provide a computer-readable storage medium, and embodiments of the present application provide a computer program product, when the computer program product runs on a client, the client executes the above-mentioned QUIC data transmission applied to the client method.
本申请实施例还提供了一种计算机可读存储介质,本申请实施例提供了一种计算机程序产品,当计算机程序产品在服务端上运行时,使得服务端执行上述应用于服务端的QUIC数据传输方法。Embodiments of the present application also provide a computer-readable storage medium, and embodiments of the present application provide a computer program product, which, when the computer program product runs on a server, enables the server to perform the above-mentioned QUIC data transmission applied to the server method.
本申请实施例提供了一种计算机程序产品,当计算机程序产品在移动终端上运行时,使得移动终端执行时实现可实现上述应用于客户端的QUIC数据传输方法中的步骤。The embodiments of the present application provide a computer program product, when the computer program product runs on a mobile terminal, the steps in the above-mentioned QUIC data transmission method applied to a client can be implemented when the mobile terminal executes the computer program product.
本申请实施例提供了一种计算机程序产品,当计算机程序产品在移动终端上运行时,使得移动终端执行时实现可实现上述应用于服务端的QUIC数据传输方法中的步骤。The embodiment of the present application provides a computer program product, when the computer program product runs on a mobile terminal, the steps in the above-mentioned QUIC data transmission method applied to a server can be implemented when the mobile terminal is executed.
本申请实施例提供了一种芯片系统,芯片系统包括存储器和处理器,处理器执行存储器中存储的计算机程序,以实现上述应用于客户端的QUIC数据传输方法中的步骤。An embodiment of the present application provides a chip system, the chip system includes a memory and a processor, and the processor executes a computer program stored in the memory to implement the steps in the above-mentioned QUIC data transmission method applied to a client.
本申请实施例提供了一种芯片系统,芯片系统包括存储器和处理器,处理器执行存储器中存储的计算机程序,以实现上述应用于服务端的QUIC数据传输方法中的步骤。An embodiment of the present application provides a chip system, where the chip system includes a memory and a processor, and the processor executes a computer program stored in the memory to implement the steps in the above-mentioned QUIC data transmission method applied to a server.
本申请实施例提供了一种芯片系统,芯片系统包括处理器,处理器与计算机可读存储介质耦合,处理器执行计算机可读存储介质中存储的计算机程序,以实现上述应用于客户端的QUIC数据传输方法中的步骤。An embodiment of the present application provides a chip system, the chip system includes a processor, the processor is coupled to a computer-readable storage medium, and the processor executes a computer program stored in the computer-readable storage medium, so as to realize the above-mentioned QUIC data applied to a client Steps in the transfer method.
本申请实施例提供了一种芯片系统,芯片系统包括处理器,处理器与计算机可读存储介质耦合,处理器执行计算机可读存储介质中存储的计算机程序,以实现上述应用于服务端的QUIC数据传输方法中的步骤。An embodiment of the present application provides a chip system, the chip system includes a processor, the processor is coupled to a computer-readable storage medium, and the processor executes a computer program stored in the computer-readable storage medium, so as to realize the above-mentioned QUIC data applied to the server Steps in the transfer method.
本申请提供的QUIC数据传输方法如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,可以通过计算机程序来指令相关的硬件来完成,的计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,计算机程序包括计算机程序代码,计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。计算机可读介质至少可以包括:能够将计算机程序代码携带到电子设备的任何实体或装置、记录介质、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、电载波信号、电信信号以及软件分发介质。例如U盘、移动硬盘、磁碟或者光盘等。在某些司法管辖区,根据立法和专利实践,计算机可读介质不可以是电载波信号和电信信号。If the QUIC data transmission method provided in this application is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application realizes all or part of the processes in the methods of the above-mentioned embodiments, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and the computer program is stored in a computer-readable storage medium. When executed by the processor, the steps of the foregoing method embodiments may be implemented. Wherein, the computer program includes computer program code, and the computer program code may be in the form of source code, object code, executable file or some intermediate form. The computer-readable medium may include at least: any entity or device capable of carrying computer program codes to an electronic device, a recording medium, a computer memory, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access). Memory), electrical carrier signals, telecommunications signals, and software distribution media. For example, U disk, mobile hard disk, disk or CD, etc. In some jurisdictions, under legislation and patent practice, computer readable media may not be electrical carrier signals and telecommunications signals.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。In the foregoing embodiments, the description of each embodiment has its own emphasis. For parts that are not described or described in detail in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementations should not be considered beyond the scope of this application.
在本申请所提供的实施例中,应该理解到,所揭露的方法、装置、客户端和服务端,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通讯连接可以是通过一些接口,装置或单元的间接耦合或通讯连接,可以是电性,机械或其它的形式。In the embodiments provided in this application, it should be understood that the disclosed method, apparatus, client and server may be implemented in other manners. For example, the apparatus embodiments described above are only illustrative. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。Units described as separate components may or may not be physically separated, and components shown as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
最后应说明的是:以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何在本申请揭露的技术范围内的变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。Finally, it should be noted that: the above are only specific embodiments of the present application, but the protection scope of the present application is not limited to this, and any changes or replacements within the technical scope disclosed in the present application should be covered by the present application. within the scope of protection of the application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (31)

  1. 一种QUIC数据传输方法,应用于客户端,其特征在于,所述方法包括:A QUIC data transmission method, applied to a client, characterized in that the method comprises:
    客户端响应于第二数据请求与服务端之间进行数据传输时,确定所述第二数据请求所使用的第二应用层协议;When the client performs data transmission with the server in response to the second data request, determining the second application layer protocol used by the second data request;
    当所述第二应用层协议为第一QUIC会话对应的应用层协议列表中的应用层协议时,在所述第一QUIC会话中建立第二数据流,所述第二数据流用于承载所述第二数据请求中请求传输的数据,所述第一QUIC会话为所述客户端响应第一数据请求时,与所述服务端建立的QUIC会话,所述第一QUIC会话对应的应用层协议列表包括所述客户端和所述服务端同时支持的应用层协议。When the second application layer protocol is an application layer protocol in the application layer protocol list corresponding to the first QUIC session, a second data stream is established in the first QUIC session, and the second data stream is used to carry the The data requested to be transmitted in the second data request, the first QUIC session is the QUIC session established with the server when the client responds to the first data request, and the list of application layer protocols corresponding to the first QUIC session Including the application layer protocols supported by the client and the server at the same time.
  2. 根据权利要求1所述的方法,其特征在于,所述在所述第一QUIC会话中建立第二数据流,包括:The method according to claim 1, wherein the establishing the second data flow in the first QUIC session comprises:
    所述客户端响应所述第二数据请求生成第一类数据帧,所述第一类数据帧包括所述第二应用层协议、所述第二数据流的标识信息以及所述第二数据请求对应的数据信息,记录所述第二数据流的标识信息与所述第二应用层协议的对应关系;The client generates a first type of data frame in response to the second data request, where the first type of data frame includes the second application layer protocol, the identification information of the second data stream, and the second data request Corresponding data information, recording the corresponding relationship between the identification information of the second data stream and the second application layer protocol;
    所述客户端向所述服务端发送所述第一类数据帧,指示所述服务端根据所述第一类数据帧中的第二应用层协议建立第二数据流。The client sends the first type of data frame to the server, and instructs the server to establish a second data stream according to the second application layer protocol in the first type of data frame.
  3. 根据权利要求2所述的方法,其特征在于,在所述客户端向所述服务端发送所述第一类数据帧之后,还包括:The method according to claim 2, wherein after the client sends the first type of data frame to the server, the method further comprises:
    所述客户端接收来自所述服务端的所述第一类数据帧;the client receives the first type of data frame from the server;
    当所述客户端确定所述第一类数据帧中所述第二数据流的标识信息与所述第二应用层协议的对应关系,与所述客户端记录的所述第二数据流的标识信息与所述第二应用层协议的对应关系一致时,将所述第一类数据帧发送给所述第二应用层协议对应的处理模块进行处理。When the client determines the correspondence between the identification information of the second data stream in the first type of data frame and the second application layer protocol, and the identifier of the second data stream recorded by the client When the information is consistent with the corresponding relationship of the second application layer protocol, the first type of data frame is sent to the processing module corresponding to the second application layer protocol for processing.
  4. 根据权利要求2或3所述的方法,其特征在于,第二类数据帧包括所述第二数据流的标识信息以及所述第二数据请求对应的数据信息;The method according to claim 2 or 3, wherein the second type of data frame includes identification information of the second data stream and data information corresponding to the second data request;
    在所述客户端向所述服务端发送所述第一类数据帧之后,还包括:After the client sends the first type of data frame to the server, the method further includes:
    所述客户端接收来自所述服务端的所述第二类数据帧;the client receives the second type of data frame from the server;
    所述客户端根据所述第二类数据帧中所述第二数据流的标识信息以及所述第二数据流的标识信息与所述第二应用层协议的对应关系,将所述第二类数据帧发送给所述第二应用层协议对应的处理模块进行处理。The client, according to the identification information of the second data stream in the second type of data frame and the corresponding relationship between the identification information of the second data stream and the second application layer protocol, assigns the second type of data to the second type of data stream. The data frame is sent to the processing module corresponding to the second application layer protocol for processing.
  5. 根据权利要求1所述的方法,其特征在于,第二类数据帧包括所述第二数据流的标识信息以及所述第二数据请求对应的数据信息;The method according to claim 1, wherein the second type of data frame includes identification information of the second data stream and data information corresponding to the second data request;
    所述客户端在所述第一QUIC会话中与所述服务端建立第二数据流,包括:The client establishes a second data stream with the server in the first QUIC session, including:
    所述客户端确定所述第二应用层协议为所述第一QUIC会话对应的应用层协议列表中的首个应用层协议;The client determines that the second application layer protocol is the first application layer protocol in the application layer protocol list corresponding to the first QUIC session;
    所述客户端响应所述第二数据请求生成第二类数据帧,记录所述第二数据流的标识信息与所述第二应用层协议的对应关系;The client generates a second type of data frame in response to the second data request, and records the correspondence between the identification information of the second data stream and the second application layer protocol;
    所述客户端向所述服务端发送所述第二类数据帧,指示所述服务端响应所述第二类数据帧,根据所述第一QUIC会话对应的应用层协议列表中的首个应用层协议建立第二数据 流。The client sends the second type of data frame to the server, instructing the server to respond to the second type of data frame, according to the first application in the application layer protocol list corresponding to the first QUIC session The layer protocol establishes the second data stream.
  6. 根据权利要求1-5任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1-5, wherein the method further comprises:
    当建立所述第一QUIC会话后,所述客户端记录所述第一QUIC会话的引用次数,所述引用次数为所述第一QUIC会话中数据流的数量;After the first QUIC session is established, the client records the number of citations of the first QUIC session, where the number of citations is the number of data streams in the first QUIC session;
    当所述第一QUIC会话中建立一个数据流时,将所述引用次数加一;When a data stream is established in the first QUIC session, add one to the number of references;
    当所述第一QUIC会话中的一个数据流关闭时,将所述引用次数减一。When a data stream in the first QUIC session is closed, the reference count is decremented by one.
  7. 根据权利要求6所述的方法,其特征在于,所述方法还包括:The method according to claim 6, wherein the method further comprises:
    当所述引用次数减为零,且经过预设的时长后所述引用次数未发生变化时,所述客户端将所述第一QUIC会话关闭。When the number of references is reduced to zero and the number of references does not change after a preset time period, the client closes the first QUIC session.
  8. 根据权利要求1-7任一项所述的方法,其特征在于,在客户端响应于第二数据请求之前,所述方法还包括:The method according to any one of claims 1-7, wherein before the client responds to the second data request, the method further comprises:
    响应第一数据请求与服务端建立第一QUIC会话,并生成所述第一QUIC会话对应的应用层协议列表;establishing a first QUIC session with the server in response to the first data request, and generating an application layer protocol list corresponding to the first QUIC session;
    在所述第一QUIC会话中建立第一数据流,所述第一数据流用于承载所述第一数据请求中请求传输的数据,所述第一数据请求使用第一应用层协议,所述第一应用层协议为所述第一QUIC会话对应的应用层协议列表中的应用层协议。A first data flow is established in the first QUIC session, where the first data flow is used to carry the data requested to be transmitted in the first data request, the first data request uses a first application layer protocol, and the first data flow An application layer protocol is an application layer protocol in the application layer protocol list corresponding to the first QUIC session.
  9. 根据权利要求8所述的方法,其特征在于,所述响应第一数据请求与服务端建立第一QUIC会话,并生成所述第一QUIC会话对应的应用层协议列表,包括:The method according to claim 8, wherein establishing a first QUIC session with a server in response to the first data request, and generating an application layer protocol list corresponding to the first QUIC session, comprising:
    所述客户端响应所述第一数据请求,向所述服务端发送建立第一QUIC会话的会话握手请求;The client sends a session handshake request for establishing a first QUIC session to the server in response to the first data request;
    所述客户端接收来自所述服务端的握手报文,所述握手报文是所述服务端根据所述会话握手请求生成的,所述握手报文包括所述服务端支持的应用层协议;The client receives a handshake message from the server, the handshake message is generated by the server according to the session handshake request, and the handshake message includes an application layer protocol supported by the server;
    根据所述客户端支持的应用层协议和所述服务端支持的应用层协议,生成所述第一QUIC会话对应的应用层协议列表;generating an application layer protocol list corresponding to the first QUIC session according to the application layer protocol supported by the client and the application layer protocol supported by the server;
    所述客户端根据所述握手报文建立所述第一QUIC会话,并将所述第一QUIC会话对应的应用层协议列表和所述第一QUIC会话建立的确认报文通过所述第一QUCI会话发送给所述服务端。The client establishes the first QUIC session according to the handshake message, and passes the application layer protocol list corresponding to the first QUIC session and the confirmation message established by the first QUIC session through the first QUCI The session is sent to the server.
  10. 根据权利要求1-9任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1-9, wherein the method further comprises:
    所述客户端接收来自所述服务端的第一通知帧或第二通知帧,所述第一通知帧用于指示所述客户端向存储于所述客户端内所述第一QUIC会话对应的应用层协议列表中添加至少一个应用层协议,所述第二通知帧用于指示所述客户端移除存储于所述客户端内所述第一QUIC会话对应的应用层协议列表中的至少一个应用层协议;The client receives a first notification frame or a second notification frame from the server, where the first notification frame is used to instruct the client to send an application corresponding to the first QUIC session stored in the client At least one application layer protocol is added to the layer protocol list, and the second notification frame is used to instruct the client to remove at least one application stored in the application layer protocol list corresponding to the first QUIC session in the client layer protocol;
    所述客户端根据接收到的第一通知帧或第二通知帧,更新所述应用层协议列表。The client updates the application layer protocol list according to the received first notification frame or the second notification frame.
  11. 根据权利要求1-9任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1-9, wherein the method further comprises:
    所述客户端响应应用层协议列表的更新指令,更新存储于所述客户端内的应用层协议列表;The client responds to the update instruction of the application layer protocol list, and updates the application layer protocol list stored in the client;
    当所述更新指令指示向所述存储于所述客户端内的应用层协议列表中添加至少一个应用层协议时,生成第一通知帧,所述第一通知帧用于指示所述服务端向存储于所述服务端内所述第一QUIC会话对应的应用层协议列表中添加至少一个应用层协议;When the update instruction instructs to add at least one application layer protocol to the application layer protocol list stored in the client, a first notification frame is generated, and the first notification frame is used to instruct the server to send adding at least one application layer protocol to the application layer protocol list corresponding to the first QUIC session stored in the server;
    当所述更新指令指示移除所述存储于所述客户端内的应用层协议列表中的至少一个应用层协议时,生成第二通知帧,所述第二通知帧用于指示所述服务端移除存储于所述服务端内所述第一QUIC会话对应的应用层协议列表中的至少一个应用层协议;When the update instruction instructs to remove at least one application layer protocol in the application layer protocol list stored in the client, a second notification frame is generated, and the second notification frame is used to instruct the server removing at least one application layer protocol in the application layer protocol list corresponding to the first QUIC session stored in the server;
    所述客户端将所述第一通知帧或所述第二通知帧发送给所述服务端。The client sends the first notification frame or the second notification frame to the server.
  12. 根据权利要求11所述的方法,其特征在于,所述方法还包括:The method according to claim 11, wherein the method further comprises:
    当所述第二应用层协议不是所述第一QUIC会话对应的应用层协议列表中的应用层协议时,所述客户端生成应用层协议列表的更新指令,所述更新指令用于将所述第二应用层协议写入存储于所述客户端内所述第一QUIC会话对应的应用层协议列表;When the second application layer protocol is not an application layer protocol in the application layer protocol list corresponding to the first QUIC session, the client generates an update instruction of the application layer protocol list, where the update instruction is used to update the The second application layer protocol is written into the application layer protocol list corresponding to the first QUIC session stored in the client;
    所述客户端响应所述更新指令,并生成所述第一通知帧;the client responds to the update instruction and generates the first notification frame;
    当所述客户端将所述第一通知帧通过第一QUIC会话发送给所述服务端后,在所述第一QUIC会话中与所述服务端建立第二数据流。After the client sends the first notification frame to the server through the first QUIC session, a second data stream is established with the server in the first QUIC session.
  13. 一种QUIC数据传输方法,应用于服务端,其特征在于,所述方法包括:A QUIC data transmission method, applied to a server, characterized in that the method comprises:
    服务端响应于第二数据请求与客户端之间进行数据传输时,确定所述第二数据请求所使用的第二应用层协议;When the server performs data transmission with the client in response to the second data request, determining the second application layer protocol used by the second data request;
    当所述第二应用层协议为第一QUIC会话对应的应用层协议列表中的应用层协议时,在所述第一QUIC会话中建立第二数据流,所述第二数据流用于承载所述第二数据请求中请求传输的数据,所述第一QUIC会话为所述客户端响应第一数据请求时,与所述服务端建立的QUIC会话,所述第一QUIC会话对应的所述应用层协议列表包括所述客户端和所述服务端同时支持的应用层协议。When the second application layer protocol is an application layer protocol in the application layer protocol list corresponding to the first QUIC session, a second data stream is established in the first QUIC session, and the second data stream is used to carry the The data requested to be transmitted in the second data request, the first QUIC session is the QUIC session established with the server when the client responds to the first data request, and the application layer corresponding to the first QUIC session The protocol list includes the application layer protocols supported by the client and the server at the same time.
  14. 根据权利要求13所述的方法,其特征在于,所述在所述第一QUIC会话中建立第二数据流,包括:The method according to claim 13, wherein the establishing the second data flow in the first QUIC session comprises:
    所述服务端响应所述第二数据请求生成第一类数据帧,所述第一类数据帧包括所述第二应用层协议、所述第二数据流的标识信息以及所述第二数据请求对应的数据信息,记录所述第二数据流的标识信息与所述第二应用层协议的对应关系;The server generates a first type of data frame in response to the second data request, where the first type of data frame includes the second application layer protocol, the identification information of the second data stream, and the second data request Corresponding data information, recording the corresponding relationship between the identification information of the second data stream and the second application layer protocol;
    所述服务端向所述客户端发送所述第一类数据帧,指示所述客户端根据所述第一类数据帧中的第二应用层协议建立第二数据流。The server sends the first type of data frame to the client, and instructs the client to establish a second data stream according to the second application layer protocol in the first type of data frame.
  15. 根据权利要求13所述的方法,其特征在于,在所述服务端向所述客户端发送所述第一类数据帧之后,还包括:The method according to claim 13, wherein after the server sends the first type of data frame to the client, the method further comprises:
    所述服务端接收来自所述客户端的所述第一类数据帧;receiving, by the server, the first type of data frame from the client;
    当所述服务端确定所述第一类数据帧中所述第二数据流的标识信息与所述第二应用层协议的对应关系,与所述服务端记录的所述第二数据流的标识信息与所述第二应用层协议的对应关系一致时,将所述第一类数据帧发送给所述第二应用层协议对应的处理模块进行处理。When the server determines the correspondence between the identification information of the second data stream in the first type of data frame and the second application layer protocol, and the identifier of the second data stream recorded by the server When the information is consistent with the corresponding relationship of the second application layer protocol, the first type of data frame is sent to the processing module corresponding to the second application layer protocol for processing.
  16. 根据权利要求14或15所述的方法,其特征在于,第二类数据帧包括所述第二数据流的标识信息以及所述第二数据请求对应的数据信息;The method according to claim 14 or 15, wherein the second type of data frame includes identification information of the second data stream and data information corresponding to the second data request;
    在所述服务端向所述客户端发送所述第一类数据帧之后,还包括:After the server sends the first type of data frame to the client, the method further includes:
    所述服务端接收来自所述客户端的所述第二类数据帧;The server receives the second type of data frame from the client;
    所述服务端根据所述第二类数据帧中所述第二数据流的标识信息以及所述第二数据流的标识信息与所述第二应用层协议的对应关系,将所述第二类数据帧发送给所述第二应 用层协议对应的处理模块进行处理。According to the identification information of the second data stream in the second type of data frame and the corresponding relationship between the identification information of the second data stream and the second application layer protocol, the server The data frame is sent to the processing module corresponding to the second application layer protocol for processing.
  17. 根据权利要求13所述的方法,其特征在于,第二类数据帧包括所述第二数据流的标识信息以及所述第二数据请求对应的数据信息;The method according to claim 13, wherein the second type of data frame includes identification information of the second data stream and data information corresponding to the second data request;
    所述服务端在所述第一QUIC会话中与所述客户端建立第二数据流,包括:The server establishes a second data stream with the client in the first QUIC session, including:
    所述服务端确定所述第二应用层协议为所述第一QUIC会话对应的应用层协议列表中的首个应用层协议;The server determines that the second application layer protocol is the first application layer protocol in the application layer protocol list corresponding to the first QUIC session;
    所述服务端响应所述第二数据请求生成第二类数据帧,记录所述第二数据流的标识信息与所述第二应用层协议的对应关系;The server generates a second type of data frame in response to the second data request, and records the correspondence between the identification information of the second data stream and the second application layer protocol;
    所述服务端向所述客户端发送所述第二类数据帧,指示所述客户端响应所述第二类数据帧,根据所述第一QUIC会话对应的应用层协议列表中的首个应用层协议建立第二数据流。The server sends the second type of data frame to the client, instructing the client to respond to the second type of data frame, according to the first application in the application layer protocol list corresponding to the first QUIC session The layer protocol establishes the second data flow.
  18. 根据权利要求13-17任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 13-17, wherein the method further comprises:
    建立所述第一QUIC会话后,所述服务端记录所述第一QUIC会话的引用次数,所述引用次数为所述第一QUIC会话中数据流的数量;After the first QUIC session is established, the server records the number of citations of the first QUIC session, where the number of citations is the number of data streams in the first QUIC session;
    当所述第一QUIC会话中建立一个数据流时,将所述引用次数加一;When a data stream is established in the first QUIC session, add one to the number of references;
    当所述第一QUIC会话中的一个数据流关闭时,将所述引用次数减一。When a data stream in the first QUIC session is closed, the reference count is decremented by one.
  19. 根据权利要求18所述的方法,其特征在于,所述方法还包括:The method of claim 18, wherein the method further comprises:
    当所述引用次数减为零,且经过预设的时长后所述引用次数未发生变化时,所述服务端将所述第一QUIC会话关闭。When the number of references is reduced to zero and the number of references does not change after a preset time period, the server closes the first QUIC session.
  20. 根据权利要求13-19任一项所述的方法,其特征在于,在服务端响应于第二数据请求之前,所述方法还包括:The method according to any one of claims 13-19, wherein before the server responds to the second data request, the method further comprises:
    所述服务端与所述客户端建立第一QUIC会话;establishing a first QUIC session between the server and the client;
    所述服务端响应来自客户的第一数据请求,建立与所述客户端之间的第一数据流,所述第一数据流用于承载所述第一数据请求中请求传输的数据,所述第一数据请求使用第一应用层协议,所述第一应用层协议为所述第一QUIC会话对应的应用层协议列表中的应用层协议。In response to the first data request from the client, the server establishes a first data stream with the client, where the first data stream is used to carry the data requested to be transmitted in the first data request, and the first data stream is used to carry the data requested to be transmitted in the first data request. A data request uses a first application layer protocol, where the first application layer protocol is an application layer protocol in the application layer protocol list corresponding to the first QUIC session.
  21. 根据权利要求20所述的方法,其特征在于,所述服务端与所述客户端建立第一QUIC会话,包括:The method according to claim 20, wherein establishing the first QUIC session between the server and the client comprises:
    接收来自所述客户端的会话握手请求,所述会话握手请求用于指示所述服务端与所述客户端之间建立第一QUIC会话;receiving a session handshake request from the client, where the session handshake request is used to instruct the server and the client to establish a first QUIC session;
    根据所述会话握手请求生成握手报文并发送给所述客户端,所述握手报文包括所述服务端支持的应用层协议;Generate a handshake message according to the session handshake request and send it to the client, where the handshake message includes an application layer protocol supported by the server;
    接收来自所述客户端的所述应用层协议列表和所述第一QUIC会话建立的确认报文;receiving the application layer protocol list from the client and the confirmation message of the establishment of the first QUIC session;
    所述服务端根据所述确认报文确认建立所述第一QUIC会话。The server confirms the establishment of the first QUIC session according to the confirmation message.
  22. 根据权利要求13-21任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 13-21, wherein the method further comprises:
    所述服务端接收来自所述客户端的第一通知帧或第二通知帧,所述第一通知帧用于指示所述服务端向存储于所述服务端内所述第一QUIC会话对应的应用层协议列表中添加至少一个应用层协议,所述第二通知帧用于指示所述服务端移除存储于所述服务端内所述第一QUIC会话对应的应用层协议列表中的至少一个应用层协议;The server receives the first notification frame or the second notification frame from the client, where the first notification frame is used to instruct the server to send the application corresponding to the first QUIC session stored in the server At least one application layer protocol is added to the layer protocol list, and the second notification frame is used to instruct the server to remove at least one application stored in the application layer protocol list corresponding to the first QUIC session in the server layer protocol;
    所述服务端根据接收到的第一通知帧或第二通知帧,更新所述第一QUIC会话对应的所述应用层协议列表。The server updates the application layer protocol list corresponding to the first QUIC session according to the received first notification frame or the second notification frame.
  23. 根据权利要求13-21任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 13-21, wherein the method further comprises:
    所述服务端响应应用层协议列表的更新指令,更新存储于所述服务端内的应用层协议列表;The server responds to the update instruction of the application layer protocol list, and updates the application layer protocol list stored in the server;
    当所述更新指令指示向所述存储于所述服务端内的应用层协议列表中添加至少一个应用层协议时,生成第一通知帧,所述第一通知帧用于指示所述客户端向存储于所述客户端内所述第一QUIC会话对应的应用层协议列表中添加至少一个应用层协议;When the update instruction instructs to add at least one application layer protocol to the application layer protocol list stored in the server, a first notification frame is generated, and the first notification frame is used to instruct the client to send adding at least one application layer protocol to the application layer protocol list corresponding to the first QUIC session stored in the client;
    当所述更新指令指示移除所述存储于所述服务端内的应用层协议列表中的至少一个应用层协议时,生成第二通知帧,所述第二通知帧用于指示所述客户端移除存储于所述客户端内所述第一QUIC会话对应的应用层协议列表中的至少一个应用层协议;When the update instruction instructs to remove at least one application layer protocol in the application layer protocol list stored in the server, a second notification frame is generated, and the second notification frame is used to instruct the client removing at least one application layer protocol stored in the application layer protocol list corresponding to the first QUIC session in the client;
    所述服务端将所述第一通知帧或所述第二通知帧发送给所述客户端。The server sends the first notification frame or the second notification frame to the client.
  24. 根据权利要求23所述的方法,其特征在于,所述方法还包括:The method of claim 23, wherein the method further comprises:
    当所述第二应用层协议不是所述第一QUIC会话对应的应用层协议列表中的应用层协议时,所述服务端生成应用层协议列表的更新指令,所述更新指令用于将所述第二应用层协议写入存储于所述服务端内的所述第一QUIC会话对应的应用层协议列表;When the second application layer protocol is not an application layer protocol in the application layer protocol list corresponding to the first QUIC session, the server generates an update instruction of the application layer protocol list, and the update instruction is used to update the The second application layer protocol is written into the application layer protocol list corresponding to the first QUIC session stored in the server;
    所述服务端响应所述更新指令,并生成所述第一通知帧;The server responds to the update instruction and generates the first notification frame;
    当所述服务端将所述第一通知帧通过第一QUIC会话发送给所述客户端后,在所述第一QUIC会话中与所述客户端建立第二数据流。After the server sends the first notification frame to the client through the first QUIC session, a second data stream is established with the client in the first QUIC session.
  25. 一种QUIC数据传输装置,应用于客户端,其特征在于,所述装置包括:A QUIC data transmission device, applied to a client, characterized in that the device comprises:
    确定模块,用于响应于第二数据请求与服务端之间进行数据传输时,确定所述第二数据请求所使用的第二应用层协议;a determining module, configured to determine the second application layer protocol used by the second data request in response to the data transmission between the second data request and the server;
    建立模块,用于当所述第二应用层协议为第一QUIC会话对应的应用层协议列表中的应用层协议时,在所述第一QUIC会话中建立第二数据流,所述第二数据流用于承载所述第二数据请求中请求传输的数据,所述第一QUIC会话为所述客户端响应第一数据请求时,与所述服务端建立的QUIC会话,所述第一QUIC会话对应的应用层协议列表包括所述客户端和所述服务端同时支持的应用层协议。An establishment module, configured to establish a second data stream in the first QUIC session when the second application layer protocol is an application layer protocol in the application layer protocol list corresponding to the first QUIC session, the second data stream The stream is used to carry the data requested to be transmitted in the second data request, the first QUIC session is the QUIC session established with the server when the client responds to the first data request, and the first QUIC session corresponds to The application layer protocol list includes the application layer protocols supported by the client and the server at the same time.
  26. 一种QUIC数据传输装置,应用于服务端,其特征在于,所述装置包括:A QUIC data transmission device, applied to a server, characterized in that the device comprises:
    确定模块,用于响应于第二数据请求与客户端之间进行数据传输时,确定所述第二数据请求所使用的第二应用层协议;a determining module, configured to determine the second application layer protocol used by the second data request when performing data transmission with the client in response to the second data request;
    建立模块,用于当所述第二应用层协议为第一QUIC会话对应的应用层协议列表中的应用层协议时,在所述第一QUIC会话中建立第二数据流,所述第二数据流用于承载所述第二数据请求中请求传输的数据,所述第一QUIC会话为所述客户端响应第一数据请求时,与所述服务端建立的QUIC会话,所述第一QUIC会话对应的应用层协议列表包括所述客户端和所述服务端同时支持的应用层协议。An establishment module, configured to establish a second data stream in the first QUIC session when the second application layer protocol is an application layer protocol in the application layer protocol list corresponding to the first QUIC session, the second data stream The stream is used to carry the data requested to be transmitted in the second data request, the first QUIC session is the QUIC session established with the server when the client responds to the first data request, and the first QUIC session corresponds to The application layer protocol list includes the application layer protocols supported by the client and the server at the same time.
  27. 一种QUIC客户端,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现如权利要求1至12任一项所述的方法。A QUIC client, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, when the processor executes the computer program, the implementation of claim 1 The method of any one of to 12.
  28. 一种QUIC服务端,包括存储器、处理器以及存储在所述存储器中并可在所述处理 器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现如权利要求13至24任一项所述的方法。A QUIC server, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, when the processor executes the computer program, the implementation of claim 13 The method of any one of to 24.
  29. 一种数据传输系统,其特征在于,包括至少一个权利要求27所述的QUIC客户端和至少一个权利要求28所述的QUIC服务端,所述QUIC客户端和所述QUIC服务端通过网络通信连接。A data transmission system, characterized in that it includes at least one QUIC client according to claim 27 and at least one QUIC server according to claim 28, wherein the QUIC client and the QUIC server are connected through network communication .
  30. 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至12任一项所述的方法。A computer-readable storage medium storing a computer program, characterized in that, when the computer program is executed by a processor, the method according to any one of claims 1 to 12 is implemented.
  31. 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求13至24任一项所述的方法。A computer-readable storage medium storing a computer program, characterized in that, when the computer program is executed by a processor, the method according to any one of claims 13 to 24 is implemented.
PCT/CN2022/084139 2021-04-26 2022-03-30 Method and apparatus for data transmission using quic, client, and server WO2022228011A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110456892.6 2021-04-26
CN202110456892.6A CN115334138B (en) 2021-04-26 2021-04-26 QUIC data transmission method and device, client and server

Publications (1)

Publication Number Publication Date
WO2022228011A1 true WO2022228011A1 (en) 2022-11-03

Family

ID=83847776

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/084139 WO2022228011A1 (en) 2021-04-26 2022-03-30 Method and apparatus for data transmission using quic, client, and server

Country Status (2)

Country Link
CN (1) CN115334138B (en)
WO (1) WO2022228011A1 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116248631B (en) * 2022-12-02 2024-05-14 中国互联网络信息中心 DoQ priority setting method and system
CN115580667B (en) * 2022-12-12 2023-03-24 腾讯科技(深圳)有限公司 Data transmission method, device, equipment and storage medium
CN117149476A (en) * 2023-01-13 2023-12-01 荣耀终端有限公司 Fault reporting method and related device
CN116185429B (en) * 2023-05-05 2023-07-07 成都市易冲半导体有限公司 Firmware upgrading method, device, receiving terminal equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102065017A (en) * 2010-12-31 2011-05-18 成都市华为赛门铁克科技有限公司 Message processing method and device
CN107666486A (en) * 2017-09-27 2018-02-06 清华大学 A kind of network data flow restoration methods and system based on message protocol feature
CN110809899A (en) * 2017-10-20 2020-02-18 Oppo广东移动通信有限公司 Method for transmitting data, terminal equipment and network equipment
WO2021009553A1 (en) * 2019-07-18 2021-01-21 Telefonaktiebolaget Lm Ericsson (Publ) Method and system for in-band signaling in a quic session

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3753235B1 (en) * 2018-04-13 2024-02-28 Samsung Electronics Co., Ltd. Method and system for handling data path creation in wireless network system
EP3844922A1 (en) * 2018-08-27 2021-07-07 Telefonaktiebolaget LM Ericsson (publ) A method of detecting quick user datagram protocol internet connections, quic, traffic in a telecommunication network between a user equipment, ue, and a content provider, cp
CN110149388B (en) * 2019-05-16 2023-02-24 北京字节跳动网络技术有限公司 Method, device and equipment for connecting HTTPDNS (hypertext transport protocol version transport protocol DNS) server
CN111064792A (en) * 2019-12-19 2020-04-24 北京航天云路有限公司 Method for accelerating data acquisition of sensor equipment based on QUIC protocol

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102065017A (en) * 2010-12-31 2011-05-18 成都市华为赛门铁克科技有限公司 Message processing method and device
CN107666486A (en) * 2017-09-27 2018-02-06 清华大学 A kind of network data flow restoration methods and system based on message protocol feature
CN110809899A (en) * 2017-10-20 2020-02-18 Oppo广东移动通信有限公司 Method for transmitting data, terminal equipment and network equipment
WO2021009553A1 (en) * 2019-07-18 2021-01-21 Telefonaktiebolaget Lm Ericsson (Publ) Method and system for in-band signaling in a quic session

Also Published As

Publication number Publication date
CN115334138A (en) 2022-11-11
CN115334138B (en) 2023-09-01

Similar Documents

Publication Publication Date Title
WO2022228011A1 (en) Method and apparatus for data transmission using quic, client, and server
WO2020244623A1 (en) Air-mouse mode implementation method and related device
US11736224B2 (en) Data transmission method and electronic device
WO2021052178A1 (en) Wi-fi connection method and device
EP4156625A1 (en) Data synchronization method, electronic device, and computer readable storage medium
WO2022083386A1 (en) Screen projection method and system, and electronic device
US11848016B2 (en) Voice control command generation method and terminal
US11412437B2 (en) Data transmission method and electronic device
US11997736B2 (en) Connection establishment method and terminal device
US20230198934A1 (en) Reverse address resolution method and electronic device
CN114979021B (en) Data processing method and electronic equipment
CN113810451B (en) Method and device for establishing point-to-point link, first terminal equipment and storage medium
WO2021043250A1 (en) Bluetooth communication method, and related device
CN114006712A (en) Method, electronic equipment and system for acquiring verification code
WO2021218544A1 (en) Wireless connection providing system, method, and electronic apparatus
WO2024093614A1 (en) Device input method and system, and electronic device and storage medium
WO2022222691A1 (en) Call processing method and related device
WO2022068486A1 (en) Data sending method, electronic device, chip system, and storage medium
WO2024037040A9 (en) Data processing method and electronic device
EP4362507A1 (en) Communication system and communication method
CN114172860B (en) Mail processing method and device
WO2021227820A1 (en) Method and device for negotiating permission during communication process, and electronic apparatus
WO2023001044A1 (en) Data processing method and electronic device
WO2023226881A1 (en) Device registration method and system, and device
CN114980152A (en) Method for improving voice call quality

Legal Events

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

Ref document number: 22794484

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 22794484

Country of ref document: EP

Kind code of ref document: A1