Data constitution method and device

A construction method and data technology, applied in the field of network communication, can solve the problems of high technical requirements of Protobuf users, poor data accuracy, slowness, etc., and achieve the effect of improving reusability and accuracy, reducing technical requirements, and simplifying the process.

Active Publication Date: 2014-08-06
TENCENT TECH (SHENZHEN) CO LTD +1
View PDF4 Cites 30 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0005] First of all, with the continuous expansion and improvement of the business, the definition file of Protobuf is usually rewritten one at a time, and the complexity of the structure and the nesting level are also increasing, which makes the entire data construction process very cumbersome And slow, the construction cost of Protobuf data is relatively high, and the data accuracy is poor;
[0006] Then, the one-time constructed data cannot be reused in the subse

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Data constitution method and device
  • Data constitution method and device
  • Data constitution method and device

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0061] see figure 1 , the embodiment of the present invention provides a data construction method, the method includes:

[0062] 101. Compile the Proto file uploaded by the user to obtain the specified message structure corresponding to the specified message name preset by the user; the Proto file is a definition file of ProtoBuf data;

[0063] 102. Generate a web page corresponding to the specified message structure, and fill the data of the specified message into the web page to generate web page data;

[0064] 103. Convert Web page data into Json format data;

[0065] 104. Create a specified message object according to the data in Json format;

[0066] 105. Serialize the specified message object to obtain a ProtoBuf data file of the specified message.

[0067] Specifically, after obtaining the ProtoBuf data file of the specified message, it also includes:

[0068] Compile the Proto file to obtain the message structure of ProtoBuf data, and obtain the corresponding speci...

Embodiment 2

[0081] see figure 2 , the embodiment of the present invention provides a data construction method, the method includes:

[0082] 201. Obtain the Proto file uploaded by the user and the specified message name and data of the specified message preset by the user;

[0083] Specifically, the Proto file is the definition file of ProtoBuf data; the user also needs to reserve the specified message name and the data of the specified message for subsequent use.

[0084] 202. Compile the Proto file uploaded by the user to obtain the specified message structure corresponding to the specified message name preset by the user;

[0085] Specifically, the Proto file uploaded by the user is compiled to obtain the message structure of the ProtoBuf data; the specified message structure corresponding to the specified message name preset by the user is searched in the message structure of the ProtoBuf data.

[0086] Among them, the compilation of Proto files is realized by the Proto file compil...

Embodiment 3

[0127] see Figure 7 , an embodiment of the present invention provides a data construction device, the device includes:

[0128] The first compiling module 701 is used for compiling the Proto file uploaded by the user to obtain the specified message structure corresponding to the specified message name preset by the user; the Proto file is a definition file of ProtoBuf data;

[0129] The first Web generation module 702 is used to generate a Web page corresponding to the specified message structure, and fill the data of the specified message into the Web page to generate Web page data;

[0130] The first Json conversion module 703 is used to convert Web page data into Json format data;

[0131] The first object generation module 704 is used to create a specified message object according to the Json format data;

[0132] The ProtoBuf data generating module 705 is configured to serialize the specified message object to obtain the ProtoBuf data file of the specified message.

...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention discloses a data constitution method and device and belongs to the field of network communication. The method comprises the following steps: compiling Proto files uploaded by a user to obtain assigned message structures corresponding to assigned message names preset by users; generating Web pages corresponding to the assigned message structures, and filling the data of assigned messages to the Web pages to generate Web page data; converting the Web page data into Json format data; creating assigned message objects according to the Json format data; serializing the assigned message objects and obtaining ProtoBuf data files of the assigned messages. According to the data constitution method and device, the problems that the ProtoBtuf data is higher in constitution cost and poor in data accuracy, the reusability of the ProtoBtuf data is low, and the requirement for the user is high are solved; the process of data construction is simplified, the requirement of the user is lowered, and the efficiency of the data construction and the reusability and the accuracy of the data are improved.

Description

technical field [0001] The invention relates to the field of network communication, in particular to a data construction method and device. Background technique [0002] Protobuf (Protocol Buffers) is a data description language developed by Google, which can serialize structured data and can be used in data storage, communication protocols, etc. Protobuf is widely used due to its excellent performance and good scalability . However, data construction in Protobuf format is a complex process. [0003] At present, the Protobuf data construction method is generally to first obtain the Protobuf definition file proto file, and then use the Protoc compiler provided by Google to compile the proto file and generate a language-specific data access class file (.Java or .cc or .py) , and then include the data access class file in the program, and use the code interface in the data access class file to construct and analyze Protobuf data. [0004] In the process of realizing the pres...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
IPC IPC(8): G06F17/30G06F9/44
CPCG06F8/41G06F9/448G06F16/986
Inventor 孔令挥
Owner TENCENT TECH (SHENZHEN) CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products