Data transmission method, computing device, storage medium and program product

By comparing and splicing the analytical information of network data packets, the problem of low compression efficiency of small network data packets is solved, efficient data transmission is achieved, and user experience and system performance are improved.

CN119324764APending Publication Date: 2025-01-17ZHUHAI KINGSOFT ONLINE GAME TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411552672.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-01
Publication Date
2025-01-17

AI Technical Summary

Technical Problem

Existing data compression technology is not efficient when processing large and fragmented small network data packets, resulting in increased network communication delays and affecting user experience.

Method used

By comparing the parsing information of multiple initial network data packets, the intersection information and the difference information are extracted and spliced ​​into target network data packets, reducing data redundancy, optimizing data transmission efficiency and processor performance consumption.

Benefits of technology

It improves data transmission efficiency, reduces the amount of data transmitted, optimizes the performance of the server processor, and improves the user experience and the smoothness and reliability of data transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119324764A_ABST
    Figure CN119324764A_ABST
Patent Text Reader

Abstract

Embodiments of the present specification provide a data transmission method, a computing device, a storage medium and a program product wherein the data transmission method is applied to a server, and comprises: obtaining at least one initial network data packet sent to a target terminal wherein any initial network data packet comprises initial analysis information and to-be-processed information; the initial analysis information is used for analyzing the initial network data packet on the target terminal; comparing the initial analysis information of each initial network data packet, and determining intersection information and difference set information in each initial analysis information; splicing the intersection information, each piece of difference set information and each piece of to-be-processed information to obtain a target network data packet; and sending the target network data packet to the target terminal. The target network data packet is formed by extracting and splicing the common intersection information and the difference set information in the initial network data packet, so that the data redundancy and the transmission quantity are reduced, the data integrity is ensured, the data transmission efficiency is improved, the server performance is optimized, and the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of this specification relate to the field of Internet technology, and in particular to a data transmission method, a computing device, a storage medium, and a program product. Background Art

[0002] With the rapid development of Internet technology, the application of multi-person network communication is becoming more and more widespread, such as multi-person online games, video conferencing, etc. In these application scenarios with high real-time requirements, data compression technology plays an important role in reducing network traffic and improving transmission efficiency. Data compression technology can effectively represent the original data by identifying and removing redundant information in the data.

[0003] At present, the network data compression method is to identify and encode repeated information in the network data packets that need to be sent, and use shorter encoded information to replace the original content before encoding, so as to express the original data with less data, reduce the size of the network data packets sent in network communication, and improve the real-time performance of network communication.

[0004] However, this technology is not ideal when processing a large number of fragmented small network data packets. Since the small network data packets themselves have less information, the repeated information that can be compressed is limited. When facing a single small network data packet, the compression efficiency is not high; at the same time, it is necessary to add decompression reference information to assist decoding in the compressed network data packet, and these added decompression reference information may take up a considerable amount of space, especially when the network data packet is small. The size of these decompression reference information will reach or even exceed the original network data packet size, making the benefits of compression processing low or even negative; and if a set of compression algorithms is configured for each small network data packet to improve the compression rate, when the number of small network data packets is large, it will significantly increase the performance consumption of the processors of the sending and receiving terminals, reduce the processing speed of network data, and increase the delay of network communication, causing jamming, which in turn affects the user experience. Therefore, there is an urgent need for an efficient and convenient data transmission method. Summary of the invention In view of this, an embodiment of this specification provides a data transmission method. One or more embodiments of this specification also relate to another data transmission method, a data transmission device, another data transmission device, a computing device, a computer-readable storage medium, and a computer program product to solve the technical defects existing in the prior art.

[0005] According to a first aspect of an embodiment of this specification, a data transmission method is provided, which is applied to a server, including: Acquire at least one initial network data packet sent to a target terminal, wherein any initial network data packet includes initial parsing information and information to be processed, and the initial parsing information is used to parse the initial network data packet on the target terminal; Compare the initial parsing information of each initial network data packet to determine the intersection information and the difference information in each initial parsing information; Splicing the intersection information, each difference set information and each to-be-processed information to obtain the target network data packet; Send the target network data packet to the target terminal.

[0006] Optionally, sending the target network data packet to the target terminal includes: Determine whether the target network data packet meets the preset sending conditions; If yes, send the target network data packet to the target terminal; If not, wait and obtain other initial network data packets sent to the target terminal, return to execute the step of comparing the initial parsing information of each initial network data packet, determine the intersection information and difference information in each initial parsing information, and obtain the updated target network data packet. When the updated target network data packet meets the preset sending conditions, the updated target network data packet is sent to the target terminal.

[0007] Optionally, determining whether the target network data packet meets a preset sending condition includes: Determine whether the size of the target network data packet exceeds a preset buffer threshold, wherein the preset buffer threshold is set according to the buffer size of the server.

[0008] Optionally, determining whether the target network data packet meets a preset sending condition includes: Determine whether the target time window where the target network data packet is located has ended.

[0009] Optionally, before sending the target network data packet to the target terminal, the method further includes: Determine whether the size of the target network data packet exceeds a preset compression threshold; If yes, compress the target network data packet to obtain a compressed target network data packet.

[0010] Optionally, the intersection information includes a scene identifier, where the scene identifier is a scene identifier corresponding to a target scene generated by each initial network data packet; Compress the target network data packets, including: Determining a target compression dictionary from at least one preset compression dictionary according to the scenario identifier; The target network data packets are compressed using the target compression dictionary.

[0011] Optionally, compressing the target network data packet using a target compression dictionary includes: Encode each piece of information to be processed in the target network data packet to obtain the encoded pieces of information to be processed and decoding reference information, wherein the decoding reference information is used to decode the encoded pieces of information to be processed; The decoding reference information is replaced based on the dictionary index information included in the target compression dictionary.

[0012] Optionally, before determining the target compression dictionary according to the scenario identifier, the method further includes: Obtain historical network data packets generated in the target scenario; Based on historical network data packets, build a training dataset related to the target scenario; The target compression dictionary is trained using the training dataset.

[0013] According to a second aspect of an embodiment of this specification, another data transmission method is provided, which is applied to a target terminal, including: Receive a target network data packet sent by the server, wherein the target data network packet is obtained by concatenating intersection information, each difference set information and each to-be-processed information, the intersection information and each difference set information are determined by comparing each initial parsed information of at least one initial network data packet, and any initial network data packet includes initial parsed information and to-be-processed information; Utilizing the intersection information, parsing the target network data packet, obtaining at least one difference set information, and determining the information to be processed corresponding to each difference set information; The intersection information, each difference set information and each to-be-processed information are concatenated to obtain at least one initial network data packet.

[0014] Optionally, parsing the target network data packet according to the intersection information to obtain at least one difference set information, and determining the information to be processed corresponding to each difference set information, includes: Determine whether the target network data packet has been compressed; If yes, decompress the target network data packet, and use the intersection information to parse the decompressed target network data packet to obtain at least one difference set information, and determine the information to be processed corresponding to each difference set information; If not, the target network data packet is parsed using the intersection information to obtain at least one difference set information, and the to-be-processed information corresponding to each difference set information is determined.

[0015] Optionally, the intersection information includes a scene identifier, where the scene identifier is a scene identifier corresponding to a target scene generated by each initial network data packet; Decompress the target network data packet, including: Determining a target compression dictionary from at least one preset compression dictionary according to the scenario identifier; Decompress the target network data packet using the target compression dictionary.

[0016] According to a third aspect of an embodiment of this specification, a data transmission device is provided, which is applied to a server, including: An acquisition module is configured to acquire at least one initial network data packet sent to a target terminal, wherein any initial network data packet includes initial parsing information and information to be processed, and the initial parsing information is used to parse the initial network data packet on the target terminal; A comparison module is configured to compare the initial parsing information of each initial network data packet and determine the intersection information and difference information in each initial parsing information; A splicing module is configured to splice the intersection information, each difference set information and each to-be-processed information to obtain a target network data packet; The sending module is configured to send the target network data packet to the target terminal.

[0017] According to a fourth aspect of an embodiment of this specification, another data transmission device is provided, which is applied to a target terminal, including: A receiving module is configured to receive a target network data packet sent by a server, wherein the target data network packet is obtained by concatenating intersection information, each difference information and each to-be-processed information, and the intersection information and each difference information are determined by comparing each initial parsed information of at least one initial network data packet, and any initial network data packet includes initial parsed information and to-be-processed information; A parsing module is configured to parse the target network data packet using the intersection information, obtain at least one difference set information, and determine the information to be processed corresponding to each difference set information; The splicing module is configured to splice the intersection information, each difference set information and each to-be-processed information to obtain at least one initial network data packet.

[0018] According to a fifth aspect of an embodiment of this specification, a computing device is provided, including: Memory and processor; The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions. When the computer programs / instructions are executed by the processor, the steps of the above-mentioned data transmission method are implemented.

[0019] According to a sixth aspect of the embodiments of this specification, a computer-readable storage medium is provided, which stores a computer program / instruction, and when the computer program / instruction is executed by a processor, the steps of the above-mentioned data transmission method are implemented.

[0020] According to a seventh aspect of the embodiments of this specification, a computer program product is provided, including a computer program / instruction, which implements the steps of the above-mentioned data transmission method when executed by a processor.

[0021] An embodiment of the present specification provides a data transmission method, which is applied to a server, including: obtaining at least one initial network data packet sent to a target terminal, wherein any initial network data packet includes initial parsing information and information to be processed, and the initial parsing information is used to parse the initial network data packet on the target terminal; comparing the initial parsing information of each initial network data packet, determining the intersection information and difference information in each initial parsing information; splicing the intersection information, each difference information and each information to be processed to obtain a target network data packet; and sending the target network data packet to the target terminal. By comparing the parsing information of multiple initial network data packets, the common intersection information and the difference difference information are extracted, and these information and the information to be processed are spliced ​​into a target network data packet, so that while using each difference information to ensure the integrity of the data in each initial network data packet, only one common intersection information is retained, and the repeated information in each initial parsing information is removed, thereby reducing data redundancy and reducing the amount of transmitted data; the sending of at least one initial network data packet is completed at one time, improving the data transmission efficiency, optimizing the processor performance consumption of the server, improving the fluency and reliability of data transmission, and improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 is a flow chart of a data transmission method provided by an embodiment of this specification; Figure 2 It is a schematic diagram of a method for merging network data packets provided by an embodiment of this specification; Figure 3 is a flow chart of another data transmission method provided by an embodiment of this specification; Figure 4 It is a schematic diagram of the flow structure of a data transmission method provided by an embodiment of this specification; Figure 5 is a processing flow chart of a data transmission method provided by an embodiment of this specification; Figure 6 It is a structural schematic diagram of a data transmission device provided by an embodiment of this specification; Figure 7 is a schematic diagram of the structure of another data transmission device provided by an embodiment of this specification; Figure 8 It is a structural block diagram of a computing device provided by an embodiment of this specification. DETAILED DESCRIPTION

[0023] Many specific details are described in the following description to facilitate a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of this specification, so this specification is not limited to the specific implementation disclosed below.

[0024] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "a", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.

[0025] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of this specification, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0026] In addition, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in one or more embodiments of this specification are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0027] First, the terms involved in one or more embodiments of this specification are explained.

[0028] Network Data Packet: Network Data Packet (NDP) is the basic data unit transmitted on the network, which contains header information and actual transmitted data content.

[0029] Data compression: Data compression is a technology that reduces data storage space or transmission bandwidth by reducing data redundancy through algorithms.

[0030] Dictionary Compression: Dictionary compression is a compression method based on a lookup table that compresses data by replacing recurring data patterns with shorter codes.

[0031] Scenario Identifier: A scenario identifier is a label or code used to uniquely identify a specific scenario or context, helping to identify and process data in a specific situation.

[0032] In this specification, a data transmission method is provided. One or more embodiments of this specification also involve another data transmission method, a data transmission device, another data transmission device, a computing device, and a computer-readable storage medium, which are described in detail one by one in the following embodiments.

[0033] See also Figure 1 , Figure 1 A flow chart of a data transmission method provided according to an embodiment of the present specification is shown. The data transmission method is applied to a server and specifically includes the following steps.

[0034] Step 102: Acquire at least one initial network data packet sent to the target terminal, wherein any initial network data packet includes initial parsing information and information to be processed, and the initial parsing information is used to parse the initial network data packet on the target terminal.

[0035] Network data packets are the basis for realizing Internet communication and are also the basic unit for transmitting data in Internet communication. Internet communication can be applied to communications in networks such as Local Area Network (LAN), Wide Area Network (WAN) and the Internet. In these networks, data is transmitted from one end to the other through network data packets.

[0036] Network data packets generally consist of two parts: a header and a payload. The header includes information used for routing and transmission control, i.e., parsing information, such as source address, destination address, protocol type, checksum, etc. This information can help network communication equipment (such as routers, switches, etc.) determine where the network data packet should be sent. It also includes information such as how to decode the data packet, what type of data, and data format, to help the target terminal correctly parse and process the network data packet. The payload includes the actual data to be transmitted, i.e., the information to be processed, which can be any form of data, such as email, web page content, part of a file, multimedia stream, etc. When the network data packet reaches the target terminal, the target terminal will reassemble the network data packet based on the parsing information and restore the original data.

[0037] Initial network data packets refer to unprocessed network data packets generated by the server. Initial parsing information refers to parsing information contained in the initial network data packets. Target terminals refer to hardware devices that receive each initial network data packet, such as servers, personal computers, personal mobile devices, smart wearable devices, or any hardware device that can receive network data packets.

[0038] For example, in the application of the game field, the server can be the game server A, the target terminal can be the player client 1, and the initial network data packet is a network data packet generated by various types of data that the game server A needs to send to the player client 1; for example, "player character status information network data packet", "player score information network data packet", etc. The initial parsed information of the player character status information network data packet can be used to identify the game server A that generated the network packet, the address of the player client 1 to be sent, the network communication protocol used, and other information, as well as the data type of the network data packet is the player character status information, the data format is character type, and other information, and the pending information of the network data packet is "the data value 'Alive' corresponding to the player character status information data"; the initial parsed information of the player score information network data packet "identifies the game server A that generated the network packet, the address of the player client 1 to be sent, the network communication protocol used, and other information", and the data type of the network data packet is "player character score information, the data format is integer, etc. Information", the pending information of the network data packet is "the data value '3500' corresponding to the player score information data".

[0039] By acquiring at least one initial network data packet sent to the target terminal, and any initial network data packet including initial parsing information and information to be processed, the composition of each initial network data packet is determined, providing a basis for further comparison and processing of each network data packet.

[0040] Step 104: Compare the initial parsing information of each initial network data packet to determine the intersection information and difference information in each initial parsing information.

[0041] The intersection information is the same part of the initial parsed information of multiple initial network data packets, that is, the information elements that exist in each initial network data packet, such as the source address, destination address, protocol type, checksum and other information mentioned above. Since the generating server and target terminal of each initial network data packet, as well as the communication network adopted are the same, this information remains consistent in the initial parsed information of each initial network data packet.

[0042] The difference information is the different partial information in the initial parsed information of multiple initial network data packets, that is, the information that only exists in one or some of the initial network data packets, but does not exist or is different in other initial network data packets, such as the information mentioned above on how to decode the data packet, what type of data, data format type, etc. Because the encoding method of each initial network data packet may be different, the type of data carried and the data format are different, this information is inconsistent in the initial parsed information of each initial network data packet.

[0043] For example, in the application of the game field, the initial network data packets sent by the game server A to the player client 1 are the player character status information network data packets and the player score information network data packets. By comparing the initial parsed information of each initial network data packet, it can be determined that the intersection information is "information identifying the game server A that generates the network packet, the address of the player client 1 to be sent, the network communication protocol used is the IP (Internet Protocol) protocol, etc."; the difference information is "information such as the data type is the player character status information, the data format is character type, etc.", and "information such as the data type is the player character score information, the data format is integer, etc."

[0044] By comparing the initial parsing information in each initial network data packet, the intersection information and difference information therein are determined, which provides a basis for further splicing processing of each initial network data packet.

[0045] Step 106: Concatenate the intersection information, each difference information and each to-be-processed information to obtain a target network data packet.

[0046] The target network data packet is a network data packet sent by the server to the target terminal, which is usually composed of one or more initial network data packets. Specifically, it is obtained by splicing the intersection information, the difference information and the to-be-processed information of each initial network data packet. The splicing method is specifically: using the intersection information as the target parsing information of the target network data packet, splicing each to-be-processed information as the target to-be-processed information of the target network data packet, and adding each difference information to the corresponding to-be-processed information to distinguish each to-be-processed information.

[0047] Exemplarily, in the application of the game field, the player character status information network data packet and the player score information network data packet sent by the game server A to the player client 1 are spliced, and the intersection information "information identifying the game server A that generates the network packet, the address of the player client 1 to be sent, the network communication protocol adopted as the IP protocol, etc." is used as the parsing information of the target network data packet after splicing; each piece of information to be processed "the data value 'Alive' corresponding to the player character status information data" and "the data value '3500' corresponding to the player score information data" are spliced ​​as the target information to be processed, and the difference information "the data type is the player character status information, the data format is character type, etc." is added before the "data value 'Alive' corresponding to the player character status information data", and the difference information "the data type is the player character score information, the data format is integer type, etc." is added before the "data value '3500' corresponding to the player score information data" to obtain the target network data packet.

[0048] By splicing the intersection information, each difference set information and each to-be-processed information, the target network data packet is obtained, the number of network data packets sent during the data transmission process in network communication is reduced, and the intersection information is merged, which further reduces the total amount of data transmission and improves the data transmission efficiency.

[0049] Step 108: Send the target network data packet to the target terminal.

[0050] After obtaining the target network data packet, the target network data packet is sent to the target terminal to complete the data transmission process in this network communication. After receiving the target network data packet, the target terminal uses the intersection information in the target network data packet to parse the target network data packet, obtains each difference set information and each to-be-processed information, and obtains each initial network data packet generated by the server by splicing the intersection information, each difference set information and each to-be-processed information.

[0051] For example, in the application of the game field, after obtaining the target network data packet, the target network data packet is sent from the game server A to the player client 1; after receiving the target network data packet, the player client 1 uses the intersection information "information that identifies the game server A that generates the network packet, the address of the player client 1 to be sent, the network communication protocol used is the IP protocol, etc." to parse the target network data packet, and obtain the information to be processed "the data value 'Alive' corresponding to the player character status information data" and "the data value '3500' corresponding to the player score information data" and the difference information "the data type is the player character status information, the data format is character type, etc." and "the data type is the player character score information, the data format is integer type, etc."; by parsing the intersection information "the game server A that identifies the network packet, the address of the player client 1 to be sent, the network communication protocol used is the IP protocol, etc." The intersection information "information identifying the game server A that generated the network packet, the address of the player client 1 to be sent, the network communication protocol adopted is the IP protocol, etc.", the information to be processed "the data value 'Alive' corresponding to the player character status information data" and the difference information "the data type is the player character status information, the data format is character type, etc." are spliced ​​to obtain the initial network data packet "player character status information network data packet" sent by game server A to the player client 1; the intersection information "information identifying the game server A that generated the network packet, the address of the player client 1 to be sent, the network communication protocol adopted is the IP protocol, etc.", the information to be processed "the data value '3500' corresponding to the player score information data" and the difference information "the data type is the player character score information, the data format is integer, etc." are spliced ​​to obtain the initial network data packet "player score information network data packet" sent by game server A to the player client 1.

[0052] In the embodiments of the present specification, by comparing the parsed information of multiple initial network data packets, the common intersection information and the different difference information are extracted, and this information is spliced ​​with the information to be processed into a target network data packet, so that while the integrity of the data in each initial network data packet is ensured by utilizing the difference information, only one common intersection information is retained, and duplicate information in each initial parsed information is removed, thereby reducing data redundancy and reducing the amount of transmitted data; the sending of multiple initial network data packets is completed at one time, thereby improving data transmission efficiency, optimizing the processor performance consumption of the server, improving the smoothness and reliability of data transmission, and improving user experience.

[0053] Figure 2 A schematic diagram of a method for merging network data packets provided by an embodiment of the present specification is shown. Figure 2 As shown: Each initial network data packet before the merger consists of parsed information A and information to be processed C. The target network data packet after the merger is composed of intersection information A, each difference set information B and each information to be processed C, wherein each difference set information B is located before each information to be processed C and is used to distinguish each information to be processed C.

[0054] The size of the n initial network data packets before merging is n(A+C), and the size of the target network data packet after merging is A+n(B+C). Therefore, compared with the n initial network data packets before merging, the size saved by the merged target network data packet is n(A+C)-[A+n(B+C)]=(n-1)An*B.

[0055] In an optional embodiment of the present specification, sending a target network data packet to a target terminal includes: Determine whether the target network data packet meets the preset sending conditions; If yes, send the target network data packet to the target terminal; If not, wait and obtain other initial network data packets sent to the target terminal, return to execute the step of comparing the initial parsing information of each initial network data packet, determine the intersection information and difference information in each initial parsing information, and obtain the updated target network data packet. When the updated target network data packet meets the preset sending conditions, the updated target network data packet is sent to the target terminal.

[0056] When sending a target network data packet to a target terminal, the target network data packet can be detected to determine whether the target network data packet meets the preset sending conditions. The preset sending conditions can be set from multiple dimensions, such as the size of the target network data packet, the number of initial network data packets merged by the target network data packet, the time window that the target network data packet waits for, and other dimensions. The preset sending condition can be one condition or multiple conditions; each condition can be used individually or multiple conditions can be used simultaneously; the preset sending condition can be met when one of the conditions is met, or a predetermined number of conditions must be met to meet the preset sending condition.

[0057] After determining that the target network data packet meets the preset sending condition, the target network data packet is sent to the target terminal.

[0058] When it is determined that the target network data packet has not yet reached the preset sending conditions, it is necessary to wait for the target network data packet, that is, wait for other initial network data packets subsequently sent by the server to the target terminal, and after receiving other initial network data packets, return to perform comparison of the initial parsing information of each initial network data packet, determine the intersection information and the difference information, and perform the splicing operation again to obtain an updated target network data packet, and detect the updated target network data packet again to determine whether the preset sending conditions are met. If the preset sending conditions are met, the updated target network data packet is sent to the target terminal.

[0059] For example, in the application of the game field, the preset sending condition for the game server A to send to the player client 1 is "the number of initial network data packets merged is 3", then after the "player character status information network data packet" and the "player score information network data packet" are merged to obtain the target network data packet, it is determined that the number of initial network data packets merged by the target network data packet is 2, and the preset sending condition is not met, then the subsequent game server A continues to wait for the initial network data packet sent to the player client 1; when the initial network data packet "player location information network data packet" sent by the game server A to the player client 1 is obtained, the execution is returned to determine that the intersection information in the initial parsed information of each initial network data packet is "the game server A that identifies the generation of the network packet, the address of the player client 1 to be sent, and the network communication used The protocol is IP protocol, etc.", the difference set information is "the data type is player character status information, the data format is character type, etc.", "the data type is player corner score information, the data format is integer, etc." and "the data type is player position information, the data format is array type, etc.", and the to-be-processed information is "the data value 'Alive' corresponding to the player character status information data", "the data value '3500' corresponding to the player score information data" and "the data value '[112, 123]' corresponding to the player position information data"; the intersection information, the difference set information and the to-be-processed information are concatenated to obtain an updated target network data packet, and it is determined again that the number of initial network data packets merged by the updated target network data packet is 3, and the preset sending condition is met, and the updated target network data packet is sent to the player client 1.

[0060] In the embodiments of the present specification, a preset sending condition is set to determine whether to send the merged target network data packet. When the target network data packet does not meet the preset sending condition, the subsequent initial network data packets will be waited for and further merged until the preset condition is met and then sent. This optimizes the sending timing of the target network data packet. While ensuring that the target network data packet can be sent according to the preset sending condition, more initial network data packets can be merged, reducing the number of target network data packets that need to be sent for network communication, thereby reducing the resource consumption of the server-side processor, improving the efficiency of network packet merging, thereby reducing the cost of network data transmission and enhancing the user experience.

[0061] In an optional embodiment of the present specification, determining whether the target network data packet meets the preset sending condition includes: Determine whether the size of the target network data packet exceeds a preset buffer threshold, wherein the preset buffer threshold is set according to the buffer size of the server.

[0062] The preset sending condition can be set according to the size of the target network data packet. The preset buffer threshold is a threshold for judging whether the size of the target network data packet meets the preset sending condition. The preset buffer threshold can be set according to the buffer size of the server, or according to other conditions, such as the maximum network data packet size that the network communication bandwidth can allow for transmission, the maximum network data packet size that the target terminal can receive, etc., or a certain size value can be set manually to obtain certain specific technical effects, such as the highest economic benefit that can be obtained by a certain size value, etc. This specification does not make specific limitations on this.

[0063] After setting the preset buffer threshold, the preset buffer threshold is used to determine whether the size of the target network data packet meets the preset sending condition. Optionally, when the size of the target network data packet exceeds the preset buffer threshold, the target network data packet meets the preset sending condition.

[0064] For example, in the application of the game field, the maximum network data packet allowed by the buffer size of the game server A is 18 megabytes. For data security, the preset buffer threshold can be set to 16 megabytes. After merging the "player character status information network data packet" and the "player score information network data packet" to obtain the target network data packet, it is determined that the size of the network data packet is 12 megabytes, which does not exceed the preset buffer threshold of 16 megabytes, that is, the preset sending condition is not met, and then the initial network data packet sent by the subsequent game server A to the player client 1 is continued to be waited; when the initial network data packet "player position information network data packet" sent by the game server A to the player client 1 is obtained, the step of determining the intersection information, each difference set information and each to-be-processed information and splicing them to obtain the updated target network data packet is returned, and the specific steps are described in detail in the previous embodiment, and will not be repeated here; after obtaining the updated target network data packet, it is again determined that the size of the updated target network data packet is 16.7 megabytes, which exceeds the preset buffer threshold of 16 megabytes, that is, the preset sending condition is met, and the updated target network data packet is sent to the player client 1.

[0065] In the embodiments of the present specification, a preset buffer threshold is set to determine whether the size of the target network data packet reaches the preset sending condition, thereby deciding whether to send the merged target network data packet, effectively avoiding the risk of buffer overflow caused by excessively large network data packets, while also ensuring that the size of the network data packet is within a reasonable range, which not only fully utilizes the network bandwidth, but also prevents problems such as transmission delays and data loss caused by excessively large data packets. Through this technical solution, the sending timing of the target network data packet can be reasonably adjusted, thereby optimizing network communication efficiency, reducing the number of target network data packets to be sent, and thereby reducing the cost of network data transmission, and improving the stability of data transmission and user experience.

[0066] In an optional embodiment of the present specification, determining whether the target network data packet meets the preset sending condition includes: Determine whether the target time window where the target network data packet is located has ended.

[0067] The preset sending condition can be set according to the time window where the target network data packet is located. For example, it can be set that the preset sending condition is met when the time window where the target network data packet is located ends. A time window refers to a valid time interval within a certain period of time, during which a specific operation can be performed. In this embodiment, the time window can be used to control the length of time the server waits for the initial network data packet in the process of merging the initial network data packet to obtain the target network data packet. That is, when the server sends a network data packet to the target terminal, it collects the initial network data packets to be sent at the beginning of the target time window, and at the end of the target time window, sends the target network data packet generated in the current target time window by merging the initial network data packets.

[0068] Optionally, the time window may be determined according to a preset update frequency of the server. For example, when the update frequency of the server is 50 times within 1 second, the time window may be set to 20 milliseconds.

[0069] The preset update frequency of the server is the preset frequency of data update or data transmission of the current server. By setting the preset update frequency of the server, the relationship between the real-time data transmission and the consumption of server resources can be balanced, which not only avoids the situation that the initial network data packet is sent at any time point as soon as it is generated, which occupies too many server resources and causes the server performance to deteriorate, but also ensures that the network communication delay is too high due to the long waiting time for sending the initial network packet.

[0070] In actual applications, after obtaining the target network data packet, it is determined whether the target time window where the target network data packet is located has ended. If the preset sending condition is that the target time window where the target network data packet is located has ended, but the target time window has not ended at this time, the preset sending condition has not been met, and it is necessary to continue waiting for the subsequent initial network data packet in the target time window until the time window ends.

[0071] Exemplarily, in the application of the game field, the preset sending condition is set as the end of the target time window where the target network data packet is located. After the "player character status information network data packet" and the "player score information network data packet" are merged to obtain the target network data packet, it is determined that the target time window where the network data packet is located has not ended, that is, the preset sending condition has not been met, and then the initial network data packet sent by the subsequent game server A to the player client 1 is continued to be waited; when the initial network data packet "player position information network data packet" sent by the game server A to the player client 1 is obtained, the step of determining the intersection information, each difference set information and each to-be-processed information and splicing them to obtain the updated target network data packet is returned, and the specific steps are described in detail in the previous embodiment, and will not be repeated here; after obtaining the updated target network data packet, it is again determined that the target time window where the updated target network data packet is located has ended, that is, the preset sending condition is met, and the updated target network data packet is sent to the player client 1.

[0072] In the embodiments of the present specification, whether the preset sending conditions are met is determined by judging whether the target time window in which the target network data packet is located has ended, thereby determining the time point for sending the target network data packet, ensuring that the sending timing of the target network data packet is consistent with the update frequency of the server, avoiding the situation where the data packet is sent in advance when the target time window is not completed, reducing the number of network data packets sent in network transmission, reducing the cost of network data transmission, improving the efficiency and reliability of data transmission, and optimizing the utilization of network resources, ensuring the integrity and timeliness of data transmission.

[0073] In an optional embodiment of the present specification, before sending the target network data packet to the target terminal, the method further includes: Determine whether the size of the target network data packet exceeds a preset compression threshold; If yes, compress the target network data packet to obtain a compressed target network data packet.

[0074] After merging the initial network data packets to obtain the target network data packet, the target network data packet can be compressed to further improve data transmission efficiency and reduce data transmission traffic overhead. However, the compression of the target network data packet needs to consider the size of the target network data packet. When the size of the target network data packet is small, it contains less compressible information (such as repeated information). The amount of data such as decompression reference information added by the compression process may reach or even exceed the amount of data reduced by the compression process, resulting in low or even negative benefits from the compression process. Therefore, it is necessary to determine when the target network data packet needs to be compressed.

[0075] The preset compression threshold is a pre-set threshold used to determine whether the target network data packet needs to be compressed. The preset compression threshold can be set based on factors such as network conditions, network communication bandwidth limitations, or device processing capabilities. It can also be analyzed based on historical data and averaged to determine the target network data packet size at which compression processing will yield the highest benefit.

[0076] When the preset compression threshold is set, after obtaining the target network data packet, it is determined whether the size of the target network data packet exceeds the preset compression threshold. If so, the target network data packet is compressed to obtain a compressed target network data packet.

[0077] For example, in a gaming application, the size of a target network data packet to be sent by game server A to player client 1 is 20 megabytes, and the preset compression threshold is 18 megabytes. If it is determined that the size of the target network data packet exceeds the preset compression threshold, the target network data packet is compressed to obtain a compressed target network data packet.

[0078] In the embodiments of the present specification, a preset compression threshold is set to determine whether the target network data packet needs to be compressed, so that compression is performed when the data packet size exceeds the preset threshold, ensuring that the compression processing can bring about the actual benefit of reducing the amount of data transmitted, avoiding the problem of compressing smaller network data packets but increasing the amount of data transmitted.

[0079] Optionally, after determining whether the size of the target network data packet exceeds a preset compression threshold, the following steps may also be included: Add a compression mark bit to the intersection information of the target network data packet; If yes, compress the target network data packet to obtain a compressed target network data packet, and set the compression flag bit to a compressed flag; If not, the target network data packet is not compressed, and the compression flag is set to the uncompressed flag.

[0080] The compression flag is used to identify whether the target network data packet has been compressed. The compression flag is included in the intersection information of the target network data packet. After the target network data packet is sent to the target terminal, the target terminal reads the information of the compression flag to determine whether the target network data packet has been compressed, and thus chooses whether it needs to be decompressed before parsing.

[0081] For example, in the application of the game field, a compression mark is set in the intersection information of the target network data packet to be sent by the game server A to the player client 1, and the size of the target network data packet 20 megabytes exceeds the preset compression threshold of 18 megabytes, then the target network data packet is compressed to obtain a compressed target network data packet, and the compression mark is set to a compressed mark.

[0082] In the embodiments of the present specification, a preset compression threshold is set to determine whether a target network data packet needs to be compressed. At the same time, a compression mark bit is added to the intersection information of the target network data packet, so that the target terminal can determine whether the target network data packet has been compressed based on the mark bit, and select an appropriate decompression or direct parsing strategy accordingly, thereby improving the efficiency and reliability of data transmission.

[0083] In an optional embodiment of the present specification, the intersection information includes a scene identifier, where the scene identifier is a scene identifier corresponding to a target scene generated by each initial network data packet; Compress the target network data packets, including: Determining a target compression dictionary from at least one preset compression dictionary according to the scenario identifier; The target network data packets are compressed using the target compression dictionary.

[0084] Each initial network data packet may be a network data packet generated in a specific scenario and containing a specific data type or data pattern. These initial network data packets will include data corresponding to the generated scenario. Therefore, the intersection information of the target network data packet obtained by merging each initial network data packet will include a scenario identifier. The scenario identifier is a scenario identifier corresponding to the target scenario generated by each initial network data packet. For example, in a financial transaction system, different transaction scenarios will generate different network data packets. At this time, the scenario identifier may be a stock trading scenario, an option trading scenario, a foreign exchange exchange scenario, etc.; in the application of the game field, different game scenarios will generate different network data packets. At this time, the scenario identifier may be a game level scenario, a game mode scenario, a game event scenario, etc.

[0085] For compression of each initial network data packet generated in different scenarios, the scenario identifier can be used to determine the target compression dictionary from the preset compression dictionary. The compression dictionary is an auxiliary tool used in the data compression process, which is used to store data patterns or symbols that frequently appear in the compressed data. In general, each entry in the compression dictionary usually contains two parts: one is the data pattern itself, and the other is the corresponding code. The code is usually shorter than the original data pattern, thereby achieving data compression. The compression dictionary can be automatically set according to the commonly used data in the generation scenario of the network data packet to be compressed, or it can be manually set based on experience, and it can also be trained using the historically sent network data packets as a training data set. This manual does not make specific limitations on this.

[0086] Optionally, before compressing the target network data packet, the method further includes: Load all preset compression dictionaries on the server.

[0087] Because the size of the compression dictionary is generally very small and the resources it occupies are also very small, it will not place too much burden on the server processor. At the same time, it can also immediately determine the target compression dictionary after determining the scene identifier, avoiding the extra waiting time caused by reloading the corresponding target compression dictionary after determining the scene identifier, thereby improving data transmission efficiency.

[0088] According to the scene identifier in the network data packet generated in different scenes, the corresponding target compression dictionary can be determined from at least one preset compression dictionary. For example, in the application of the Internet of Things, the compression dictionary can be used to reduce the transmission volume of sensor data, and different types of sensors will generate different network data packets for transmission, such as temperature sensors, humidity sensors, light intensity sensors, etc. At this time, the target compression dictionary can be determined from the preset compression dictionary according to the scene identifier carried in the network data packet generated by different sensors.

[0089] Exemplarily, in the application of the game field, the initial network data packets sent by the game server A to the player client 1: "player character status information network data packet", "player score information network data packet" and "player position information network data packet" are all generated in the "player battle scene 1" scenario. The intersection information of the target network data packet obtained from these initial network data packets is "information such as the game server A that identifies the network packet generated, the address of the player client 1 to be sent, the network communication protocol used is the IP protocol, the player battle scene 1 scene identifier, etc." When compressing the target network data packet, according to the scene identifier of the "player battle scene 1" in the intersection information, the target compression dictionary "player battle scene 1 compression dictionary" is determined from at least one preset compression dictionary for compression processing.

[0090] In the embodiments of the present specification, by including a scene identifier in the intersection information of the target network data packet, and selecting a corresponding target compression dictionary from at least one preset compression dictionary for compression processing based on the scene identifier, efficient compression of data packets in specific scenarios is achieved, the compression rate is improved, the data transmission volume is reduced, and the transmission efficiency and compression effect are improved.

[0091] In an optional embodiment of the present specification, compressing a target network data packet using a target compression dictionary includes: Encode each piece of information to be processed in the target network data packet to obtain the encoded pieces of information to be processed and decoding reference information, wherein the decoding reference information is used to decode the encoded pieces of information to be processed; The decoding reference information is replaced based on the dictionary index information included in the target compression dictionary.

[0092] When compressing the target network data packet using the target compression dictionary, the information to be processed in the target network data packet is first encoded to obtain the encoded information to be processed and decoding reference information. The decoding reference information refers to the reference information required for decoding the compressed and encoded information to be processed after the network data packet is compressed and encoded, including encoding rules, algorithm identifiers, verification information decompression order, etc., to ensure that the data to be processed can be correctly restored during decompression.

[0093] After obtaining the decoding reference information, the patterns of the data contained therein are searched and replaced with the encoded content in the compression dictionary, so that the information to be processed of the compressed target network data packet only contains the encoded information to be processed and the dictionary index information. The dictionary index information is used to indicate the compression dictionary used in the compression process.

[0094] For example, in the application of the game field, the initial network data packets sent by the game server A to the player client 1 are "player character status information network data packets", "player score information network data packets" and "player position information network data packets", and the target network data packets to be processed obtained from these initial network data packets are "data value 'Alive' corresponding to the player character status information data", "data value '3500' corresponding to the player score information data" and "data value '[112, 123]' corresponding to the player position information data", and the target compression dictionary "player character status information data packets" is used to store the data of the player character status information data. For home battle scene 1, the "compression dictionary" is "'Player character status information' → '10001001'; 'Alive' → '10000001'; 'Player score information' → '10001010'; '3500' → '00100011'; 'Player position information' → '10001011'; '[112, 123]' → '01110000, 01111011'; ...", and the dictionary index information is "00100001", then the to-be-processed information of the compressed target network data packet is "00100001 10001001 10000001 10001010 00100011 10001011 01110000, 01111011".

[0095] In the embodiments of the present specification, the target compression dictionary is used to encode the information to be processed in the target network data packet, and decoding reference information is generated, and then the decoding reference information is replaced with the encoded content in the target compression dictionary, thereby significantly reducing the amount of data transmission, improving data compression efficiency and transmission speed, ensuring that the data can be correctly restored during decompression, and optimizing the performance of network communication and user experience.

[0096] In an optional embodiment of the present specification, before determining the target compression dictionary according to the scene identifier, the method further includes: Obtain historical network data packets generated in the target scenario; Based on historical network data packets, build a training dataset related to the target scenario; The target compression dictionary is trained using the training dataset.

[0097] The training of the compression dictionary can be carried out using the historical network data packets generated in the scenario corresponding to the compression dictionary as the training set. The historical network data packets refer to the network data packets that have been generated and sent before in the scenario. These network data packets contain data that have been transmitted in the past in the same or similar scenarios, and can be used to analyze and identify common data patterns, and then build a compression dictionary related to the scenario. Specifically, the higher the repetition rate and the stronger the correlation between the data set for training the compression dictionary and the data to be compressed by the compression dictionary, the higher the compression rate of the trained compression dictionary for the data to be compressed, and the better the compression effect.

[0098] After acquiring historical network data packets, a training data set can be constructed based on the historical network data packets. Optionally, the data can be preprocessed, such as data cleaning to remove invalid or abnormal data, data format unification, data integration processing, etc.

[0099] When training a target compression dictionary using a training data set, data patterns in the training data set can be identified, such as identifying repeated patterns or high-frequency symbols in the data through statistical analysis, machine learning or other algorithms. These patterns can be specific character strings, digital sequences, etc.; the identified patterns or symbols are then added to the target compression dictionary, and a unique code is assigned to each pattern or symbol. This code is usually shorter than the original pattern or symbol to achieve data compression.

[0100] Optionally, after obtaining the target compression dictionary, the target compression dictionary may be optimized, for example, by adjusting the encoding length, removing uncommon data patterns, etc., so that the target compression dictionary can efficiently perform data compression.

[0101] Optionally, after obtaining the target compression dictionary, the target compression dictionary can also be verified, that is, the trained target compression dictionary is used to perform compression and decompression tests on new data to verify the validity and compression effect of the target compression dictionary. If the compression effect is not good, the compression dictionary needs to be adjusted or retrained.

[0102] Optionally, after all preset compression dictionaries are trained, the following is also included: Copies the preset compression dictionary and sends it to the target terminal.

[0103] All preset compression dictionaries are also copied to the target terminal, which can avoid sending the target compression dictionary to the target terminal when the target network data packet is sent, reducing the data transmission volume during network communication, and all preset compression dictionaries can be loaded in time during decompression processing, further improving data transmission efficiency.

[0104] For example, in the application of the game field, the historical network data packets "historical player character status information network data packet", "historical player score information network data packet" and "historical player position information network data packet" generated and sent by the game server A in the target scene "player battle scene 1" are collected, wherein the corresponding historical information to be processed is "the data value 'Alive' corresponding to the player character status information data, the data value 'Dead' corresponding to the player character status information data...", "the data value '1500' corresponding to the player score information data, the data value '2800' corresponding to the player score information data..." and "the data value '[121, 210]' corresponding to the player position information data, the data value '[180, ***]' corresponding to the player position information data...", based on these historical network data packets, a training data set "player character status information: Alive, Dead...; player score information: 1500, 2800" related to the "player battle scene 1" can be constructed. ……; player position information: [121, 210], [180, ***]... ", preprocess the data set, remove the abnormal data "player position information: [180, ***]", and perform data pattern recognition to obtain the patterns of "player role status information, player score information, player position information, Alive, Dead, 1500, 2800, [121, 210]...", etc., and construct the corresponding target compression dictionary "player battle scene 1 compression dictionary" as "' "Player character status information' → '10001001'; 'Player score information' → '10001010'; 'Player position information' → '10001011'; 'Alive' → '10000001'; 'Dead' → '10000002'; '1500' → '00011100'; '2800' → '00001111'; '[121, 210]' → '01111001, 11010010'; ... ".

[0105] In the embodiments of the present specification, by analyzing historical network data packets in a specific scenario and constructing a target compression dictionary for the scenario, efficient data compression and transmission is achieved, the amount of data transmitted over the network is reduced, the data processing speed is increased, and the data processing delay is reduced. By pre-loading the compression dictionary to the client, the responsiveness and reliability of data transmission are further improved. At the same time, the compression dictionary is optimized and verified to ensure its lightness and efficiency.

[0106] See also Figure 3 , Figure 3 A flowchart of another data transmission method provided according to an embodiment of the present specification is shown. The data transmission method is applied to a target terminal and specifically includes the following steps.

[0107] Step 302: Receive a target network data packet sent by the server, wherein the target data network packet is obtained by concatenating intersection information, each difference set information and each to-be-processed information, and the intersection information and each difference set information are determined by comparing each initial parsed information of at least one initial network data packet, and any initial network data packet includes initial parsed information and to-be-processed information.

[0108] The target terminal refers to the hardware device that receives each initial network data packet, such as a server, a personal computer, a personal mobile device, a smart wearable device, or any hardware device that can receive a network data packet. The target terminal is responsible for processing the received network data packet and responding as needed. The target network data packet received by the target terminal is obtained by splicing the intersection information, each difference information, and each to-be-processed information of each initial network data packet.

[0109] Exemplarily, in the application of the game field, the player client 1 receives the target network data packet sent by the game server A. The target network data packet is the intersection information of the initial network data packets "player character status information network data packet, player score information network data packet", "information identifying the game server A generating the network packet, the address of the player client 1 to be sent, the network communication protocol adopted is the IP protocol, etc."; each difference set information is "the data type is the player character status information, the data format is character type, etc.; the data type is the player character score information, the data format is integer, etc."; each information to be processed is "the data value 'Alive' corresponding to the player character status information data, the data value '3500' corresponding to the player score information data".

[0110] By receiving the target network data packet, the target terminal can subsequently process the target network data packet and obtain information to be processed so as to make a corresponding response as needed.

[0111] Step 304: parse the target network data packet using the intersection information to obtain at least one difference information, and determine the information to be processed corresponding to each difference information.

[0112] The target network data packet can be parsed through the intersection information to obtain at least one difference information, and then the difference information can be distinguished to determine the corresponding information to be processed.

[0113] Exemplarily, in the application of the game field, after receiving the target network data packet sent by the game server A, the player client 1 uses the intersection information "information that identifies the game server A that generates the network packet, the address of the player client 1 to be sent, the network communication protocol used is the IP protocol, etc." to parse the target network data packet, and obtain the difference set information "the data type is the player character status information, the data format is character type, etc.; the data type is the player score information, the data format is integer, etc.", and then determines the corresponding information to be processed "the data value 'Alive' corresponding to the player character status information data, the data value '3500' corresponding to the player score information data, etc." according to the difference set information.

[0114] The target network data packet is parsed through the intersection information to obtain the difference information and the information to be processed, so that the subsequent target terminal can perform splicing processing to obtain the initial network data packet.

[0115] Step 306: Concatenate the intersection information, each difference information and each to-be-processed information to obtain at least one initial network data packet.

[0116] After obtaining the intersection information, each difference set information and each to-be-processed information, a splicing operation is performed on them to restore at least one initial network data packet to be sent by the server to the target terminal.

[0117] Exemplarily, in the application of the game field, the player client 1 splices the intersection information "information identifying the game server A that generates the network packet, the address of the player client 1 to be sent, the network communication protocol adopted is the IP protocol, etc.", each difference set information "information such as the data type is the player character status information, the data format is character type, etc.; the data type is the player character score information, the data format is integer type, etc." and each to-be-processed information "the data value 'Alive' corresponding to the player character status information data" to obtain the initial network data packet "player character status information network data packet" to be sent by the game server A: "information identifying the game server A that generates the network packet, the address of the player client 1 to be sent, the network communication protocol adopted is the IP protocol, the data type is the player character status information, the data format is character type, the data value 'Alive' corresponding to the player character status information data" and the "player score information network data packet": "information identifying the game server A that generates the network packet, the address of the player client 1 to be sent, the network communication protocol adopted is the IP protocol, the data type is the player character status information, the data format is character type, the data value 'Alive' corresponding to the player character status information data" The protocol, data type is player corner score information, data format is integer, etc., and the data value corresponding to the player score information data is '3500'".

[0118] In the embodiments of the present specification, by receiving and parsing the target network data packet sent by the server and containing intersection information, difference information and information to be processed, the intersection information is used to distinguish and extract the difference information and the corresponding information to be processed, and finally the initial network data packet is spliced ​​and restored, thereby achieving efficient data transmission and parsing, reducing data redundancy, accelerating data transmission efficiency, and ensuring data integrity and accuracy.

[0119] The above is an illustrative scheme of a data transmission method of this embodiment, which is applied to a target terminal. It should be noted that the technical scheme of the data transmission method and the technical scheme of the above data transmission method belong to the same concept, and the details not described in detail in the technical scheme of the data transmission method can be referred to the description of the technical scheme of the above data transmission method.

[0120] In an optional embodiment of the present specification, the target network data packet is parsed according to the intersection information to obtain at least one difference set information, and the to-be-processed information corresponding to each difference set information is determined, including: Determine whether the target network data packet has been compressed; If yes, decompress the target network data packet, and use the intersection information to parse the decompressed target network data packet to obtain at least one difference set information, and determine the information to be processed corresponding to each difference set information; If not, the target network data packet is parsed using the intersection information to obtain at least one difference set information, and the to-be-processed information corresponding to each difference set information is determined.

[0121] The step of determining whether the target network data packet has been compressed includes the following steps: Add a compression mark bit to the intersection information of the target network data packet; If the compression flag is a compressed flag, the target network data packet has been compressed; If the compression flag is an uncompressed flag, the target network data packet is not compressed.

[0122] For example, in a gaming application, the player client 1 receives a target network data packet sent by the game server A, and reads the compression flag set in the intersection information of the target network data packet as a compressed flag. This means that the target network data packet has been compressed, and the target network data packet needs to be decompressed before being parsed.

[0123] In the embodiments of the present specification, the compression status of the data packet is checked before the target terminal parses the received target network data packet, including reading the intersection information of the target network data packet and adding a compression mark bit to make a judgment, and deciding whether to perform a decompression operation based on the result, thereby ensuring that decompression is performed only when necessary, avoiding unnecessary computing overhead, and ensuring that the data can be parsed and used correctly, thereby improving the efficiency and reliability of data transmission.

[0124] The above is an illustrative scheme of a data transmission method of this embodiment, which is applied to a target terminal. It should be noted that the technical scheme of the data transmission method and the technical scheme of the above data transmission method belong to the same concept, and the details not described in detail in the technical scheme of the data transmission method can be referred to the description of the technical scheme of the above data transmission method.

[0125] In an optional embodiment of the present specification, the intersection information includes a scene identifier, where the scene identifier is a scene identifier corresponding to a target scene generated by each initial network data packet; Decompress the target network data packet, including: Determining a target compression dictionary from at least one preset compression dictionary according to the scenario identifier; Decompress the target network data packet using the target compression dictionary.

[0126] Optionally, after training each preset compression dictionary, a copy of the preset compression dictionary can be made to the target terminal. When the target terminal receives the target network data packet, all the preset compression dictionaries can be loaded in advance. Because the size of the compression dictionary is generally very small and the resources occupied are also very small, it will not cause excessive burden on the processor of the target terminal. At the same time, the target compression dictionary can be determined immediately after the scene identifier is determined, avoiding extra waiting time due to the need to reload the corresponding target compression dictionary after determining the scene identifier, thereby improving data transmission efficiency.

[0127] For example, in the application of the game field, the target network data packet sent by the game server A received by the player client 1 is "the game server A that identifies the network packet generated, the address of the player client 1 to be sent, the network communication protocol used is the IP protocol, the data type is the player character status information, the data format is character type, the data type is the player character score information, the data format is integer, 00100001 10001001 10000001 10001010 0010001110001011 01110000, 01111011... ", then the target network data packet needs to be decompressed, and according to the scene identifier "player battle scene 1 scene identifier" included in the intersection information of the target network data packet "information identifying the game server A generating the network packet, the address of the player client 1 to be sent, the network communication protocol adopted is the IP protocol, the player battle scene 1 scene identifier, etc.", the target compression dictionary "player battle scene 1 compression dictionary" is determined from the preset compression dictionary as "'player character status information'→'10001001'; 'Alive'→'10000001'; 'player score information'→'10001010'; '3500'→'00100011'; 'player position information'→ '10001011'; '[112, 123]'→'01110000, 01111011';... ", then use the "player battle scene 1 compression dictionary" to decompress the target network data packet, and the decompressed target network data packet is "the game server A that identifies the network packet generated, the address of the player client 1 to be sent, the network communication protocol used is the IP protocol, the data type is the player character status information, the data format is character type, the data type is the player character score information, the data format is integer, the data value 'Alive' corresponding to the player character status information data, the data value '3500' corresponding to the player score information data, and the data value '[112, 123]' corresponding to the player position information data".

[0128] In the embodiments of the present specification, by selecting a corresponding preset compression dictionary according to the scene identifier contained in the target network data packet, the data can be accurately restored during the decompression process. This method not only improves the decompression efficiency, but also ensures the accuracy of the data and the matching of scene relevance.

[0129] The above is an illustrative scheme of a data transmission method of this embodiment, which is applied to a target terminal. It should be noted that the technical scheme of the data transmission method and the technical scheme of the above data transmission method belong to the same concept, and the details not described in detail in the technical scheme of the data transmission method can be referred to the description of the technical scheme of the above data transmission method.

[0130] Figure 4FIG. 1 shows a flow chart of a data transmission method provided by an embodiment of the present specification. Figure 4 As shown: -When sending a target network data packet, the following steps are included: - Setting a preset buffer threshold to obtain at least one network data packet sent to the target terminal; -Determine whether there is an existing network data packet of the same target terminal within the current time window; --If not, cache the current network data packet until the end of this time window; --If yes, determine whether the current network packet size exceeds the preset buffer threshold; ---If not, merge the current network data packet with the existing network data packet; ---If so, send the existing network data packet directly; -Get the target network data packet to be sent; -Set dictionary flag and compression flag, and preset compression threshold; -Determine whether the target network data packet size exceeds the preset compression threshold; --If yes, compress the target network data packet using the dictionary, set the compression flag to True, and update the dictionary flag information; --If not, no compression is performed, the compression flag is set to False, and the dictionary flag is empty; -Send target network packets.

[0131] Through the process structure diagram, it can be clearly and intuitively concluded that the above data transmission method sets a preset buffer threshold and compression threshold, judges and merges the data packets in the current frame when sending network data packets, avoids frequent transmission of small data packets, and performs compression processing when the data packet size exceeds the preset compression threshold, thereby reducing the amount of data transmitted. This method effectively improves the efficiency and real-time performance of data transmission, reduces network bandwidth usage, and simplifies the data transmission process, and is particularly suitable for application scenarios that require efficient data synchronization.

[0132] The following combination Figure 5 , taking the application of the data transmission method provided in this specification in the field of games as an example, the data transmission method is further explained. Figure 5 A processing flow chart of a data transmission method provided by an embodiment of the present specification is shown. The data transmission method is applied to a server of a game application and specifically includes the following steps.

[0133] Step 502: obtaining at least one initial game network data packet sent by the game server to the player client, wherein any initial game network data packet includes initial parsing information and to-be-processed game information, and the initial parsing information is used to parse the initial game network data packet on the player client; Step 504: compare the initial parsing information of each initial game network data packet, determine the intersection information and difference information in each initial parsing information, the intersection information includes a game scene identifier, and the game scene identifier is a game scene identifier corresponding to the target game scene generated by each initial game network data packet; Step 506: splicing the intersection information, each difference set information and each to-be-processed game information to obtain a target game network data packet; Step 508: Determine whether the size of the target game network data packet exceeds a preset compression threshold; Step 510: If yes, determine a target compression dictionary from at least one preset compression dictionary according to the game scene identifier; encode each to-be-processed game information in the target game network data packet to obtain the encoded to-be-processed game information and decoding reference information, wherein the decoding reference information is used to decode the encoded to-be-processed game information; Step 512: replacing the decoding reference information based on the dictionary index information included in the target compression dictionary to obtain a compressed target game network data packet; Step 514: determining whether the size of the target game network data packet exceeds a preset buffer threshold and / or determining whether the target time window where the target game network data packet is located ends, wherein the preset buffer threshold is set according to the buffer size of the game server; Step 516: If yes, send the target game network data packet to the player client; Step 518: If not, wait and obtain other initial game network data packets sent to the player client, return to execute the step of comparing the initial parsing information of each initial game network data packet, determine the intersection information and difference information in each initial parsing information, obtain the updated target game network data packet, and when the updated target game network data packet meets the preset sending conditions, send the updated target game network data packet to the player client.

[0134] In the embodiments of the present specification, the intersection information and difference information in multiple initial game network data packets are compared and extracted to merge them into a target game network data packet, thereby changing from compressing multiple small network game data packets to compressing a single target game network data packet, reducing the number of compression times and optimizing the performance consumption of the server of the game application. At the same time, a scene-adapted compression dictionary is used for compression, which reduces the amount of transmitted data in network communication and improves the quality of network communication. The sending timing is determined according to the buffer size and time window status, ensuring the efficiency and real-time performance of data transmission, and is suitable for online game scenarios that require real-time synchronization of large amounts of data.

[0135] Corresponding to the above method embodiment, this specification also provides a data transmission device embodiment, Figure 6 FIG. 1 is a schematic diagram showing the structure of a data transmission device provided by an embodiment of the present specification. Figure 6 As shown, the device comprises: The acquisition module 602 is configured to acquire at least one initial network data packet sent to the target terminal, wherein any initial network data packet includes initial parsing information and information to be processed, and the initial parsing information is used to parse the initial network data packet on the target terminal; The comparison module 604 is configured to compare the initial parsing information of each initial network data packet and determine the intersection information and the difference information in each initial parsing information; The splicing module 606 is configured to splice the intersection information, each difference information and each to-be-processed information to obtain a target network data packet; The sending module 608 is configured to send the target network data packet to the target terminal.

[0136] Optionally, the sending module 608 is further configured to: determine whether the target network data packet meets a preset sending condition; If so, send the target network data packet to the target terminal; if not, wait for and obtain other initial network data packets sent to the target terminal, return to execute the step of comparing the initial parsing information of each initial network data packet, determine the intersection information and difference information in each initial parsing information, obtain the updated target network data packet, and when the updated target network data packet meets the preset sending conditions, send the updated target network data packet to the target terminal.

[0137] Optionally, the sending module 608 is further configured to: determine whether the size of the target network data packet exceeds a preset buffer threshold, wherein the preset buffer threshold is set according to the buffer size of the server.

[0138] Optionally, the sending module 608 is further configured to: determine whether the target time window where the target network data packet is located ends.

[0139] Optionally, the device further includes: a judgment module configured to judge whether the size of the target network data packet exceeds a preset compression threshold; if so, compress the target network data packet to obtain a compressed target network data packet.

[0140] Optionally, the intersection information includes a scene identifier, which is a scene identifier corresponding to a target scene generated by each initial network data packet; correspondingly, the judgment module is further configured to: determine a target compression dictionary from at least one preset compression dictionary based on the scene identifier; and compress the target network data packet using the target compression dictionary.

[0141] Optionally, the judgment module is further configured to: encode each piece of information to be processed in the target network data packet to obtain the encoded pieces of information to be processed and decoding reference information, wherein the decoding reference information is used to decode the encoded pieces of information to be processed; and replace the decoding reference information based on the dictionary index information included in the target compression dictionary.

[0142] Optionally, the judgment module is further configured to: obtain historical network data packets generated in the target scenario; construct a training data set related to the target scenario based on the historical network data packets; and train the target compression dictionary using the training data set.

[0143] The above is a schematic scheme of a data transmission device of this embodiment. It should be noted that the technical scheme of the data transmission device and the technical scheme of the above data transmission method belong to the same concept, and the details of the technical scheme of the data transmission device that are not described in detail can all be referred to the description of the technical scheme of the above data transmission method.

[0144] Corresponding to the above method embodiment, this specification also provides a data transmission device embodiment, Figure 7 FIG. 2 shows a schematic diagram of the structure of another data transmission device provided by an embodiment of the present specification. Figure 7 As shown, the device comprises: The receiving module 702 is configured to receive a target network data packet sent by the server, wherein the target data network packet is obtained by concatenating intersection information, each difference information and each to-be-processed information, and the intersection information and each difference information are determined by comparing each initial parsed information of at least one initial network data packet, and any initial network data packet includes initial parsed information and to-be-processed information; The parsing module 704 is configured to parse the target network data packet using the intersection information, obtain at least one difference set information, and determine the information to be processed corresponding to each difference set information; The splicing module 706 is configured to splice the intersection information, each difference information and each to-be-processed information to obtain at least one initial network data packet.

[0145] Optionally, the parsing module 704 is further configured to: determine whether the target network data packet has been compressed; if so, decompress the target network data packet, and use the intersection information to parse the decompressed target network data packet to obtain at least one difference set information, and determine the information to be processed corresponding to each difference set information; if not, use the intersection information to parse the target network data packet to obtain at least one difference set information, and determine the information to be processed corresponding to each difference set information.

[0146] Optionally, the intersection information includes a scene identifier, which is a scene identifier corresponding to a target scene generated by each initial network data packet; correspondingly, the parsing module 704 is further configured to: determine a target compression dictionary from at least one preset compression dictionary based on the scene identifier; and use the target compression dictionary to decompress the target network data packet.

[0147] The above is a schematic scheme of a data transmission device of this embodiment. It should be noted that the technical scheme of the data transmission device and the technical scheme of the above data transmission method belong to the same concept, and the details of the technical scheme of the data transmission device that are not described in detail can all be referred to the description of the technical scheme of the above data transmission method.

[0148] Figure 8 The structure block diagram of a computing device provided by an embodiment of the present specification is shown. The components of the computing device 800 include but are not limited to a memory 810 and a processor 820. The processor 820 is connected to the memory 810 via a bus 830, and the database 850 is used to store data.

[0149] The computing device 800 also includes an access device 840 that enables the computing device 800 to communicate via one or more networks 860. Examples of these networks include a Public Switched Telephone Network (PSTN), a Local Area Network (LAN), a Wide Area Network (WAN), a Personal Area Network (PAN), or a combination of communication networks such as the Internet. The access device 840 may include one or more of any type of network interface (e.g., a Network Interface Controller (NIC)) of wired or wireless type, such as an IEEE 802.11 Wireless Local Area Network (WLAN) wireless interface, a Worldwide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, and a Near Field Communication (NFC).

[0150] In one embodiment of the present specification, the above components of the computing device 800 and Figure 8 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Figure 8 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.

[0151] The computing device 800 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or a personal computer (PC). The computing device 800 may also be a mobile or stationary server.

[0152] The processor 820 is used to execute the following computer program / instruction, which implements the steps of the above-mentioned data transmission method when executed by the processor.

[0153] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the above data transmission method belong to the same concept, and the details not described in detail in the technical scheme of the computing device can be referred to the description of the technical scheme of the above data transmission method.

[0154] An embodiment of the present specification further provides a computer-readable storage medium storing a computer program / instruction, which implements the steps of the above-mentioned data transmission method when executed by a processor.

[0155] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the above-mentioned data transmission method belong to the same concept, and the details not described in detail in the technical scheme of the storage medium can be referred to the description of the technical scheme of the above-mentioned data transmission method.

[0156] An embodiment of the present specification also provides a computer program product, including a computer program / instruction, which implements the steps of the above data transmission method when executed by a processor.

[0157] The above is a schematic scheme of a computer program product of this embodiment. It should be noted that the technical scheme of the computer program product and the technical scheme of the above data transmission method belong to the same concept, and the details not described in detail in the technical scheme of the computer program product can be referred to the description of the technical scheme of the above data transmission method.

[0158] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0159] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the contents contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of patent practice. For example, in some regions, according to patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0160] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of this specification are not limited by the order of the actions described, because according to the embodiments of this specification, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the embodiments of this specification.

[0161] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0162] The preferred embodiments of this specification disclosed above are only used to help explain this specification. The optional embodiments do not describe all the details in detail, nor do they limit the invention to only the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the embodiments of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of this specification, so that technicians in the relevant technical field can well understand and use this specification. This specification is only limited by the claims and their full scope and equivalents.

Claims

1. A data transmission method, characterized in that: Applied to the server, including: Acquire at least one initial network data packet sent to a target terminal, wherein any initial network data packet includes initial parsing information and information to be processed, and the initial parsing information is used to parse the initial network data packet on the target terminal; Comparing the initial parsing information of each of the initial network data packets, and determining the intersection information and the difference information in each of the initial parsing information; splicing the intersection information, each of the difference set information and each of the to-be-processed information to obtain a target network data packet; The target network data packet is sent to the target terminal.

2. The method according to claim 1, characterized in that The sending the target network data packet to the target terminal includes: Determining whether the target network data packet meets the preset sending condition; If so, sending the target network data packet to the target terminal; If not, wait for and obtain other initial network data packets sent to the target terminal, return to execute the step of comparing the initial parsing information of each of the initial network data packets, determine the intersection information and difference information in each of the initial parsing information, obtain the updated target network data packet, and when the updated target network data packet meets the preset sending condition, send the updated target network data packet to the target terminal.

3. The method according to claim 2, characterized in that The determining whether the target network data packet meets the preset sending condition includes: Determine whether the size of the target network data packet exceeds a preset buffer threshold, wherein the preset buffer threshold is set according to the buffer size of the server.

4. The method according to claim 2, characterized in that: The determining whether the target network data packet meets the preset sending condition includes: Determine whether the target time window where the target network data packet is located has ended.

5. The method according to any one of claims 1 to 4, characterized in that: Before sending the target network data packet to the target terminal, the method further includes: Determining whether the size of the target network data packet exceeds a preset compression threshold; If yes, compress the target network data packet to obtain the compressed target network data packet.

6. The method according to claim 5, characterized in that The intersection information includes a scene identifier, where the scene identifier is a scene identifier corresponding to a target scene generated by each initial network data packet; The compressing the target network data packet includes: Determining a target compression dictionary from at least one preset compression dictionary according to the scenario identifier; The target network data packet is compressed using the target compression dictionary.

7. The method according to claim 6, characterized in that The compressing the target network data packet by using the target compression dictionary includes: Encoding each of the to-be-processed information in the target network data packet to obtain the encoded each of the to-be-processed information and decoding reference information, wherein the decoding reference information is used to decode the encoded each of the to-be-processed information; The decoding reference information is replaced based on dictionary index information included in the target compression dictionary.

8. The method according to claim 5, characterized in that Before determining the target compression dictionary according to the scene identifier, the method further includes: Obtaining historical network data packets generated in the target scenario; Based on the historical network data packets, construct a training data set related to the target scenario; The target compression dictionary is trained using the training data set.

9. A data transmission method, characterized in that: Applied to target terminals, including: Receive a target network data packet sent by the server, wherein the target data network packet is obtained by concatenating intersection information, each difference information and each to-be-processed information, the intersection information and each difference information are determined by comparing each initial parsed information of at least one initial network data packet, and any initial network data packet includes initial parsed information and to-be-processed information; Utilizing the intersection information, parsing the target network data packet to obtain at least one difference set information, and determining the information to be processed corresponding to each difference set information; The intersection information, each of the difference set information and each of the to-be-processed information are concatenated to obtain the at least one initial network data packet.

10. The method according to claim 9, characterized in that The step of parsing the target network data packet according to the intersection information to obtain at least one difference set information, and determining the information to be processed corresponding to each difference set information, includes: Determining whether the target network data packet has been compressed; If yes, decompress the target network data packet, and use the intersection information to parse the decompressed target network data packet to obtain at least one difference set information, and determine the information to be processed corresponding to each difference set information; If not, the target network data packet is parsed using the intersection information to obtain at least one difference information, and the to-be-processed information corresponding to each difference information is determined.

11. The method according to claim 10, characterized in that The intersection information includes a scene identifier, where the scene identifier is a scene identifier corresponding to a target scene generated by each initial network data packet; The decompressing the target network data packet includes: Determining a target compression dictionary from at least one preset compression dictionary according to the scenario identifier; The target network data packet is decompressed using the target compression dictionary.

12. A computing device, characterized in that: include: Memory and processor; The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions. When the computer programs / instructions are executed by the processor, the steps of the method described in any one of claims 1 to 11 are implemented.

13. A computer-readable storage medium, characterized in that: It stores a computer program / instruction, which implements the steps of the method described in any one of claims 1 to 11 when executed by a processor.

14. A computer program product, characterized in that The invention comprises a computer program / instruction, which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 11.