WO2023202243A1 - 数据处理方法、装置、计算机设备及存储介质 - Google Patents

数据处理方法、装置、计算机设备及存储介质 Download PDF

Info

Publication number
WO2023202243A1
WO2023202243A1 PCT/CN2023/079758 CN2023079758W WO2023202243A1 WO 2023202243 A1 WO2023202243 A1 WO 2023202243A1 CN 2023079758 W CN2023079758 W CN 2023079758W WO 2023202243 A1 WO2023202243 A1 WO 2023202243A1
Authority
WO
WIPO (PCT)
Prior art keywords
data packet
target
packet
redundant
data
Prior art date
Application number
PCT/CN2023/079758
Other languages
English (en)
French (fr)
Inventor
包增辉
Original Assignee
腾讯科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 腾讯科技(深圳)有限公司 filed Critical 腾讯科技(深圳)有限公司
Publication of WO2023202243A1 publication Critical patent/WO2023202243A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0823Configuration setting characterised by the purposes of a change of settings, e.g. optimising configuration for enhancing reliability
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0823Configuration setting characterised by the purposes of a change of settings, e.g. optimising configuration for enhancing reliability
    • H04L41/083Configuration setting characterised by the purposes of a change of settings, e.g. optimising configuration for enhancing reliability for increasing network speed
    • 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/40Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass for recovering from a failure of a protocol instance or entity, e.g. service redundancy protocols, protocol state redundancy or protocol service redirection

Definitions

  • This application relates to the field of Internet technology, especially to the field of data transmission technology, and specifically to a data processing method, device, computer equipment and storage medium.
  • Internet services such as game services, audio and video services, etc.
  • the data sender usually encapsulates the data into one or more data packets for transmission, and the data receiver reconstructs the transmitted data by parsing these data packets; during the transmission process of data packets, weak network (such as poor network signal), network congestion (For example, congestion caused by a large amount of data transmitted in the network) and other situations will lead to packet loss (i.e., data packet loss). Packet loss will make the data reconstructed by the data receiver incomplete. Therefore, Internet services usually require solving the problem of data packets being transmitted during transmission. Problems lost in the process.
  • ARQ Automatic Repeat-reQuest
  • ARQ stipulates that the data receiver immediately sends a request to the data packet after receiving the data packet from the data sender. The data sender returns the confirmation frame of the data packet. If the data sender does not receive the confirmation frame of the data packet after sending the data packet for a period of time, the data sender will think that the data packet was lost during transmission and will resend the data. Bag.
  • Embodiments of the present application provide a data processing method, device, computer equipment and storage medium, which can reduce data transmission delay in the case of packet loss and improve data transmission efficiency.
  • the embodiment of the present application provides a data processing method, which is executed by a data sending device.
  • the data processing method includes:
  • the original data packet group includes M original data packets.
  • the M original data packets are obtained by encapsulating the business data to be transmitted according to the transmission protocol.
  • the packet format defined by the transmission protocol is non-redundant. Rest recovery format, M is a positive integer; obtain the corresponding first data packet of each original data packet in the original data packet group Redundant recovery parameters; perform splicing processing on each original data packet in the original data packet group and the corresponding first redundant recovery parameter to obtain M target data packets, and the M target data packets constitute the target data packet group,
  • the first redundancy recovery parameter in each target data packet is used to indicate that the target data packet is in a redundant recovery format, and the target data packet in the redundant recovery format supports redundancy recovery processing;
  • the target data packet group is sent To the data receiving device, generate N target redundant packets corresponding to the target data packet group, where N is a positive integer less than or equal to M; send the N target redundant packets to the data receiving device so that the data can be received
  • the embodiment of the present application provides another data processing method, which is executed by the data receiving device.
  • the data processing method includes:
  • Receive a target data packet group from a data sending device wherein the data sending device obtains an original data packet group to be sent, the original data packet group includes M original data packets, and the M original data packets are transmitted according to
  • the protocol is obtained by encapsulating the business data to be transmitted.
  • the packet format defined by the transmission protocol is a non-redundant recovery format, and M is a positive integer; the data sending device obtains each original data packet in the original data packet group.
  • Each original data packet in the original data packet group and the corresponding first redundant recovery parameter are respectively spliced together to obtain the target data including M target data packets.
  • Packet group wherein, the first redundancy recovery parameter in each target data packet is used to indicate that the target data packet is in a redundant recovery format, and the target data packet in the redundant recovery format supports redundancy recovery processing;
  • N target redundant packets from the data sending device, the N target redundant packets correspond to the target data packet group, and N is a positive integer less than or equal to M;
  • the lost data packet is obtained through redundancy recovery processing based on the N target redundant packets.
  • An embodiment of the present application provides a data processing device, which includes:
  • the acquisition unit is used to obtain the original data packet group to be sent.
  • the original data packet group includes M original data packets.
  • the M original data packets are obtained by encapsulating the business data to be transmitted according to the transmission protocol.
  • the transmission protocol defines The packet format is a non-redundant recovery format, and M is a positive integer; obtain the first redundancy recovery parameter corresponding to each original data packet in the original data packet group;
  • a processing unit configured to perform splicing processing on each original data packet in the original data packet group and the corresponding first redundant recovery parameter to obtain M target data packets, and the M target data packets constitute the target data packet group.
  • the first redundancy recovery parameter in each target data packet is used to indicate that the target data packet is in a redundant recovery format, and the target data packet in the redundant recovery format supports redundancy recovery processing;
  • the target data packet group Sent to data receiving device, Generate N target redundant packets corresponding to the target data packet group, where N is a positive integer less than or equal to M; send the N target redundant packets to the data receiving device, so that the data receiving device detects the target When there is data packet loss in the data packet group, the lost data packet is obtained through redundancy recovery processing according to the N target redundant packets.
  • the embodiment of the present application provides another data processing device, which includes:
  • a processing unit configured to receive a target data packet group from a data sending device, wherein the data sending device obtains an original data packet group to be sent, and the original data packet group includes M original data packets, and the M original data packets are The data packet is obtained by encapsulating the business data to be transmitted according to the transmission protocol.
  • the packet format defined by the transmission protocol is a non-redundant recovery format, and M is a positive integer; the data sending device obtains the original data packet group
  • Each original data packet corresponds to the first redundancy recovery parameter.
  • Each original data packet in the original data packet group and the corresponding first redundancy recovery parameter are separately spliced to obtain M target data packets.
  • the target data packet group wherein, the first redundancy recovery parameter in each target data packet is used to indicate that the target data packet is in a redundant recovery format, and the target data packet in the redundant recovery format supports redundant recovery. deal with;
  • N target redundant packets from the data sending device, the N target redundant packets correspond to the target data packet group, and N is a positive integer less than or equal to M;
  • the lost data packet is obtained through redundancy recovery processing based on the N target redundant packets.
  • An embodiment of the present application provides a computer device, which includes a processor and a computer-readable storage medium. in:
  • the processor is suitable for implementing a computer program
  • the computer-readable storage medium stores the computer program
  • the computer program is suitable for the processor to load and execute the above-mentioned data processing method.
  • Embodiments of the present application provide a computer-readable storage medium that stores a computer program.
  • the computer program When the computer program is read and executed by a processor of a computer device, it causes the computer device to execute the above-mentioned data processing method.
  • Embodiments of the present application provide a computer program product or computer program.
  • the computer program product or computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium.
  • the processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the above-mentioned data processing method.
  • Figure 1A is a schematic diagram of a process for recovering lost data packets provided by an embodiment of the present application
  • Figure 1B is a schematic diagram of another process of recovering lost data packets provided by an embodiment of the present application.
  • Figure 2 is a schematic architectural diagram of a data processing system provided by an embodiment of the present application.
  • Figure 3 is a schematic diagram of the data transmission process of a cloud game scenario provided by an embodiment of the present application.
  • Figure 4 is a schematic flowchart of a data processing method provided by an embodiment of the present application.
  • Figure 5A is a schematic structural diagram of an original data packet provided by an embodiment of the present application.
  • Figure 5B is a schematic structural diagram of another original data packet provided by an embodiment of the present application.
  • Figure 5C is a schematic structural diagram of yet another original data packet provided by an embodiment of the present application.
  • Figure 6 is a schematic structural diagram of a target data packet provided by an embodiment of the present application.
  • FIGS 7A and 7B are schematic flow diagrams of another data processing method provided by the embodiment of the present application.
  • Figure 8A is a schematic structural diagram of a target redundancy package provided by an embodiment of the present application.
  • Figure 8B is a schematic structural diagram of another target redundancy package provided by an embodiment of the present application.
  • Figure 9A is a schematic flowchart of a key agreement process provided by an embodiment of the present application.
  • Figure 9B is a schematic flowchart of another key agreement process provided by an embodiment of the present application.
  • FIG. 10 is a schematic flowchart of yet another data processing method provided by an embodiment of the present application.
  • Figure 11 is a schematic interactive flow diagram of a data processing method provided by an embodiment of the present application.
  • Figure 12 is a schematic diagram of a generation process of original redundant packets provided by an embodiment of the present application.
  • Figure 13 is a schematic diagram of a memory allocation strategy provided by an embodiment of the present application.
  • Figure 14 is a schematic structural diagram of a data processing device provided by an embodiment of the present application.
  • Figure 15 is a schematic structural diagram of another data processing device provided by an embodiment of the present application.
  • Figure 16 is a schematic structural diagram of a computer device provided by an embodiment of the present application.
  • Data transmission technology refers to the technology in which the data sender and the data receiver jointly follow a transmission protocol to transmit data through one or more data channels or links.
  • the data transmission process based on data transmission technology can be more specifically understood as: the data sender encapsulates the data to be transmitted into one or more data packets according to the transmission protocol, and then transmits one or more data packets to the data receiver. The receiver reconstructs the transmitted data by parsing one or more packets.
  • the transmission protocol refers to the rules and conventions that must be followed for data transmission between the data sender and the data receiver.
  • the transmission protocol defines the format of the data packet used to encapsulate the data.
  • FEC Forward Error Correction
  • FEC is an error control method. It means that the signal is pre-coded according to a certain algorithm before being sent to the transmission channel, and redundant codes with the characteristics of the signal itself are added. The receiver decodes the received signal according to the corresponding algorithm to find out the error codes generated during the transmission and correct them.
  • FEC is used to perform redundancy recovery processing and recover data packets lost during data transmission.
  • the data sender encapsulates the data to be transmitted into one or more data packets according to the transmission protocol.
  • the data sender can also generate redundant packets of one or more data packets based on the FEC algorithm, and combine the data packets with the redundant packets.
  • Figure 1A shows the process of ARQ recovering lost data packets: the data sender transmits data packet A, data packet B and data packet C to the data receiver.
  • data packet B is lost, and the data sender detects After data packet B is lost (the data sender does not receive the confirmation frame returned by the data receiver after sending data packet B for a period of time), data packet B is retransmitted to the data receiver.
  • the transmission delay includes at least the delay in detecting the loss of data packet B and the delay in retransmitting data packet B (RTT/2), and the data transmission efficiency is not high.
  • RTT Red-Trip Time
  • ARQ can overcome the problem of data packet loss during transmission, it brings very high transmission delays (including the delay in detecting packet loss and the delay in retransmitting data packets), resulting in a relatively high data transmission efficiency. Low.
  • Figure 1B shows the process of FEC recovery of lost data packets: the data sender generates redundant packets of data packet A, data packet B and data packet C based on the FEC algorithm, and combines data packet A, data packet B, data packet C and The redundant packet is sent to the data receiver.
  • the data receiver detects that data packet B is lost, it can recover the lost data packet B based on data packet A, data packet C and the redundant packet. There is no need to retransmit data packet B, which reduces It reduces the transmission delay in case of packet loss and improves data transmission efficiency.
  • Cloud gaming is a gaming method based on cloud computing.
  • the game server compresses the rendered game media data (such as game screen, game audio, etc.) and transmits it to the game client through the network.
  • the game client presents the game to the game player.
  • Media data; the game player’s operation data in the game client will be transmitted to the game server through the network to achieve the purpose of operating the game.
  • Cloud Computing is a computing model that distributes computing tasks across a resource pool composed of a large number of computers, enabling various application systems to obtain computing power, storage space and information services as needed.
  • the data sender uses redundant recovery parameters (redundant recovery parameters refer to data that supports redundant recovery processing).
  • the parameters that the packet needs to contain) are spliced with the original data packet that does not support redundant recovery processing, so that the target data packet obtained by the splicing process supports redundant recovery processing;
  • the so-called data packet supports redundant recovery processing means: the data packet is detected When a data packet is lost during transmission, the data packet can be recovered through the corresponding redundancy package;
  • the so-called data packet does not support redundant recovery processing means: when it is detected that the data packet is lost during transmission, the corresponding redundancy package cannot be used.
  • the data packet is recovered from the packet; that is to say, in the embodiment of this application, after the data sender sends the target data packet that supports redundancy recovery processing and the corresponding redundant packet to the data receiver, if the data receiver detects the data packet If the packet is lost, the data receiver can recover the lost data packet through the corresponding redundant packet, which can reduce the data transmission delay in the case of packet loss and improve data transmission efficiency.
  • the data processing capabilities provided by the data processing solutions in the embodiments of the present application can be encapsulated in a data processing toolkit.
  • the data processing capabilities can include: performing redundant recovery parameters and original data packets that do not support redundant recovery processing. Splicing processing enables the spliced target data packet to support redundant recovery processing, or when it is detected that the target data packet supporting redundant recovery processing is lost, the ability to recover the lost data packet through redundant recovery processing.
  • the data processing toolkit can be, for example, an SDK (Software Development Kit).
  • the data processing toolkit can be connected to applications, software, devices, etc., so that applications, software, devices, etc. have data.
  • Processing capabilities for example, when the data processing toolkit is connected to the data sender, the data transmission is facilitated by splicing the redundant recovery parameters with the original data packets that do not support redundant recovery processing, so that the target data obtained by splicing
  • the package supports the ability of redundant recovery processing; when the data processing tool package is connected to the data receiver, the data reception is convenient and has the ability to recover the loss through redundant recovery processing when the target data packet that supports redundant recovery processing is detected to be lost. of data packet capabilities.
  • the data processing system 20 may include a data sending device 201 and a data receiving device 202.
  • the data sending device 201 may be a terminal or a server, and the data receiving device 202 may be a terminal or a server.
  • the data sending device 201 may be a terminal or a server.
  • the sending device 201 and the data receiving device 202 may be directly or indirectly connected through wired communication or wireless communication.
  • the terminals mentioned in the embodiments of this application may be smartphones, tablets, laptops, desktop computers, smart speakers, smart watches, smart TVs, vehicle-mounted terminals, game controllers, etc., but are not limited thereto; the embodiments of this application
  • the server mentioned can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or it can provide cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud Cloud servers for basic cloud computing services such as communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. in:
  • the data sending device corresponds to the data sender.
  • the data sending device can obtain the business data to be transmitted, and then encapsulate the business data to be transmitted according to the transmission protocol (ie, the above-mentioned transmission protocol) to obtain one or more original data packets.
  • the transmission protocol ie, the above-mentioned transmission protocol
  • one or more original data packets encapsulated according to the transmission protocol do not support redundant recovery processing; the original data packets can be in packet groups, and each time a certain number of original data packets are reached, a data packet group (group) can be formed.
  • the number of original data packets contained in different data packet groups can be the same or different.
  • the original data packet group can include M original data packets, and the M original data packets encapsulated according to the transmission protocol are not Supports redundant recovery processing, M is a positive integer.
  • the data sending device can encapsulate a packet header (redundancy recovery parameter) in front of each original data packet in the original data packet group for splicing processing, and obtain M target data packets that support redundant recovery processing, consisting of M target data packets.
  • Target data packet group the data sending device can send the target data packet group to the data receiving device.
  • the data sending device can also generate N target redundant packets of the target data packet group, and send the N target redundant packets of the target data packet group to the data receiving device.
  • the number of generated target redundant packets must be less than or equal to the original
  • the number of data packets, that is, N is a positive integer less than or equal to M.
  • the data receiving device corresponds to the data receiver.
  • the data receiving device can receive the target data packet group from the data sending device. If the data receiving device detects that there is a data packet loss in the target data packet group, the data receiving device The lost data packets can be recovered based on the N target redundant packets and non-lost data packets received from the data sending device. Therefore, the data receiving device can reconstruct the service data based on the received data packets and the recovered data packets. As the data receiving device continuously receives the data packet group from the data sending device, the data receiving device can finally reconstruct the complete service data.
  • the data receiving device can quickly recover the lost data packets through redundant recovery processing.
  • the data sending device does not need to resend the lost data packets, and the data receiving device does not need to wait for the lost data packets to be resent.
  • This can reduce the data transmission delay in the case of packet loss and improve the data transmission between the data sending device and the data receiving device. efficiency.
  • the data processing system described in the embodiments of the present application is to more clearly illustrate the technical solutions of the embodiments of the present application, and does not constitute a limitation on the technical solutions provided by the embodiments of the present application. As a person of ordinary skill in the art will know, With the evolution of system architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.
  • the data processing solution provided by the embodiment of the present application can achieve excellent technical effects when combined with cloud games.
  • the specific application of the data processing solution provided by the embodiment of the present application in the cloud game scenario will be introduced below with reference to Figure 3:
  • the data sending device can run a game client with a cloud game, and the game player can operate the cloud game through the game client, or the data sending device can be a game controller of the cloud game, and the game player can operate the cloud game through the game.
  • the controller operates the cloud game;
  • the data receiving device can be the game server of the cloud game.
  • the game server runs the Cloud Game Engine, and the Cloud Game Engine runs the cloud game.
  • the data sending device When the data sending device detects a game player's operation event on the cloud game (such as touch screen event, keyboard and mouse event, joystick event, etc.), the data sending device will send the operation data corresponding to the operation event (such as touch screen data, keyboard and mouse event, etc.) Data, joystick data, etc.) are sent to the game server, so that the game server can inject the operation data into the cloud game engine to achieve the purpose of operating the game.
  • the cloud game scenario is very sensitive to the operation delay of the game player.
  • the game client sends the operation data to the game server, the data processing solution provided by the embodiment of the present application can be used. This can solve some problems caused by poor network quality. When operation data is lost, the lost operation data can be quickly recovered, which can reduce the operation delay of cloud games and improve the cloud gaming experience of game players.
  • the data sending device may be a game server, and the data receiving device may run a game client.
  • the game client may present game media data including game images, game audio, etc. to the game player.
  • the data sending device can transmit the game screen, game audio and other game media data rendered by the Cloud Game Engine to the data receiving device.
  • the data receiving device can present the game media data to the game player through the game client and send the game media data to the game server.
  • the data processing solution provided by the embodiment of the present application can be used. In this way, when some game media data is lost due to poor network quality, the lost game media data can be quickly recovered, thereby reducing the cost of cloud gaming. Media presentation delay improves gamers’ cloud gaming experience.
  • the embodiment of the present application provides a data processing method.
  • the data processing method mainly introduces the splicing processing of redundant recovery parameters and original data packets that do not support redundant recovery processing.
  • the data processing method can be composed of the above data processing.
  • the data processing method is executed by the data sending device 201 (i.e., the data sender) in the processing system 20. Refer to Figure 4.
  • the data processing method may include the following steps S401 to S404:
  • the data sending device can obtain the business data to be transmitted, and then encapsulate the business data to be transmitted according to the transmission protocol to obtain one or more original data packets.
  • the original data packets can be in units of data packet groups. Each time a certain amount of original data is reached, Packets can form a data packet group, and the number of original data packets contained in different data packet groups can be the same or different.
  • the embodiments of this application are introduced by taking any data packet group (i.e., the original data packet group) obtained by encapsulating the business data to be transmitted as an example.
  • the original data packet group is obtained by encapsulating the business data in the business data according to the transmission protocol.
  • the original data packet group can include M original data packets. Each original data packet encapsulated by the transmission protocol does not support redundancy recovery processing, and M is a positive integer.
  • the packet format defined by the transmission protocol is a non-redundant recovery format, so that the original data packet encapsulated by the transmission protocol does not support redundant recovery processing. That is, when it is detected that the original data packet is lost during the transmission process, the corresponding redundant recovery format cannot be used. The original data packet is recovered from the remaining packets.
  • the embodiments of this application take the transmission protocol QUIC (Quick UDP Internet Connection, Quick UDP (User Datagram Protocol, User Data Packet Protocol) Internet Connection) protocol as an example for explanation. Other transmission protocols except the QUIC protocol can be seen in the embodiments of this application. Related descriptions of the QUIC protocol.
  • the QUIC protocol is a protocol that uses UDP for multi-channel forwarding and transmission.
  • the QUIC protocol can at least include either the gQUIC protocol or the IETF QUIC protocol.
  • the gQUIC protocol is an early QUIC version protocol implemented in a specific web browser.
  • the IETF QUIC protocol is the IETF (The Internet Engineering Task Force, Internet Engineering Task Force) ) QUIC protocol specification of the standard organization.
  • the packet format defined by the IETF QUIC protocol is introduced with reference to Figure 5B and Figure 5C. To introduce:
  • the packet format defined by the gQUIC protocol includes a packet header and a packet body;
  • the packet header can include the Public Flags field, Connection ID field, Quic Version field, Diversification Nonce field, and Packet Number field;
  • the packet body can include the payload (valid load).
  • Public Flags field (public identification field): represents the public identification bit.
  • the size of the Public Flags field is 8 bits.
  • the first bit (bit0) is the PUBLIC_FLAGS_VERSION (public flag version) field.
  • bit1 is the PUBLIC_FLAGS_VERSION (public flag version) field.
  • bit1 is the PUBLIC_FLAGS_RESET (public flag reset) field.
  • Setting the value of the PUBLIC_FLAGS_RESET field indicates that the data packet is a public reset data packet; the third bit ( bit2) is the Diversification Nonce field. Setting the value of the Diversification Nonce field indicates that the packet header contains the Diversification Nonce field; setting the value of the fourth bit (bit4) indicates that the packet header contains the 64-bit Connection ID field; the fifth bit (bit4) and the value of the sixth bit (bit5) indicates the number of bytes in the Packet Number field; the seventh bit (bit6) is currently unused and is reserved for multipath use; the eighth bit (bit7) is currently unused and must be set is 0.
  • Connection ID field The field value is the connection ID of the data sending device, which is used to uniquely identify the identity of the data sending device.
  • QUIC Version field (protocol version field): The field value is used to identify the QUIC protocol version.
  • the field value is a diversified random number.
  • Packet Number field (packet number field): The field value is used to identify the sequence number of the data packet.
  • the data sending device assigns a sequence number to each regular data packet (not required for special public reset data packets and version negotiation data packets), for example , the sequence number of the first data packet sent is 1, and the sequence number of subsequent data packets is increased by 1 based on the previous data packet.
  • the payload can encapsulate business data according to the data frame (frame).
  • the payload includes the Authenticated Hash field (authentication hash field) and one or more frames.
  • Each frame includes the type field (data frame type field), frame header (data Frame header) and frame payload (payload of the data frame), the business data to be transmitted is actually encapsulated in the frame payload.
  • the packet format defined by the IETF QUIC protocol includes long header packet format and short header packet format; data packets sent and received during the connection establishment process use long header (long header), and data packets with long header can include initial data packet (Initial ), 0-RTT packet (0-RTT), handshake packet (Handshake), retry packet (Retry), and version negotiation packet (Version Negotiation).
  • Figure 5B takes the format of the version negotiation packet as an example. introduce:
  • the format of the version negotiation data packet includes a header and a body;
  • the header can include the Public Flags field, the Quic Version field, the DCID len field, the Destination Connection ID field, the SCID len field, and the Source Connection ID field;
  • the packet header can include payload. in:
  • Public Flags field represents the public identification bit.
  • the size of the Public Flags field is 8bit(bit).
  • bit7 When the eighth bit (bit7) is set to 1, it indicates that the data packet is a long header data packet; the seventh bit (bit6) must be set to 1. If this bit is set to 0, the data packet is considered invalid. The data packet must be discarded directly; the values of the sixth bit (bit5) and the fifth bit (bit4) are used to identify the specific type of the data packet. For example, 0x0 indicates that the type of data packet is the original data packet, and 0x1 indicates that the data packet type is the original data packet.
  • the type of data packet is 0-RTT packet, 0x2 indicates that the type of data packet is handshake packet, 0x3 indicates that the type of data packet is retry packet; the fourth bit (bit3) to the first bit (bit0) are Different types of packets have different meanings for specific types.
  • QUIC Version field (protocol version field): The field value is used to identify the QUIC protocol version.
  • DCID len field (destination connection identification length field): The field value is used to identify the length of the Destination Connection ID field.
  • Destination Connection ID field The field value is the connection ID of the data receiving device, which can be used to uniquely identify the identity of the data receiving device.
  • SCID len field (source connection identification length field): The field value is used to identify the length of the Source Connection ID field.
  • Source Connection ID field The field value is the connection ID of the data sending device, which is used to uniquely identify the identity of the data sending device.
  • the payload can include multiple supported versions (Supported Version1...Supported VersionP, that is, supported version 1...supported version P).
  • the format of the short header data packet may include a header and a packet body; the packet header may include a Public Flags field, a Destination Connection ID field, and a Packet Number field; the packet body may include an encrypted payload (encrypted data). in:
  • Public Flags field Indicates the public identification bit.
  • the size of the Public Flags field is 8 bits; when the eighth bit (bit7) is set to 0, it indicates that the data packet is a short header data packet; seventh A bit (bit6) must be set to 1. If this bit is set to 0, the data packet is considered to be an invalid data packet and must be discarded directly; the sixth bit (bit5) represents the delayed spin bit; the fifth bit (bit4) and the fourth bit (bit3) are reserved fields; the value of the third bit (bit2) is used to identify whether the key has been updated (the key is updated after the handshake confirmation), and is initially set to 0. It is reversed after each key update.
  • the data receiving device can use this field to determine whether the key has changed; the values of the second bit (bit1) and the first bit (bit0) are used to identify the Packet Number in the header. The length of the field.
  • Destination Connection ID field The field value is the connection ID of the data sending device, which is used to uniquely identify the identity of the data sending device.
  • Packet Number field The field value is used to identify the sequence number of the data packet.
  • the original data packet can be encapsulated according to the short header format, specifically: it can be encapsulated according to the MTU (Maximum Transmission Unit, maximum Divide the business data to be transmitted according to the target data length indicated by the transmission unit), and encapsulate the data whose length is the target data length into a packet body. That is, the data whose length is the target data length is used as the packet body of the original data packet. Then the packet body can be encrypted using the key determined through key negotiation with the data receiving device, and then the encrypted packet body can be encapsulated in the header, and an original data packet can be obtained.
  • MTU is the concept of the data link layer, which is used to limit the size of the payload of the data link layer.
  • the first redundancy recovery parameter may include a format identification parameter, and the format identification parameter may be used to identify the redundancy recovery format (FEC format). That is to say, when the data packet includes the redundancy identification parameter, It means that the packet format of this data packet is the redundant recovery format, and the data packet whose packet format is the redundant recovery format supports redundant recovery processing.
  • the first redundancy recovery parameter may also include any one or both of the sequence number parameter or the type parameter. The sequence number parameter may be used to identify the data packet to which the data packet belongs. Group and the sequence number of the data packet in the data packet group.
  • the type parameter can be used to identify the packet type of the data packet.
  • S403 Splice each original data packet in the original data packet group with the corresponding first redundancy recovery parameter to obtain M target data packets, and the M target data packets constitute the target data packet group.
  • each original data packet in the original data packet group and the corresponding first redundancy recovery parameter can be spliced. (can also be called encapsulation processing), a target data packet group is obtained, and the target data packet group includes M target data packets.
  • a target data packet group is obtained, and the target data packet group includes M target data packets.
  • the splicing process of the m-th original data packet in the original data packet group as an example, and splice the first redundancy recovery parameter corresponding to the m-th original data packet with the m-th original data packet.
  • the m-th target data packet corresponding to the m-th original data packet can be obtained, where m is a positive integer less than or equal to M.
  • the specific splicing process is as follows: for the m-th original data packet in the original data packet group, the m-th data packet body corresponding to the m-th original data packet can be generated.
  • the m-th data packet body refers to the m-th data packet body.
  • the packet structure of the first redundant recovery parameter corresponding to the mth original data packet and the mth original data packet is spliced.
  • the mth data packet body can include a header and a body; then, the mth original data packet can be corresponding to
  • the first redundancy recovery parameter is added to the m-th data packet body header, add the m-th original data packet to the body of the m-th data packet body, and obtain the m-th target data packet corresponding to the m-th original data packet. It can be seen that the splicing process is for the m-th An FEC header is added to the original data packet.
  • the first redundancy recovery parameter corresponding to the m-th original data packet may include: format identification parameter, sequence number parameter and type parameter, and the header of the m-th data packet body may include: format identification field ( FEC Format Flags), sequence number field (FEC SEQ ID) and type field (FEC Type).
  • FEC Format Flags FEC Format Flags
  • FEC SEQ ID sequence number field
  • FEC Type type field
  • the format identification parameter can be added to the format identification field.
  • the format identification parameter can be used to identify that the packet format of the m-th target data packet is the redundant recovery format.
  • the redundant recovery format is the FEC header package.
  • the mth target data packet whose packet format is redundant recovery format supports redundant recovery processing;
  • the sequence number parameter can be added to the sequence number field, and the sequence number parameter can be used to identify that the mth target data packet belongs to the target data packet group.
  • the sequence number of the mth target data packet in the target data packet group For example, the sequence number of each packet in the target data packet group is 0-7, and the sequence number parameter of the mth target data packet is 3, identifying the mth target.
  • the data packet belongs to the target data packet group, and the m-th target data packet is ranked 4th in the target data packet group;
  • the type parameter can be added to the type field, and the type parameter is used to identify the m-th target data packet.
  • the type is the data packet type; and the m-th original data packet can be added to the body of the m-th data packet body, and finally the m-th target data packet is obtained.
  • the first redundancy recovery parameter is added to the original data packet in the form of a header without modifying the packet format defined by the transmission protocol. This can be compatible with multiple types of transmission protocols and is especially suitable for packet formats that do not support extensions. field or a transport protocol for which extension fields do not exist.
  • the first redundancy recovery parameter corresponding to the m-th original data packet may include a format identification parameter
  • the header of the m-th data packet body may include a format identification field.
  • the format identification parameter can be added to the format identification field
  • the m-th original data packet can be added to the body of the m-th data packet body, finally obtaining the m-th target data packet.
  • the data sending device can send the sequence number parameter corresponding to the m-th original data packet and the type parameter corresponding to the m-th original data packet to the data receiving device separately, instead of adding the sequence number parameter to the m-th original data packet.
  • the header is sent to the data receiving device.
  • sending the sequence number parameters and type parameters separately to the data receiving device can reduce the amount of data in the target data packet. , which can improve the transmission efficiency of the target data packet and further improve the data transmission efficiency.
  • the first redundancy recovery parameter corresponding to the m-th original data packet includes a format identification parameter.
  • the first redundancy recovery parameter corresponding to the m-th original data packet may also include Either the sequence number parameter or the type parameter; the header of the m-th data packet body includes the format identification field, except the format identification word
  • the header of the m-th data packet body may also include either a sequence number field or a type field.
  • the format identification parameter can be added to the format identification field; when the first redundancy recovery parameter corresponding to the m-th original data packet also includes a sequence number parameter, and the header of the m-th data packet body also includes a sequence number field, the format identification parameter can be added to the format identification field.
  • the sequence number parameter is added to the sequence number field; when the first redundancy recovery parameter corresponding to the m-th original data packet also includes a type parameter, and the header of the m-th data packet body also includes a type field, the sequence number parameter can be added to In the type field; and the m-th original data packet can be added to the body of the m-th data packet body, and finally the m-th target data packet is obtained.
  • the first redundancy recovery parameter corresponding to the mth original data packet may include a format identification parameter and a type parameter
  • the header of the mth data packet body includes a format identification field and a type field.
  • the mth The sequence number parameter corresponding to the original data packet can be sent to the data receiving device separately, instead of being sent to the data receiving device by being added to the header of the mth original data packet.
  • S404 Send the target data packet group to the data receiving device, so that when the data receiving device detects that there is data packet loss in the target data packet group, it can obtain the lost data packet through redundancy recovery processing.
  • Each original data packet in the original data packet group is spliced with the corresponding first redundancy recovery parameter.
  • the data sending device can send the target data packet group to the data receiving device so that the data
  • the receiving device detects data packet loss in the target data packet group, it can obtain the lost data packets through redundancy recovery processing.
  • the data sending device can also generate N target redundant packets of the target data packet group, and send the N target redundant packets of the target data packet group to the data receiving device, so that the data receiving device detects the target data packet group.
  • redundancy recovery processing can be performed based on N target redundant packets to obtain the lost data packets, where N is a positive integer less than or equal to M.
  • the data sending device performs splicing processing on each original data packet in the original data packet group and the corresponding first redundancy recovery parameter, so that each target in the target data packet group obtained by the splicing processing can be All data packets support redundant recovery processing. Therefore, when the target data packet group is lost during transmission to the data receiving device, the data receiving device can quickly recover the lost data packets through redundant recovery processing, and the data is sent The device does not need to retransmit lost data packets, which can reduce transmission delays in the case of packet loss and improve data transmission efficiency.
  • the embodiment of the present application adds the first redundancy recovery parameter to the original data packet in the form of a header without modifying the packet format defined by the transmission protocol. This makes it compatible with multiple types of transmission protocols, such as packets defined by the gQUIC protocol. format and the packet format defined by the IETF QUIC protocol, and is especially suitable for transmission protocols where the defined packet format does not support extension fields or does not exist.
  • the embodiment of the present application provides a data processing method.
  • the data processing method mainly introduces the generation of target redundant packets of the target data packet group, and determines the redundant processing capability of the data receiving device during the key negotiation process.
  • the data processing method can be executed by the data sending device 201 (ie, the data sender) in the above-mentioned data processing system 20. Please refer to Figure 7.
  • the data processing method can include the following steps S701-step S706:
  • step S701 in the embodiment of the present application is the same as the execution process of step S401 in the embodiment shown in FIG. 4.
  • step S401 in the embodiment shown in FIG. 4, which will not be described again here.
  • step S702 in the embodiment of the present application is the same as the execution process of step S402 in the embodiment shown in FIG. 4.
  • step S402 in the embodiment shown in FIG. 4 please refer to the description of step S402 in the embodiment shown in FIG. 4, which will not be described again here.
  • S703 Splice each original data packet in the original data packet group with the corresponding first redundancy recovery parameter to obtain M target data packets, and the M target data packets constitute the target data packet group.
  • step S703 in the embodiment of the present application is the same as the execution process of step S403 in the embodiment shown in FIG. 4.
  • step S403 in the embodiment shown in FIG. 4 please refer to the description of step S403 in the embodiment shown in FIG. 4, which will not be described again here.
  • the data sending device can send the target data packet group to the data receiving device.
  • S705 Generate N target redundant packets corresponding to the target data packet group.
  • the data sending device can generate N target redundant packets corresponding to the target data packet group.
  • generating N target redundant packets corresponding to the target data packet group may include the following sub-steps S11-S13:
  • the process of generating N original redundant packets based on M original data packets may include: redundant encoding processing of M original data packets according to the FEC algorithm to obtain N redundant data, and N redundant data according to the transmission protocol. The data is encapsulated and N original redundant packets are obtained.
  • FEC algorithms can include many types, such as XOR algorithm (XOR algorithm), UPLFEC algorithm, FlexFEC algorithm, and Reed-Solomon Code (Reed-Solomon Code) algorithm, etc. Table 1 below shows the above several FEC algorithms. specialty:
  • the Reed-Solomon Code algorithm is more flexible and has a relatively high recovery rate for lost original data packets.
  • the FEC algorithm is the Reed-Solomon Code algorithm. Example to illustrate.
  • the FEC algorithm stipulates that the data packet lengths of the M original data packets used to generate redundant data must be consistent. Therefore, the maximum data packet length among the M original data packets can be obtained, and the M original data packets can be processed according to the maximum data packet length.
  • the packets are filled so that the data packet lengths of the filled M original data packets are consistent, and then the filled M original data packets can be redundantly encoded according to the FEC algorithm to obtain N redundant data; according to the maximum data packet Length padding of M original data packets means: for M original data packets whose data packet length is less than the maximum data packet length, 0 is padded at the end of the original data packet until the padded original data packet The length reaches the maximum packet length.
  • the original redundant packet can be encapsulated according to the short header format, specifically: for N redundant data
  • the redundant data can be used as the package body of the original redundant package, and then the package body can be encrypted using the key determined after key negotiation with the data receiving device, and then the encrypted By encapsulating the header in the packet body, one original redundant packet can be obtained. In the same way, N original redundant packets can be obtained.
  • the second redundancy recovery parameter corresponding to each of the N original redundant packets can be obtained.
  • the second redundancy recovery parameter may include a format identification parameter, and the format identification parameter may be used to identify the redundancy recovery format (FEC format), that is, When the redundant package includes the format identification parameter, it means that the package format of the redundant package is the redundant recovery format.
  • the redundant package whose package format is the redundant recovery format supports redundant recovery processing.
  • the redundant package supports redundant recovery processing. It means: the redundant package can be used for redundancy recovery processing.
  • the second redundancy recovery parameter may also include at least one of the following: a sequence number parameter, a type parameter, a data packet quantity parameter, a redundant packet quantity parameter, and a connection identification parameter,
  • the sequence number parameter can be used to identify the data packet group to which the redundant packet belongs and the sequence number of the redundant packet in the data packet group.
  • the type parameter can be used to identify the packet type of the redundant packet.
  • the data packet quantity parameter is used to identify the redundant packet. The number of data packets contained in the data packet group to which it belongs.
  • the redundant packet number parameter can be used to identify the number of redundant packets in the data packet group to which the redundant packet belongs.
  • the connection identification parameter can be used to uniquely identify the identity of the data sending device. .
  • S13 Splice each of the N original redundant packets with the corresponding second redundancy recovery parameter to obtain N target redundant packets.
  • the N original redundant packets can be Each original redundant packet in and the corresponding second redundancy recovery parameter are spliced (also called encapsulation processing) to obtain N target redundant packets.
  • splicing also called encapsulation processing
  • the second redundancy recovery parameter corresponding to the nth original redundant packet is compared with the nth original redundant packet.
  • the splicing process of redundant packets can obtain the n-th target redundant packet corresponding to the n-th original redundant packet, where n is a positive integer less than and then equal to N.
  • the specific splicing process is as follows: for the n-th original redundant packet among the N original redundant packets, generate the second redundancy recovery parameter corresponding to the n-th original redundant packet and the n-th original redundant packet.
  • the nth redundant package body is spliced.
  • the nth redundant package body includes a header and a body; the second redundancy recovery parameter corresponding to the nth original redundant package is added to the nth redundant package body.
  • header add the nth original redundant packet to the body of the nth redundant packet body, and obtain the nth target redundant packet corresponding to the nth original redundant packet.
  • the format identification parameter, sequence number parameter, type parameter, data packet quantity parameter, and redundant packet quantity parameter can be All are added to the header of the nth redundant packet body; similar to the original data packet, the second redundancy recovery parameter is added to the original redundant packet in the form of a header without modifying the packet format defined by the transmission protocol, so it is compatible Various types of transport protocols, and especially suitable for transport protocols whose packet format does not support extension fields or does not exist.
  • the format identification parameter identifying the redundancy recovery format can be added to the header of the nth redundant packet body, and the remaining parameters can be sent to the data receiving device separately; alternatively, the format identification parameter identifying the redundancy recovery format can be added to the header of the nth redundant packet body, the remaining parameters can be partially added to the header of the nth redundant packet body, and the remaining parameters can be sent to the data receiving device separately; similar to the original data packet, the sequence number parameters, Type parameters, number of packets Any one or more of the quantity parameters and redundant packet quantity parameters are sent to the data receiving device separately, which can reduce the amount of data in the target redundant packet, which can improve the transmission efficiency of the target redundant packet and further improve the data transmission efficiency. .
  • the second redundancy recovery parameters corresponding to the nth original redundant packet may include: format identification parameter, sequence number parameter, type Parameters, data packet number parameters and redundant packet number parameters;
  • the header of the nth redundant packet body can include: format identification field (FEC Format Flags), sequence number field (FEC SEQ ID), type field (FEC Type), Data packet number field (Data Shard Num) and redundant packet number field (Parity Shard Num).
  • the format identification parameter can be added to the format identification field.
  • the format identification parameter can be used to identify the packet format of the nth target redundant packet as the redundant recovery format.
  • the redundant recovery format is the FEC header package.
  • the main body of the nth target redundant packet whose packet format is the redundancy recovery format can support redundancy recovery processing.
  • the nth target redundancy packet can support redundancy recovery processing means: the nth target redundancy packet can be used For redundancy recovery processing; the sequence number parameter can be added to the sequence number field. The sequence number parameter can be used to identify that the nth target redundant packet belongs to the target data packet group, and that the nth target redundant packet is in the target data packet group.
  • the arrangement sequence number; the type parameter can be added to the type field, and the type parameter can be used to identify the packet type of the nth target redundant packet as a redundant packet type; the data packet quantity parameter can be added to the data packet quantity field , the data packet number parameter can be used to identify the number M of target data packets contained in the target data packet group; the redundant packet number parameter can be added to the redundant packet number field, and the redundant packet number parameter can be used to identify the target The number of target redundant packets in the packet group is N.
  • the second redundancy recovery parameters corresponding to the nth original redundant packet may include: a format identification parameter, a sequence number parameter, Type parameters, data packet number parameters, redundant packet number parameters and connection identification parameters;
  • the header of the nth redundant packet body can include: format identification field (FEC Format Flags), sequence number field (FEC SEQ ID), type field (FEC Type), data packet number field (Data Shard Num), redundant packet number field (Parity Shard Num) and connection identification field (Connection ID).
  • the format identification parameter can be added to the format identification field.
  • the formula identification parameter can be used to identify the nth target redundant packet whose packet format is the redundancy recovery format.
  • the redundancy recovery format is the body of the FEC header package, and the nth target redundant packet whose packet format is the redundancy recovery format. Can support redundancy recovery processing.
  • the nth target redundant package can support redundancy recovery processing means: the nth target redundant package can be used for redundancy recovery processing; the sequence number parameter can be added to the sequence number field, and the sequence number Parameters can be used to identify that the nth target redundant packet belongs to the target data packet group, and the arrangement position of the nth target redundant packet in the target data packet group; the type parameter can be added to the type field, and the type parameter can be used
  • the packet type used to identify the nth target redundant packet is a redundant packet type; a data packet number parameter can be added to the data packet number field, and the data packet number parameter can be used to identify targets included in the target data packet group
  • the number of target redundant packets in the target data packet group to be generated can be determined based on the number of target data packets included in the target data packet group and the redundancy parameters; when generating the target data packet group Before the target redundant packet is received, the packet loss parameters between the data sending device and the data receiving device can be obtained.
  • the packet loss parameter refers to the proportion of the current number of lost packets to the total number of packets currently transmitted to the data receiving device. It can be based on The packet loss parameter adjusts the number of target redundant packets that need to be generated for the target packet group, so that N of the target packet group can be generated according to the adjusted number of target redundant packets that need to be generated for the target packet group. target redundant package.
  • the number of target redundant packets to be generated for the target data packet group can be adjusted according to the packet loss parameter.
  • the redundancy parameter can be adjusted according to the packet loss parameter, and then the redundancy parameter can be adjusted again according to the adjusted redundancy parameter.
  • the redundancy parameter can be adjusted according to the current packet loss parameter, the mapping relationship between the packet loss parameter and the redundancy parameter.
  • the exemplary packet loss parameter is as follows The mapping relationship between redundancy parameters can be seen in Table 2 below:
  • adjusting the number of target redundant packets generated for the target data packet according to the current packet loss parameters can make the number of target redundant packets generated for the target data packet more consistent with the packet loss situation of the current network, thus Can This is to avoid situations such as generating unnecessary redundant packets and generating insufficient redundant packets to recover all lost data packets.
  • the number of original packets that need to be included in the original packet group also supports adjustment.
  • the transmission rate parameter between the data sending device and the data receiving device can be obtained.
  • the transmission rate parameter can be used to indicate the transmission speed of the transmission network between the data sending device and the data receiving device. The larger the transmission rate parameter, the higher the transmission rate. The faster the transmission speed of the transmission network between the data sending device and the data receiving device, then the number of original data packets that need to be included in the original data packet group can be adjusted according to the transmission rate parameter.
  • the number of target redundant packets that need to be generated for the target data packet group corresponding to the original data packet group can also be determined based on the number of original data packets that need to be included in the original data packet group and the redundancy parameter.
  • the mapping relationship between the exemplary transmission rate parameters and the number of original data packets that need to be included in the original data packet group can be seen in Table 3 below. :
  • adjusting the number of original data packets to be included in the original data packet group according to the current transmission rate parameters can make the number of original data packets to be included in the original data packet group more consistent with the current network transmission rate. Try to avoid packet loss and increase data transmission rate.
  • the target data packet group needs to contain The size relationship between M and X, according to the size relationship between M and Yu Bao.
  • M is equal to The original number obtained by protocol encapsulation
  • the M original data packets can be divided into original data packet groups, and N target redundant packets can be generated based on the M original data packets.
  • the original data packet encapsulated according to the transmission protocol is not enough to be divided into
  • it can be combined with ARQ to set a timer (the time period set in the timer is the target period (for example, it can be RTT ⁇ 0.25)). If the last target data packet is not received after the target period is sent, The acknowledgment frame sent by the data receiving device will generate N target redundant packets of the target data packet group and be actively sent.
  • the acknowledgment frame sent by the data receiving device is received within the target period when the last target data packet is sent, it means that the data packet is in There is no loss during transmission, and there is no need to generate target redundant packets. In this way, when the amount of business data to be transmitted is small, a redundant packet can be generated when it is confirmed that the data packet is lost. If it is confirmed that the data packet is not lost, there is no need to generate a target redundant packet, which can save data sending equipment. of redundant coding resources.
  • S706 Send N target redundant packets to the data receiving device, so that when the data receiving device detects that there is a data packet loss in the target data packet group, it can perform redundancy recovery processing based on the N target redundant packets and obtain the lost data. data pack.
  • the N target redundant packets of the target data packet group may be sent to the data receiving device, so that the data receiving device detects the presence of data packets in the target data packet group.
  • redundancy recovery processing can be performed based on N target redundant packets to obtain the lost data packets.
  • steps S701-S706 in the embodiment of the present application are executed after it is determined that the data receiving device has redundancy recovery capability. If the data receiving device does not have redundancy recovery capability, the first redundant data will not be restored. The recovery parameters are spliced with the original data packets, and corresponding redundant packets will not be generated. When the original data packets are lost during transmission, the lost original data packets are retransmitted through ARQ; the data receiving device has Redundant recovery capability means that the data receiving device can be used for redundant recovery processing.
  • the embodiments of this application can detect the redundancy recovery capability of the data receiving device during the key negotiation process between the data sending device and the data receiving device.
  • Steps S701-S706 key negotiation between the data sending device and the data receiving device occurs before the formal transmission of business data.
  • the key negotiation can be used to determine the key, and the key can be used for encryption in the process of encapsulating M original data packets (specifically, It is to encrypt the body of the original data packet or the original redundant packet).
  • the key agreement process may include a 1RTT process and an ORTT process.
  • the 1RTT process can be used to perform key negotiation when the data sending device and the data receiving device are connected for the first time.
  • the ORTT process can be used to perform key negotiation when the data sending device and the data receiving device are connected for the first time. After the connection, key negotiation is performed when the connection is disconnected and reconnected.
  • the 1RTT process is introduced below with reference to Figure 9A, and the 0RTT process is introduced with reference to Figure 9B:
  • the embodiment shown in Figure 9A takes a client running in the data sending device and the data receiving device is a server as an example to introduce the 1RTT process: 1
  • the client sends an early hello (Inchoate Client Hello, InchoateCHLO) message to request to establish a connection ;
  • the server generates a set of prime numbers p and base point g, then calculates the value A based on the prime number p, base point g, and randomly generated number a, and puts the value A, prime number p, and base point g in the serverConfig (server configuration), and passes Rejection , REJ) message is sent to the client.
  • an early hello Inchoate Client Hello, InchoateCHLO
  • the server generates a set of prime numbers p and base point g, then calculates the value A based on the prime number p, base point g, and randomly generated number a, and puts the value A, prime number p, and base point g in the serverConfig (server configuration), and passes Rejection , REJ
  • the client randomly generates a number b, and calculates the initial key K based on the value A, prime number p and number b in the serverConfig, and passes the public number B and the Data data encrypted with the initial key K through the Complete Client Hello, CompleteCHLO) message is sent to the server, and the client also sends an encrypted request (Encrypted Request) to the server.
  • the server receives the data from the client, uses the public number B sent by the client and serverConfig to generate the same key to decrypt the data sent by the client, and then the server sends a greeting (Server Hello, SHLO) message.
  • Server Hello The message will carry the public number generated by the server (the server is updating its own private key, in fact, this is to ensure forward security), and the server will also send an encrypted response (Encrypted Response) to the client.
  • Encrypted Response an encrypted response
  • both the client and the server update the key.
  • the encryption algorithm (such as SHA-256 algorithm, etc.) can be used to deduce the encryption key between the client and the server. The client and server then use this key for encrypted data transmission.
  • the client's local serverConfig has not expired (including the value A, prime number p, base point g, and other previous negotiation information)
  • the initial key K can be directly calculated and the transmitted data can be encrypted to achieve 0RTT handshake.
  • the client will embed the client's redundancy recovery capability set (FEC capability set) into the Complete Client Hello message and send it to the server.
  • the client's redundancy recovery capability set can be used to indicate that the client has redundancy recovery capabilities. , and the FEC version supported by the client.
  • the server's redundant recovery capability set is embedded in the Server Hello message sent by the server received by the client, it can be determined that the server (i.e., the data receiving device) has redundant recovery capabilities, and the server's redundant recovery capability set can be used to indicate The server has redundant recovery capabilities and the FEC version supported by the server.
  • the embodiment shown in Figure 9B takes the data sending device running as a client and the data receiving device as a server as an example to introduce the ORTT process:
  • the premise of ORTT is that the client must already have ServerConfig, and it must be combined with certificate verification.
  • ServerConfig after verification, the key exchange algorithm and public key can be obtained. At this time, a brand new key will be generated. According to the DH algorithm (key exchange algorithm) and parameters, it can be calculated locally.
  • Symmetric key Sc After the server receives the client's ClientHello message (CHLO message), it also contains the client's public key information. The server can also calculate the key S s based on the previous public key parameters.
  • the client will embed the client's redundant recovery capability set (FEC capability set) into the Client Hello message and send it to the server.
  • the client's redundant recovery capability set can be used to indicate that the client has redundant recovery capabilities. And the FEC version supported by the client.
  • the server's redundant recovery capability set is embedded in the Server Hello message sent by the server received by the client, it can be determined that the server (i.e., the data receiving device) has redundant recovery capabilities, and the server's redundant recovery capability set can be used to indicate The server has redundant recovery capabilities and the FEC version supported by the server.
  • the key agreement process is a necessary pre-process for data transmission between the data sending device and the data receiving device.
  • the key negotiation process between the data sending device and the data receiving device it is determined whether the data receiving device has redundant recovery capabilities. , can be compatible with the process of establishing a connection and sending and receiving packets between the data sending device and the data receiving device. There is no additional new process, which can reduce the changes in the process without adding more signaling and links; and no hard-coded logic is used , through the format identification field (FEC Format Flag), it can be determined whether the data receiving device has redundant recovery capabilities, which has strong scalability and readability.
  • FEC Format Flag format identification field
  • data packets are generated when the target data packet group is transmitted to the data receiving device.
  • the data receiving device can perform redundancy recovery processing based on the target redundant packets to quickly recover the lost data packets.
  • the data sending device does not need to retransmit the lost data packets. This can reduce the transmission delay in the case of packet loss and improve data processing. transmission efficiency.
  • the number of target redundant packets to be generated for the target data packet group can be adjusted according to the current packet loss parameters, which can make the number of target redundant packets generated for the target data packet more consistent with the current network packet loss situation; it can be based on
  • the transmission rate parameter of the current network adjusts the number of data packets that need to be included in the data packet group, which can make the number of original data packets that need to be included in the original data packet group more consistent with the transmission rate of the current network, try to avoid packet loss, and improve data transmission. rate.
  • the embodiment of the present application provides a data processing method.
  • the data processing method mainly introduces the content of determining the presence of data packet loss in the target data packet group and recovering the lost data packets through redundancy recovery processing.
  • the data processing method can be composed of the above data
  • the data receiving device 202 i.e., the data receiver
  • the data processing method may include steps S1001-S1003:
  • the data sending device obtains an original data packet group to be sent, the original data packet group includes M original data packets, and the M original data packets are obtained by encapsulating the business data to be transmitted according to the transmission protocol.
  • the packet format defined by the transmission protocol is a non-redundant recovery format, and M is a positive integer; the data sending device obtains the first redundant recovery corresponding to each original data packet in the original data packet group.
  • each target The first redundancy recovery parameter in the data packet is used to indicate that the target data packet is in a redundancy recovery format, and the target data packet in the redundancy recovery format supports redundancy recovery processing.
  • N target redundant packets from the data sending device.
  • the N target redundant packets correspond to the target data packet group, and N is a positive integer less than or equal to M.
  • the lost data packet is obtained through redundancy recovery processing based on the N target redundant packets.
  • the data receiving device can receive the target packet from the data sending device and read the header and body of the target packet; if the target packet is determined to be a target data packet in the target data packet group based on the header of the target packet, the target packet can be determined The main body is the corresponding original data packet in the original data packet group, and the original data packet in the target packet can be copied to the queue; if the target packet is determined to be the target redundant packet of the target data packet group based on the header of the target packet, then It can be determined that the main body of the target packet is the original redundant packet corresponding to the target redundant packet, and the original redundant packet in the target packet can be copied to the queue; and so on, each time the data receiving device receives a packet, it can The processing logic of the above target package is processed.
  • packet loss detection can be performed on the target packet group based on the number of original packets in the original packet group contained in the queue; if it is determined that there is packet loss in the target packet group, it can be restored through redundancy The processing recovers the lost packets; if it is determined that there is no packet loss in the target packet group, there is no need to perform redundant recovery processing.
  • the header of the original data packet can be decrypted to obtain the encrypted packet body in the original data packet.
  • the encrypted packet body can be decrypted using the key obtained through key negotiation, and the decrypted packet body can be decrypted.
  • the obtained packet body is unpacked; for the original data packet group, the data obtained from the unpacked body can be arranged according to the arrangement position of the original data packet in the original data packet group, and the business data can be reconstructed.
  • the header of the target packet can include a format identification field, a sequence number field and a type field; the value of the format identification field can be used to identify that the target packet supports redundancy recovery processing or does not support redundancy recovery processing, and the value of the sequence number field can be It is used to identify the data packet group to which the target packet belongs.
  • the value of the type field can be used to identify the packet type of the target packet; if the value of the format identification field indicates that the target packet supports redundancy recovery processing, the value of the sequence number field identifies the target packet.
  • the data packet group it belongs to is the target data packet group, and the value of the type field is used to identify the packet type of the target packet as the data packet type, then it can be determined that the main body of the target packet is the corresponding original data packet in the original data packet group; if The value of the format identification field indicates that the target packet supports redundant recovery processing, and the value of the sequence number field indicates that the data packet group to which the target packet belongs is the target data. package group, and the value of the type field is used to identify the package type of the target package as a redundant package type, then it can be determined that the main body of the target package is the original redundant package.
  • packet loss detection is performed on the target data packet group, which may include: obtaining the number M of target data packets in the target data packet group sent by the data sending device,
  • the quantity M may be read from the header of the target redundant packet of the received target data packet group, that is, the header of the target redundant packet includes a data packet quantity field, or the quantity M may be sent separately by the data sending device.
  • the number of original data packets in the original data packet group contained in the queue is less than the number M, that is, the number of original data packets in the original data packet group and the number of original redundant packets contained in the queue is equal to the number M, then it can It is determined that there is packet loss in the target packet group; if the number of original packets in the original packet group contained in the queue is equal to the number M, it can be determined that there is no packet loss in the target packet group.
  • the number N of target redundant packets of the target data packet sent by the data sending device can be obtained.
  • the number N is the number of target redundant packets of the target data packet group received from the data sending device.
  • the header is read, that is, the header of the target redundant packet includes the redundant packet quantity field, or the quantity N can be sent separately by the data sending device, and N is a positive integer less than or equal to M; according to the quantity N, the receiving N target redundant packets of the target data packet sent by the data sending device; then the lost data packet can be redundantly restored based on the N target redundant packets of the target data packet group to obtain the lost data packet.
  • the body of each target redundant packet among the N target redundant packets can be read to obtain N original redundant packets; for any original redundant packet, the header of the original redundant packet can be decoded , obtain the encrypted package body in the original redundant package, and then use the key obtained through key negotiation to decrypt the encrypted package body, and unpack the decrypted package body to obtain the corresponding redundant data, and then The lost data packets can be recovered based on the non-lost data packets among the N redundant data and M original data packets.
  • the data receiving device can perform the processing according to the target redundant packet of the target data packet group. Redundant recovery processing recovers lost data packets; the premise that the data receiving device can recover lost data packets through redundant recovery processing is that the target data packets in the target data packet group support redundant recovery processing, and the target data packet group It is obtained by splicing each original data packet in the original data packet group and the corresponding first redundancy recovery parameter. Each original data packet in the original data packet group does not support redundancy recovery processing. The first redundancy recovery parameter is not supported.
  • the remaining recovery parameters refer to the parameters that need to be included in the data packets that support redundant recovery processing; that is to say, the data receiving device can directly and quickly recover the lost data packets without waiting for the data sending device to retransmit the lost data packets, which can reduce Transmission delay in case of packet loss improves data transmission efficiency.
  • the packet body can then be encrypted using the key determined through key negotiation with the data receiving device, and then the encrypted packet body can be encapsulated with a header, and an original data packet can be obtained.
  • the original data packet can be copied to the queue. It should be noted that during the process of copying the original data packet to the queue, a 2-byte size can be added to the header of the original data packet. , the 2-byte size is used to represent the packet length of the original packet. Then, the FEC header (ie, the first redundancy recovery parameter) can be spliced (ie, encapsulated) for the original data packet to obtain the target data packet, and the target data packet is sent to the data receiving device.
  • the FEC header ie, the first redundancy recovery parameter
  • the target data packet is sent to the data receiving device.
  • the data can be processed according to a set of original data packets.
  • the original data packets contained in the packet group generate N original redundant packets, and then the FEC header (i.e., the second redundancy recovery parameter) can be spliced (i.e., encapsulated) for each of the N original redundant packets. , obtain N target redundant packets, and send the N target redundant packets to the data receiving device.
  • the current data packet group includes 3 original data packets, and the data packet length (Data length) of the 3 original data packets is 50 bytes respectively. (Byte), 70 bytes and 100 bytes.
  • each original data packet adds 2 bytes of size to indicate the data packet length; you can obtain the maximum data packet length (max_length) in the current data packet group )100 bytes, and then allocate memory space (the memory space size of the data packet is: max_length ⁇ the number of original data packets contained in the current data packet group, the memory space size of the redundant packet: max_length ⁇ the original redundancy of the current data packet group number of packets), copy the original data packet to the memory space.
  • the FEC algorithm such as the Reed-Solomon Code algorithm stipulates that the data packet length of each original data packet used for redundant encoding must be consistent.
  • the embodiment of the present application can allocate a few more bytes (i.e., Reserve space) at the head and tail, so that the memory space can be allocated for the original data packet.
  • original packet When splicing the FEC header, directly use the Reserve space in the header, or directly use the Reserve space in the tail when filling the original data packet, which can save memory space allocation and the number of copies.
  • allocating memory space for the original redundant packet you can allocate a few more bytes (i.e., Reserve space) in the header, so that when splicing the FEC header for the original redundant packet, you can directly use the Reserve in the header.
  • flow control means that in order to avoid data packet loss, the sending speed of the data sending device needs to be controlled so that the data receiving device can receive it in time; congestion control acts on the network and means to prevent too much data from being injected into the network and avoid network load. Too large; Pacing processing refers to setting the target frequency so that the original data packet can be encapsulated according to the target frequency.
  • the target packet After receiving the target packet from the data sending device, the target packet can be parsed and the FEC header of the target packet can be parsed. If the target packet is determined to be a target data packet based on the value of the type field in the FEC header, the main body of the target packet, that is, the original data packet, can be copied to the queue. It should be noted that the copy needs to be in the header of the original data packet. Add a 2-byte size to the end, and the 2-byte size is used to identify the data packet length of the original data packet). If the target packet is determined to be a target redundant packet based on the value of the type field in the FEC header, the main body of the target packet, that is, the original redundant packet, can be copied to the queue.
  • the number of original data packets in the latest group of data packets in the queue (you can judge whether they belong to the same group of data packets through the sequence number field in the FEC header) reaches the number that needs to be included in the set data packet group.
  • the number of original data packets (this number can be obtained by the value of the number of data packets field in the FEC header of the target redundant packet), it can indicate that there is no data packet loss and no recovery is required.
  • the data packet can be determined The maximum sequence number of the packets in the group. If a subsequent packet with a sequence number less than or equal to the maximum sequence number is received, it will be discarded and the original data packets and original redundant packets stored in the queue will be deleted.
  • the number of original data packets in the latest group of data packets in the queue (you can judge whether they belong to the same group of data packets through the sequence number field in the FEC header) does not reach the set number of data packets that need to be included in the group
  • the number of original data packets (this number can be obtained by the value of the number of data packets field in the FEC header of the target redundant packet), for example, the number of original data packets and the original redundancy in the most recent group of data packets
  • the sum of the number of packets is equal to the number of original data packets that need to be included in the set data packet group, then it is determined that there is data packet loss, and the original redundant packets can be Recover lost original data packets.
  • the data encapsulated in the original data packet can be obtained by unpacking the header, decrypting, and unpacking the body; for the recovered original data packet, the zero value and size filled at the tail can be removed, and then By unpacking the header, decrypting, and unpacking the body, the data encapsulated in the original data packet can be obtained. Then the business data can be reconstructed according to the arrangement position indicated by the value of the serial number field.
  • the FEC header refers to the content that a data packet that supports redundancy recovery processing needs to contain.
  • the splicing process is The target data packet supports redundant recovery processing, so that when the target data packet is lost during transmission to the data receiving device, the data receiving device can quickly recover the lost data packet through redundant recovery processing, which can reduce Transmission delay in case of packet loss, thereby improving data transmission efficiency.
  • Figure 14 is a schematic structural diagram of a data processing device provided by an embodiment of the present application.
  • the data processing device can be provided in the computer equipment provided by the embodiment of the present application.
  • the computer equipment can be the computer device provided in the above method embodiment. and data sending equipment (level data sender).
  • the data processing device shown in Figure 14 can be a computer program (including program code) running in a computer device, and the data processing device can be used to perform some or all of the steps in the method embodiment shown in Figure 4 or Figure 7 .
  • the data processing device may include the following units:
  • the acquisition unit 1401 is used to obtain the original data packet group to be sent.
  • the original data packet group includes M original data packets.
  • the M original data packets are obtained by encapsulating the business data to be transmitted according to the transmission protocol.
  • the transmission protocol defines The packet format is a non-redundant recovery format, and M is a positive integer; obtain the first redundancy recovery parameter corresponding to each original data packet in the original data packet group;
  • the processing unit 1402 is configured to perform splicing processing on each original data packet in the original data packet group and the corresponding first redundancy recovery parameter to obtain M target data packets, and the M target data packets constitute the target data packet.
  • group wherein the first redundancy recovery parameter in each target data packet is used to indicate that the target data packet is in a redundant recovery format, and the target data packet in the redundant recovery format supports redundancy recovery processing;
  • the target data packet is The group is sent to the data receiving device, and N target redundant packets corresponding to the target data packet group are generated, where N is a positive integer less than or equal to M; the N target redundant packets are sent to the data receiving device, so that When the data receiving device detects that a data packet is lost in the target data packet group, it obtains the lost data packet through redundancy recovery processing based on the N target redundant packets.
  • the system can be configured by including a central processing unit (CPU), a random access
  • CPU central processing unit
  • a computer capable of executing some or all of the steps involved in the method shown in Figure 4 or Figure 7 runs on a general computing device such as a computer with processing elements and storage elements such as memory media (RAM) and read-only storage media (ROM).
  • Program including program code
  • the computer program can be recorded on, for example, a computer-readable storage medium, loaded into the above-mentioned computing device through the computer-readable storage medium, and run therein.
  • the first redundancy recovery parameter refers to the parameter that needs to be included in the data packet that supports redundancy recovery processing.
  • Each original data packet in the original data packet group does not support redundancy recovery processing.
  • the data sending device passes Each original data packet in the original data packet group is spliced with the corresponding first redundancy recovery parameter, so that each target data packet in the target data packet group obtained by the splicing process supports redundancy recovery processing, thereby , when the target data packet group is lost during transmission to the data receiving device, the data receiving device can quickly recover the lost data packets through redundant recovery processing, and the data sending device does not need to retransmit the lost data packets. In this way It can reduce transmission delay in the case of packet loss and improve data transmission efficiency.
  • Figure 15 is a schematic structural diagram of another data processing device provided by an embodiment of the present application.
  • the data processing device can be provided in the computer equipment provided by the embodiment of the present application.
  • the computer equipment can be one of the above method embodiments.
  • the mentioned data receiving device i.e. the data receiver).
  • the data processing device shown in FIG. 15 may be a computer program (including program code) running in a computer device, and the data processing device may be used to execute some or all of the steps in the method embodiment shown in FIG. 10 .
  • the data processing device may include the following units:
  • the processing unit 1501 is configured to receive a target data packet group from a data sending device, wherein the data sending device obtains an original data packet group to be sent, and the original data packet group includes M original data packets, and the M original data packets are The original data packet is obtained by encapsulating the business data to be transmitted according to the transmission protocol.
  • the packet format defined by the transmission protocol is a non-redundant recovery format, and M is a positive integer; the data sending device obtains the original data packet group
  • Each original data packet corresponds to the first redundancy recovery parameter, and each original data packet in the original data packet group and the corresponding first redundancy recovery parameter are separately spliced to obtain M pieces of target data.
  • the target data packet group of the package wherein, the first redundancy recovery parameter in each target data packet is used to indicate that the target data packet is in a redundant recovery format, and the target data packet in the redundancy recovery format supports redundancy. recovery processing;
  • N target redundant packets from the data sending device, the N target redundant packets correspond to the target data packet group, and N is a positive integer less than or equal to M;
  • the lost data packet is obtained through redundancy recovery processing based on the N target redundant packets.
  • each unit in the data processing device shown in Figures 14 and 15 can be separately or entirely combined into one or several additional units to form, or one (some) of the units can also be It is then divided into multiple functionally smaller units to form a structure, which can achieve the same operation without affecting the realization of the technical effects of the embodiments of the present application.
  • the above units are divided based on logical functions.
  • the function of one unit can also be realized by multiple units, or the functions of multiple units can be realized by one unit.
  • the data processing device may also include other units. In practical applications, these functions may also be implemented with the assistance of other units, and may be implemented by multiple units in cooperation.
  • the method can be implemented on a general computing device such as a computer including a central processing unit (CPU), a random access storage medium (RAM), a read-only storage medium (ROM), and other processing elements and storage elements.
  • a computer program including program code capable of executing some or all steps involved in the method shown in Figure 10, to construct the data processing device shown in Figure 15, and to implement the data processing of the embodiment of the present application.
  • the computer program can be recorded on, for example, a computer-readable storage medium, loaded into the above-mentioned computing device through the computer-readable storage medium, and run therein.
  • the data receiving device can recover the lost data packet through redundancy recovery processing.
  • the premise that the data receiving device can recover the lost data packets through redundant recovery processing is that the target data packets in the target data packet group support redundant recovery processing, and the target data packet group is to restore each original data packet in the original data packet group.
  • the data packets are obtained by splicing the corresponding first redundancy recovery parameters. Each original data packet in the original data packet group does not support redundancy recovery processing.
  • the first redundancy recovery parameter refers to the data packet that supports redundancy recovery processing.
  • the parameters that the data packet needs to contain that is to say, the data receiving device can directly and quickly recover the lost data packet without waiting for the data sending device to retransmit the lost data packet, which can reduce the transmission delay in the case of packet loss and improve the data transmission efficiency.
  • FIG. 16 is a schematic structural diagram of a computer device provided by an embodiment of the present application.
  • the computer device shown in FIG. 16 at least includes a processor 1601, an input interface 1602, an output interface 1603, and a computer-readable storage medium 1604.
  • the processor 1601, the input interface 1602, the output interface 1603 and the computer-readable storage medium 1604 can be connected through a bus or other means.
  • the computer-readable storage medium 1604 may be stored in the memory of the computer device.
  • the computer-readable storage medium 1604 is used to store a computer program.
  • the computer program includes computer instructions.
  • the processor 1601 is used to execute the program instructions stored in the computer-readable storage medium 1604.
  • Processor 1601 (or CPU (Central Processing Unit, The central processing unit (CPU)) is the computing core and control core of a computer device, which is suitable for implementing one or more computer instructions. Specifically, it is suitable for loading and executing one or more computer instructions to implement corresponding method processes or corresponding functions.
  • Embodiments of the present application also provide a computer-readable storage medium (Memory).
  • the computer-readable storage medium is a memory device in a computer device and is used to store programs and data. It can be understood that the computer-readable storage media here may include built-in storage media in the computer device, and of course may also include extended storage media supported by the computer device.
  • Computer-readable storage media provide storage space that stores the operating system of the computer device. Furthermore, the storage space also stores one or more computer instructions suitable for being loaded and executed by the processor. These computer instructions may be one or more computer programs (including program codes).
  • the computer-readable storage medium here can be a high-speed RAM memory, or a non-volatile memory (Non-Volatile Memory), such as at least one disk memory; it can also be at least one located far away from the aforementioned processor.
  • Computer-readable storage media can be a high-speed RAM memory, or a non-volatile memory (Non-Volatile Memory), such as at least one disk memory; it can also be at least one located far away from the aforementioned processor.
  • one or more computer instructions stored in the computer-readable storage medium 1604 can be loaded and executed by the processor 1601 to implement the above corresponding steps of the data processing method shown in FIG. 4 or FIG. 7 . In some embodiments, one or more computer instructions stored in the computer-readable storage medium 1604 can be loaded and executed by the processor 1601 to implement the above corresponding steps of the data processing method shown in FIG. 10 .
  • a computer program product or computer program includes computer instructions stored in a computer-readable storage medium.
  • the processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the data processing method provided in the various embodiments described above.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Communication Control (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本申请实施例提供了一种数据处理方法、装置、计算机设备及存储介质,该数据处理方法包括:获取包括M个原始数据包的原始数据包组,M个原始数据包的包格式为非冗余恢复格式;将每个原始数据包与对应的第一冗余恢复参数进行拼接处理,得到包括M个目标数据包的目标数据包组,每个目标数据包为冗余恢复格式且支持冗余恢复处理;将目标数据包组发送至数据接收设备,生成所述目标数据包组对应的N个目标冗余包;将所述N个目标冗余包发送至数据接收设备,以使数据接收设备在检测到目标数据包组中存在数据包丢失时,根据所述N个目标冗余包通过冗余恢复处理得到丢失的数据包。

Description

数据处理方法、装置、计算机设备及存储介质
本申请要求于2022年4月21日提交中国专利局、申请号为202210418803.3,发明名称为“一种数据处理方法及相关设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及互联网技术领域,尤其涉及数据传输技术领域,具体涉及一种数据处理方法、装置、计算机设备及存储介质。
背景技术
随着互联网技术的快速发展,互联网业务(例如游戏业务、音视频业务等)对数据传输的要求越来越高。数据发送方通常将数据封装为一个或多个数据包进行发送,数据接收方通过解析这些数据包来重建传输的数据;在数据包的传输过程中,弱网(例如网络信号差)、网络拥堵(例如网络中传输的数据量较大导致的拥堵)等情况会导致丢包(即数据包丢失),丢包会使得数据接收方重建的数据不完整,因此互联网业务通常要求解决数据包在传输过程中丢失的问题。
目前,解决数据包在传输过程中丢失的问题所采用的技术手段为ARQ(Automatic Repeat-reQuest,自动重传请求),ARQ规定数据接收方在接收到来自数据发送方的数据包后,立即向数据发送方返回该数据包的确认帧,如果数据发送方在发送数据包一段时间后未收到该数据包的确认帧,数据发送方便认为数据包在传输过程中丢失了,会重新发送该数据包。
技术内容
本申请实施例提供了一种数据处理方法、装置、计算机设备及存储介质,可以降低丢包情况下的数据传输时延,提升数据传输效率。
本申请实施例提供了一种数据处理方法,由数据发送设备执行,该数据处理方法包括:
获取待发送的原始数据包组,原始数据包组包括M个原始数据包,M个原始数据包是按照传输协议对待传输的业务数据进行封装得到的,所述传输协议定义的包格式为非冗余恢复格式,M为正整数;获取原始数据包组中的每个原始数据包各自对应的第一 冗余恢复参数;将原始数据包组中的每个原始数据包与对应的第一冗余恢复参数进行拼接处理,得到M个目标数据包,所述M个目标数据包组成目标数据包组,其中,每个目标数据包中的第一冗余恢复参数用于指示该目标数据包为冗余恢复格式,所述冗余恢复格式的目标数据包支持冗余恢复处理;将目标数据包组发送至数据接收设备,生成所述目标数据包组对应的N个目标冗余包,N为小于或等于M的正整数;将所述N个目标冗余包发送至数据接收设备,以使数据接收设备在检测到目标数据包组中存在数据包丢失时,根据所述N个目标冗余包通过冗余恢复处理得到丢失的数据包。
本申请实施例提供了另一种数据处理方法,由数据接收设备执行,该数据处理方法包括:
接收来自数据发送设备的目标数据包组,其中,所述数据发送设备获取待发送的原始数据包组,所述原始数据包组包括M个原始数据包,所述M个原始数据包是按照传输协议对待传输的业务数据进行封装得到的,所述传输协议定义的包格式为非冗余恢复格式,M为正整数;所述数据发送设备获取所述原始数据包组中的每个原始数据包各自对应的第一冗余恢复参数,将所述原始数据包组中的每个原始数据包与对应的第一冗余恢复参数分别进行拼接处理,得到包括M个目标数据包的所述目标数据包组;其中,每个目标数据包中的第一冗余恢复参数用于指示该目标数据包为冗余恢复格式,所述冗余恢复格式的目标数据包支持冗余恢复处理;
接收来自所述数据发送设备的N个目标冗余包,所述N个目标冗余包与所述目标数据包组对应,且N为小于或等于M的正整数;
若检测到目标数据包组中存在数据包丢失,则根据所述N个目标冗余包通过冗余恢复处理得到丢失的数据包。
本申请实施例提供了一种数据处理装置,该数据处理装置包括:
获取单元,用于获取待发送的原始数据包组,原始数据包组包括M个原始数据包,M个原始数据包是按照传输协议对待传输的业务数据进行封装得到的,所述传输协议定义的包格式为非冗余恢复格式,M为正整数;获取原始数据包组中的每个原始数据包各自对应的第一冗余恢复参数;
处理单元,用于将原始数据包组中的每个原始数据包与对应的第一冗余恢复参数分别进行拼接处理,得到M个目标数据包,所述M个目标数据包组成目标数据包组,其中,每个目标数据包中的第一冗余恢复参数用于指示该目标数据包为冗余恢复格式,所述冗余恢复格式的目标数据包支持冗余恢复处理;将目标数据包组发送至数据接收设备, 生成所述目标数据包组对应的N个目标冗余包,N为小于或等于M的正整数;将所述N个目标冗余包发送至数据接收设备,以使数据接收设备在检测到目标数据包组中存在数据包丢失时,根据所述N个目标冗余包通过冗余恢复处理得到丢失的数据包。
本申请实施例提供了另一种数据处理装置,该数据处理装置包括:
处理单元,用于接收来自数据发送设备的目标数据包组,其中,所述数据发送设备获取待发送的原始数据包组,所述原始数据包组包括M个原始数据包,所述M个原始数据包是按照传输协议对待传输的业务数据进行封装得到的,所述传输协议定义的包格式为非冗余恢复格式,M为正整数;所述数据发送设备获取所述原始数据包组中的每个原始数据包各自对应的第一冗余恢复参数,将所述原始数据包组中的每个原始数据包与对应的第一冗余恢复参数分别进行拼接处理,得到包括M个目标数据包的所述目标数据包组;其中,每个目标数据包中的第一冗余恢复参数用于指示该目标数据包为冗余恢复格式,所述冗余恢复格式的目标数据包支持冗余恢复处理;
接收来自所述数据发送设备的N个目标冗余包,所述N个目标冗余包与所述目标数据包组对应,且N为小于或等于M的正整数;
若检测到目标数据包组中存在数据包丢失,则根据所述N个目标冗余包通过冗余恢复处理得到丢失的数据包。
本申请实施例提供一种计算机设备,该计算机设备包括处理器和计算机可读存储介质。其中:
处理器适于实现计算机程序,计算机可读存储介质存储有计算机程序,计算机程序适于由处理器加载并执行上述的数据处理方法。
本申请实施例提供一种计算机可读存储介质,该计算机可读存储介质存储有计算机程序,该计算机程序被计算机设备的处理器读取并执行时,使得计算机设备执行上述的数据处理方法。
本申请实施例提供了一种计算机程序产品或计算机程序,该计算机程序产品或计算机程序包括计算机指令,该计算机指令存储在计算机可读存储介质中。计算机设备的处理器从计算机可读存储介质读取该计算机指令,处理器执行该计算机指令,使得该计算机设备执行上述的数据处理方法。
附图简要说明
图1A是本申请实施例提供的一种恢复丢失数据包的过程示意图;
图1B是本申请实施例提供的另一种恢复丢失数据包的过程示意图;
图2是本申请实施例提供的一种数据处理系统的架构示意图;
图3是本申请实施例提供的一种云游戏场景的数据传输过程的示意图;
图4是本申请实施例提供一种数据处理方法的流程示意图;
图5A是本申请实施例提供的一种原始数据包的结构示意图;
图5B是本申请实施例提供的另一种原始数据包的结构示意图;
图5C是本申请实施例提供的再一种原始数据包的结构示意图;
图6是本申请实施例提供的一种目标数据包的结构示意图;
图7A和7B是本申请实施例提供的另一种数据处理方法的流程示意图;
图8A是本申请实施例提供的一种目标冗余包的结构示意图;
图8B是本申请实施例提供的另一种目标冗余包的结构示意图;
图9A是本申请实施例提供的一种密钥协商过程的流程示意图;
图9B是本申请实施例提供的另一种密钥协商过程的流程示意图;
图10是本申请实施例提供的再一种数据处理方法的流程示意图;
图11是本申请实施例提供的一种数据处理方法的交互流程示意图;
图12是本申请实施例提供的一种原始冗余包的生成过程的示意图;
图13是本申请实施例提供的一种内存分配策略的示意图;
图14是本申请实施例提供的一种数据处理装置的结构示意图;
图15是本申请实施例提供的另一种数据处理装置的结构示意图;
图16是本申请实施例提供的一种计算机设备的结构示意图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
为了更清楚地理解本申请实施例提供的技术方案,在此先对本申请实施例涉及的关键术语进行介绍:
(1)本申请实施例涉及数据传输技术。数据传输技术是指数据发送方和数据接收方之间通过一个或多个数据通道或链路,共同遵循一个传输协议来进行数据传输的技术。 基于数据传输技术的数据传输过程可以更具体地理解为:数据发送方按照传输协议将待传输的数据封装为一个或多个数据包,然后将一个或多个数据包传输至数据接收方,数据接收方通过解析一个或多个数据包来重建传输的数据。其中,传输协议是指数据发送方和数据接收方之间进行数据传输所必须遵循的规则和约定,传输协议中定义了用于封装数据的数据包的格式。
(2)本申请实施例涉及FEC。FEC(Forward Error Correction,前向纠错)是一种差错控制方式,它是指信号在被送入传输信道之前预先按一定的算法进行编码处理,加入带有信号本身特征的冗余码,在接收方按照相应算法对接收到的信号进行解码,从而找出在传输过程中产生的错误码并将其纠正的技术。在本申请实施例中,FEC用于进行冗余恢复处理,恢复出数据传输过程中丢失的数据包。具体来说,数据发送方按照传输协议将待传输的数据封装为一个或多个数据包,数据发送方还可以基于FEC算法生成一个或多个数据包的冗余包,并将数据包和冗余包均发送至数据接收方,数据接收方在检测到数据包丢失时,可以进行根据冗余包和未丢失的数据包恢复出丢失的数据包。下面结合图1A和图1B对ARQ和FEC进行比对:
图1A示出了ARQ恢复丢失的数据包的过程:数据发送方传输数据包A、数据包B和数据包C至数据接收方,在数据传输过程中数据包B丢失了,数据发送方在检测到数据包B丢失(数据发送方发送数据包B一段时间后未收到数据接收方返回的确认帧)后,重新传输数据包B至数据接收方。在上述过程中,传输时延至少包括检测到数据包B丢失的时延和重新传输数据包B的时延(RTT/2),数据传输效率不高。其中,RTT(Round-Trip Time,往返时延)是指从数据发送方发送数据包开始,到数据发送方接收到来自数据接收方返回的该数据包的确认帧为止的时间段所产生的时延。
ARQ虽然能够克服数据包在传输过程中丢失的问题,但是却带来了非常高的传输时延(包括检测到数据包丢失的时延和重新传输数据包的时延),导致数据传输效率比较低。
图1B示出了FEC恢复丢失的数据包的过程:数据发送方基于FEC算法生成数据包A、数据包B和数据包C的冗余包,将数据包A、数据包B、数据包C以及冗余包发送至数据接收方,当数据接收方检测到数据包B丢失后,可以根据数据包A、数据包C和冗余包恢复出丢失的数据包B,无需重新传输数据包B,降低了丢包情况下的传输时延,提升了数据传输效率。
(3)本申请实施例涉及云游戏。云游戏是以云计算为基础的游戏方式,在云游戏 的运行模式下,所有游戏都在游戏服务器运行,游戏服务器将渲染完毕后的游戏媒体数据(例如游戏画面、游戏音频等)压缩后通过网络传送给游戏客户端,游戏客户端向游戏玩家呈现游戏媒体数据;游戏玩家在游戏客户端中的操作数据会通过网络传输到游戏服务器,达到操作游戏的目的。其中,云计算(Cloud Computing)是一种计算模式,它将计算任务分布在大量计算机构成的资源池上,使各种应用系统能够根据需要获取计算力、存储空间和信息服务。
基于上述关键术语的相关描述,本申请实施例提供了一种数据处理方案,在该数据处理方案中,数据发送方通过将冗余恢复参数(冗余恢复参数是指支持冗余恢复处理的数据包需包含的参数)与不支持冗余恢复处理的原始数据包进行拼接处理,使得拼接处理得到的目标数据包支持冗余恢复处理;所谓数据包支持冗余恢复处理是指:检测到数据包在传输过程中丢失时,可以通过相应的冗余包恢复出该数据包;所谓数据包不支持冗余恢复处理是指:检测到数据包在传输过程中丢失时,不可以通过相应的冗余包恢复出该数据包;也就是说,本申请实施例在数据发送方将支持冗余恢复处理的目标数据包以及相应的冗余包发送至数据接收方后,若数据接收方检测到数据包丢失,则数据接收方可以通过相应的冗余包恢复出丢失的数据包,这样可以降低丢包情况下的数据传输时延,提升数据传输效率。
另外,本申请实施例中数据处理方案提供的数据处理能力可以封装于数据处理工具包中,该数据处理能力具体可以包括:通过将冗余恢复参数与不支持冗余恢复处理的原始数据包进行拼接处理,使得拼接得到的目标数据包支持冗余恢复处理的能力,或者在检测到支持冗余恢复处理的目标数据包丢失时,通过冗余恢复处理恢复出丢失的数据包的能力。该数据处理工具包例如可以是SDK(Software Development Kit,软件开发工具包),可以通过将数据处理工具包接入应用程序、软件、以及设备等中,使得应用程序、软件、以及设备等具备数据处理能力;例如,当该数据处理工具包接入数据发送方后,数据发送方便具备了通过将冗余恢复参数与不支持冗余恢复处理的原始数据包进行拼接处理,使得拼接得到的目标数据包支持冗余恢复处理的能力;当该数据处理工具包接入数据接收方之后,数据接收方便具备了在检测到支持冗余恢复处理的目标数据包丢失时,通过冗余恢复处理恢复出丢失的数据包的能力。
下面结合图2对适于实现本申请实施例提供数据处理方案的数据处理系统进行介绍。如图2所示,数据处理系统20可以包括数据发送设备201和数据接收设备202,数据发送设备201可以是终端或服务器,数据接收设备202可以是终端或服务器,数据发 送设备201与数据接收设备202之间可以通过有线通信方式或无线通信方式进行直接或间接地通信连接。本申请实施例提及的终端可以是智能手机、平板电脑、笔记本电脑、台式计算机、智能音箱、智能手表、智能电视、车载终端、以及游戏手柄等,但并不局限于此;本申请实施例提及的服务器可以是独立的物理服务器,也可以是多个物理服务器构成的服务器集群或者分布式系统,还可以是提供云服务、云数据库、云计算、云函数、云存储、网络服务、云通信、中间件服务、域名服务、安全服务、CDN(Content Delivery Network,内容分发网络)、以及大数据和人工智能平台等基础云计算服务的云服务器。其中:
(1)数据发送设备201。数据发送设备对应于数据发送方,数据发送设备可以获取待传输的业务数据,然后可以按照传输协议(即上述提及的传输协议)对待传输的业务数据进行封装,得到一个或多个原始数据包,按照传输协议封装得到的一个或多个原始数据包均不支持冗余恢复处理;原始数据包可以数据包组为单位,每达到一定数量的原始数据包可以组成一个数据包组(group),不同的数据包组中包含的原始数据包的数量可以相同,也可以不同。
针对待传输的业务数据封装得到的任一个数据包组(可以称为原始数据包组),原始数据包组中可以包括M个原始数据包,按照传输协议封装得到的M个原始数据包均不支持冗余恢复处理,M为正整数。数据发送设备可以在原始数据包组中的每个原始数据包的前面封装一个包头(冗余恢复参数)进行拼接处理,得到支持冗余恢复处理的M个目标数据包,M个目标数据包组成目标数据包组,数据发送设备可以将目标数据包组发送至数据接收设备。数据发送设备还可以生成目标数据包组的N个目标冗余包,并将目标数据包组的N个目标冗余包发送至数据接收设备,生成的目标冗余包的数量需小于或等于原始数据包的数量,即N为小于或等于M的正整数。
(2)数据接收设备202。数据接收设备对应于数据接收方,针对目标数据包组,数据接收设备可以接收来自数据发送设备的目标数据包组,若数据接收设备检测到目标数据包组中存在数据包丢失,则数据接收设备可以根据接收到的来自数据发送设备的N个目标冗余包和未丢失的数据包恢复出丢失的数据包。从而,数据接收设备可以根据接收到的数据包和恢复出的数据包重建业务数据,随着数据接收设备不断地接收来自数据发送设备的数据包组,数据接收设备最终可以重建完整的业务数据。
通过图2所示的系统架构,当数据发送设备向数据接收设备发送的数据包组在传输过程中存在数据包丢失时,数据接收设备通过冗余恢复处理可以快速恢复丢失的数据包, 数据发送设备无需重新发送丢失的数据包,数据接收设备无需等待重新发送的丢失的数据包,这样可以降低丢包情况下的数据传输时延,提升数据发送设备与数据接收设备之间的数据传输效率。可以理解的是,本申请实施例描述的数据处理系统是为了更加清楚的说明本申请实施例的技术方案,并不构成对于本申请实施例提供的技术方案的限定,本领域普通技术人员可知,随着系统架构的演变和新业务场景的出现,本申请实施例提供的技术方案对于类似的技术问题,同样适用。
本申请实施例提供的数据处理方案与云游戏相结合可以达到优秀的技术效果,下面结合图3介绍本申请实施例提供的数据处理方案在云游戏场景中的具体应用:
在一种实现方式中,数据发送设备中可以运行有云游戏的游戏客户端,游戏玩家可以通过游戏客户端操作云游戏,或者,数据发送设备可以是云游戏的游戏手柄,游戏玩家可以通过游戏手柄操作云游戏;数据接收设备可以是云游戏的游戏服务器,游戏服务器中运行有Cloud Game Engine(云游戏引擎),Cloud Game Engine中运行有云游戏。当数据发送设备检测到游戏玩家对云游戏的操作事件(例如触屏事件、键盘鼠标事件、摇杆事件等)时,数据发送设备会将操作事件对应的操作数据(例如触屏数据、键盘鼠标数据、摇杆数据等)发送至游戏服务器,从而游戏服务器可以将操作数据注入到云游戏引擎中,达到操作游戏的目的。云游戏场景对游戏玩家的操作延迟是非常敏感的,在游戏客户端将操作数据发送至游戏服务器的过程中,可以采用本申请实施例提供的数据处理方案,这样可以在网络质量较差导致部分操作数据丢失的情况下,快速恢复出丢失的操作数据,从而可以降低云游戏的操作延迟,提升游戏玩家的云游戏体验。
在另一种实现方式中,数据发送设备可以是游戏服务器,数据接收设备中可以运行有游戏客户端,游戏客户端可以向游戏玩家呈现包括游戏画面、游戏音频等的游戏媒体数据。数据发送设备可以将Cloud Game Engine渲染得到的游戏画面、游戏音频等游戏媒体数据传输至数据接收设备,数据接收设备可以通过游戏客户端向游戏玩家呈现游戏媒体数据,在游戏服务器将游戏媒体数据发送至游戏客户端的过程中可以采用本申请实施例提供的数据处理方案,这样可以在网络质量较差导致部分游戏媒体数据丢失的情况下,快速恢复出丢失的游戏媒体数据,从而可以降低云游戏的媒体呈现延迟,提升游戏玩家的云游戏体验。
下面结合附图对本申请实施例提供的数据处理方案进行更为详细地介绍。
本申请实施例提供一种数据处理方法,该数据处理方法主要介绍冗余恢复参数与不支持冗余恢复处理的原始数据包的拼接处理等内容,该数据处理方法可以由上述数据处 理系统20中的数据发送设备201(即数据发送方)执行,请参见图4,该数据处理方法可以包括以下步骤S401-步骤S404:
S401,获取原始数据包组,原始数据包组包括M个原始数据包。
数据发送设备可以获取待传输的业务数据,然后可以按照传输协议对待传输的业务数据进行封装,得到一个或多个原始数据包,原始数据包可以数据包组为单位,每达到一定数量的原始数据包可以组成一个数据包组,不同的数据包组中包含的原始数据包的数量可以相同,也可以不同。本申请实施例以对待传输的业务数据进行封装得到的任一个数据包组(即原始数据包组)为例进行介绍,原始数据包组是按照传输协议对业务数据中的业务数据进行封装得到的,原始数据包组可以包括M个原始数据包,通过传输协议封装得到的每个原始数据包均不支持冗余恢复处理,M为正整数。
其中,传输协议定义的包格式为非冗余恢复格式,使得传输协议封装得到的原始数据包不支持冗余恢复处理,即检测到原始数据包在传输过程中丢失时,不可以通过相应的冗余包恢复出该原始数据包。本申请实施例以传输协议是QUIC(Quick UDPInternet Connection,快速UDP(User Datagram Protocol,用户数据包协议)互联网连接)协议为例进行说明,除QUIC协议外的其他传输协议均可参见本申请实施例中关于QUIC协议的相关描述。QUIC协议是使用UDP进行多路转发传输的协议,相对于TCP(Transmission Control Protocol,传输控制协议)有诸多优势。QUIC协议至少可以包括gQUIC协议或IETF QUIC协议中的任一种,gQUIC协议是在特定的网页浏览器中实现的早期QUIC版本协议,IETF QUIC协议是IETF(The Internet Engineering Task Force,互联网工程任务组)标准组织的QUIC协议规范,gQUIC协议和IETF QUIC协议定义的包格式有一些差异,下面结合图5A对gQUIC协议定义的包格式进行介绍,结合图5B和图5C对IETF QUIC协议定义的包格式进行介绍:
①gQUIC协议定义的包格式:
如图5A所示,gQUIC协议定义的包格式包括包头和包体;包头中可以包括Public Flags字段、Connection ID字段、Quic Version字段、Diversification Nonce字段、Packet Number字段;包体中可以包括payload(有效载荷)。其中:
Public Flags字段(公共标识字段):表示公共标识位,Public Flags字段的大小为8bit(比特)。第一个比特(bit0)为PUBLIC_FLAGS_VERSION(公共标志版本)字段,当数据发送设备为客户端时,设置PUBLIC_FLAGS_VERSION字段的取值表示数据包的包头中包含QUIC版本号,当数据发送设备为服务器时,设置 PUBLIC_FLAGS_VERSION字段的取值表示数据包为版本数据包;第二个比特(bit1)为PUBLIC_FLAGS_RESET(公共标志重置)字段,设置PUBLIC_FLAGS_RESET字段的取值表示数据包为公共复位数据包;第三个比特(bit2)为Diversification Nonce字段,设置Diversification Nonce字段的取值表示包头中包含Diversification Nonce字段;设置第四个比特(bit4)的取值表示包头中包含64bit的Connection ID字段;第五个比特(bit4)和第六个比特(bit5)的取值表示Packet Number字段的字节数;第七个比特(bit6)当前未使用,为多路径使用保留;第八个比特(bit7)当前未使用,必须设置为0。
Connection ID字段(连接标识字段):字段取值为数据发送设备的连接标识,用于唯一标识数据发送设备的身份。
QUIC Version字段(协议版本字段):字段取值用于标识QUIC协议版本。
Diversification Nonce字段(多样化随机数字段):字段取值为多样化随机数。
Packet Number字段(包号字段):字段取值用于标识数据包的序号,数据发送设备给每个常规数据包(特殊公共重置数据包、版本协商数据包则不需要)分配一个序号,例如,发送的第一个数据包的序号为1,之后的数据包的序号在前一个数据包的基础上加1。
payload中可以按照数据帧(frame)封装业务数据,payload中包括Authenticated Hash字段(认证哈希字段),以及一个或多个frame,每个frame包括type字段(数据帧类型字段),frame header(数据帧头部)和frame payload(数据帧的有效载荷),待传输的业务数据被真正封装于frame payload中。
②IETF QUIC协议定义的包格式:
IETF QUIC协议定义的包格式包括长报头的包格式和短报头包格式;在连接建立过程中收发的数据包都使用长报头(long header),具有长报头的数据包可以包括初始数据包(Initial)、0-RTT数据包(0-RTT)、握手数据包(Handshake)和重试数据包(Retry)、以及版本协商数据包(Version Negotiation),图5B以版本协商数据包的格式为例进行介绍:
如图5B所示,版本协商数据包的格式包括包头和包体;包头中可以包括Public Flags字段、Quic Version字段、DCID len字段、Destination Connection ID字段、SCID len字段、以及Source Connection ID字段;包体中可以包括payload(有效载荷)。其中:
Public Flags字段(公共标识字段):表示公共标识位,Public Flags字段的大小为 8bit(比特)。当第八个比特(bit7)设置为1时表明该数据包为长报头的数据包;第七个比特(bit6)必须设置为1,若该比特被设置为0,则认为该数据包为无效的数据包,必须直接丢弃;第六个比特(bit5)和第五个比特(bit4)的取值用于标识数据包的具体类型,例如,0x0表示数据包的类型为原始数据包,0x1表示数据包的类型为0-RTT数据包,0x2表示数据包的类型为握手数据包,0x3表示数据包的类型为重试数据包;第四个比特(bit3)至第一个比特(bit0)用于特定类型,不同类型的数据包具有不同的含义。
QUIC Version字段(协议版本字段):字段取值用于标识QUIC协议版本。
DCID len字段(目标连接标识长度字段):字段取值用于标识Destination Connection ID字段的长度。
Destination Connection ID字段(目标连接标识字段):字段取值为数据接收设备的连接标识,可以用于唯一标识数据接收设备的身份。
SCID len字段(源连接标识长度字段):字段取值用于标识Source Connection ID字段长度。
Source Connection ID字段(源连接标识字段):字段取值为数据发送设备的连接标识,用于唯一标识数据发送设备的身份。
payload中可以包括支持的多个版本(Supported Version1...Supported VersionP,即支持的版本1..支持的版本P)。
短报头的数据包在版本协商和1-RTT密钥协商之后使用,主要传输常用的数据帧。如图5C所示,短报头的数据包的格式可以包括包头和包体;包头中可以包括Public Flags字段、Destination Connection ID字段、以及Packet Number字段;包体中可以包括被加密的有效载荷(encrypted data)。其中:
Public Flags字段(公共标识字段):表示公共标识位,Public Flags字段的大小为8bit(比特);当第八个比特(bit7)设置为0时表明该数据包为短报头的数据包;第七个比特(bit6)必须设置为1,若该比特被设置为0,则认为该数据包为无效的数据包,必须直接丢弃;第六个比特(bit5)表示延迟自旋位;第五个比特(bit4)和第四个比特(bit3)为保留字段;第三个比特(bit2)的取值用于标识是否已经更新了密钥(密钥更新在握手确认之后),初始设置为0,在每次密钥更新之后反转,数据接收设备通过该字段可以判断密钥是否发生了变化;第二个比特(bit1)和第一个比特(bit0)的取值用于标识包头中的Packet Number字段的长度。
Destination Connection ID字段(目标连接标识字段):字段取值为数据发送设备的连接标识,用于唯一标识数据发送设备的身份。
Packet Number字段(包号字段):字段取值用于标识数据包的序号。
基于以上传输协议定义的包格式的相关描述,在此对原始数据包的封装过程进行介绍,原始数据包可以是按照短报头格式进行封装的,具体来说:可以按照MTU(Maximum Transmission Unit,最大传输单元)指示的目标数据长度对待传输的业务数据进行划分,对划分得到的长度为目标数据长度的数据进行封包体,即将划分得到的长度为目标数据长度的数据作为原始数据包的包体,然后可以采用与数据接收设备经密钥协商确定的密钥对包体进行加密,然后可以对加密后的包体封装包头,便可以得到一个原始数据包。其中,MTU是数据链路层的概念,用于限制数据链路层的有效载荷的大小。
S402,获取原始数据包组中的每个原始数据包各自对应的第一冗余恢复参数。
原始数据包组中的每个原始数据包各自对应一个第一冗余恢复参数。在一种实现方式中,第一冗余恢复参数可以包括格式标识参数,格式标识参数可以用于标识冗余恢复格式(FEC格式),也就是说,当数据包中包括冗余标识参数时,说明该数据包的包格式为冗余恢复格式,包格式为冗余恢复格式的数据包支持冗余恢复处理。在另一种实现方式中,第一冗余恢复参数除包括格式标识参数外,还可以包括序号参数或类型参数中的任意一种或两种,序号参数可以用于标识数据包所属的数据包组以及数据包在数据包组中的排列序号,类型参数可以用于标识数据包的包类型。
S403,将原始数据包组中的每个原始数据包与对应的第一冗余恢复参数进行拼接处理,得到M个目标数据包,M个目标数据包组成目标数据包组。
在获取到原始数据包组中的每个原始数据包各自对应的第一冗余恢复参数之后,可以将原始数据包组中的每个原始数据包与对应的第一冗余恢复参数进行拼接处理(也可以称为封装处理),得到目标数据包组,目标数据包组包括M个目标数据包。为了便于理解,在此以原始数据包组中的第m个原始数据包的拼接处理过程为例,对第m个原始数据包对应的第一冗余恢复参数与第m个原始数据包进行拼接处理,可以得到第m个原始数据包对应的第m个目标数据包,m为小于或等于M的正整数。具体的拼接过程如下:针对原始数据包组中的第m个原始数据包,可以生成第m个原始数据包对应的第m个数据包体,第m个数据包体是指用于对第m个原始数据包和第m个原始数据包对应的第一冗余恢复参数进行拼接处理的包结构,第m个数据包体可以包括头部和主体;然后,可以将第m个原始数据包对应的第一冗余恢复参数添加至第m个数据包体 的头部,将第m个原始数据包添加至第m个数据包体的主体,得到第m个原始数据包对应的第m个目标数据包,可以看出,拼接处理过程即是为第m个原始数据包添加了FEC头部(FEC header)。
在一种实现方式中,第m个原始数据包对应的第一冗余恢复参数可以包括:格式标识参数、序号参数和类型参数,第m个数据包体的头部可以包括:格式标识字段(FEC Format Flags)、序号字段(FEC SEQ ID)和类型字段(FEC Type)。如图6所示,可以将格式标识参数添加至格式标识字段中,格式标识参数可以用于标识第m个目标数据包的包格式为冗余恢复格式,冗余恢复格式即FEC头部包裹的主体,包格式为冗余恢复格式的第m个目标数据包支持冗余恢复处理;可以将序号参数添加至序号字段中,序号参数可以用于标识第m个目标数据包属于目标数据包组,以及第m个目标数据包在目标数据包组中的排列序号,例如,目标数据包组中各个包的序号为0-7,第m个目标数据包的序号参数为3,标识第m个目标数据包属于目标数据包组,且第m个目标数据包在目标数据包组中排列于第4位;可以将类型参数添加至类型字段中,类型参数用于标识第m个目标数据包的包类型为数据包类型;以及可以将第m个原始数据包添加至第m个数据包体的主体,最终得到第m个目标数据包。通过这种方式,以头部的形式为原始数据包添加第一冗余恢复参数,没有修改传输协议定义的包格式,这样可以兼容多种类型的传输协议,而且尤其适用于包格式不支持扩展字段或不存在扩展字段的传输协议。
在另一种实现方式中,第m个原始数据包对应的第一冗余恢复参数可以包括格式标识参数,第m个数据包体的头部可以包括格式标识字段。可以将格式标识参数添加至格式标识字段中,以及可以将第m个原始数据包添加至第m个数据包体的主体,最终得到第m个目标数据包。在此情况下,数据发送设备可以将第m个原始数据包对应的序号参数和第m个原始数据包对应的类型参数单独发送至数据接收设备,而不是通过添加于第m个原始数据包的头部发送至数据接收设备。相比于将格式标识参数、类型参数以及序号参数全部添加于第m个数据包体的头部的方式,将序号参数和类型参数单独发送至数据接收设备,可以减少目标数据包中的数据量,这样可以提升目标数据包的传输效率,进一步提升数据传输效率。
在另一种实现方式中,第m个原始数据包对应的第一冗余恢复参数包括格式标识参数,除格式标识参数外,第m个原始数据包对应的第一冗余恢复参数还可以包括序号参数或类型参数中的任一种;第m个数据包体的头部包括格式标识字段,除格式标识字 段外,第m个数据包体的头部还可以包括序号字段或类型字段中的任一种。可以将格式标识参数添加至格式标识字段中;在第m个原始数据包对应的第一冗余恢复参数还包括序号参数,且第m个数据包体的头部还包括序号字段时,可以将序号参数添加至序号字段中;在第m个原始数据包对应的第一冗余恢复参数还包括类型参数,且第m个数据包体的头部还包括类型字段时,可以将序号参数添加至类型字段中;以及可以将第m个原始数据包添加至第m个数据包体的主体,最终得到第m个目标数据包。例如,第m个原始数据包对应的第一冗余恢复参数可以包括格式标识参数和类型参数,第m个数据包体的头部包括格式标识字段和类型字段,在此情况下,第m个原始数据包对应的序号参数可以单独发送至数据接收设备,而不是通过添加于第m个原始数据包的头部发送至数据接收设备。
S404,将目标数据包组发送至数据接收设备,以使数据接收设备在检测到目标数据包组中存在数据包丢失时,通过冗余恢复处理得到丢失的数据包。
将原始数据包组中的每个原始数据包与对应的第一冗余恢复参数进行拼接处理,得到目标数据包组后,数据发送设备可以将目标数据包组发送至数据接收设备,以使数据接收设备在检测到目标数据包组中存在数据包丢失时,可以通过冗余恢复处理得到丢失的数据包。数据发送设备还可以生成目标数据包组的N个目标冗余包,并将目标数据包组的N个目标冗余包发送至数据接收设备,以使数据接收设备在检测到目标数据包组中存在数据包丢失时,可以根据N个目标冗余包进行冗余恢复处理,得到丢失的数据包,N为小于或等于M的正整数。
本申请实施例中,数据发送设备通过将原始数据包组中的每个原始数据包与对应的第一冗余恢复参数进行拼接处理,可以使得拼接处理得到的目标数据包组中的每个目标数据包均支持冗余恢复处理,从而,当目标数据包组在传输至数据接收设备的过程中发生数据包丢失时,数据接收设备可以通过冗余恢复处理快速恢复出丢失的数据包,数据发送设备无需重新传输丢失的数据包,这样可以降低丢包情况下的传输时延,提升数据传输效率。另外,本申请实施例以头部的形式为原始数据包添加第一冗余恢复参数,没有修改传输协议定义的包格式,这样可以兼容多种类型的传输协议,例如可以兼容gQUIC协议定义的包格式和IETF QUIC协议定义的包格式,而且尤其适用于定义的包格式不支持扩展字段或不存在扩展字段的传输协议。
本申请实施例提供一种数据处理方法,该数据处理方法主要介绍生成目标数据包组的目标冗余包,在密钥协商过程中确定数据接收设备的冗余处理能力等内容,该数据处 理方法可以由上述数据处理系统20中的数据发送设备201(即数据发送方)执行,请参见图7,该数据处理方法可以包括以下步骤S701-步骤S706:
S701,获取原始数据包组,原始数据包组包括M个原始数据包。
本申请实施例中步骤S701的执行过程与上述图4所示实施例中步骤S401的执行过程相同,具体可参见上述图4所示实施例中步骤S401的描述,在此不再赘述。
S702,获取原始数据包组中的每个原始数据包各自对应的第一冗余恢复参数。
本申请实施例中步骤S702的执行过程与上述图4所示实施例中步骤S402的执行过程相同,具体可参见上述图4所示实施例中步骤S402的描述,在此不再赘述。
S703,将原始数据包组中的每个原始数据包与对应的第一冗余恢复参数进行拼接处理,得到M个目标数据包,M个目标数据包组成目标数据包组。
本申请实施例中步骤S703的执行过程与上述图4所示实施例中步骤S403的执行过程相同,具体可参见上述图4所示实施例中步骤S403的描述,在此不再赘述。
S704,将目标数据包组发送至数据接收设备。
在将原始数据包组中的每个原始数据包与对应的第一冗余恢复参数进行拼接处理,得到目标数据包组后,数据发送设备可以将目标数据包组发送至数据接收设备。
S705,生成目标数据包组对应的N个目标冗余包。
数据发送设备可以生成目标数据包组对应的N个目标冗余包,需生成的目标冗余包的数量,可以是根据目标数据包组中包括的目标数据包的数量和冗余度参数确定的,需生成的目标冗余包的数量可以等于,目标数据包组中包括的目标数据包的数量与冗余度参数之间的乘积,例如,目标数据包组中包括5个目标数据包,冗余度参数为60%,则需生成5×60%=3个目标冗余包;冗余度参数为小于或等于1的正实数,N为小于或等于M的正整数。其中,参见图7B,生成目标数据包组对应的N个目标冗余包可以包括以下子步骤S11-S13:
S11,根据M个原始数据包生成N个原始冗余包。
根据M个原始数据包生成N个原始冗余包的过程,可以包括:按照FEC算法对M个原始数据包进行冗余编码处理,得到N个冗余数据,以及按照传输协议对N个冗余数据进行封装处理,得到N个原始冗余包。
FEC算法可以包括很多种,例如XOR算法(异或算法)、UPLFEC算法、FlexFEC算法、以及Reed-Solomon Code(里德-索罗门码)算法等,如下表1示出了上述几种FEC算法的特点:
表1
通过上述表1中几种FEC算法的比较,可以发现,Reed-Solomon Code算法更加灵活,对于丢失的原始数据包的恢复率比较高,本申请实施例中以FEC算法是Reed-Solomon Code算法为例进行说明。
其中,FEC算法规定用于生成冗余数据的M个原始数据包的数据包长度需一致,因此,可以获取M个原始数据包中的最大数据包长度,按照最大数据包长度对M个原始数据包进行填充,使得填充后的M个原始数据包的数据包长度一致,然后可以根据FEC算法对填充后的M个原始数据包进行冗余编码处理,得到N个冗余数据;按照最大数据包长度对M个原始数据包进行填充是指:对于M个原始数据包中数据包长度小于最大数据包长度的原始数据包,在该原始数据包的末尾填充0,直至填充后的该原始数据包的长度达到最大数据包长度。
基于以上传输协议定义的包格式的相关描述,在此对原始冗余包的封装过程进行介绍,原始冗余包可以是按照短报头格式进行封装的,具体来说:针对N个冗余数据中的任一个冗余数据,可以将该冗余数据作为原始冗余包的包体,然后可以采用与数据接收设备经密钥协商后确定的密钥对包体进行加密,然后可以对加密后的包体封装包头,便可以得到一个原始冗余包,同理可以得到N个原始冗余包。
S12,获取N个原始冗余包中的每个原始冗余包对应的第二冗余恢复参数。
在根据M个原始数据包生成N个原始冗余包之后,可以获取N个原始冗余包中的每个原始冗余包对应的第二冗余恢复参数。在一种实现方式中,第二冗余恢复参数可以包括格式标识参数,格式标识参数可以用于标识冗余恢复格式(FEC格式),也就是说, 当冗余包中包括格式标识参数时,说明该冗余包的包格式为冗余恢复格式,包格式为冗余恢复格式的冗余包支持冗余恢复处理,冗余包支持冗余恢复处理是指:冗余包可以用于进行冗余恢复处理。在一种实现方式中,第二冗余恢复参数除包括格式标识参数外,还可以包括以下至少一种:序号参数、类型参数、数据包数量参数、冗余包数量参数、以及连接标识参数,序号参数可以用于标识冗余包所属的数据包组以及冗余包在数据包组中的排列序号,类型参数可以用于标识冗余包的包类型,数据包数量参数用于标识冗余包所属的数据包组中包含的数据包的数量,冗余包数量参数可以用于标识冗余包所属的数据包组的冗余包的数量,连接标识参数可以用于唯一标识数据发送设备的身份。
S13,将N个原始冗余包中的每个原始冗余包与对应的第二冗余恢复参数进行拼接处理,得到N个目标冗余包。
在根据M个原始数据包生成N个原始冗余包,以及获取到N个原始冗余包中的每个原始冗余包对应的第二冗余恢复参数之后,可以将N个原始冗余包中的每个原始冗余包与对应的第二冗余恢复参数进行拼接处理(也可以称为封装处理),得到N个目标冗余包。为了便于理解,在此以N个原始冗余包中的第n个原始冗余包的拼接处理过程为例,对第n个原始冗余包对应的第二冗余恢复参数与第n个原始冗余包的拼接处理,可以得到第n个原始冗余包对应的第n个目标冗余包,n为小于后等于N的正整数。具体的拼接过程如下:针对N个原始冗余包中的第n个原始冗余包,生成用于对第n个原始冗余包和第n个原始冗余包对应的第二冗余恢复参数进行拼接处理的第n个冗余包体,第n个冗余包体包括头部和主体;将第n个原始冗余包对应的第二冗余恢复参数添加至第n个冗余包体的头部,将第n个原始冗余包添加至第n个冗余包体的主体,得到第n个原始冗余包对应的第n个目标冗余包。
需要说明的是,与将原始数据包对应的第一冗余恢复参数与原始数据包进行拼接处理类似,可以将格式标识参数、序号参数、类型参数、数据包数量参数、以及冗余包数量参数全部添加至第n个冗余包体的头部;与原始数据包类似,以头部的形式为原始冗余包添加第二冗余恢复参数,没有修改传输协议定义的包格式,这样可以兼容多种类型的传输协议,而且尤其适用于包格式不支持扩展字段或不存在扩展字段的传输协议。或者,可以将标识冗余恢复格式的格式标识参数添加至第n个冗余包体的头部,其余参数可以单独发送至数据接收设备;或者,可以将标识冗余恢复格式的格式标识参数添加至第n个冗余包体的头部,其余参数可以部分添加至第n个冗余包体的头部,剩余的参数可以单独发送至数据接收设备;与原始数据包类似,将序号参数、类型参数、数据包数 量参数以及冗余包数量参数中的任意一种或多种单独发送至数据接收设备,可以减少目标冗余包中的数据量,这样可以提升目标冗余包的传输效率,进一步提升数据传输效率。在此以将格式标识参数、序号参数、类型参数、数据包数量参数、以及冗余包数量参数全部添加至第n个冗余包体的头部为例进行介绍,其余情况可以参见上述原始数据包的拼接处理的相关描述。特别地,当数据发送设备中运行有客户端,数据接收设备为服务器时,由于服务器可以连接多个客户端,为了便于服务器对不同的客户端进行区分,可以将用于唯一标识数据发送设备中运行的客户端的身份的连接标识参数添加至第n个冗余包体的头部。下面结合图8A和图8B介绍将第n个原始冗余包对应的第二冗余恢复参数添加至第n个冗余包体的头部的过程:
在一种实现方式中,当数据发送设备为服务器,数据接收设备中运行有客户端时,第n个原始冗余包对应的第二冗余恢复参数可以包括:格式标识参数、序号参数、类型参数、数据包数量参数和冗余包数量参数;第n个冗余包体的头部可以包括:格式标识字段(FEC Format Flags)、序号字段(FEC SEQ ID)、类型字段(FEC Type)、数据包数量字段(Data Shard Num)和冗余包数量字段(Parity Shard Num)。如图8A所示,可以将格式标识参数添加至格式标识字段中,格式标识参数可以用于标识第n个目标冗余包的包格式为冗余恢复格式,冗余恢复格式即FEC头部包裹的主体,包格式为冗余恢复格式的第n个目标冗余包可以支持冗余恢复处理,第n个目标冗余包可以支持冗余恢复处理是指:第n个目标冗余包可以用于进行冗余恢复处理;可以将序号参数添加至序号字段中,序号参数可以用于标识第n个目标冗余包属于目标数据包组,以及第n个目标冗余包在目标数据包组中的排列序号;可以将类型参数添加至类型字段中,类型参数可以用于标识所述第n个目标冗余包的包类型为冗余包类型;可以将数据包数量参数添加至数据包数量字段中,数据包数量参数可以用于标识目标数据包组中包含的目标数据包的数量M;可以将冗余包数量参数添加至冗余包数量字段中,冗余包数量参数可以用于标识目标数据包组的目标冗余包的数量N。
在另一种实现方式中,当数据发送设备中运行有客户端,数据接收设备为服务器时,第n个原始冗余包对应的第二冗余恢复参数可以包括:格式标识参数、序号参数、类型参数、数据包数量参数、冗余包数量参数和连接标识参数;第n个冗余包体的头部可以包括:格式标识字段(FEC Format Flags)、序号字段(FEC SEQ ID)、类型字段(FEC Type)、数据包数量字段(Data Shard Num)、冗余包数量字段(Parity Shard Num)和连接标识字段(Connection ID)。如图8B所示,可以将格式标识参数添加至格式标识字段中,格 式标识参数可以用于标识第n个目标冗余包的包格式为冗余恢复格式,冗余恢复格式即FEC头部包裹的主体,包格式为冗余恢复格式的第n个目标冗余包可以支持冗余恢复处理,第n个目标冗余包可以支持冗余恢复处理是指:第n个目标冗余包可以用于进行冗余恢复处理;可以将序号参数添加至序号字段中,序号参数可以用于标识第n个目标冗余包属于目标数据包组,以及第n个目标冗余包在目标数据包组中的排列位置;可以将类型参数添加至类型字段中,类型参数可以用于标识所述第n个目标冗余包的包类型为冗余包类型;可以将数据包数量参数添加至数据包数量字段中,数据包数量参数可以用于标识目标数据包组中包含的目标数据包的数量M;可以将冗余包数量参数添加至冗余包数量字段中,冗余包数量参数可以用于标识目标数据包组的目标冗余包的数量N;可以将连接标识参数添加至连接标识字段中,连接标识参数可以用于唯一标识数据发送设备中运行的客户端的身份。
由前述内容可知,需生成的目标数据包组的目标冗余包的数量,可以是根据目标数据包组中包括的目标数据包的数量和冗余度参数确定的;在生成目标数据包组的目标冗余包之前,可以获取数据发送设备与数据接收设备之间的丢包参数,丢包参数是指当前丢包数量在当前已传输至数据接收设备的包总数量中的占比,可以根据丢包参数对需为目标数据包组生成的目标冗余包的数量进行调整,这样便可以按照调整后的需为目标数据包组生成的目标冗余包的数量,生成目标数据包组的N个目标冗余包。其中,可以根据丢包参数对需为目标数据包组生成的目标冗余包的数量进行调整,具体可以是根据丢包参数对冗余度参数进行调整,然后根据调整后的冗余度参数重新计算需为目标数据包组生成的目标冗余包的数量。丢包参数与冗余度参数之间具备映射关系,可以根据当前丢包参数、丢包参数与冗余度参数之间的映射关系来对冗余度参数进行调整,示例性的丢包参数与冗余度参数之间的映射关系可参见如下表2:
表2
通过这种方式,根据当前的丢包参数来调整为目标数据包生成的目标冗余包的数量,可以使得为目标数据包生成的目标冗余包的数量更加符合当前网络的丢包情况,从而可 以避免生成多余的冗余包、生成的冗余包不足以恢复全部丢失的数据包等情况发生。
除了支持调整为目标数据包组生成的目标冗余包的数量外,原始数据包组中需包含的原始数据包的数量也支持调整。具体来说,可以获取数据发送设备与数据接收设备之间的传输速率参数,传输速率参数可以用于指示数据发送设备与数据接收设备之间的传输网络的传输速度,传输速率参数越大,表示数据发送设备与数据接收设备之间的传输网络的传输速度越快,然后可以根据传输速率参数,对原始数据包组中需包含的原始数据包的数量进行调整。进一步地,还可以根据原始数据包组中需包含的原始数据包的数量以及冗余度参数,可以确定出需要为原始数据包组对应的目标数据包组生成的目标冗余包的数量。传输速率参数与原始数据包组中需包含的原始数据包的数量之间具备映射关系,可以根据当前传输速率、传输速率参数与原始数据包组中需包含的原始数据包的数量之间的映射关系,来对原始数据包组中需包含的原始数据包的数量进行调整,示例性的传输速率参数与原始数据包组中需包含的原始数据包的数量之间的映射关系可参见如下表3:
表3
通过这种方式,根据当前的传输速率参数来调整原始数据包组中需包含的原始数据包的数量,可以使得原始数据包组中需包含的原始数据包的数量更加符合当前网络的传输速率,尽量避免丢包,提升数据传输速率。
值得注意的是,可以设置原始数据包组中需包含X个原始数据包,即目标数据包组中需包含X个目标数据包组,可以比较原始数据包组中包含的原始数据包的数量M与X之间的大小关系,根据M与X之间的大小关系,确定N个目标冗余包的生成时间,然后便可以按照确定的生成时间,生成所述目标数据包组的N个目标冗余包。其中,若M等于X,则可以将封装得到M个原始数据包的时间确定为N个目标冗余包的生成时间;也就是说,当待传输的业务数据的数据量较大时,按照传输协议封装得到的原始数 据包达到X个(即M个),便可以将M个原始数据包划分为原始数据包组,并根据M个原始数据包生成N个目标冗余包。或者,若M小于X,则将确定M个目标数据包中的最后一个目标数据包发送超时的时间,确定为N个目标冗余包的生成时间;最后一个目标数据包发送超时是指:最后一个目标数据包发送目标时段后,未收到数据接收设备发送的确认帧;也就是说,当待传输的业务数据的数据量较小,按照传输协议封装得到的原始数据包不足够划分为一个原始数据包组时,可以与ARQ结合,设置一个定时器(定时器中设置的时间段为目标时段(例如可以是RTT×0.25)),若最后一个目标数据包发送目标时段后,未收到数据接收设备发送的确认帧,便生成目标数据包组的N个目标冗余包主动发出,若最后一个目标数据包发送目标时段之内,收到数据接收设备发送的确认帧,说明数据包在传输过程中未丢失,可以无需生成目标冗余包。通过这种方式,当待传输的业务数据的数据量较小时,可以在确认数据包丢失时再生成冗余包,若确认数据包未丢失,则无需生成目标冗余包,可以节省数据发送设备的冗余编码资源。
S706,将N个目标冗余包发送至数据接收设备,以使数据接收设备在检测到目标数据包组中存在数据包丢失时,根据N个目标冗余包进行冗余恢复处理,得到丢失的数据包。
在生成目标数据包组的N个目标冗余包之后,可以将目标数据包组的N个目标冗余包发送至数据接收设备,以使数据接收设备在检测到目标数据包组中存在数据包丢失时,可以根据N个目标冗余包进行冗余恢复处理,得到丢失的数据包。
需要说明的是,本申请实施例中步骤S701-S706是在确定数据接收设备具备冗余恢复能力的情况下执行的,若数据接收设备不具备冗余恢复能力,则不会将第一冗余恢复参数与原始数据包进行拼接处理,也不会生成相应的冗余包,并且当原始数据包在传输过程中存在丢失时,是通过ARQ来重新传输丢失的原始数据包的;数据接收设备具备冗余恢复能力是指数据接收设备可以用于进行冗余恢复处理。本申请实施例可以在数据发送设备与数据接收设备进行密钥协商的过程中,对数据接收设备的冗余恢复能力进行检测,若确定数据接收设备具备冗余恢复能力,则可以执行本申请实施例中步骤S701-S706。其中,数据发送设备与数据接收设备进行密钥协商发生在正式传输业务数据之前,密钥协商可以用于确定密钥,密钥可以用于在封装M个原始数据包的过程中加密(具体可以是对原始数据包或原始冗余包的包体进行加密)。密钥协商过程可以包括1RTT过程和0RTT过程,1RTT过程可以用于在数据发送设备和数据接收设备首次连接时进行密钥协商,0RTT过程可以用于在数据发送设备和数据接收设备已进行首次连 接后,连接断开重新连接时进行密钥协商,下面结合图9A对1RTT过程进行介绍,结合图9B对0RTT过程进行介绍:
图9A所示实施例以数据发送设备中运行有客户端(client),数据接收设备是服务器(server)为例介绍1RTT过程:①客户端发送早期招呼(Inchoate Client Hello,InchoateCHLO)消息请求建立连接;服务器生成一组质数p以及基点g,然后根据质数p、基点g和随机生成数a算出数值A,并将数值A、质数p和基点g放在serverConfig(server配置)里面,通过拒绝(Rejection,REJ)消息发送到客户端。②客户端随机生成一个数b,并根据serverConfig里面的数值A、质数p和数b可以算出初始密钥K,并将公开数B和采用初始密钥K加密的Data数据通过完整招呼(Complete Client Hello,CompleteCHLO)消息发送到服务器,客户端还会向服务器发送加密请求(Encrypted Request)。③服务器接收到客户端的数据,用客户端发来的公开数B和serverConfig生成同样的密钥,来解密客户端发来的数据,然后服务器发送招呼(Server Hello,SHLO)消息,这时Server Hello消息中会带上服务器生成的公开数(服务器这是在更新自己的私钥,实际上这就是为了保证前向安全性),服务器还会向客户端发送加密响应(Encrypted Response)。④客户端接收到服务器的公开数后,客户端和服务器双方便更新了密钥,采用加密算法(例如SHA-256算法等)用可以推倒出客户端与服务器之间的用于进行加密的密钥,客户端与服务器后续便采用该密钥进行数据加密传输。并且,后续的连接过程中,如果客户端本地的serverConfig没过期(包含了数值A、质数p和基点g,以及其他前次协商信息),直接可以计算出初始密钥K并加密传输数据,实现0RTT握手。
在上述1RTT过程中,客户端会将客户端的冗余恢复能力集(FEC能力集)嵌入Complete Client Hello消息中发送至服务器,客户端的冗余恢复能力集可以用于指示客户端具备冗余恢复能力,以及客户端支持的FEC版本。若客户端接收到的服务器发送的Server Hello消息中嵌入了服务器的冗余恢复能力集,则可以确定服务器(即数据接收设备)具备冗余恢复能力,服务器的冗余恢复能力集可以用于指示服务器具备冗余恢复能力,以及服务器支持的FEC版本。
图9B所示实施例以数据发送设备中运行有客户端(client),数据接收设备是服务器(server)为例介绍0RTT过程:0RTT的前提是客户端必须已经拥有了ServerConfig,并且要结合证书验证ServerConfig,验证无误后就能够获取到密钥交换算法及公钥,此时再生成一个全新的密钥,按照DH算法(密钥交换算法)和参数,就能在本地计算出 对称密钥Sc。服务器收到客户端的ClientHello消息(CHLO消息)后,同时也包含了客户端的公钥信息,服务端也能结合之前的公钥参数计算出密钥Ss
在上述0RTT过程中,客户端会将客户端的冗余恢复能力集(FEC能力集)嵌入Client Hello消息中发送至服务器,客户端的冗余恢复能力集可以用于指示客户端具备冗余恢复能力,以及客户端支持的FEC版本。若客户端接收到的服务器发送的Server Hello消息中嵌入了服务器的冗余恢复能力集,则可以确定服务器(即数据接收设备)具备冗余恢复能力,服务器的冗余恢复能力集可以用于指示服务器具备冗余恢复能力,以及服务器支持的FEC版本。
密钥协商过程是数据发送设备与数据接收设备之间可以进行数据传输的必要前序流程,通过在数据发送设备与数据接收设备进行密钥协商的过程中确定数据接收设备是否具备冗余恢复能力,可以兼容数据发送设备与数据接收设备之间的建立连接、收发包流程,没有额外增加新的流程,可以减少流程上的改动,不增加更多的信令和环节;并且没有使用硬编码逻辑,通过格式标识字段(FEC Format Flag)便可以确定数据接收设备是否具备冗余恢复能力,这样具有较强的扩展性和可读性。
本申请实施例中,通过为目标数据包组生成目标冗余包,并将生成的目标冗余包发送至数据接收设备,使得当目标数据包组在传输至数据接收设备的过程中发生数据包丢失时,数据接收设备可以根据目标冗余包进行冗余恢复处理快速恢复出丢失的数据包,数据发送设备无需重新传输丢失的数据包,这样可以降低丢包情况下的传输时延,提升数据传输效率。此外,可以根据当前的丢包参数调整需为目标数据包组生成的目标冗余包的数量,可以使得为目标数据包生成的目标冗余包的数量更加符合当前网络的丢包情况;可以根据当前网络的传输速率参数调整数据包组中需包含的数据包的数量,可以使得原始数据包组中需包含的原始数据包的数量更加符合当前网络的传输速率,尽量避免丢包,提升数据传输速率。
本申请实施例提供一种数据处理方法,该数据处理方法主要介绍确定目标数据包组中存在数据包丢失,以及通过冗余恢复处理恢复丢失的数据包等内容,该数据处理方法可以由上述数据处理系统20中的数据接收设备202(即数据接收方)执行,请参见图10,该数据处理方法可以包括步骤S1001-S1003:
S1001,接收来自数据发送设备的目标数据包组。
其中,所述数据发送设备获取待发送的原始数据包组,所述原始数据包组包括M个原始数据包,所述M个原始数据包是按照传输协议对待传输的业务数据进行封装得 到的,所述传输协议定义的包格式为非冗余恢复格式,M为正整数;所述数据发送设备获取所述原始数据包组中的每个原始数据包各自对应的第一冗余恢复参数,将所述原始数据包组中的每个原始数据包与对应的第一冗余恢复参数分别进行拼接处理,得到包括M个目标数据包的所述目标数据包组;其中,每个目标数据包中的第一冗余恢复参数用于指示该目标数据包为冗余恢复格式,所述冗余恢复格式的目标数据包支持冗余恢复处理。
S1002,接收来自所述数据发送设备的N个目标冗余包,所述N个目标冗余包与所述目标数据包组对应,且N为小于或等于M的正整数。
S1003,若检测到目标数据包组中存在数据包丢失,则根据所述N个目标冗余包通过冗余恢复处理得到丢失的数据包。
数据接收设备可以接收来自数据发送设备的目标包,并读取目标包的头部和主体;若根据目标包的头部确定目标包为目标数据包组中的目标数据包,则可以确定目标包的主体为原始数据包组中对应的原始数据包,可以将目标包中的原始数据包拷贝至队列中;若根据目标包的头部确定目标包为目标数据包组的目标冗余包,则可以确定目标包的主体为该目标冗余包对应的原始冗余包,可以将目标包中的原始冗余包拷贝到队列中;以此类推,数据接收设备每接收到一个包,都可以按照上述目标包的处理逻辑进行处理。在这之后,可以根据队列中包含的原始数据包组中的原始数据包的数量,对目标数据包组进行丢包检测;若确定目标数据包组中存在数据包丢失,则可以通过冗余恢复处理恢复丢失的数据包;若确定目标数包组中不存在数据包丢失,则无需进行冗余恢复处理。最后,针对任一个原始数据包,可以对该原始数据包进行解包头,得到原始数据包中加密的包体,然后可以采用密钥协商得到的密钥对加密的包体进行解密,并对解密得到的包体进行解包体;针对原始数据包组,可以按照原始数据包在原始数据包组中的排列位置,对解包体得到的数据进行排列,重建得到业务数据。
其中,目标包的头部可以包括格式标识字段、序号字段和类型字段;格式标识字段的取值可以用于标识目标包支持冗余恢复处理或不支持冗余恢复处理,序号字段的取值可以用于标识目标包所属的数据包组,类型字段的取值可以用于标识目标包的包类型;若格式标识字段的取值标识目标包支持冗余恢复处理,序号字段的取值标识目标包所属的数据包组为目标数据包组,且类型字段的取值用于标识目标包的包类型为数据包类型,则可以确定目标包的主体为原始数据包组中对应的原始数据包;若格式标识字段的取值标识目标包支持冗余恢复处理,序号字段的取值标识目标包所属的数据包组为目标数据 包组,且类型字段的取值用于标识目标包的包类型为冗余包类型,则可以确定目标包的主体为原始冗余包。
根据队列中包含的原始数据包组中的原始数据包的数量,对目标数据包组进行丢包检测,可以包括:可以获取数据发送设备发送的目标数据包组中的目标数据包的数量M,数量M可以是从接收到的目标数据包组的目标冗余包的头部读取到的,即目标冗余包的头部包括数据包数量字段,或者数量M可以是数据发送设备单独发送的;若队列中包含的原始数据包组中的原始数据包的数量小于数量M,即队列中包含的原始数据包组中的原始数据包的数量和原始冗余包的数量等于数量M,则可以确定目标数据包组中存在数据包丢失;若队列中包含的原始数据包组中的原始数据包的数量等于数量M,则可以确定目标数据包组中不存在数据包丢失。
若检测到目标数据包组中存在数据包丢失,则可以获取数据发送设备发送的目标数据包的目标冗余包的数量N,数量N是从接收到的目标数据包组的目标冗余包的头部读取到的,即目标冗余包的头部包括冗余包数量字段,或者数量N可以是数据发送设备单独发送的,N为小于或等于M的正整数;可以根据数量N,接收数据发送设备发送的目标数据包的N个目标冗余包;然后可以根据目标数据包组的N个目标冗余包对丢失的数据包进行冗余恢复处理,得到丢失的数据包。具体来说,可以读取N个目标冗余包中的每个目标冗余包的主体,得到N个原始冗余包;针对任一个原始冗余包,可以对该原始冗余包进行解包头,得到原始冗余包中加密的包体,然后可以采用密钥协商得到的密钥对加密的包体进行解密,并对解密得到的包体进行解包体,得到对应的冗余数据,然后可以根据N个冗余数据和M个原始数据包中未丢失的数据包,恢复出丢失的数据包。
本申请实施例中,在接收来自数据发送设备的目标数据包组的过程中,若检测到目标数据包组中存在数据包丢失,则数据接收设备可以根据目标数据包组的目标冗余包进行冗余恢复处理,恢复出丢失的数据包;数据接收设备可以通过冗余恢复处理恢复丢失的数据包的前提是,目标数据包组中的目标数据包支持冗余恢复处理,而目标数据包组是将原始数据包组中的每个原始数据包与对应的第一冗余恢复参数进行拼接处理得到的,原始数据包组中的每个原始数据包均不支持冗余恢复处理,第一冗余恢复参数是指支持冗余恢复处理的数据包需包含的参数;也就是说,数据接收设备可以直接快速地恢复出丢失的数据包,无需等待数据发送设备重新传输丢失的数据包,可以降低丢包情况下的传输时延,提升数据传输效率。
基于上述图4-图10所示实施例的描述,下面结合图11对数据发送设备与数据接收设备之间的数据传输流程进行总结:
对于数据发送设备:
(1)按照MTU指示的目标数据长度对待传输的业务数据进行划分,对划分得到的长度为目标数据长度的数据进行封包体,即将划分得到的长度为目标数据长度的数据作为原始数据包的包体,然后可以采用与数据接收设备经密钥协商确定的密钥对包体进行加密,然后可以对加密后的包体封装包头,便可以得到一个原始数据包。
(2)生成原始数据包后,可以将原始数据包拷贝至队列中,需要注意的是,在将原始数据包拷贝至队列的过程中,可以在原始数据包的头部加2字节的size,2字节的size用于表示原始数据包的数据包长度。然后,可以为原始数据包拼接(即封装)FEC头部(即第一冗余恢复参数),得到目标数据包,并将目标数据包发送至数据接收设备。
(3)在待传输的业务数据的数据量较大时,若队列中存储的原始数据包的数量达到设置的一组数据包组中需包含的原始数据包的数量,则可以根据一组原始包组中包含的原始数据包生成N个原始冗余包,然后可以为N个原始冗余包中的每个原始冗余包拼接(即封装)FEC头部(即第二冗余恢复参数),得到N个目标冗余包,并将N个目标冗余包发送至数据接收设备。
下面结合图12具体说明原始冗余包的生成过程,如图12所示,当前数据包组中包括3个原始数据包,3个原始数据包的数据包长度(Data length)分别为50字节(Byte)、70字节和100字节,每个原始数据包的头部增加了2个字节的size,用于表示数据包长度;可以获取当前数据包组中的最大数据包长度(max_length)100字节,然后分配内存空间(数据包的内存空间大小为:max_length×当前数据包组中包含的原始数据包数量,冗余包的内存空间大小:max_length×当前数据包组的原始冗余包的数量),将原始数据包拷贝至内存空间中,在拷贝过程中,由于FEC算法(例如Reed-Solomon Code算法)规定用于进行冗余编码的各个原始数据包的数据包长度需一致,可以按照max_length对数据包长度不足100字节的原始数据包进行填充(末尾补零),使得拷贝至内存空间中的当前数据包组中的原始数据包的数据包长度一致,均为100字节;然后,可以基于FEC算法根据3个原始数据包生成1个原始冗余包,原始冗余包的长度为100+2=102字节。
需要说明的是,如图13所示,本申请实施例在为原始数据包分配内存空间时,可以在头部和尾部多分配几个字节(即保留(Reserve)空间),这样可以在为原始数据包 拼接FEC头部时,直接使用头部的Reserve空间,或者在对原始数据包进行填充时,直接使用尾部的Reserve空间,这样可以节省分配内存空间和拷贝的次数。类似地,在为原始冗余包分配内存空间时,可以在头部多分配几个字节(即Reserve空间),这样可以在为原始冗余包拼接FEC头部时,直接使用头部的Reserve空间,这样可以节省分配内存空间和拷贝的次数。另外,在使用FEC算法进行冗余编码处理时可以使用CPU SIMD(Central Processing UnitSingle Instruction Multiple Data,中央处理器单指令多数据流)指令进行冗余编码加速,提升冗余包的生成效率,整体提升数据传输效率。
还需说明的是,在对业务数据进行封装之前,还可以进行流量控制、拥塞控制以及Pacing(调整节奏)处理。其中,流量控制是指为了避免数据包丢失,需控制数据发送设备的发送速度,使得数据接收设备来得及接收;拥塞控制作用于网络,是指防止过多的数据注入到网络中,避免出现网络负载过大的情况;Pacing处理是指设置目标频率,使得可以按照该目标频率封装原始数据包。
对于数据接收设备:
(1)当接收到来自数据发送设备的目标包后,可以对目标包进行解析,解析目标包的FEC头部。若根据FEC头部的类型字段的取值确定目标包为目标数据包,则可以将目标包的主体,即原始数据包拷贝至队列中,需要注意的是,拷贝时需要在原始数据包的头部加个2字节的size,2字节的size用于标识原始数据包的数据包长度)。若根据FEC头部的类型字段的取值确定目标包为目标冗余包,则可以将目标包的主体,即原始冗余包拷贝至队列中。
(2)若队列中最近一组数据包组(可以通过FEC头部中的序号字段来判断是否属于同一组数据包组)中的原始数据包的数量,达到设置的数据包组中需包含的原始数据包的数量(该数量可以通过目标冗余包的FEC头部中的数据包数量字段的取值获得),则可以说明不存在数据包丢失,不需要恢复,此时可以确定该数据包组中的包的最大序号,若后续接收到序号小于或等于最大序号的包则丢弃,并删除队列中存储的原始数据包和原始冗余包。
(3)若队列中最近一组数据包组(可以通过FEC头部中的序号字段来判断是否属于同一组数据包组)中的原始数据包的数量,未达到设置的数据包组中需包含的原始数据包的数量(该数量可以通过目标冗余包的FEC头部中的数据包数量字段的取值获得),例如,最近一组数据包组中的原始数据包的数量和原始冗余包的数量之和,等于设置的数据包组中需包含的原始数据包的数量,则确定存在数据包丢失,可以根据原始冗余包 恢复出丢失的原始数据包。
(4)对于未丢失的原始数据包,通过解包头、解密、解包体,可以得到原始数据包中封装的数据;对于恢复出的原始数据包,可以去掉尾部填充的零值和size,再通过解包头、解密、解包体,可以得到原始数据包中封装的数据。然后可以按照序号字段的取值指示的排列位置,重建业务数据。
本申请实施例中,FEC头部是指支持冗余恢复处理的数据包需包含的内容,通过将不支持冗余恢复处理的原始数据包与对应的FEC头部进行拼接处理,使得拼接处理得到的目标数据包支持冗余恢复处理,从而当目标数据包在传输至数据接收设备的过程中发生数据包丢失时,数据接收设备可以通过冗余恢复处理快速恢复出丢失的数据包,这样可以降低丢包情况下的传输时延,从而提升数据传输效率。
上述详细阐述了本申请实施例的方法,为了便于更好地实施本申请实施例的上述方案,相应地,下面提供了本申请实施例的装置。
请参见图14,图14是本申请实施例提供的一种数据处理装置的结构示意图,该数据处理装置可以设置于本申请实施例提供的计算机设备中,计算机设备可以是上述方法实施例中提及的数据发送设备(级数据发送方)。图14所示的数据处理装置可以是运行于计算机设备中的一个计算机程序(包括程序代码),该数据处理装置可以用于执行图4或图7所示的方法实施例中的部分或全部步骤。请参见图14,该数据处理装置可以包括如下单元:
获取单元1401,用于获取待发送的原始数据包组,原始数据包组包括M个原始数据包,M个原始数据包是按照传输协议对待传输的业务数据进行封装得到的,所述传输协议定义的包格式为非冗余恢复格式,M为正整数;获取原始数据包组中的每个原始数据包各自对应的第一冗余恢复参数;
处理单元1402,用于将原始数据包组中的每个原始数据包与对应的第一冗余恢复参数分别进行拼接处理,得到M个目标数据包,所述M个目标数据包组成目标数据包组,其中,每个目标数据包中的第一冗余恢复参数用于指示该目标数据包为冗余恢复格式,所述冗余恢复格式的目标数据包支持冗余恢复处理;将目标数据包组发送至数据接收设备,生成所述目标数据包组对应的N个目标冗余包,N为小于或等于M的正整数;将所述N个目标冗余包发送至数据接收设备,以使数据接收设备在检测到目标数据包组中存在数据包丢失时,根据所述N个目标冗余包通过冗余恢复处理得到丢失的数据包。
根据本申请的另一个实施例,可以通过在包括中央处理单元(CPU)、随机存取存 储介质(RAM)、只读存储介质(ROM)等处理元件和存储元件的例如计算机的通用计算设备上运行能够执行如图4或图7所示的部分或全部方法所涉及的各步骤的计算机程序(包括程序代码),来构造如图14中所示的数据处理装置,以及来实现本申请实施例的数据处理方法。计算机程序可以记载于例如计算机可读存储介质上,并通过计算机可读存储介质装载于上述计算设备中,并在其中运行。
本申请实施例中,第一冗余恢复参数是指支持冗余恢复处理的数据包需包含的参数,原始数据包组中的每个原始数据包均不支持冗余恢复处理,数据发送设备通过将原始数据包组中的每个原始数据包与对应的第一冗余恢复参数进行拼接处理,可以使得拼接处理得到的目标数据包组中的每个目标数据包均支持冗余恢复处理,从而,当目标数据包组在传输至数据接收设备的过程中发生数据包丢失时,数据接收设备可以通过冗余恢复处理快速恢复出丢失的数据包,数据发送设备无需重新传输丢失的数据包,这样可以降低丢包情况下的传输时延,提升数据传输效率。
请参见图15,图15是本申请实施例提供的另一种数据处理装置的结构示意图,该数据处理装置可以设置于本申请实施例提供的计算机设备中,计算机设备可以是上述方法实施例中提及的数据接收设备(即数据接收方)。图15所示的数据处理装置可以是运行于计算机设备中的一个计算机程序(包括程序代码),该数据处理装置可以用于执行图10所示的方法实施例中的部分或全部步骤。请参见图15,该数据处理装置可以包括如下单元:
处理单元1501,用于接收来自数据发送设备的目标数据包组,其中,所述数据发送设备获取待发送的原始数据包组,所述原始数据包组包括M个原始数据包,所述M个原始数据包是按照传输协议对待传输的业务数据进行封装得到的,所述传输协议定义的包格式为非冗余恢复格式,M为正整数;所述数据发送设备获取所述原始数据包组中的每个原始数据包各自对应的第一冗余恢复参数,将所述原始数据包组中的每个原始数据包与对应的第一冗余恢复参数分别进行拼接处理,得到包括M个目标数据包的所述目标数据包组;其中,每个目标数据包中的第一冗余恢复参数用于指示该目标数据包为冗余恢复格式,所述冗余恢复格式的目标数据包支持冗余恢复处理;
接收来自所述数据发送设备的N个目标冗余包,所述N个目标冗余包与所述目标数据包组对应,且N为小于或等于M的正整数;
若检测到目标数据包组中存在数据包丢失,则根据所述N个目标冗余包通过冗余恢复处理得到丢失的数据包。
根据本申请的另一个实施例,图14和15所示的数据处理装置中的各个单元可以分别或全部合并为一个或若干个另外的单元来构成,或者其中的某个(些)单元还可以再拆分为功能上更小的多个单元来构成,这可以实现同样的操作,而不影响本申请的实施例的技术效果的实现。上述单元是基于逻辑功能划分的,在实际应用中,一个单元的功能也可以由多个单元来实现,或者多个单元的功能由一个单元实现。在本申请的其它实施例中,数据处理装置也可以包括其它单元,在实际应用中,这些功能也可以由其它单元协助实现,并且可以由多个单元协作实现。
根据本申请的另一个实施例,可以通过在包括中央处理单元(CPU)、随机存取存储介质(RAM)、只读存储介质(ROM)等处理元件和存储元件的例如计算机的通用计算设备上运行能够执行如图10所示的部分或全部方法所涉及的各步骤的计算机程序(包括程序代码),来构造如图15中所示的数据处理装置,以及来实现本申请实施例的数据处理方法。计算机程序可以记载于例如计算机可读存储介质上,并通过计算机可读存储介质装载于上述计算设备中,并在其中运行。
本申请实施例中,在接收来自数据发送设备的目标数据包组的过程中,若检测到目标数据包组中存在数据包丢失,则数据接收设备可以通过冗余恢复处理恢复出丢失的数据包;数据接收设备可以通过冗余恢复处理恢复丢失的数据包的前提是,目标数据包组中的目标数据包支持冗余恢复处理,而目标数据包组是将原始数据包组中的每个原始数据包与对应的第一冗余恢复参数进行拼接处理得到的,原始数据包组中的每个原始数据包均不支持冗余恢复处理,第一冗余恢复参数是指支持冗余恢复处理的数据包需包含的参数;也就是说,数据接收设备可以直接快速地恢复出丢失的数据包,无需等待数据发送设备重新传输丢失的数据包,可以降低丢包情况下的传输时延,提升数据传输效率。
基于上述方法以及装置实施例,本申请实施例提供了一种计算机设备,该计算机设备可以是前述所提及的数据发送设备(即数据发送方)或是前述所提及的数据接收设备(即数据接收方)。请参见图16,图16是本申请实施例提供的一种计算机设备的结构示意图。图16所示的计算机设备至少包括处理器1601、输入接口1602、输出接口1603以及计算机可读存储介质1604。其中,处理器1601、输入接口1602、输出接口1603以及计算机可读存储介质1604可通过总线或其他方式连接。
计算机可读存储介质1604可以存储在计算机设备的存储器中,计算机可读存储介质1604用于存储计算机程序,计算机程序包括计算机指令,处理器1601用于执行计算机可读存储介质1604存储的程序指令。处理器1601(或称CPU(Central Processing Unit, 中央处理器))是计算机设备的计算核心以及控制核心,其适于实现一条或多条计算机指令,具体适于加载并执行一条或多条计算机指令从而实现相应方法流程或相应功能。
本申请实施例还提供了一种计算机可读存储介质(Memory),计算机可读存储介质是计算机设备中的记忆设备,用于存放程序和数据。可以理解的是,此处的计算机可读存储介质既可以包括计算机设备中的内置存储介质,当然也可以包括计算机设备支持的扩展存储介质。计算机可读存储介质提供存储空间,该存储空间存储了计算机设备的操作系统。并且,在该存储空间中还存放了适于被处理器加载并执行的一条或多条的计算机指令,这些计算机指令可以是一个或一个以上的计算机程序(包括程序代码)。需要说明的是,此处的计算机可读存储介质可以是高速RAM存储器,也可以是非不稳定的存储器(Non-Volatile Memory),例如至少一个磁盘存储器;还可以是至少一个位于远离前述处理器的计算机可读存储介质。
在一些实施例中,可由处理器1601加载并执行计算机可读存储介质1604中存放的一条或多条计算机指令,以实现上述有关图4或图7所示的数据处理方法的相应步骤。在一些实施例中,可由处理器1601加载并执行计算机可读存储介质1604中存放的一条或多条计算机指令,以实现上述有关图10所示的数据处理方法的相应步骤。
根据本申请的一个方面,提供了一种计算机程序产品或计算机程序,该计算机程序产品或计算机程序包括计算机指令,该计算机指令存储在计算机可读存储介质中。计算机设备的处理器从计算机可读存储介质读取该计算机指令,处理器执行该计算机指令,使得该计算机设备执行上述各种实施方式中提供的数据处理方法。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。

Claims (21)

  1. 一种数据处理方法,由数据发送设备执行,所述方法包括:
    获取待发送的原始数据包组,所述原始数据包组包括M个原始数据包,所述M个原始数据包是按照传输协议对待传输的业务数据进行封装得到的,所述传输协议定义的包格式为非冗余恢复格式,M为正整数;
    获取所述原始数据包组中的每个原始数据包各自对应的第一冗余恢复参数;
    将所述原始数据包组中的每个原始数据包与对应的第一冗余恢复参数分别进行拼接处理,得到M个目标数据包,所述M个目标数据包组成目标数据包组,其中,每个目标数据包中的第一冗余恢复参数用于指示该目标数据包为冗余恢复格式,所述冗余恢复格式的目标数据包支持冗余恢复处理;
    将所述目标数据包组发送至数据接收设备;
    生成所述目标数据包组对应的N个目标冗余包,N为小于或等于M的正整数;
    将所述N个目标冗余包发送至数据接收设备,以使所述数据接收设备在检测到所述目标数据包组中存在数据包丢失时,根据所述N个目标冗余包通过冗余恢复处理得到丢失的数据包。
  2. 如权利要求1所述的方法,其中,所述将所述原始数据包组中的每个原始数据包与对应的第一冗余恢复参数分别进行拼接处理,得到M个目标数据包,包括:
    针对所述原始数据包组中的每个原始数据包,执行以下处理:
    生成所述原始数据包对应的数据包体,所述数据包体包括头部和主体;
    将所述原始数据包对应的第一冗余恢复参数添加至所述数据包体的头部,将所述原始数据包添加至所述数据包体的主体,得到所述原始数据包对应的目标数据包。
  3. 如权利要求2所述的方法,其中,所述原始数据包对应的第一冗余恢复参数包括格式标识参数,所述数据包体的头部包括格式标识字段;所述将所述原始数据包对应的第一冗余恢复参数添加至所述数据包体的头部,包括:
    将所述格式标识参数添加至所述格式标识字段中,所述格式标识参数用于标识所述目标数据包支持冗余恢复处理。
  4. 如权利要求3所述的方法,其中,所述原始数据包对应的第一冗余恢复参数还包括序号参数或类型参数中的任意一种或两种;所述数据包体的头部还包括序号字段或 类型字段中的任意一种或两种;所述将所述第m个原始数据包对应的第一冗余恢复参数添加至所述数据包体的头部,还包括:
    在所述原始数据包对应的第一冗余处理参数还包括所述序号参数、且所述数据包体的头部还包括所述序号字段时,将所述序号参数添加至所述序号字段中,所述序号参数用于标识所述目标数据包所属的目标数据包组;
    在所述原始数据包对应的第一冗余处理参数还包括所述类型参数、且所述数据包体的头部还包括所述类型字段时,将所述类型参数添加至所述类型字段中,所述类型参数用于标识所述目标数据包的包类型为数据包。
  5. 如权利要求1所述的方法,其中,所述生成所述目标数据包组的N个目标冗余包,包括:
    根据所述M个原始数据包生成N个原始冗余包;
    获取所述N个原始冗余包中的每个原始冗余包各自对应的第二冗余恢复参数;
    将所述N个原始冗余包中的每个原始冗余包与对应的第二冗余恢复参数进行拼接处理,得到N个目标冗余包,其中,所述第二冗余恢复参数指示对应的目标冗余包为冗余恢复格式,所述冗余恢复格式的目标冗余包用于冗余恢复处理。
  6. 如权利要求5所述的方法,其中,所述将所述N个原始冗余包中的每个原始冗余包与对应的第二冗余恢复参数进行拼接处理,得到N个目标冗余包,包括:
    针对所述N个原始冗余包中的每个原始冗余包,执行以下处理:
    生成所述原始冗余包对应的冗余包体,所述冗余包体包括头部和主体;
    将所述原始冗余包对应的第二冗余恢复参数添加至所述冗余包体的头部,将所述原始冗余包添加至所述冗余包体的主体,得到所述原始冗余包对应的目标冗余包。
  7. 如权利要求6所述的方法,其中,所述原始冗余包对应的第二冗余恢复参数包括格式标识参数,所述冗余包体的头部包括格式标识字段;所述将所述原始冗余包对应的第二冗余恢复参数添加至所述冗余包体的头部,包括:
    将所述格式标识参数添加至所述格式标识字段中,所述格式标识参数用于标识所述目标冗余包为冗余恢复格式。
  8. 如权利要求7所述的方法,其中,所述第二冗余恢复参数还包括以下至少一种: 序号参数、类型参数、数据包数量参数、以及冗余包数量参数;所述冗余包体的头部还包括以下至少一个字段:序号字段、类型字段、数据包数量字段、以及冗余包数量字段;所述将所述原始冗余包对应的第二冗余恢复参数添加至所述冗余包体的头部,还包括:
    在所述第二冗余恢复参数还包括所述序号参数、且所述冗余包体的头部还包括所述序号字段时,将所述序号参数添加至所述序号字段中,所述序号参数用于标识所述目标冗余包对应的目标数据包组;
    在所述第二冗余恢复参数还包括所述类型参数、且所述冗余包体的头部还包括所述类型字段时,将所述类型参数添加至所述类型字段中,所述类型参数用于标识所述目标冗余包的包类型为冗余包;
    在所述第二冗余恢复参数还包括所述数据包数量参数、且所述冗余包体的头部还包括所述数据包数量字段时,将所述数据包数量参数添加至所述数据包数量字段中,所述数据包数量参数用于标识所述目标数据包组中包含的目标数据包的数量M;
    在所述第二冗余恢复参数还包括所述冗余包数量参数、且所述冗余包体的头部还包括所述冗余包数量字段时,将所述冗余包数量参数添加至所述冗余包数量字段中,所述冗余包数量参数用于标识所述目标数据包组的目标冗余包的数量N。
  9. 如权利要求1所述的方法,其中,所述原始数据包组被设置需包括X个原始数据包,X为正整数;所述方法还包括:
    比较M与X之间的大小关系;
    根据M与X之间的大小关系,确定所述N个目标冗余包的生成时间;
    所述生成所述目标数据包组的N个目标冗余包,包括:
    按照确定的生成时间,生成所述目标数据包组的N个目标冗余包。
  10. 如权利要求9所述的方法,其中,所述根据M与X之间的大小关系,确定所述N个目标冗余包的生成时间,包括:
    若M等于X,则将封装得到所述M个原始数据包的时间确定为所述N个目标冗余包的生成时间;
    若M小于X,则将确定所述M个目标数据包中的最后一个目标数据包发送超时的时间,确定为所述N个目标冗余包的生成时间;其中,所述最后一个目标数据包发送超时是指:所述最后一个目标数据包发送目标时段后,未收到所述数据接收设备发送的确认帧。
  11. 如权利要求1所述的方法,还包括:
    与所述数据接收设备进行密钥协商,得到密钥,所述密钥用于在封装所述M个原始数据包的过程中进行加密;
    在与所述数据接收设备的密钥协商过程中,对所述数据接收设备的冗余恢复能力进行检测;
    若确定所述数据接收设备具备所述冗余恢复能力,则触发执行所述获取原始数据包组的步骤。
  12. 一种数据处理方法,由数据接收设备执行,所述方法包括:
    接收来自数据发送设备的目标数据包组,其中,所述数据发送设备获取待发送的原始数据包组,所述原始数据包组包括M个原始数据包,所述M个原始数据包是按照传输协议对待传输的业务数据进行封装得到的,所述传输协议定义的包格式为非冗余恢复格式,M为正整数;所述数据发送设备获取所述原始数据包组中的每个原始数据包各自对应的第一冗余恢复参数,将所述原始数据包组中的每个原始数据包与对应的第一冗余恢复参数分别进行拼接处理,得到包括M个目标数据包的所述目标数据包组;其中,每个目标数据包中的第一冗余恢复参数用于指示该目标数据包为冗余恢复格式,所述冗余恢复格式的目标数据包支持冗余恢复处理;
    接收来自所述数据发送设备的N个目标冗余包,所述N个目标冗余包与所述目标数据包组对应,且N为小于或等于M的正整数;
    若检测到所述目标数据包组中存在数据包丢失,则根据所述N个目标冗余包通过冗余恢复处理得到丢失的数据包。
  13. 如权利要求12所述的方法,还包括:
    接收来自所述数据发送设备的目标包,并读取所述目标包的头部和主体;
    若根据所述目标包的头部确定所述目标包为所述目标数据包组中的目标数据包,则确定所述目标包的主体为所述原始数据包组中对应的原始数据包,将所述目标包中的原始数据包拷贝至队列中;
    根据所述队列中包含的所述原始数据包组中的原始数据包的数量,对所述目标数据包组进行丢包检测。
  14. 如权利要求13所述的方法,其中,所述目标包的头部包括格式标识字段、序号字段和类型字段;所述格式标识字段的取值用于标识所述目标包支持冗余恢复处理或不支持冗余恢复处理,所述序号字段的取值用于标识所述目标包所属的数据包组,所述类型字段的取值用于标识所述目标包的包类型;所述方法还包括:
    若所述格式标识字段的取值标识所述目标包支持冗余恢复处理,所述序号字段的取值标识所述目标包所属的数据包组为所述目标数据包组,且所述类型字段的取值标识所述目标包的包类型为数据包,则确定所述目标包为所述目标数据包组中的目标数据包。
  15. 如权利要求13所述的方法,其中,所述根据所述队列中包含的所述原始数据包组中的原始数据包的数量,对所述目标数据包组进行丢包检测,包括:
    获取所述数据发送设备发送的目标数据包组中的目标数据包的数量M,所述数量M是从接收到的所述目标数据包组的目标冗余包的头部的数据包数量字段中读取到的;
    若所述队列中包含的所述原始数据包组中的原始数据包的数量小于所述数量M,则确定所述目标数据包组中存在数据包丢失。
  16. 如权利要求12所述的方法,其中,所述接收来自所述数据发送设备的N个目标冗余包,包括:
    获取所述数据发送设备发送的目标数据包的目标冗余包的数量N,所述数量N是从接收到的所述目标数据包组的目标冗余包的头部的冗余包数量字段中读取到的,N为小于或等于M的正整数;
    根据所述数量N,接收所述数据发送设备发送的目标数据包组的N个目标冗余包。
  17. 一种数据处理装置,包括:
    获取单元,用于获取待发送的原始数据包组,所述原始数据包组包括M个原始数据包,所述M个原始数据包是按照传输协议对待传输的业务数据进行封装得到的,所述传输协议定义的包格式为非冗余恢复格式,M为正整数;
    所述获取单元,还用于获取所述原始数据包组中的每个原始数据包各自对应的第一冗余恢复参数;
    处理单元,用于将所述原始数据包组中的每个原始数据包与对应的第一冗余恢复参数分别进行拼接处理,得到M个目标数据包,所述M个目标数据包组成目标数据包组,其中,每个目标数据包中的第一冗余恢复参数用于指示该目标数据包为冗余恢复格式, 所述冗余恢复格式的目标数据包支持冗余恢复处理;
    所述处理单元,还用于将所述目标数据包组发送至数据接收设备,生成所述目标数据包组对应的N个目标冗余包,N为小于或等于M的正整数;将所述N个目标冗余包发送至数据接收设备,以使所述数据接收设备在检测到所述目标数据包组中存在数据包丢失时,根据所述N个目标冗余包通过冗余恢复处理得到丢失的数据包。
  18. 一种数据处理装置,包括:
    处理单元,用于接收来自数据发送设备的目标数据包组,其中,所述数据发送设备获取待发送的原始数据包组,所述原始数据包组包括M个原始数据包,所述M个原始数据包是按照传输协议对待传输的业务数据进行封装得到的,所述传输协议定义的包格式为非冗余恢复格式,M为正整数;所述数据发送设备获取所述原始数据包组中的每个原始数据包各自对应的第一冗余恢复参数,将所述原始数据包组中的每个原始数据包与对应的第一冗余恢复参数分别进行拼接处理,得到包括M个目标数据包的所述目标数据包组;其中,每个目标数据包中的第一冗余恢复参数用于指示该目标数据包为冗余恢复格式,所述冗余恢复格式的目标数据包支持冗余恢复处理;
    接收来自所述数据发送设备的N个目标冗余包,所述N个目标冗余包与所述目标数据包组对应,且N为小于或等于M的正整数;
    若检测到所述目标数据包组中存在数据包丢失,则根据所述N个目标冗余包通过冗余恢复处理得到丢失的数据包。
  19. 一种计算机设备,包括:
    处理器,适于实现计算机程序;
    计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序适于由所述处理器加载并执行如权利要求1至11任一项所述的数据处理方法,或者如权利要求12至16任一项所述的数据处理方法。
  20. 一种非易失性计算机可读存储介质,其中,所述存储介质存储有计算机指令,所述计算机指令被执行时,实现如权利要求1至11任一项所述的数据处理方法,或者如权利要求12至16任一项所述的数据处理方法。
  21. 一种计算机程序产品,所述计算机程序产品包括计算机指令,所述计算机指令 存储在计算机可读存储介质中,当所述计算机指令被执行时,实现如权利要求1至11任一项所述的数据处理方法,或者如权利要求12至16任一项所述的数据处理方法。
PCT/CN2023/079758 2022-04-21 2023-03-06 数据处理方法、装置、计算机设备及存储介质 WO2023202243A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210418803.3 2022-04-21
CN202210418803.3A CN114513418B (zh) 2022-04-21 2022-04-21 一种数据处理方法及相关设备

Publications (1)

Publication Number Publication Date
WO2023202243A1 true WO2023202243A1 (zh) 2023-10-26

Family

ID=81555158

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/079758 WO2023202243A1 (zh) 2022-04-21 2023-03-06 数据处理方法、装置、计算机设备及存储介质

Country Status (2)

Country Link
CN (1) CN114513418B (zh)
WO (1) WO2023202243A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114513418B (zh) * 2022-04-21 2022-06-24 腾讯科技(深圳)有限公司 一种数据处理方法及相关设备

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9967306B1 (en) * 2016-09-08 2018-05-08 Sprint Spectrum L.P. Prioritized transmission of redundancy data for packetized voice communication
CN108616328A (zh) * 2016-12-12 2018-10-02 北京视联动力国际信息技术有限公司 一种音视频流丢包恢复方法及音视频流发送端和接收端
CN111181698A (zh) * 2019-10-31 2020-05-19 腾讯云计算(北京)有限责任公司 数据处理方法、装置、设备及介质
CN113242155A (zh) * 2021-03-30 2021-08-10 深圳震有科技股份有限公司 一种数据包丢包的恢复方法、系统及计算机可读存储介质
CN114513418A (zh) * 2022-04-21 2022-05-17 腾讯科技(深圳)有限公司 一种数据处理方法及相关设备

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7017102B1 (en) * 2001-12-27 2006-03-21 Network Equipment Technologies, Inc. Forward Error Correction (FEC) for packetized data networks
CN107241166A (zh) * 2017-06-12 2017-10-10 京信通信系统(中国)有限公司 一种长期演进上的语音Volte数据保障方法和设备
CN112820306B (zh) * 2020-02-20 2023-08-15 腾讯科技(深圳)有限公司 语音传输方法、系统、装置、计算机可读存储介质和设备

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9967306B1 (en) * 2016-09-08 2018-05-08 Sprint Spectrum L.P. Prioritized transmission of redundancy data for packetized voice communication
CN108616328A (zh) * 2016-12-12 2018-10-02 北京视联动力国际信息技术有限公司 一种音视频流丢包恢复方法及音视频流发送端和接收端
CN111181698A (zh) * 2019-10-31 2020-05-19 腾讯云计算(北京)有限责任公司 数据处理方法、装置、设备及介质
CN113242155A (zh) * 2021-03-30 2021-08-10 深圳震有科技股份有限公司 一种数据包丢包的恢复方法、系统及计算机可读存储介质
CN114513418A (zh) * 2022-04-21 2022-05-17 腾讯科技(深圳)有限公司 一种数据处理方法及相关设备

Also Published As

Publication number Publication date
CN114513418A (zh) 2022-05-17
CN114513418B (zh) 2022-06-24

Similar Documents

Publication Publication Date Title
US7502860B1 (en) Method and apparatus for client-side flow control in a transport protocol
US10873613B2 (en) TCP processing for devices
US7451381B2 (en) Reliable method and system for efficiently transporting dynamic data across a network
WO2017211154A1 (zh) 前向纠错反馈信息传输方法、装置、设备、存储介质
US20080304486A1 (en) Multiplexed data stream protocol
US20140310405A1 (en) Tcp processing for devices
Culley et al. Marker PDU aligned framing for TCP specification
CN112787945B (zh) 数据传输方法、装置、计算机可读介质及电子设备
WO2009021417A1 (fr) Procédé, système et dispositif de transmission et de réception de données de réseau
WO2008153651A1 (en) File protocol for transaction based communication
US10225239B2 (en) Method for in-line TLS/SSL cleartext encryption and authentication
JP2007533012A (ja) データ格納のための情報処理と輸送アーキテクチャ
WO2023202243A1 (zh) 数据处理方法、装置、计算机设备及存储介质
US20110141904A1 (en) Method and apparatus for transmitting packets of a two-way passenger data stream
JP2013123219A (ja) データを送信ノードから宛先ノードに移送する方法
WO2011079777A1 (zh) 数据传输的方法和网络侧设备
US10594661B1 (en) System and method for recovery of data packets transmitted over an unreliable network
TWI779383B (zh) Br/edr 鏈路的mic 恢復
CN113938881A (zh) 适用于互联网数据的传输系统及方法
WO2021208694A1 (zh) 一种数据传输方法及网络设备
US20210014006A1 (en) System and method for implementing a hybrid automatic repeat request process
US10498867B2 (en) Network interface device and host processing device field
WO2018214070A1 (zh) 译码的方法和装置
WO2023109891A1 (zh) 组播传输方法、装置和系统
US20220217093A1 (en) Sequence Number Synchronization Method and Apparatus

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: 23790906

Country of ref document: EP

Kind code of ref document: A1