Data transmission method, device, equipment, medium and product

By identifying the stream type of client data requests and generating target data packets, combined with strategies for the transmission scenario, the problem of poor data transmission quality in existing systems is solved, achieving efficient and reliable data transmission.

CN121367679APending Publication Date: 2026-01-20TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410973727.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-18
Publication Date
2026-01-20

AI Technical Summary

Technical Problem

Existing data transmission methods cannot meet the specific needs of different application areas, resulting in poor data transmission quality.

Method used

By receiving data requests with target stream identifiers sent by clients, identifying the data stream type, determining the data to be transmitted based on the stream type, generating target data packets, and obtaining the target transmission strategy under the current transmission scenario for data transmission.

Benefits of technology

It improves the accuracy and efficiency of data transmission, ensures that the content and format of data packets match the data stream type, adapts to the needs of different transmission scenarios, and guarantees stable and flexible services.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121367679A_ABST
    Figure CN121367679A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a data transmission method and device, equipment, a medium and a product, and the method comprises the steps: receiving a target data request which is sent by a client with established communication connection and is used for multiplexing a target flow identifier, and enabling the target flow identifier to be a flow identifier carried by a server for a corresponding data packet transmitted to the client, the target flow identifier is used for identifying a data flow type of the data packet; according to a preset identification bit of the target flow identifier, identifying a data flow type of data requested by the target data request; determining to-be-transmitted data according to the data stream type of the requested data, and generating a target data packet based on the to-be-transmitted data; and obtaining a target transmission strategy corresponding to the data stream type in the current transmission scene, and transmitting the target data packet to the client according to the target transmission strategy. According to the technical scheme provided by the embodiment of the invention, the high efficiency and reliability of data transmission are improved, the data transmission quality can be effectively improved, and meanwhile, flexible response and stable service in various transmission scenes are ensured.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of communication, in particular to a data transmission method, a data transmission device, an electronic device, a computer readable storage medium and a computer program product. BACKGROUND

[0002] With the continuous development of network communication technology, data transmission has been widely applied in various application fields, such as video conference, file download, electronic mail, etc. In the current conventional data transmission process, the client usually initiates a request to the server, the server parses the request to generate a data packet, and transmits the data packet to the client according to the transmission parameters negotiated with the client. However, with the continuous expansion of the application field of data transmission, this simple data transmission method according to the preset transmission parameters cannot meet the specific needs of the application scenarios in different application fields, resulting in poor data transmission quality. SUMMARY

[0003] Embodiments of the present application provide a data transmission method, a data transmission device, an electronic device, a computer readable storage medium and a computer program product, which improve the efficiency and reliability of data transmission, effectively improve the data transmission quality, and ensure flexible response and stable service in various transmission scenarios.

[0004] Other characteristics and advantages of the present application will become apparent from the following detailed description, or will be learned by practice of the present application.

[0005] According to an aspect of an embodiment of the present application, a data transmission method is provided, comprising: receiving a target data request sent by a client with an established communication connection, the target data request carrying a target stream identifier, the target stream identifier being carried by a corresponding data packet transmitted by a server to the client, the target stream identifier being used to identify the data stream type of the data packet; identifying the data stream type of the requested data of the target data request according to a preset identifier bit of the target stream identifier; determining to-be-transmitted data according to the data stream type of the requested data, and generating a target data packet based on the to-be-transmitted data; obtaining a target transmission strategy corresponding to the data stream type in a current transmission scenario, and transmitting the target data packet to the client according to the target transmission strategy.

[0006] According to an aspect of an embodiment of the present application, a data transmission method is further provided, comprising: obtaining a corresponding data packet transmitted by a server, and extracting a target flow identifier carried in the data packet, the target flow identifier being used to identify a data flow type of the data packet; multiplexing the target flow identifier, to send a target data request carrying the target flow identifier to the server, so that the server identifies a data flow type of requested data of the target data request based on a preset identification bit of the target flow identifier, and generates a target data packet according to the data flow type of the requested data, and transmits the target data packet to a client according to a target transmission strategy corresponding to the data flow type; and receiving a target data packet transmitted by the server, and performing data operation according to the target data packet.

[0007] According to an aspect of an embodiment of the present application, a data transmission apparatus is provided, comprising: a request receiving module, configured to receive a target data request multiplexing a target flow identifier sent by a client having established a communication connection, the target flow identifier being a flow identifier carried in a corresponding data packet transmitted to the client by a server, and the target flow identifier being used to identify a data flow type of the data packet; an identifying module, configured to identify a data flow type of requested data of the target data request according to a preset identification bit of the target flow identifier; a generating module, configured to determine to-be-transmitted data according to the data flow type of the requested data, and generate a target data packet based on the to-be-transmitted data; and a transmitting module, configured to obtain a target transmission strategy corresponding to the data flow type in a current transmission scenario, and transmit the target data packet to the client according to the target transmission strategy.

[0008] In an embodiment of the present application, the request receiving module is further configured to receive a first data request sent by the client for the first time after the communication connection is established with the client; the generating module is further configured to generate the data packet according to request content of the first data request, and encode a flow identifier in the data packet to generate the target flow identifier according to the data flow type of the data packet; and the transmitting module is further configured to obtain a transmission strategy corresponding to the data flow type of the data packet, and transmit the data packet carrying the target flow identifier to the client according to the transmission strategy corresponding to the data flow type of the data packet.

[0009] In an embodiment of the present application, the generating module is further configured to convert a value corresponding to the flow identification in the data packet into a binary; add a binary basic symbol matching the data stream type to a preset identification bit of the binary to obtain a target binary according to the data stream type of the data packet, the binary basic symbol matching the data stream type being used to identify the data stream type; and encode the target binary to obtain the target flow identification; the identifying module is further configured to decode the target flow identification to obtain the target binary; and obtain a binary basic symbol corresponding to a preset identification bit of the target binary and identify a data stream type matching the binary basic symbol.

[0010] In an embodiment of the present application, the generating module is further configured to determine a number of bits to be added to the binary according to a type number of the data stream type; assign different binary basic symbols to different data stream types according to the number of bits; and add a binary basic symbol matching the data stream type to a preset identification bit in the binary to obtain the target binary.

[0011] In an embodiment of the present application, the target transmission strategy includes a transmission strategy corresponding to a video stream in a real-time transmission scenario; and the transmitting module is further configured to transmit the target data packet to the client according to a transmission parameter negotiated with the client; if it is detected that the target data packet has data loss in the process of transmitting the target data packet, obtain an expiration time of a data packet corresponding to the video stream negotiated when the communication connection is established with the client; and retransmit the lost data when the current time is not more than the expiration time.

[0012] In an embodiment of the present application, the apparatus further includes an establishing module configured to receive a handshake message sent by the client, and extract a timeout parameter field from a transmission parameter field in the handshake message, the timeout parameter field being used to indicate the expiration time; if the server locally supports the expiration time, record the expiration time, and send an acknowledgement message indicating that the expiration time is supported to the client; and establish a communication connection with the client according to the transmission parameter field and the acknowledgement message.

[0013] In an embodiment of the present application, the establishing module is further configured to obtain an upper and lower limit time supported locally by the server; if the expiration time is within the upper and lower limit time, determine that the server supports the expiration time; if the expiration time is outside the upper and lower limit time, adjust the expiration time according to the upper and lower limit time to obtain a target expiration time; write the target expiration time into the timeout parameter field, and send an acknowledgement message carrying the timeout parameter field to the client.

[0014] In an embodiment of the present application, the transmission module is further configured to acquire a current network condition, and determine a retransmission number threshold according to the current network condition; and record a retransmission number within the expiration time, and stop retransmitting the lost data if the retransmission number is equal to the retransmission number threshold.

[0015] In an embodiment of the present application, the target transmission strategy includes a transmission strategy corresponding to a video stream in a real-time transmission scenario; the transmission module is further configured to divide the target data packet into a plurality of sub-packets, perform forward error correction coding on the plurality of sub-packets to obtain a redundant data packet, and send the plurality of sub-packets and the redundant data packet to the client, so that the client recovers lost data based on the redundant data packet when detecting that there is data loss in the plurality of sub-packets.

[0016] In an embodiment of the present application, the target transmission strategy includes a transmission strategy corresponding to a signaling stream in a real-time transmission scenario; the transmission module is further configured to transmit the target data packet to the client according to transmission parameters negotiated with the client; and retransmit the target data packet if an acknowledgement packet sent by the client is not received within a preset time period, or a plurality of repeated acknowledgement packets are received.

[0017] According to an aspect of an embodiment of the present application, an electronic device is provided, which includes one or more processors; and a storage device configured to store one or more computer programs, which, when executed by the one or more processors, cause the electronic device to implement the data transmission method as described above.

[0018] According to an aspect of an embodiment of the present application, a computer readable storage medium is provided, which stores a computer program, which, when executed by a processor of an electronic device, causes the electronic device to perform the data transmission method as described above.

[0019] According to an aspect of an embodiment of the present application, a computer program product is provided, which includes a computer program stored in a computer readable storage medium, and a processor of an electronic device reads and executes the computer program from the computer readable storage medium, so that the electronic device performs the data transmission method as described above.

[0020] In the technical scheme provided by the embodiment of the application, the server receives a target data request with a multiplexing target stream identifier sent by the client, the target stream identifier is a stream identifier carried by a corresponding data packet transmitted to the client by the server, and the target stream identifier is used to identify a data stream type of the data packet, so that the server can quickly identify the data stream type of the data requested by the target data request based on a preset identifier bit of the target stream identifier, and then determine corresponding to-be-transmitted data, generate a target data packet, so as to ensure that the content and format of the data packet match the data stream type, thereby improving the accuracy of data transmission; then, a target transmission strategy corresponding to the data stream type in a current transmission scenario is acquired, and the target data packet is transmitted to the client according to the target transmission strategy, that is, the server not only considers the data stream type, but also combines the transmission scenario to select an appropriate transmission strategy according to different data stream types in the transmission scenario, so that the efficiency and reliability of data transmission are improved by using the appropriate transmission strategy, the data transmission quality can be effectively improved, and flexible response and stable service in various transmission scenarios are ensured.

[0021] It should be understood that the foregoing general description and the following detailed description are only exemplary and explanatory, and are not limiting to the application. BRIEF DESCRIPTION OF DRAWINGS

[0022] The drawings incorporated in the specification and constituting a part of the specification illustrate embodiments consistent with the application and, together with the specification, serve to explain the principles of the application. Obviously, the drawings in the following description are only some embodiments of the application, and those skilled in the art can obtain other drawings according to these drawings without creative labor. In the drawings:

[0023] Figure 1 is a schematic diagram of an implementation environment related to the application;

[0024] Figure 2 is a flowchart of a data transmission method according to an exemplary embodiment of the application;

[0025] Figure 3 is a schematic diagram of a data transmission method according to an exemplary embodiment of the application;

[0026] Figure 4 is a flowchart of another data transmission method according to an exemplary embodiment of the application;

[0027] Figure 5 is a flowchart of another data transmission method according to an exemplary embodiment of the application;

[0028] Figure 6 is a flowchart of another data transmission method according to an exemplary embodiment of the application;

[0029] Figure 7 is a flow chart of another data transmission method according to an example embodiment of the present application;

[0030] Figure 8 is a flow chart of another data transmission method according to an example embodiment of the present application;

[0031] Figure 9 is a schematic diagram of a client-server connection according to an example embodiment of the present application;

[0032] Figure 10 is a schematic diagram of a data packet format according to an example embodiment of the present application;

[0033] Figure 11 is a flow chart of a client-server interaction according to an example embodiment of the present application;

[0034] Figure 12 is a flow chart of another client-server interaction according to an example embodiment of the present application;

[0035] Figure 13 is a block diagram of a data transmission apparatus according to an example embodiment of the present application;

[0036] Figure 14 is a block diagram of another data transmission apparatus according to an example embodiment of the present application;

[0037] Figure 15 shows a block diagram of a computer system suitable for implementing an electronic device according to an example embodiment of the present application. DETAILED DESCRIPTION

[0038] The example embodiments will now be described in detail with reference to the drawings. Like reference numerals in different drawings denote like or similar elements. The following description of the example embodiments is not representative of all embodiments consistent with the present application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of the present application as detailed in the appended claims.

[0039] The block diagrams shown in the drawings are merely functional entities and do not necessarily have to correspond to physically independent entities. That is, the functional entities can be implemented in software, or in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.

[0040] The flowchart shown in the drawing is only an exemplary illustration, and is not necessarily required to include all the contents and operations, nor is it necessarily required to be executed in the order described. For example, some operations can be further decomposed, and some operations can be combined or partially combined, so the actual execution order can be changed according to actual conditions.

[0041] It should be further noted that the "multiple" mentioned in the present application refers to two or more than two. The "and / or" describes the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B can represent the three cases of A alone, A and B together, and B alone. The character " / " generally represents an "or" relationship between the associated objects before and after it.

[0042] The technical solutions of the embodiments of the present application will be described in detail below in combination with an implementation environment:

[0043] Please refer to Figure 1 , Figure 1 is a schematic diagram of an implementation environment involved in the present application. The implementation environment includes a client 10 and a server 20.

[0044] The client 10 is configured to establish a communication connection with the server and initiate a data request to the server to request corresponding data.

[0045] The server 20 is configured to receive a target data request with a multiplex target stream identifier sent by a client that has established a communication connection, the target stream identifier being a stream identifier carried by the server for a corresponding data packet transmitted to the client, the target stream identifier being used to identify the data stream type of the data packet; identifying the data stream type of the data requested by the target data request according to a preset identifier bit of the target stream identifier; determining the data to be transmitted according to the data stream type of the requested data, and generating a target data packet based on the data to be transmitted, obtaining a target transmission strategy corresponding to the data stream type, and transmitting the target data packet to the client according to the target transmission strategy.

[0046] Among them, the aforementioned client 10 can be a smart phone, a tablet, a notebook computer, a computer, a smart voice interaction device, a vehicle-mounted terminal, an aircraft, etc. electronic device, the server 20 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network, Content Delivery Network) and big data and artificial intelligence platform Basic cloud computing services such as platform, which are not limited herein.

[0047] It should be noted that the embodiments of the application can be applied to real-time communication scenarios, including but not limited to video number live broadcast, video conference, online voice, online game and various scenarios requiring real-time communication.

[0048] It should be noted that in the detailed description of the application, if at least one of the data request and the data packet involves object-related, when the embodiments of the application are applied to specific products or technologies, the permission or consent of the object needs to be obtained, and the collection, use and processing of related data need to comply with relevant laws, regulations and standards of the country and region.

[0049] The various implementation details of the technical solutions of the embodiments of the application are described in detail as follows:

[0050] As shown in Figure 2 , Fig. 1 is a flowchart of a data transmission method according to an embodiment of the application, which can be applied to the implementation environment shown in Figure 2 , the method can be executed by a server, and the data transmission method can include S210 to S240, which are described in detail as follows: Figure 1

[0051] S210, receiving a target data request with multiplexed target stream identifier sent by a client with established communication connection, the target stream identifier is a stream identifier carried by a corresponding data packet transmitted from the server to the client, and the target stream identifier is used to identify the data stream type of the data packet.

[0052] In the embodiments of the application, the server and the client have established a communication connection in advance, and the server can optionally establish a real-time communication connection with the client based on the QUIC (Quick UDP Internet Connections) protocol, wherein the server has transmitted a corresponding data packet to the client, the data packet carries a target stream identifier, the target stream identifier can be used to identify the stream to which the data packet belongs, and also used to identify the data stream type of the data packet, wherein the data stream type includes but is not limited to real-time video stream and signaling stream.

[0053] After the client has obtained a data packet of a certain data stream type, if it wants to request the same data stream type again, it can directly multiplex the target stream identifier of the data packet, so the client sends a target data request with multiplexed target stream identifier to the server; for example, the corresponding data packet A transmitted from the server to the client carries a target stream identifier a, which indicates that the data stream type of the data packet A is a video stream, and when the client needs to obtain a video stream again, it can send a target data request carrying the target stream identifier a to the server.

[0054] S220, identifying the data stream type of the data requested by the target data request according to the preset identifier bit of the target stream identifier. ​

[0055] In the embodiment of the present application, the server receives the target data request, extracts the target stream identifier from the target data request, and identifies the data stream type of the data requested by the target data request according to a preset identification bit of the target stream identifier; wherein the preset identification bit of the target stream identifier is used to identify the data stream type of the data packet, and the preset identification bit can be determined by the client and the server in advance, or can be determined by the server and notified to the client. For example, the server extracts the target stream identifier a, extracts the preset identification bit of the target stream identifier, and identifies the data of the video stream requested by the client this time.

[0056] S230, determining the to-be-transmitted data according to the data stream type of the requested data, and generating a target data packet based on the to-be-transmitted data.

[0057] After the server obtains the data stream type that the client wants to request, the to-be-transmitted data can be determined, and then the target data packet is generated based on the to-be-transmitted data; in an example, the local to-be-transmitted data can be determined based on the same data stream type of the data packet transmitted by the server to the client last time; for example, the video stream transmitted by the server to the client last time is data packet A, and the to-be-transmitted data is determined based on data packet A to ensure the same data progress. In another example, the target data request also includes a request requirement, and the to-be-transmitted data can be determined based on the request requirement and the data stream type of the requested data.

[0058] In the embodiment of the present application, when the target data packet is generated, the server can also directly reuse the target stream identifier, and take the target stream identifier as the stream identifier of the target data packet; the data stream type of the target data packet is consistent with the data stream type of the data packet.

[0059] S240, obtaining a target transmission strategy corresponding to the data stream type in the current transmission scenario, and transmitting the target data packet to the client according to the target transmission strategy.

[0060] It should be noted that in some transmission scenarios, different data stream types correspond to different transmission emphases. For example, in real-time communication transmission scenarios and non-real-time transmission scenarios, the signaling stream transmission is key data, such as initiating a video session, ending a video session, video session network change, and reporting video related data, and the transmission emphasis requires complete data reliability; in real-time communication transmission scenarios, real-time video stream transmission transmits real-time video content, such as live picture and voice call content, and the real-time data can tolerate a certain degree of packet loss, and the transmission emphasis is that occasional data loss is more important than waiting for retransmission to maintain real-time performance; and in non-real-time transmission scenarios, video stream transmission pays more attention to data integrity, and the transmission emphasis is complete data reliability.

[0061] Therefore, in the embodiments of the present application, different data stream types correspond to different target transmission strategies in different transmission scenarios, the server pre-establishes the correspondence between different data stream types and transmission strategies in various communication scenarios, and therefore, the server can obtain the target transmission strategy corresponding to the data stream type in the current transmission scenario according to the pre-established correspondence after identifying the data stream type to be transmitted to the client this time, and transmit the target data packet to the client according to the target transmission strategy. The server can obtain the current transmission scenario from the target data request.

[0062] It can be understood that the server can receive multiple different target data requests sent by the client, and transmit multiple target data packets to the client according to the corresponding transmission strategies based on S220-S240.

[0063] In an example, the target transmission strategy includes a transmission strategy corresponding to a signaling stream in a real-time transmission scenario, and transmitting the target data based on the target transmission strategy includes transmitting the target data packet to the client according to the transmission parameters negotiated with the client, and retransmitting the target data packet if an acknowledgement packet sent by the client is not received within a preset time period or multiple repeated acknowledgement packets are received.

[0064] In the embodiments of the present application, the server needs an acknowledgement (ACK) from the client for each data packet transmitted by the server. After receiving the data packet, the client sends an ACK data packet to the server to confirm that the data packet has been successfully received. In an example, the server transmits a target data packet of the signaling stream type, and starts a timer to wait for an ACK confirmation. If the server does not receive the ACK confirmation within a certain time, it is considered that the data packet may have been lost. At this time, the server will immediately retransmit the target data packet until the ACK confirmation is received. In another example, when the client detects that the target data packet has data loss (such as by detecting a skipped sequence number), the client will send a repeated ACK. When the server receives multiple repeated ACKs within a preset time period, it will understand that the lost data packet needs to be retransmitted without waiting for the timer to time out.

[0065] In the embodiment of the present application, the server receives a target data request with a multiplex target stream identifier sent by the client, the target stream identifier is carried by the server to the corresponding data packet transmitted to the client, and the target stream identifier is used to identify the data stream type of the data packet. Then, the server can quickly identify the data stream type of the data requested by the target data request based on the preset identifier of the target stream identifier, and then determine the corresponding to-be-transmitted data, generate a target data packet, so as to ensure that the content and format of the data packet match the data stream type, thereby improving the accuracy of data transmission. Then, the target transmission strategy corresponding to the data stream type in the current transmission scenario is obtained, and the target data packet is transmitted to the client according to the target transmission strategy. That is, the server not only considers the current transmission scenario, but also selects an appropriate transmission mode according to different data stream types. By using the appropriate transmission strategy, the efficiency and reliability of data transmission are improved, and flexible response and stable service in various transmission scenarios are ensured.

[0066] In an embodiment of the present application, another data transmission method is provided, which can be applied to Figure 1 the implementation environment shown in the figure, which can be executed by a server, as Figure 4 shown in the figure, the data transmission method is based on S210-S240 shown in Figure 2 , S310-S330 are added before S210. Among them, S310-S330 are described in detail as follows:

[0067] S310, receiving the initial data request sent by the client after establishing a communication connection with the client.

[0068] S320, generating a data packet according to the request content of the initial data request, and encoding the stream identifier in the data packet according to the data stream type of the data packet to generate a target stream identifier.

[0069] In the embodiment of the present application, after the server and the client establish a communication connection, the client can request related data from the server, and the server receives the initial data request initiated by the client for the first time after establishing a communication connection.

[0070] In order to facilitate the server to know the content requested by the client, the request content is carried in the initial data request. The initial data request is a request signaling data or a video stream data, and then the server can generate a data packet based on the request content of the initial data request, and obtain the data stream type of the data packet. It should be noted that when the data packet is generated, the stream identifier of the data packet is generated, and the data packet already contains a stream identifier. In order to facilitate subsequent distinction of the data stream type of the data packet, the server needs to encode the stream identifier in the data packet according to the data stream type of the data packet to generate a target stream identifier, so that the target stream identifier can identify the data stream type of the data packet.

[0071] In an example, encoding the stream identifier in the data packet according to the data stream type of the data packet to generate a target stream identifier includes: converting a value corresponding to the stream identifier in the data packet into binary; adding a binary basic symbol matching the data stream type to a preset identifier bit of the binary to obtain a target binary according to the data stream type of the data packet, wherein the basic symbol matching the data stream type is used to identify the data stream type; and performing encoding processing on the target binary to obtain the target stream identifier.

[0072] In the embodiments of the present application, the stream identifier in the data packet can be an integer. In order to facilitate subsequent encoding processing, the value corresponding to the stream identifier needs to be converted into binary. The two lowest bits of the stream identifier are related to the type of the stream: the lowest bit identifies the initiator of the stream, and a value of 0 indicates that the stream is initiated by a client, and a value of 1 indicates that the stream is initiated by a server; the second lowest bit identifies the direction of the stream, and a value of 0 indicates that it is a bidirectional stream, and a value of 1 indicates that it is a unidirectional stream. Based on this, the preset identifier bit of the binary can be used to distinguish the data stream type. The preset identifier bit is a position in the binary other than the two lowest bits. For example, the preset identifier bit is the first bit of the binary, or the preset identifier bit is the first two bits of the binary, which can be flexibly adjusted according to actual conditions.

[0073] Different binary basic symbols matching different data stream types are used to identify different data stream types. The binary basic symbol is 0 and 1. The binary basic symbol matching the data stream type can be added to the preset identifier bit of the binary to obtain the target binary, and different data stream types can be distinguished through the target binary.

[0074] In an example, obtaining the target binary includes: determining the number of bits added to the binary according to the type number of the data stream type; assigning different binary basic symbols to different data stream types according to the number of bits; and adding the binary basic symbol matching the data stream type to the preset identifier bit in the binary to obtain the target binary.

[0075] The type number of the data stream type is positively related to the number of bits added to the binary. For example, if the type number of the data stream type is 2, the number of bits added to the binary is 1, and only 1 bit is needed to distinguish two types of data streams. Based on 1 bit, different binary basic symbols are assigned to different data stream types. For example, if the data stream type is a signaling stream and a real-time video stream, the signaling stream can be assigned a 1-bit binary basic symbol 1, and the real-time video stream can be assigned a 1-bit binary basic symbol 0.

[0076] If the number of types of the data stream type is 4, the number of bits added to the binary is 2, such as the data stream type is a signaling stream, a real-time video stream, a normal data stream, and a file transmission stream; the signaling stream can be assigned a 2-bit binary basic symbol 11; the real-time video stream can be assigned a 2-bit binary basic symbol 00; the normal data stream can be assigned a binary basic symbol 01; and the normal data stream can be assigned a binary basic symbol 10.

[0077] In this way, different data stream types can be effectively distinguished without adding extra fields.

[0078] The preset identification bit of the binary can be a front position of the binary. After the different data stream types are assigned different binary basic symbols, the assigned binary basic symbols can be added to the first n bits to obtain a target binary, where n is the determined number of bits.

[0079] For example, the stream identification of a data packet is 16, which is converted into a binary 00010000. Assuming that the data stream type of the data packet is a signaling stream, the first bit 1 is added to the binary to obtain a target binary 10010000; or the first 2 bits are added to the binary to obtain a target binary 1100010000. For another example, the stream identification of a data packet is 300, which is converted into a binary 100101100. Assuming that the data stream type of the data packet is a real-time video stream, the first bit 0 is added to the binary to obtain a target binary 0+100101100=0100101100.

[0080] In the embodiment of the present application, in order to reduce the data storage space or reduce the transmission bandwidth, the target binary needs to be encoded; for example, a target length encoding mode is determined according to the size of the target binary, and the target binary is encoded based on the target length encoding mode to obtain a target stream identification. Optionally, the present application uses VLE encoding to encode the target binary, wherein a smaller value uses a shorter encoding, and a larger value uses a longer encoding; for example, if the value is less than 128 (0x80), only one byte needs to be encoded; if the value is larger, multiple bytes are needed; the basic rule is: if the highest bit is 0, the byte contains part of the value; if the highest bit is 1, the next byte is also part of the value.

[0081] For example, the target binary 10010000 only needs one byte encoding, and the VLE encoding result is 0x90 (hexadecimal), and the target stream identification is 0x90. The target binary 0100101100 cannot be directly represented by one byte, so according to the VLE encoding rule, the highest bit 1 indicates that there is a next byte, the first byte is 01000010 (0x42), the second byte is 00101100 (0x2c), and the combined result is 0x422c, and the target stream identification is 0x422c.

[0082] It should be noted that the process of encoding the flow identifier in the data packet to generate the target flow identifier corresponds to the process of identifying the data stream type according to the preset identifier bit of the target flow identifier. That is, the target flow identifier is decoded to obtain the target binary, the preset identifier bit corresponding to the binary basic symbol of the target binary is obtained, and the data stream type matching the binary basic symbol is identified. For example, the target flow identifier 0x90 is decoded based on the VLE encoding rule to obtain 10010000, and since the first bit is 1, it can be determined that the data stream type of the data is a signaling stream.

[0083] S330, obtaining a transmission strategy corresponding to the data stream type of the data packet, and transmitting the data packet carrying the target flow identifier to the client according to the transmission strategy corresponding to the data stream type of the data packet.

[0084] In the embodiment of the application, the server obtains the transmission strategy corresponding to the data stream type of the data packet in the current scene based on the pre-established corresponding relationship, and then transmits the data packet carrying the target flow identifier to the client based on the transmission strategy. That is, the server needs to determine the corresponding transmission strategy based on the data stream type of the data packet each time the data packet is transmitted to the client, and then perform transmission.

[0085] It should be noted that, Figure 3 For other detailed descriptions of S210-S240 shown in Figure 2 S210-S240 shown in

[0086] In the embodiment of the application, the server allocates different binary basic symbols to different data stream types based on the type number of the data stream type, and then generates the target binary based on the allocated different binary basic symbols. Different data streams can be identified without additional protocol fields, and the data storage space or transmission bandwidth can be reduced by encoding the target binary, so as to transmit the data packet carrying the target flow identifier to the client, so that the client can directly reuse the target flow identifier subsequently.

[0087] The embodiment of the application provides another data transmission method, which can be applied to Figure 1 the implementation environment shown in Figure 4 the method can be executed by the server, as Figure 2 the data transmission method is based on Figure 2 S240 shown in

[0088] S410. Transmit the target data packet to the client according to the transmission parameter negotiated with the client.

[0089] S420. If data loss of the target data packet is detected during the transmission of the target data packet, obtain the expiration time of the data packet corresponding to the video stream negotiated when the communication connection is established with the client.

[0090] In the embodiments of the present application, the server and the client negotiate the relevant transmission parameters when the communication connection is established, so that the server can transmit the target data packet to the client based on the transmission parameters; for example, the transmission parameters include encryption algorithm, maximum data packet size, etc., such as the server can divide the target data packet according to the maximum data packet size, and encrypt the divided data packet based on the encryption algorithm, and then sequentially transmit the multiple data packets to the client based on the multiple divided data packets.

[0091] It can be understood that when data transmission is performed, there is a case of data loss, so that the server can detect whether there is a packet loss case during the transmission of the target data packet; if there is a packet loss case, the server obtains the expiration time of the data packet corresponding to the real-time video stream, which is negotiated when the communication connection is established between the server and the client, and the expiration time is used to indicate that the data packet corresponding to the video stream is considered to be expired after how long after being sent.

[0092] S430. When the current time does not exceed the expiration time, retransmit the lost data.

[0093] The server obtains the current time, judges whether the current time exceeds the expiration time, if yes, does not trigger the retransmission mechanism any more, and directly ignores the lost data (packet); if not, retransmits the lost data.

[0094] In other embodiments of the present application, the current time and the transmission time between the server and the client are obtained, the transmission time can be determined based on the interaction when the communication connection is established between the server and the client, the sum of the current time and the transmission time is used as the judgment time, if the judgment time does not exceed the expiration time, the lost data is retransmitted, if the judgment time exceeds the expiration time, the lost data is directly ignored.

[0095] In an example, in network transmission, in order to ensure reliable arrival of data packets, retransmission is performed for lost data packets; however, frequent retransmission can cause network congestion, affecting overall transmission efficiency. In order to optimize the retransmission mechanism, the number of retransmissions threshold can be dynamically determined according to the current network situation, and the retransmission of the lost data is stopped when the number of retransmissions threshold is reached. Therefore, the retransmission of the lost data in the embodiment of the application comprises: acquiring the current network situation, and determining the number of retransmissions threshold according to the current network situation; recording the number of retransmissions within the expiration time, and if the number of retransmissions is equal to the number of retransmissions threshold, the retransmission of the lost data is stopped.

[0096] Among them, the server can collect and analyze network state data regularly, including bandwidth utilization, delay, packet loss rate, etc.; according to the current network situation, the maximum number of retransmissions is dynamically determined, wherein in the case of high network load, large delay and high packet loss rate, the number of retransmissions should be reduced to avoid further congestion; wherein the number of retransmissions threshold under different network states can be set, in an example, the real-time network state data and the set different network state data are compared to determine the corresponding number of retransmissions threshold under similar network state data, wherein the similar network state data refers to the similarity of two network state data is greater than a preset similarity threshold; in another example, after comparing the real-time network state data with the set different network state data, there is no similar network state data, then according to the difference between the real-time network state data and the network state data with the highest similarity, the number of retransmissions threshold corresponding to the network state data with the highest similarity is adjusted to obtain the number of retransmissions threshold corresponding to the real-time network; wherein the adjustment rule is: the higher the network load, the larger the delay, the higher the packet loss rate, the smaller the number of retransmissions threshold.

[0097] The server determines that the current time exceeds the expiration time of the data packets corresponding to the video stream, and retransmits the lost data, and records the number of retransmissions within the expiration time, if the number of retransmissions is equal to the number of retransmissions threshold, it means that further retransmission will cause network congestion, so the retransmission of the lost data is stopped; if the number of retransmissions is less than the number of retransmissions threshold, the retransmission of the lost data is continued within the expiration time until the current time exceeds the expiration time or the number of retransmissions is equal to the number of retransmissions threshold.

[0098] It should be noted that, Figure 4 For detailed introduction of S210-S230 shown in Figure 2 S210-S230 shown in the foregoing description will not be repeated here.

[0099] In the embodiment of the present application, for the data corresponding to the real-time video stream, whether the current time exceeds the expiration time negotiated with the client is judged, if yes, retransmission is not triggered, low delay of data delivery is ensured, network congestion caused by a large number of retransmissions is avoided, and the transmission quality of real-time audio and video can be effectively improved; further, when retransmission is performed, the retransmission number threshold can be dynamically determined according to the current network situation, and when the retransmission number threshold is reached, retransmission of the lost data is stopped, so that network congestion caused by frequent retransmission is avoided, and the overall transmission efficiency is affected.

[0100] The embodiment of the present application also provides another data transmission method, which can be applied to the implementation environment as shown in the figure, the method can be executed by a server, as shown in the figure, on the basis of Figure 1 Figure 5 The embodiment of the present application also provides another data transmission method, which can be applied to the implementation environment as shown in the figure, the method can be executed by a server, as shown in the figure, on the basis of Figure 4

[0101] S510, receiving the handshake message sent by the client, and extracting the timeout parameter field from the transport parameter field in the handshake message, the timeout parameter field being used to indicate the expiration time.

[0102] In the embodiment of the present application, the client and the server establish a connection based on the QUIC protocol, in the QUIC protocol, the parameter exchange in the handshake process usually occurs in the initial encryption handshake stage, this stage is called "Crypto" handshake. In this process, the client and the server negotiate encryption parameters and transmission parameters through a series of data packet exchanges.

[0103] Among them, the client first initiates a handshake message, namely "ClientHello" message, to the server, carries the transport parameter field "Transport Parameters" in the handshake message, defines a new field in the "Transport Parameters" message, named "RealTimeAudioStreamTimeout" timeout parameter field, which can be a 32-bit integer, indicating how many milliseconds after the data packet of the real-time video stream is sent to be considered expired.

[0104] S520, if the server locally supports the expiration time, recording the expiration time, and sending an acknowledgment message to the client indicating that the expiration time is supported.

[0105] S530, establishing a communication connection with the client according to the transport parameter field and the acknowledgment message.

[0106] ​​In the embodiment of the present application, the server extracts the expiration time from the handshake message, and if the server supports the expiration time, records the expiration time and sets a value of 1 in the timeout parameter field to indicate support, and then sends the confirmation message "ServerConfig" carrying the timeout parameter field with the value of 1 to the client.

[0107] It can be understood that the transmission parameter field further includes various transmission-related configurations, including the maximum flow ID, the maximum packet size, etc., and thus the server establishes a communication connection with the client based on the transmission parameter field and the confirmation message.

[0108] In an example, if the server does not support the expiration time, it can set a value of 0 in the timeout parameter field to indicate non-support, and then sends the "ServerConfig" carrying the timeout parameter field with the value of 0 to the client, and then the server establishes a communication connection with the client based on the transmission parameter field.

[0109] In an example, whether the server supports the expiration time proposed by the client can be determined based on the server's own conditions, for example, obtaining the upper and lower limit time supported by the server locally; if the expiration time is within the upper and lower limit time, it is determined that the server supports the expiration time; if the expiration time is outside the upper and lower limit time, it is determined that the server does not support the expiration time.

[0110] In an example, in addition to indicating whether the server supports or does not support the expiration time proposed by the client, the server can also propose its own expiration time; for example, if the server does not support the expiration time proposed by the client, the server can adjust the expiration time according to the upper and lower limit time to obtain a target expiration time; write the target expiration time into the timeout parameter field, and send the confirmation message carrying the timeout parameter field to the client. For example, the upper and lower limit time supported by the server is 100-200 ms; the expiration time proposed by the client is 300 ms, which can be adjusted to 200 ms, and then the 200 ms is written into the timeout parameter field as the target expiration time, and then the "ServerConfig" carrying the timeout parameter field with the value of 200 ms is sent to the client.

[0111] It should be noted that Figure 5 For other detailed descriptions of S210-S230, S410-S430 shown in Figure 4 For other detailed descriptions of S210-S230, S410-S430 shown in

[0112] In the embodiments of the present application, by adding a new field in the message in the handshake process, the expiration time policy of the real-time video stream can be effectively negotiated between the client and the server, not only flexibility is provided, but also compatibility with the existing implementation is ensured, thereby optimizing the transmission experience of the real-time video stream.

[0113] In an embodiment of the present application, another data transmission method is also provided, which can be applied to Figure 1 the implementation environment shown, the method can be executed by a server, and in the embodiments of the present application, as Figure 6 shown, the data transmission method is based on Figure 2 the method shown in Figure 2 S240, and the S240 shown in is extended to S610-S620, wherein the target transmission policy includes a transmission policy corresponding to a video stream in a real-time transmission scenario.

[0114] S610, the target data packet is divided into a plurality of sub-packets, and the plurality of sub-packets are forward error correction encoded to obtain a redundant data packet.

[0115] S620, the plurality of sub-packets and the redundant data packet are sent to the client, so that the client recovers the lost data based on the redundant data packet when detecting that there is data loss in the plurality of sub-packets.

[0116] In the embodiments of the present application, in order to guarantee the low latency requirement of the real-time video stream, forward error correction (FEC) capability can be introduced; FEC adds redundant information when sending a data packet, so that when the data packet is lost, the receiver can recover the lost data through the redundant data, thereby reducing the delay caused by packet loss.

[0117] The server can divide the target data packet according to the maximum packet size, divide the target data packet into a plurality of sub-packets, and perform forward error correction encoding based on the plurality of sub-packets to obtain a redundant data packet; for example, including four sub-packets D1, D2, D3, and D4; redundant data packets: R1=D1⊕D2; R2=D3⊕D4, and then the server sends the following data packets to the client: D1, D2, D3, D4, R1, and R2.

[0118] The client receives all data packets, and in the case of no packet loss, directly uses the plurality of sub-packets to play the video; assuming that D2 is lost, the client can use the following method to recover the lost data packet; using R1=D1⊕D2, and knowing D1, calculating D2; the client continues to play the video using the recovered data packet, maintaining low latency.

[0119] Figure 6 It should be noted that,For further details of S210-S230, please refer to Figure 2 For further details of S210-S230, please refer to

[0120] In the embodiment of the present application, for real-time video stream, a forward error correction mode is also adopted, through sending additional data packets, the lost data packets can be recovered, retransmission is avoided, and the timeliness of real-time video stream is ensured.

[0121] Figures 2 to 6 The embodiment described above is from the perspective of the server, and the implementation details of the technical solution of the embodiment of the present application from the perspective of the client are described as follows: Figures 7 to 8 The implementation details of the technical solution of the embodiment of the present application from the perspective of the client are described as follows:

[0122] In an embodiment of the present application, another data transmission method is also provided, which can be applied to Figure 1 The implementation environment is shown in FIG. 7, and the method can be executed by the client, as shown in FIG. 8. Figure 7 The data transmission method includes S710-S730, and details are as follows:

[0123] S710, a corresponding data packet transmitted by the server is acquired, and a target stream identifier carried in the data packet is extracted, the target stream identifier being used to identify the data stream type of the data packet.

[0124] S720, the target stream identifier is multiplexed to send a target data request carrying the target stream identifier to the server, so that the server identifies the data stream type of the requested data of the target data request based on a preset identifier bit of the target stream identifier, and generates a target data packet according to the data stream type of the requested data, and transmits the target data packet to the client according to a target transmission strategy corresponding to the data stream type.

[0125] S730, the target data packet transmitted by the server is received, and data operation is performed according to the target data packet.

[0126] In the embodiment of the present application, after the client receives the data packet transmitted by the server, the target stream identifier used to identify the data stream type of the data packet is extracted, so that the target stream identifier carried in the data packet can be identified to obtain the data stream type of the data packet; then the target stream identifier can be associated with the data stream type, if the client wants to obtain data of the same data stream type from the server again, the target stream identifier can be directly multiplexed to send a target data request carrying the target stream identifier to the server, and then the server performs corresponding operation based on the target data request, for details, please refer to the embodiment shown in FIG. 9. Figure 2

[0127] ​The client receives the target data packet transmitted by the server based on the target transmission strategy, and performs data operation according to the data stream type of the target data packet; if the data stream type is a signaling stream, corresponding signaling operation is performed; if the data stream type is a video stream, corresponding video is played.

[0128] In the embodiment of the application, the client can directly reuse the target stream identifier to request data of the same stream type, and then the server can quickly identify the data stream type of the requested data based on the preset identifier bit of the target stream identifier, generate the target data packet, and ensure that the content and format of the data packet match the data stream type, thereby improving the accuracy of data transmission; in the current transmission scenario, appropriate transmission mode is selected through different data stream types, and the efficiency and reliability of data transmission are improved through the use of appropriate transmission strategy.

[0129] In an embodiment of the application, another data transmission method is also provided, which can be applied to the implementation environment as shown in Figure 1 The data transmission method can be executed by the client, as shown in Figure 8 The data transmission method adds S810-S840 before S710 based on the implementation environment as shown in Figure 7 The details of S810-S840 are as follows:

[0130] S810, a handshake message is sent to the server, and the transmission parameter field in the handshake message includes a timeout parameter field, which is used to indicate the expiration time of the real-time video stream corresponding data packet.

[0131] S820, a confirmation message indicating that the expiration time is supported is received, and a communication connection is established with the server according to the confirmation message and the transmission parameter field.

[0132] S830, the initial data request is sent to the server for the first time, so that the server generates the data packet according to the request content of the initial data request, and encodes the stream identifier in the data packet according to the data stream type of the data packet to generate the target stream identifier.

[0133] S840, the data packet carrying the target stream identifier is received, and the data stream type of the data packet and the target stream identifier are associated and stored, so as to reuse the target stream identifier when the data of the corresponding data stream type is requested again.

[0134] In the embodiment of the present application, when the client wants to establish a communication connection with the server, it needs to send a handshake message to the server, which is used to exchange various transmission related configurations; wherein a new field, i.e. the timeout parameter field, is defined in the transmission parameter field of the handshake message, which is used to indicate the expiration time of the real-time video stream corresponding data packet; that is, the client proposes its own expected video stream expiration time; the server can confirm the expiration time with the client in the handshake stage, or propose its own expected expiration time, and the client receives the sent confirmation message to determine from the confirmation message whether the server supports the expiration time and whether to propose its own expected expiration time; if the confirmation message sent by the server indicating that the expiration time is supported is received, the communication connection with the server can be established according to the confirmation message and the transmission parameter field, and the expiration time of the video stream is negotiated.

[0135] After the client and the server establish a communication connection, the client can perform data transmission with the server, and various types of data exist in the server, and the client needs to request the server when it needs certain data. In the embodiment of the present application, the first request sent by the client after the client and the server establish a communication connection is regarded as the initial data request, and the server receives the initial data request, generates a data packet according to the request content of the initial data request, and encodes the stream identifier in the data packet according to the data stream type of the data packet to generate a target stream identifier. For details, please refer to the embodiment shown in Figure 3

[0136] After that, the client receives the data packet carrying the target stream identifier, can know that the target stream identifier is used to identify the data stream type of the data packet, and therefore stores the data stream type of the data packet and the target stream identifier in association, so as to reuse the target stream identifier when requesting data of the data stream type again.

[0137] It should be noted that Figure 8 For other detailed descriptions of S710-S730 shown in Figure 7 S710-S730 shown in the embodiment, which will not be described here.

[0138] In the embodiment of the present application, by adding a new field in the "Transport Parameters" message in the handshake process, the expiration time strategy of the real-time video stream can be effectively negotiated between the client and the server.

[0139] In order to facilitate understanding, the embodiment of the present application also provides a data transmission method, which can be applied in real-time communication transmission scenarios, such as video conference scenarios.

[0140] In the embodiment of the present application, the QUIC protocol is used as the transmission protocol of real-time communication, and two kinds of data streams are newly defined, which are signaling stream and real-time audio / video stream.​

[0141] The signaling stream is used to transmit key signaling, such as initiating a video session, ending a video session, video session network changes, reporting video-related data, etc. The signaling stream transmits key data, which requires complete reliability, and lost packets need to be corrected through retransmission to ensure data integrity.

[0142] The real-time audio and video stream transmits real-time audio and video data, such as live pictures, voice call content, etc. This real-time data can tolerate a certain degree of packet loss, because occasional data loss may be more important than waiting for retransmission to maintain real-time performance. At the same time, this data stream can support custom expiration time, i.e., retransmission is no longer performed after the expiration time.

[0143] In the QUIC protocol, the exchange of parameters in the handshake process usually occurs in the initial encryption handshake phase. In this process, the client and the server negotiate encryption parameters and transmission parameters through a series of data packet exchanges. In order to implement the expiration time strategy of real-time video stream in the QUIC protocol, a new parameter field can be added to the "TransportParameters" message in the handshake process.

[0144] In the handshake process of QUIC, the client sends a ClientHello message, and the server responds with a ServerConfig message. The "Transport Parameters" message is usually sent and received in the "ClientHello" message of the client and the "ServerConfig" message of the server. These messages are used to exchange various transmission-related configurations, including connection ID, maximum stream ID, maximum packet size, etc.

[0145] It is worth noting that in the embodiments of the present application, a new field named "RealTimeAudioStreamTimeout" (i.e., timeout transmission field) is defined in the "Transport Parameters" message. This field can be a 32-bit integer, indicating how many milliseconds after the real-time video stream packet is sent that it is considered expired. The client includes this new field in the "ClientHello" message and sets an expected timeout value. The server confirms or proposes its own timeout value in the "ServerConfig" message. If the server does not support the protocol, it sets a 0 value in the field to indicate that it does not support the feature. If the server supports the field, it sets a 1 value in the field to indicate that it supports the feature. If the server proposes its own timeout value, it can set an integer in the field.

[0146] The RealTimeAudioStreamTimeout field can be added as a subfield of the Transport Parameters message; the type of this subfield can be a new transport parameter type, such as 0xa0 (the type can be assigned as needed); the value of this field will be encoded as an integer, and both the client and the server will parse and generate this value according to the agreed format.

[0147] It should be noted that, in order to ensure compatibility with existing QUIC implementations, the new transport parameter field should not conflict with existing fields, and should be optional; if the client does not transmit this field, the server transmits according to the original data stream, and if the server does not support this field, the client parses the data returned by the server according to the original parsing method.

[0148] As shown in Figure 9 , the client sends a ClientHello message to the server, carrying the RealTimeAudioStreamTimeout parameter to set the expiration time; the server detects whether the ClientHello message carries the RealTimeAudioStreamTimeout parameter, and if it carries this parameter, determines whether it supports the parameter, and if it supports, records the connection state with the client based on other transport parameters in the ClientHello message, and records the expiration time indicated by the parameter, sends a ServerConfig message to the client, and then the client and the server complete the handshake and establish a communication connection for data transmission; wherein if the client does not carry RealTimeAudioStreamTimeout, the server directly sends a ServerConfig message to the client to establish a communication connection with the client for data transmission.

[0149] By adding a new field in the Transport Parameters message in the QUIC handshake process, the expiration time strategy of the real-time video stream can be effectively negotiated between the client and the server, while maintaining compatibility with existing implementations; this design provides flexibility and allows both parties to adjust the timeout strategy according to actual needs.

[0150] It should be understood that QUIC supports connection multiplexing, so multiple streams can be created in one connection, each stream using a separate stream ID for identification, and the data format of the QUIC protocol packet is as shown in Figure 10 , it can be seen that the payload part of the data is composed of multiple frames (Frame), each frame contains Type, StreamId and the remaining part, and the StreamId is encoded using variable length.

[0151] Variable-Length Encoding (VLE) is a data compression technique that assigns different lengths of encoding according to the size of the data value. The characteristic of this encoding method is that small values use shorter encoding, while large values use longer encoding. VLE is usually used to reduce data storage space or reduce transmission bandwidth, because it can effectively compress data sets with a large number of small values and a small number of large values. The encoding rule is simply described as follows: if the highest bit is 0, then this byte contains a part of the numerical value; if the highest bit is 1, it indicates that the next byte is also a part of the numerical value.

[0152] The first bit of the StreamID used in the embodiment of the present application identifies the signaling stream and the real-time video stream. If it is a signaling stream, the first bit is 1, and if it is a real-time video stream, the first bit is 0. The subsequent data continues to use variable-length encoding. As shown in Table 1.

[0153]

[0154]

[0155] Table 1

[0156] Using this encoding method, the signaling stream and the real-time video stream can be identified without additional fields. In addition, this scheme can also be extended, for example, using the first two bits as identification data stream, which can identify four kinds of streams, and so on.

[0157] After identifying the signaling stream, the transmission strategy corresponding to the signaling stream is to transmit according to the reliable transmission mode, that is, if a timeout packet loss occurs, retransmission will be performed.

[0158] After identifying the real-time video stream, the transmission strategy corresponding to the real-time video stream is to determine whether the current time exceeds the maximum timeout time negotiated in the previous protocol, and if it exceeds, retransmission will not be triggered, which guarantees low delay of data delivery and avoids network congestion caused by a large number of retransmissions, and can effectively improve the transmission quality of real-time audio and video.

[0159] In the embodiment of the present application, the process of data transmission includes initial request of data by the client and subsequent request of data, wherein the initial request of data includes:

[0160] For example Figure 11As shown, the client requests signaling data or real-time video stream data from the server, the server detects whether the RealTimeAudioStreamTimeout parameter is carried in the handshake of the client, if the parameter is carried, the server generates a signaling data packet or a real-time video data packet based on the request, the data packet includes a StreamID, the first bit of the StreamID is used to identify the data stream type of the data packet, and the StreamID is encoded to obtain a signaling StreamID or a real-time video StreamID, the signaling data packet carrying the signaling StreamID is transmitted to the client, or the real-time video data packet carrying the real-time video StreamID is transmitted to the client.

[0161] The subsequent request data includes that when the client needs to request the signaling data or the video stream data again, the signaling StreamID or the real-time video StreamID is directly multiplexed to initiate a request to the server; the server identifies the signaling StreamID or the real-time video StreamID, determines that the data stream type requested by the client is a signaling stream or a real-time video stream, and then generates a corresponding target data packet and transmits it to the client.

[0162] Wherein, whether it is an initial request or a subsequent request, when the server transmits the data packet to the client, for the signaling data packet, the reliable transmission mode is used for transmission; for the real-time video data packet, if it is detected that there is a packet loss, it is judged whether the current time exceeds the expiration time, if not, the retransmission is triggered; if it exceeds, the packet loss is ignored.

[0163] In the embodiment of the application, the QUIC protocol can effectively distinguish the signaling stream and the real-time video stream through the first bit of the StreamID without adding additional fields; in addition, this scheme can also be extended, for example, using the first two bits as an identifier of the data stream, then four different streams can be identified. This flexible encoding and transmission strategy can significantly improve the transmission quality of real-time audio and video, and ensure efficient and low-delay communication.

[0164] In the embodiment of the application, in order to guarantee the low delay requirement of the real-time video stream, the forward error correction capability is introduced, after the server identifies the real-time video stream, the additional data packet (i.e. the aforementioned redundant data packet) is sent, when the packet loss occurs, the client can recover the lost packet through the additional data packet.

[0165] As Figure 12As shown, when transmitting real-time video data packets, the server generates additional data packets through forward error correction coding, transmits the additional data packets and real-time video data packets to the client, and determines whether to trigger retransmission according to the expiration time when detecting that there are lost packets. When detecting that there are lost packets, the client detects whether the additional data packets are received. If the additional data packets are received, the lost data packets are recovered based on the additional data packets. If the additional data packets are not received, the server sends a lost packet message, and then the server retransmits the additional data packets based on the lost packet message.

[0166] In an example, if the server triggers retransmission, the client does not need to recover based on the additional data packets. In another example, if the server triggers retransmission, the client can check the data packets recovered through the additional data packets based on the retransmitted data packets of the server.

[0167] The data transmission method provided by the embodiments of the present application introduces an improved QUIC protocol in a real-time communication system. By adding a new field in the message in the QUIC handshake process, the expiration time strategy of the real-time video stream can be effectively negotiated between the client and the server. Using the first bit of the StreamID as a different stream identification bit, different streams can be identified without additional protocol fields, partial reliable transmission can be easily supported, and the real-time communication quality can be effectively improved. In addition, this improved method can be further expanded to support more stream identification. In addition, for the real-time video stream, a forward error correction method is used, and by sending additional data packets, the lost data packets can be recovered, retransmission is avoided, and the timeliness of the real-time video stream is ensured.

[0168] The device embodiments of the present application are introduced herein and can be used to execute the data transmission method in the above-mentioned embodiments of the present application. For details not disclosed in the device embodiments of the present application, please refer to the above-mentioned embodiments of the data transmission method.

[0169] The embodiments of the present application provide a data transmission device which can be arranged in a server, as shown in the following figure. Figure 13 The device includes:

[0170] The request receiving module 1310 is configured to receive a target data request of multiplexing target stream identification sent by a client having established a communication connection, the target stream identification being a stream identification carried by a corresponding data packet transmitted to the client by the server, and the target stream identification being used to identify the data stream type of the data packet.

[0171] The identification module 1320 is configured to identify the data stream type of the data requested by the target data request according to a preset identification bit of the target stream identification.

[0172] The generating module 1330 is configured to determine to-be-transmitted data according to a data stream type of the requested data, and generate a target data packet based on the to-be-transmitted data.

[0173] The transmitting module 1340 is configured to acquire a target transmission strategy corresponding to the data stream type in a current transmission scenario, and transmit the target data packet to the client according to the target transmission strategy.

[0174] In an embodiment of the present application, based on the foregoing scheme, the request receiving module is further configured to receive a first data request sent by the client for the first time after the communication connection is established between the client and the server; the generating module is further configured to generate the data packet according to the request content of the first data request, and encode the stream identifier in the data packet according to the data stream type of the data packet to generate the target stream identifier; and the transmitting module is further configured to acquire a transmission strategy corresponding to the data stream type of the data packet, and transmit the data packet carrying the target stream identifier to the client according to the transmission strategy corresponding to the data stream type of the data packet.

[0175] In an embodiment of the present application, based on the foregoing scheme, the generating module is further configured to convert the value corresponding to the stream identifier in the data packet into a binary; add a binary basic symbol matching the data stream type to a preset identifier bit of the binary to obtain a target binary, the binary basic symbol matching the data stream type being used to identify the data stream type; and encode the target binary to obtain the target stream identifier; the identifying module is further configured to decode the target stream identifier to obtain the target binary; acquire the binary basic symbol corresponding to the preset identifier bit of the target binary, and identify the data stream type matching the binary basic symbol.

[0176] In an embodiment of the present application, based on the foregoing scheme, the generating module is further configured to determine the number of bits added to the binary according to the type number of the data stream type; allocate different binary basic symbols to different data stream types according to the number of bits; and add the binary basic symbol matching the data stream type to the preset identifier bit in the binary to obtain the target binary.

[0177] In an embodiment of the present application, based on the foregoing scheme, the target transmission strategy comprises a transmission strategy corresponding to a video stream in a real-time transmission scenario; the transmission module is further configured to transmit the target data packet to the client according to the transmission parameters negotiated with the client; if data loss of the target data packet is detected during transmission of the target data packet, an expiration time of a data packet corresponding to the video stream negotiated when the communication connection is established with the client is obtained; and the lost data is retransmitted when the current time is not beyond the expiration time.

[0178] In an embodiment of the present application, based on the foregoing scheme, the apparatus further comprises an establishing module configured to receive a handshake message sent by the client, and extract a timeout parameter field from a transmission parameter field in the handshake message, the timeout parameter field being used to indicate the expiration time; if the expiration time is supported locally by the server, record the expiration time, and send an acknowledgement message to the client to indicate that the expiration time is supported; and establish a communication connection with the client according to the transmission parameter field and the acknowledgement message.

[0179] In an embodiment of the present application, based on the foregoing scheme, the establishing module is further configured to obtain an upper and lower limit time supported locally by the server; if the expiration time is within the upper and lower limit time, determine that the expiration time is supported by the server; if the expiration time is beyond the upper and lower limit time, adjust the expiration time to obtain a target expiration time according to the upper and lower limit time; write the target expiration time into the timeout parameter field, and send an acknowledgement message carrying the timeout parameter field to the client.

[0180] In an embodiment of the present application, based on the foregoing scheme, the transmission module is further configured to obtain a current network condition, and determine a retransmission number threshold according to the current network condition; record a retransmission number within the expiration time, and if the retransmission number is equal to the retransmission number threshold, stop retransmitting the lost data.

[0181] In an embodiment of the present application, based on the foregoing scheme, the target transmission strategy comprises a transmission strategy corresponding to a video stream in a real-time transmission scenario; the transmission module is further configured to divide the target data packet into a plurality of sub-packets, perform forward error correction coding on the plurality of sub-packets to obtain redundant data packets; and send the plurality of sub-packets and the redundant data packets to the client, so that the client recovers the lost data based on the redundant data packets when detecting data loss in the plurality of sub-packets.

[0182] In an embodiment of the present application, based on the foregoing scheme, the target transmission strategy includes a transmission strategy corresponding to a signaling stream in a real-time transmission scenario of a data stream type; the transmission module is further configured to transmit the target data packet to the client according to transmission parameters negotiated with the client; and if an acknowledgement packet sent by the client is not received within a preset time period or multiple repeated acknowledgement packets are received, the target data packet is retransmitted.

[0183] An embodiment of the present application provides a data transmission device which can be arranged in a client, as shown in the figure, the device includes: Figure 14

[0184] The acquisition module 1410 is configured to acquire a corresponding data packet transmitted by a server and extract a target stream identifier carried in the data packet, the target stream identifier being used to identify a data stream type of the data packet.

[0185] The sending module 1420 is configured to multiplex the target stream identifier to send a target data request carrying the target stream identifier to the server, so that the server identifies a data stream type of requested data of the target data request based on a preset identifier bit of the target stream identifier, generates a target data packet according to the data stream type of the requested data, and transmits the target data packet to a client according to a target transmission strategy corresponding to the data stream type.

[0186] The data receiving module 1430 is configured to receive a target data packet transmitted by the server and perform data operation according to the target data packet.

[0187] In an embodiment of the present application, based on the foregoing scheme, the sending module is further configured to send a handshake message to the server, a transmission parameter field in the handshake message includes a timeout parameter field, the timeout parameter field being used to indicate an expiration time of a real-time video stream corresponding data packet, the data receiving module is further configured to receive an acknowledgement message sent by the server to indicate that the expiration time is supported, and establish a communication connection with the server according to the acknowledgement message and the transmission parameter field; and the sending module is further configured to first send a primary data request to the server, so that the server generates the data packet according to request content of the primary data request, encodes a stream identifier in the data packet according to a data stream type of the data packet to generate the target stream identifier; and the data receiving module is further configured to receive the data packet carrying the target stream identifier and store the data stream type of the data packet and the target stream identifier in association, so as to multiplex the target stream identifier when the data of the data stream type is requested again.

[0188] ​It should be noted that the apparatus provided by the above embodiments and the method provided by the above embodiments belong to the same concept, wherein the specific manner in which each module and unit performs operations has been described in the method embodiments in detail, and will not be described here.

[0189] Embodiments of the present application also provide an electronic device, comprising one or more processors, and a storage device, wherein the storage device is configured to store one or more computer programs, and when the one or more computer programs are executed by the one or more processors, the electronic device is enabled to implement the data transmission method as described above.

[0190] Figure 15 A structural schematic diagram of a computer system of an electronic device suitable for implementing embodiments of the present application is shown.

[0191] It should be noted that, Figure 15 The computer system 1500 of the electronic device shown is only an example, and should not impose any limitation on the functions and use range of the embodiments of the present application.

[0192] As Figure 15 shown, the computer system 1500 includes a processor (CPU) 1501, which can perform various appropriate actions and processes according to programs stored in a read-only memory (ROM) 1502 or programs loaded from a storage portion 1508 into a random access memory (RAM) 1503, such as performing the methods in the above embodiments. In the RAM 1503, various programs and data required for system operation are also stored. The CPU 1501, the ROM 1502, and the RAM 1503 are connected to each other through a bus 1504. An input / output (I / O) interface 1505 is also connected to the bus 1504.

[0193] In some embodiments, the following components are connected to the I / O interface 1505: an input part 1506 including a keyboard, a mouse, etc.; an output part 1507 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), etc., and a speaker, etc.; a storage part 1508 including a hard disk, etc.; and a communication part 1509 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication part 1509 performs communication processing via a network such as the Internet. A drive 1510 is also connected to the I / O interface 1505 as necessary. A removable media 1511 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc. is attached to the drive 1510 as necessary, so that a computer program read therefrom is installed in the storage part 1508 as necessary.

[0194] In particular, the processes described above with reference to the flowcharts can be implemented as a computer program according to embodiments of the present application. For example, embodiments of the present application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing a computer program for executing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via the communication part 1509, and / or installed from the removable media 1511. When the computer program is executed by the processor (CPU) 1501, various functions defined in the system of the present application are executed.

[0195] It should be noted that the computer-readable medium in the embodiments shown in the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the two. The computer-readable storage medium may, for example, be an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (Compact Disc Read-Only Memory, CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, the computer-readable signal medium can include a data signal propagating in a baseband or as a carrier wave in a propagated data signal, in which the computer-readable computer program is carried. Such a propagated data signal can take various forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable storage medium, which can send, propagate or transmit programs for use by or in connection with an instruction execution system, device or component. The computer program contained on the computer-readable medium can be transmitted by any suitable medium, including but not limited to wireless, wired, or the like, or any suitable combination of the above.

[0196] The flowcharts and block diagrams in the drawings illustrate the possible implementation architectures, functions and operations of the apparatus, method and computer program product according to various embodiments of the present application. In the flowcharts or block diagrams, each block can represent a module, a program segment or a part of code, which contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions noted in the blocks can occur in different order than that shown in the drawings. For example, two blocks represented in succession can actually be executed substantially in parallel, and sometimes they can be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagram or flowchart, and the combination of blocks in the block diagram or flowchart, can be implemented by a dedicated hardware-based system that performs the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer programs.

[0197] The units or modules involved in the embodiments of the present application can be implemented in software or hardware, and the units or modules described can be arranged in a processor. In some cases, the names of the units or modules do not constitute a limitation on the units or modules themselves.

[0198] Another aspect of the present application also provides a computer readable storage medium, which stores a computer program. The computer program is executed by a processor to implement the data transmission method described above. The computer readable storage medium can be included in the electronic device described in the above embodiments, or can exist separately without being assembled into the electronic device.

[0199] Another aspect of the present application also provides a computer program product, which includes a computer program stored in a computer readable storage medium. The processor of the electronic device reads the computer program from the computer readable storage medium. The processor executes the computer program to cause the electronic device to perform the following method in each of the above embodiments: obtaining departure point data and a plurality of directed road segments in road network data; generating a plurality of to-be-collected road segments with starting point coordinates and ending point coordinates according to the departure point data and the plurality of directed road segments; constructing a distance matrix corresponding to the plurality of to-be-collected road segments according to the starting point coordinates and the ending point coordinates corresponding to the plurality of to-be-collected road segments, respectively; and generating a target path starting from the departure point data and passing through each directed road segment according to the distance matrix.

[0200] It should be noted that although several modules or units of the device for action execution are mentioned in the above detailed description, such division is not mandatory. Indeed, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into several modules or units.

[0201] Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the embodiments disclosed herein. The present application is intended to cover any variations, uses, or adaptations of the application following the general principles thereof and including such departures from the present disclosure as come within known use or custom in the art.

[0202] The above is only the preferred exemplary embodiments of the present application, and is not intended to limit the embodiments of the present application. Those skilled in the art can easily make corresponding modifications or changes according to the main idea and spirit of the present application. Therefore, the protection scope of the present application should be subject to the protection scope required by the claims.

Claims

1. A data transmission method, characterized by, The method comprises the following steps: receiving a target data request sent by a client in a communication connection, the target data request carrying a target stream identifier, the target stream identifier being carried in a corresponding data packet transmitted to the client by the server, and the target stream identifier being used to identify the data stream type of the data packet; identifying the data stream type of the data requested by the target data request according to a preset identifier bit of the target stream identifier; determining the data to be transmitted according to the data stream type of the requested data, and generating a target data packet based on the data to be transmitted; obtaining a target transmission strategy corresponding to the data stream type in a current transmission scenario, and transmitting the target data packet to the client according to the target transmission strategy.

2. The method of claim 1, wherein, Before the step of receiving the target data request sent by the client in the communication connection, the method further comprises the following steps: receiving a first data request sent by the client for the first time after the communication connection is established; generating the data packet according to the request content of the first data request, and encoding the stream identifier in the data packet according to the data stream type of the data packet to generate the target stream identifier; obtaining a transmission strategy corresponding to the data stream type of the data packet, and transmitting the data packet carrying the target stream identifier to the client according to the transmission strategy corresponding to the data stream type of the data packet.

3. The method of claim 2, wherein, The step of encoding the stream identifier in the data packet according to the data stream type of the data packet to generate the target stream identifier comprises the following steps: converting the value corresponding to the stream identifier in the data packet into binary; adding a binary basic symbol matching the data stream type to a preset identifier bit of the binary to obtain a target binary, the binary basic symbol matching the data stream type being used to identify the data stream type; encoding the target binary to obtain the target stream identifier. The step of identifying the data stream type of the data requested by the target data request according to the preset identifier bit of the target stream identifier comprises the following steps: decoding the target stream identifier to obtain the target binary; obtaining a binary basic symbol corresponding to a preset identifier bit of the target binary, and identifying the data stream type matching the binary basic symbol.

4. The method of claim 3, wherein, The step of adding a binary basic symbol matching the data stream type to a preset identifier bit of the binary to obtain a target binary according to the data stream type comprises the following steps: determining the number of bits to be added to the binary according to the type number of the data stream type; allocating different binary basic symbols to different data stream types according to the number of bits; adding the binary basic symbol matching the data stream type to the preset identifier bit in the binary to obtain the target binary.

5. The method of claim 1, wherein, The target transmission strategy comprises a transmission strategy corresponding to a video stream in a real-time transmission scenario; and the step of transmitting the target data packet to the client according to the target transmission strategy comprises the following steps: transmitting the target data packet to the client according to the transmission parameters negotiated with the client. If data loss of the target data packet is detected during transmission of the target data packet, an expiration time of a data packet corresponding to the video stream negotiated when the communication connection with the client is established is obtained; When the current time does not exceed the expiration time, the lost data is retransmitted.

6. The method of claim 5, wherein, The method further comprises: receiving a handshake message sent by the client, and extracting a timeout parameter field from a transmission parameter field in the handshake message, the timeout parameter field being used to indicate the expiration time; if the server locally supports the expiration time, recording the expiration time, and sending an acknowledgement message to the client to indicate that the expiration time is supported; establishing a communication connection with the client according to the transmission parameter field and the acknowledgement message.

7. The method of claim 6, wherein, The method further comprises: obtaining an upper and lower limit time supported by the server locally; if the expiration time is within the upper and lower limit time, determining that the server supports the expiration time; if the expiration time is outside the upper and lower limit time, adjusting the expiration time to obtain a target expiration time according to the upper and lower limit time; writing the target expiration time into the timeout parameter field, and sending an acknowledgement message carrying the timeout parameter field to the client.

8. The method of claim 5, wherein, The retransmission of the lost data comprises: obtaining a current network condition, and determining a retransmission number threshold according to the current network condition; recording a retransmission number within the expiration time, and if the retransmission number is equal to the retransmission number threshold, stopping retransmission of the lost data.

9. The method of claim 1, wherein, The target transmission strategy comprises a transmission strategy corresponding to a video stream in a real-time transmission scenario; the transmission of the target data packet to the client according to the target transmission strategy comprises: dividing the target data packet into a plurality of sub-packets, and performing forward error correction coding on the plurality of sub-packets to obtain redundant data packets; sending the plurality of sub-packets and the redundant data packets to the client, so that the client recovers the lost data based on the redundant data packets when detecting data loss in the plurality of sub-packets.

10. The method of claim 1, wherein, The target transmission strategy comprises a transmission strategy corresponding to a signaling stream in a real-time transmission scenario; the transmission of the target data packet to the client according to the target transmission strategy comprises: transmitting the target data packet to the client according to transmission parameters negotiated with the client; if an acknowledgement packet sent by the client is not received within a preset time period, or a plurality of repeated acknowledgement packets are received, retransmitting the target data packet.

11. A data transmission method, characterized by, comprises: obtaining a corresponding data packet transmitted by a server, and extracting a target stream identifier carried in the data packet, the target stream identifier being used to identify a data stream type of the data packet; multiplex the target stream identifier to send a target data request carrying the target stream identifier to the server, so that the server identifies a data stream type of data requested by the target data request based on a preset identifier bit of the target stream identifier, and generates a target data packet according to the data stream type of the requested data, and transmits the target data packet to the client according to a target transmission strategy corresponding to the data stream type; receive the target data packet transmitted by the server, and perform data operation according to the target data packet.

12. The method of claim 11, wherein, The method further comprises: sending a handshake message to the server, wherein a transmission parameter field in the handshake message comprises a timeout parameter field, and the timeout parameter field is used to indicate an expiration time of a data packet corresponding to a real-time video stream; receiving an acknowledgement message sent by the server and used to indicate support for the expiration time, and establishing a communication connection with the server according to the acknowledgement message and the transmission parameter field; sending a first data request to the server for the first time, so that the server generates the data packet according to the request content of the first data request, and encodes a stream identifier in the data packet to generate the target stream identifier according to the data stream type of the data packet; receiving the data packet carrying the target stream identifier, and associatively storing the data stream type of the data packet and the target stream identifier, so that the target stream identifier is reused when the data corresponding to the data stream type is requested again.

13. A data transmission apparatus, characterized by comprising: The apparatus comprises: a request receiving module configured to receive a target data request multiplexing a target stream identifier sent by a client having established a communication connection, wherein the target stream identifier is a stream identifier carried by a corresponding data packet transmitted to the client by a server, and the target stream identifier is used to identify a data stream type of the data packet; an identifying module configured to identify a data stream type of data requested by the target data request according to a preset identifier bit of the target stream identifier; a generating module configured to determine to-be-transmitted data according to the data stream type of the requested data, and generate a target data packet based on the to-be-transmitted data; a transmitting module configured to acquire a target transmission strategy corresponding to the data stream type in a current transmission scenario, and transmit the target data packet to the client according to the target transmission strategy.

14. An electronic device, comprising: comprise: one or more processors; a storage device configured to store one or more programs, which, when executed by the one or more processors, cause the electronic device to perform the method of any one of claims 1 to 10, or perform the method of any one of claims 11 to 12.

15. A computer-readable storage medium, characterized in that, a computer program is stored thereon, which, when executed by a processor of an electronic device, causes the electronic device to perform the method of any one of claims 1 to 10, or perform the method of any one of claims 11 to 12.

16. A computer program product, characterised in that, The computer program product includes a computer program stored in a computer readable storage medium, and a processor of an electronic device reads and executes the computer program from the computer readable storage medium, so that the electronic device executes the method in any one of claims 1 to 10, or executes the method in any one of claims 11 to 12.