Network communication data transmission method and device and computer equipment
By using flat buffer FlatBuffers and cross-language protocol Protobuf to optimize the data transmission process, the inefficient data transmission problem caused by the HTTP protocol is solved, and efficient data transmission between time-series database components is achieved.
Patent Information
- Application Number
- CN202311740826.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-18
- Publication Date
- 2025-07-11
AI Technical Summary
In the existing network communication data transmission scheme, the text nature of the HTTP protocol leads to slow data encoding and decoding processes, affecting the data transmission efficiency between time-series database components.
The flat buffer FlatBuffers is used to serialize the structure into a byte stream, and the byte stream is filled into the field Bytes through the cross-language protocol Protobuf, and the high-performance remote procedure call protocol gRPC server is used for deserialization.
It improves the data transmission efficiency between timing database components, reduces memory allocation and data copying overhead, reduces bandwidth consumption and storage resource usage, and realizes low-latency data processing and high-performance transmission.
Smart Images

Figure CN120301924A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of network communication technologies, and particularly to a network communication data transmission method, apparatus, and computer device. Background Art
[0002] In existing network communication data transmission solutions, generally the HTTP (Hypertext Transfer Protocol) protocol solution is used. The HTTP protocol is an application layer protocol and is the basis of modern Web communication. Since the HTTP protocol is text-based, the encoding and decoding processes of network communication data are relatively slow, resulting in general data transmission efficiency between time series database components. Summary of the Invention
[0003] In view of this, an object of the present invention is to provide a network communication data transmission method, apparatus, and computer device, which can improve the data transmission efficiency between time series database components.
[0004] According to one aspect of the present invention, a network communication data transmission method is provided, including: serializing a structure into a byte stream using FlatBuffers; filling the byte stream into a field Bytes through the cross-language protocol Protobuf; when the gRPC server of the high-performance remote procedure call protocol receives the field filled with the byte stream, deserializing the field filled with the byte stream using FlatBuffers.
[0005] Among them, the step of serializing a structure into a byte stream using FlatBuffers includes: defining a data structure using the interface description language of FlatBuffers to generate a corresponding code file, where the data structure includes tables, fields, and types, filling the structure data into the flat buffer, and serializing the structure into a byte stream in a manner that maintains the continuity and compactness of the structure data.
[0006] Among them, the step of filling the byte stream into a field through the cross-language protocol Protobuf includes: writing a message description file using the message definition language of Protobuf, where the language-written message description file includes the structure and fields of the language-written message, compiling the language-written message description file into a corresponding code file, where the code file includes a codec and an accessor, and filling the byte stream into the field by converting the byte stream into a binary format and encoding it according to the message structure and fields defined in the written message description file.
[0007] Among them, when the high-performance remote procedure call protocol gRPC server receives the fields after filling the byte stream, using FlatBuffers to deserialize the fields after filling the byte stream includes: when the high-performance remote procedure call protocol gRPC server receives the fields after filling the byte stream, using FlatBuffers to decode the fields after filling the byte stream into structured data based on the structure and codec of the message description file, and deserialize the fields after filling the byte stream.
[0008] Among them, after using FlatBuffers to deserialize the fields after filling the byte stream when the high-performance remote procedure call protocol gRPC server receives the fields after filling the byte stream, it further includes: directly accessing any segment of the fields in the field structure deserialized by FlatBuffers at the service layer.
[0009] According to another aspect of the present invention, a network communication data transmission device is provided, including: a serialization module, a filling module, and a deserialization module; the serialization module is used to serialize a structure into a byte stream using FlatBuffers; the filling module is used to fill the byte stream into the field Bytes through the cross-language protocol Protobuf; the deserialization module is used to use FlatBuffers to deserialize the fields after filling the byte stream when the high-performance remote procedure call protocol gRPC server receives the fields after filling the byte stream.
[0010] Among them, the serialization module is specifically used for: using the interface description language of FlatBuffers to define a data structure to generate a corresponding code file, where the data structure includes tables, fields, and types, filling the structure data into the flat buffer, and serializing the structure into a byte stream in a way that maintains the continuity and compactness of the structure data.
[0011] Among them, the filling module is specifically used for: writing a message description file through the cross-language protocol Protobuf using the message definition language, where the language writing the message description file includes the structure and fields of the written message, and compiling the language writing the message description file into a corresponding code file, where the code file includes a codec and an accessor, and filling the byte stream into the field by converting the byte stream into a binary format and encoding it according to the message structure and fields defined in the written message description file.
[0012] Among them, the deserialization module may specifically be used for: when the high-performance Remote Procedure Call Protocol (gRPC) server receives the fields after filling the byte stream, using FlatBuffers to deserialize the fields after filling the byte stream based on the structure and codec of the message description file, and decoding the fields after filling the byte stream into structured data.
[0013] Among them, the network communication data transmission device further includes an access module, and the access module is used to directly access any segment of the field structure after deserialization processing by FlatBuffers in the service layer.
[0014] According to another aspect of the present invention, there is provided a computer device, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the network communication data transmission method as described in any one of the above.
[0015] According to still another aspect of the present invention, there is provided a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, it implements the network communication data transmission method as described in any one of the above.
[0016] It can be found that the above solution can use FlatBuffers to serialize the structure into a byte stream, and can fill the byte stream into the field Bytes through the cross-language protocol Protobuf, and can use FlatBuffers to deserialize the fields after filling the byte stream when the high-performance Remote Procedure Call Protocol (gRPC) server receives the fields after filling the byte stream, which can improve the data transmission efficiency between the time series database components.
[0017] Furthermore, in the above solution, the interface description language of FlatBuffers can be used to define the data structure to generate the corresponding code file, where the data structure includes tables, fields, types, etc., and the structure data is filled into the flat buffer area, and the structure data is serialized into a byte stream in a way that maintains the continuity and compactness of the structure data. The advantage of this is that it can reduce the overhead of memory allocation and data copying during the process of serializing the structure into a byte stream by FlatBuffers, and can achieve low-latency data processing and high-performance transmission to meet the high-efficiency processing requirements of the time series database for performance.
[0018] Further, in the above solution, a message description file can be written in a message definition language through the cross - language protocol Protobuf. The message description file written in this language includes the structure and fields of the message written in the language, etc. Then, the message description file written in this language is compiled into a corresponding code file, where the code file includes a codec, an accessor, etc. And in the way of converting the byte stream into a binary format and encoding it according to the message structure and fields defined in the written message description file, filling the byte stream into the fields. The advantage of this is that it can reduce the serialization overhead when transmitting data between time - series database components, and can reduce the bandwidth consumption and storage resource occupation during data transmission.
[0019] Further, in the above solution, when the high - performance remote procedure call protocol gRPC server receives the fields filled with the byte stream, the FlatBuffers can be used to deserialize the fields filled with the byte stream based on the structure and codec of the message description file, in the way of decoding the fields filled with the byte stream into structured data. The advantage of this is that when deserializing, it can directly access the data by accessing the offset and structure information of the flat buffer, without having to parse the entire buffer, and can improve the data transmission efficiency between time - series database components.
[0020] Further, in the above solution, any segment of the fields in the field structure deserialized by the FlatBuffers can be directly accessed at the business layer. The advantage of this is that it can avoid deserializing the entire object by the FlatBuffers. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0022] Figure 1 is a schematic flowchart of an embodiment of the network communication data transmission method of the present invention;
[0023] Figure 2 is a schematic flowchart of another embodiment of the network communication data transmission method of the present invention;
[0024] Figure 3 is a schematic structural diagram of an embodiment of the network communication data transmission device of the present invention;
[0025] Figure 4It is a schematic structural diagram of another embodiment of the network communication data transmission device of the present invention;
[0026] Figure 5 It is a schematic structural diagram of an embodiment of the computer device of the present invention. Detailed implementation manners
[0027] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be specifically noted that the following embodiments are only used to illustrate the present invention, but do not limit the scope of the present invention. Similarly, the following embodiments are only partial embodiments of the present invention rather than all embodiments. All other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the scope of protection of the present invention.
[0028] The present invention provides a network communication data transmission method, which can improve the data transmission efficiency between time series database components.
[0029] Please refer to Figure 1 , Figure 1 It is a schematic flowchart of an embodiment of the network communication data transmission method of the present invention. It should be noted that if there are substantially the same results, the method of the present invention is not limited to Figure 1 the process sequence shown. As Figure 1 shown, the method includes the following steps:
[0030] S101: Serialize the structure into a byte stream using FlatBuffers.
[0031] Among them, using FlatBuffers to serialize the structure into a byte stream may include:
[0032] Define the data structure using the interface description language of FlatBuffers to generate the corresponding code file, where the data structure includes tables, fields, types, etc. Fill the structure data into the FlatBuffer, and serialize the structure into a byte stream in a way that maintains the continuity and compactness of the structure data. The advantage of this is that it can reduce the overhead of memory allocation and data copying during the process of serializing the structure into a byte stream by FlatBuffers, and can achieve low-latency data processing and high-performance transmission to meet the high-efficiency processing requirements of the time series database for performance.
[0033] In this embodiment, FlatBuffers is an efficient in-memory serialization library, and its design goal is to provide high-performance and low-memory-occupying data serialization and cross-platform transmission solutions, etc., which are not limited in the present invention.
[0034] In this embodiment, the technical principle of FlatBuffers is based on the flat buffer method, which serializes data into a continuous binary buffer without reconstructing or copying the object graph. This enables FlatBuffers to reduce the overhead of memory allocation and data copying during serialization and deserialization, improving performance, etc., which is not limited in this invention.
[0035] In this embodiment, FlatBuffers first needs to use an interface description language to define the data structure. By defining tables, fields, and types, etc., a corresponding code file is generated. During serialization, the structured data is filled into the flat buffer to maintain data continuity and compactness. During deserialization, by accessing the offsets and structure information of the flat buffer, the data can be directly accessed without parsing the entire buffer. Through the efficient serialization and memory layout of FlatBuffers, the time series database component can utilize the advantages of these two technologies to achieve low-latency data processing and high-performance transmission to meet the high-efficiency processing requirements of the time series database for performance, etc., which is not limited in this invention.
[0036] S102: Fill the byte stream into the field (Bytes) through the cross-language protocol (Protobuf).
[0037] Among them, filling the byte stream into the field through the cross-language protocol Protobuf may include:
[0038] Writing a message description file through the cross-language protocol Protobuf using a message definition language. The language writing the message description file includes the structure and fields of the message written in the language, and compiling the language-written message description file into a corresponding code file. Among them, the code file includes a codec and an accessor, etc., and converting the byte stream into a binary format and encoding it according to the message structure and fields defined in the written message description file to fill the byte stream into the field. The advantage of this is that it can reduce the serialization overhead when transmitting data between time series database components and can reduce the bandwidth consumption and storage resource occupancy during data transmission.
[0039] In this embodiment, the cross-language protocol Protobuf is a lightweight data serialization framework. It uses a structured message definition language to describe the data structure by specifying fields and data types in the message definition, etc., which is not limited in this invention.
[0040] In this embodiment, the cross - language protocol Protobuf realizes efficient data serialization and cross - platform transmission by converting structured data into binary format. The technical principle of the cross - language protocol Protobuf is based on the way of generating code. First, use the message definition language of the cross - language protocol Protobuf to write a message description file, which defines the structure and fields of the message. Then, use the cross - language protocol Protobuf compiler to compile the message description file into corresponding code files, including codec and accessor, etc. When serializing, the structured data can be converted into binary format and encoded according to the structure defined in the message description file. When deserializing, the binary data can be decoded into structured data according to the structure and codec of the message description file, etc., which is not limited in this invention.
[0041] S103: When the high - performance remote procedure call protocol gRPC server receives the field filled with the byte stream, use FlatBuffers to deserialize the field filled with the byte stream.
[0042] Among them, when the high - performance remote procedure call protocol gRPC server receives the field filled with the byte stream, using FlatBuffers to deserialize the field filled with the byte stream may include:
[0043] When the high - performance remote procedure call protocol gRPC server receives the field filled with the byte stream, use FlatBuffers to deserialize the field filled with the byte stream in a way that decodes the field filled with the byte stream into structured data based on the structure and codec of the message description file. The advantage of this is that it can directly access the data by accessing the offset and structure information of the flat buffer during deserialization without parsing the entire buffer, which can improve the data transmission efficiency between time - series database components.
[0044] Among them, after the high - performance remote procedure call protocol gRPC server uses FlatBuffers to deserialize the field filled with the byte stream when it receives the field filled with the byte stream, it may further include:
[0045] Directly access any segment of the field structure in the field structure deserialized by FlatBuffers at the business layer. The advantage of this is that it can avoid deserializing the entire object by FlatBuffers.
[0046] It can be found that in this embodiment, the FlatBuffers can be used to serialize the structure into a byte stream, and the byte stream can be filled into the field Bytes through the cross-language protocol Protobuf. When the field filled with the byte stream is received by the high-performance remote procedure call protocol gRPC server, the FlatBuffers can be used to deserialize the field filled with the byte stream, which can improve the data transmission efficiency between the time series database components.
[0047] Furthermore, in this embodiment, the interface description language of FlatBuffers can be used to define the data structure to generate the corresponding code file, where the data structure includes tables, fields, types, etc. The structure data is filled into the flat buffer, and the structure data is serialized into a byte stream in a way that maintains the continuity and compactness of the structure data. The advantage of this is that it can reduce the overhead of memory allocation and data copying during the process of serializing the structure into a byte stream by FlatBuffers, and can achieve low-latency data processing and high-performance transmission to meet the high-efficiency processing requirements of the time series database for performance.
[0048] Furthermore, in this embodiment, the message definition language can be used to write the message description file through the cross-language protocol Protobuf, where the language writing the message description file includes the structure and fields of the message written in the language, and the language writing the message description file is compiled into the corresponding code file, where the code file includes codec and accessor, etc. The byte stream is filled into the field in a way that the byte stream is converted into a binary format and encoded according to the message structure and fields defined in the written message description file. The advantage of this is that it can reduce the serialization overhead when transmitting data between the time series database components, and can reduce the bandwidth consumption and storage resource occupation during the data transmission process.
[0049] Furthermore, in this embodiment, when the field filled with the byte stream is received by the high-performance remote procedure call protocol gRPC server, the FlatBuffers can be used to deserialize the field filled with the byte stream based on the structure and codec of the message description file, in a way that the field filled with the byte stream is decoded into structured data. The advantage of this is that it can directly access the data by accessing the offset and structure information of the flat buffer during deserialization without parsing the entire buffer, and can improve the data transmission efficiency between the time series database components.
[0050] Please refer to Figure 2 , Figure 2It is a schematic flowchart of another embodiment of the network communication data transmission method of the present invention. In this embodiment, the method includes the following steps:
[0051] S201: Serialize the structure into a byte stream using FlatBuffers.
[0052] As described in S101 above, details are not repeated here.
[0053] S202: Fill the byte stream into the field Bytes through the cross - language protocol Protobuf.
[0054] As described in S102 above, details are not repeated here.
[0055] S203: When the high - performance remote procedure call protocol gRPC server receives the field filled with the byte stream, deserialize the field filled with the byte stream using FlatBuffers.
[0056] As described in S103 above, details are not repeated here.
[0057] S204: Directly access any segment of the field structure in the field deserialized by FlatBuffers at the service layer.
[0058] It can be found that in this embodiment, any segment of the field structure deserialized by FlatBuffers can be directly accessed at the service layer. The advantage is that it can avoid deserializing the entire object by FlatBuffers.
[0059] The present invention also provides a network communication data transmission device, which can improve the data transmission efficiency between time - series database components.
[0060] Please refer to Figure 3 , Figure 3 It is a schematic structural diagram of an embodiment of the network communication data transmission device of the present invention. In this embodiment, the network communication data transmission device 30 includes a serialization module 31, a filling module 32, and a deserialization module 33.
[0061] The serialization module 31 is used to serialize the structure into a byte stream using FlatBuffers.
[0062] The filling module 32 is used to fill the byte stream into the field Bytes through the cross - language protocol Protobuf.
[0063] The deserialization module 33 is used to deserialize the fields filled with the byte stream by using FlatBuffers when the high-performance Remote Procedure Call Protocol (gRPC) server receives the fields filled with the byte stream.
[0064] Optionally, the serialization module 31 can be specifically used for:
[0065] Using the Interface Description Language (IDL) of FlatBuffers to define a data structure to generate a corresponding code file, where the data structure includes tables, fields, types, etc., filling the structure data into the flat buffer, and serializing the structure data into a byte stream in a way that maintains the continuity and compactness of the structure data.
[0066] Optionally, the filling module 32 can be specifically used for:
[0067] Writing a message description file through the cross-language protocol Protobuf using the message definition language, where the message description file written in this language includes the structure and fields of the message written in the language, and compiling the message description file written in this language into a corresponding code file, where the code file includes a codec and an accessor, etc., and filling the byte stream into the field in a way that converts the byte stream into a binary format and encodes it according to the message structure and fields defined in the message description file written in this language.
[0068] Optionally, the deserialization module 33 can be specifically used for:
[0069] When the high-performance Remote Procedure Call Protocol (gRPC) server receives the fields filled with the byte stream, using FlatBuffers to deserialize the fields filled with the byte stream into structured data based on the structure and codec of the message description file.
[0070] Please refer to Figure 4 , Figure 4 FIG. is a schematic structural diagram of another embodiment of the network communication data transmission device of the present invention. Different from the previous embodiment, the network communication data transmission device 40 in this embodiment further includes an access module 41.
[0071] The access module 41 is used to directly access any segment of the fields in the field structure deserialized by FlatBuffers at the service layer.
[0072] Each unit module of the network communication data transmission device 30 / 40 can respectively execute the corresponding steps in the above method embodiments, so the unit modules will not be described in detail here. For details, please refer to the description of the corresponding steps above.
[0073] The present invention further provides a computer device, as Figure 5 shown, comprising: at least one processor 51; and a memory 52 communicatively connected to the at least one processor 51; wherein, the memory 52 stores instructions executable by the at least one processor 51, and the instructions are executed by the at least one processor 51 to enable the at least one processor 51 to execute the above network communication data transmission method.
[0074] Wherein, the memory 52 and the processor 51 are connected by a bus, and the bus may include any number of interconnected buses and bridges, and the bus connects various circuits of one or more processors 51 and the memory 52 together. The bus may also connect various other circuits together, such as peripheral devices, voltage regulators, and power management circuits, etc., which are well known in the art, and thus, will not be further described herein. The bus interface provides an interface between the bus and the transceiver. The transceiver may be one element or multiple elements, such as multiple receivers and transmitters, and provides a unit for communicating with various other devices over the transmission medium. The data processed by the processor 51 is transmitted over the wireless medium through the antenna. Further, the antenna also receives data and transmits the data to the processor 51.
[0075] The processor 51 is responsible for managing the bus and general processing, and may also provide various functions, including timing, peripheral interface, voltage regulation, power management, and other control functions. And the memory 52 may be used to store data used by the processor 51 when executing operations.
[0076] The present invention further provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the above method embodiments are implemented.
[0077] It can be found that in the above solution, the FlatBuffers can be used to serialize the structure into a byte stream, and the byte stream can be filled into the field Bytes through the cross-language protocol Protobuf, and when the field filled with the byte stream is received by the high-performance remote procedure call protocol gRPC server, the FlatBuffers can be used to deserialize the field filled with the byte stream, which can improve the data transmission efficiency between the time series database components.
[0078] Furthermore, for the above solution, the interface description language of FlatBuffers can be used to define the data structure to generate the corresponding code file. The data structure includes tables, fields, types, etc. The structure data is filled into the flat buffer to keep the continuity and compactness of the structure data, and the structure is serialized into a byte stream. The advantage of this is that it can reduce the overhead of memory allocation and data copying during the process of serializing the structure into a byte stream by FlatBuffers, and can achieve low-latency data processing and high-performance transmission to meet the high-efficiency processing requirements of the time series database for performance.
[0079] Furthermore, for the above solution, a message description file can be written in the message definition language through the cross-language protocol Protobuf. The language for writing the message description file includes the structure and fields of the message written in the language, and the message description file written in the language is compiled into the corresponding code file. The code file includes codec and accessor, etc. The byte stream is filled into the fields in the way of converting the byte stream into a binary format and encoding it according to the message structure and fields defined in the written message description file. The advantage of this is that it can reduce the serialization overhead when transferring data between time series database components, and can reduce the bandwidth consumption and storage resource occupation during the data transmission process.
[0080] Furthermore, for the above solution, when the high-performance remote procedure call protocol gRPC server receives the fields filled with the byte stream, FlatBuffers can be used to deserialize the fields filled with the byte stream based on the structure and codec of the message description file into structured data. The advantage of this is that it can directly access the data by accessing the offset and structure information of the flat buffer during deserialization without parsing the entire buffer, and can improve the data transmission efficiency between time series database components.
[0081] Furthermore, for the above solution, any segment of the field structure after deserialization by FlatBuffers can be directly accessed at the business layer. The advantage of this is that it can avoid deserializing the entire object by FlatBuffers.
[0082] In several embodiments provided by the present invention, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of modules or units is only a logical function division. In actual implementation, there can be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections between each other can be through some interfaces, and the indirect couplings or communication connections of devices or units can be in electrical, mechanical, or other forms.
[0083] The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they can be located in one place, or they can be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0084] In addition, in each embodiment of the present invention, each functional unit can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
[0085] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the methods in each embodiment of the present invention. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs that can store program codes.
[0086] The above are only partial embodiments of the present invention, and thus do not limit the protection scope of the present invention. Any equivalent device or equivalent process transformation made by using the specification and drawings of the present invention, or directly or indirectly applied in other related technical fields, shall be equally included in the patent protection scope of the present invention.
Claims
1. A network communication data transmission method, characterized in that, Including: Using the FlatBuffers flat buffer to serialize the structure into a byte stream; Filling the byte stream into the field Bytes through the cross-language protocol Protobuf; When the high-performance remote procedure call protocol gRPC server receives the field filled with the byte stream, using the FlatBuffers flat buffer to deserialize the field filled with the byte stream.
2. The network communication data transmission method according to claim 1, wherein, The step of using the FlatBuffers flat buffer to serialize the structure into a byte stream includes: Using the interface description language of the FlatBuffers flat buffer to define the data structure to generate the corresponding code file, where the data structure includes tables, fields, and types, filling the structure data into the flat buffer, and serializing the structure into a byte stream in a way that maintains the continuity and compactness of the structure data.
3. The network communication data transmission method according to claim 1, characterized in that The step of filling the byte stream into the field through the cross-language protocol Protobuf includes: Writing a message description file through the message definition language of the cross-language protocol Protobuf, where the language-written message description file includes the structure and fields of the language-written message, and compiling the language-written message description file into the corresponding code file, where the code file includes a codec and an accessor, and filling the byte stream into the field by converting the byte stream into a binary format and encoding it according to the message structure and fields defined in the written message description file.
4. The network communication data transmission method according to claim 1, characterized in that The step of, when the high-performance remote procedure call protocol gRPC server receives the field filled with the byte stream, using the FlatBuffers flat buffer to deserialize the field filled with the byte stream includes: When the high-performance remote procedure call protocol gRPC server receives the field filled with the byte stream, using the FlatBuffers flat buffer to deserialize the field filled with the byte stream by decoding the field filled with the byte stream into structured data based on the structure and codec of the message description file.
5. The network communication data transmission method according to claim 1, characterized in that After, when the high-performance remote procedure call protocol gRPC server receives the field filled with the byte stream, using the FlatBuffers flat buffer to deserialize the field filled with the byte stream, it further includes: Directly accessing any segment of the field structure in the field that has been deserialized by the FlatBuffers flat buffer at the business layer.
6. A network communication data transmission device, characterized in that, Including: A serialization module, a filling module, and a deserialization module; The serialization module is used to serialize the structure into a byte stream using the FlatBuffers flat buffer; The filling module is used to fill the byte stream into the field Bytes through the cross-language protocol Protobuf; The deserialization module is used to deserialize the fields after filling the byte stream by using FlatBuffers when the high-performance Remote Procedure Call Protocol (gRPC) server receives the fields after filling the byte stream.
7. The network communication data transmission device according to claim 6, characterized in that, The serialization module is specifically configured to: Use the Interface Description Language (IDL) of FlatBuffers to define a data structure and generate a corresponding code file, where the data structure includes tables, fields, and types, fill the structure data into the flat buffer, and serialize the structure into a byte stream in a way that maintains the continuity and compactness of the structure data.
8. The network communication data transmission device according to claim 6, wherein The filling module is specifically configured to: Write a message description file through the cross-language protocol Protobuf, where the language for writing the message description file includes the structure and fields of the message written in the language, compile the language-written message description file into a corresponding code file, where the code file includes a codec and an accessor, and fill the byte stream into the fields in a way that converts the byte stream into a binary format and encodes it according to the message structure and fields defined in the written message description file.
9. A computer device, characterized in that, It includes: At least one processor; And a memory communicatively connected to the at least one processor; wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the network communication data transmission method according to any one of claims 1 to 5.
10. A computer-readable storage medium, characterized in that, A computer program is stored, and when the computer program is executed by a processor, it implements the network communication data transmission method according to any one of claims 1 to 5.