A method, system and terminal for restoring Protobuf format data

By obtaining and analyzing Protobuf format data information and restoring requirements information, the problem of data restoration in the absence of definition files is solved, and the accurate restoration of data and accurate analysis of meaning is achieved.

CN119783632BActive Publication Date: 2025-06-24SHANGHAI YVIEW TECHNOLOGY CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510274399.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-03-10
Publication Date
2025-06-24
Estimated Expiration
2045-03-10

AI Technical Summary

Technical Problem

In the absence of Protobuf definition files, it is difficult to restore Protobuf data.

Method used

By obtaining Protobuf format data information and restore demand information, retrieving data byte information and data source information, determining the source reference byte information, determining the data meaning information based on the data byte information, and outputting restore data information based on the restore demand information.

Benefits of technology

It realizes that the Protobuf data is conveniently restored in the absence of Protobuf definition files, improving the accuracy of data meaning information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119783632B_ABST
    Figure CN119783632B_ABST
Patent Text Reader

Abstract

The present invention relates to a method, system and terminal for restoring Protobuf format data, belonging to the technical field of data processing. The method includes: obtaining Protobuf format data information and restoration requirement information; retrieving data byte information and data source information based on the Protobuf format data information; determining the source reference byte information corresponding to the data source information according to the corresponding relationship between the data source information and the preset source reference byte information; determining data meaning information based on the source reference byte information and the data byte information; determining restored data information according to the restoration requirement information and the data meaning information, and outputting the restored data information. The present invention has the effect of facilitating the restoration of Protobuf data lacking a Protobuf definition file.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data processing, and in particular, to a method, system and terminal for restoring Protobuf format data. Background Art

[0002] Data processing refers to the process of performing a series of operations on raw data to extract useful information, support decision-making, or meet specific requirements. It includes the entire life cycle from data collection, storage, cleaning, transformation, analysis to visualization.

[0003] Protobuf is often used in network communication as a data exchange format for configuration files and for transferring structured data between different systems. In order to convert binary Protobuf data back into structured data that is human-readable or processable by a program, it is necessary to restore the Protobuf data. Currently, when restoring Protobuf data in network traffic, generally, the Protobuf definition file (i.e., the.proto file) is obtained, then the Protobuf definition file is compiled to generate code, and then the serialized Protobuf binary data is read, so that the binary data can be deserialized into an object using the generated code to complete the restoration.

[0004] When the Protobuf definition file is lacking in the Protobuf data, it is inconvenient to restore the Protobuf data at this time. Summary of the Invention

[0005] In order to facilitate the restoration of Protobuf data lacking the Protobuf definition file, the present invention provides a method, system and terminal for restoring Protobuf format data.

[0006] In a first aspect, the present invention provides a method for restoring Protobuf format data, adopting the following technical solution:

[0007] A method for restoring Protobuf format data includes:

[0008] Obtaining Protobuf format data information and restoration requirement information;

[0009] Based on the Protobuf format data information, retrieving data byte information and data source information;

[0010] According to the correspondence between the data source information and the preset source reference byte information, determining the source reference byte information corresponding to the data source information;

[0011] Determining data meaning information according to the source reference byte information and the data byte information;

[0012] Determine the restored data information according to the restoration requirement information and the data meaning information, and output the restored data information.

[0013] Optionally, the method for determining the data meaning information includes:

[0014] Judge whether the source reference byte information and the data byte information are consistent;

[0015] If so, use the data byte information that is consistent with the source reference byte information as the consistent byte information, and use the data byte information other than the consistent byte information as the remaining byte information;

[0016] According to the corresponding relationship between the consistent byte information and the preset consistent byte meaning information, determine the consistent byte meaning information corresponding to the consistent byte information;

[0017] According to the corresponding relationship between the remaining byte information and the preset remaining byte meaning information, determine the remaining byte meaning information corresponding to the remaining byte information;

[0018] Combine the consistent byte meaning information and the remaining byte meaning information to form comprehensive byte meaning information, and use the comprehensive byte meaning information as the data meaning information;

[0019] If not, select similar byte information based on the source reference byte information and the data byte information;

[0020] Determine the similar meaning information according to the similar byte information and the data byte information, and use the similar meaning information as the data meaning information.

[0021] Optionally, the method for selecting the similar byte information includes:

[0022] Retrieve the reference single-byte information and the reference byte count value based on the source reference byte information;

[0023] Select the data byte information that is consistent with the reference single-byte information and use it as the byte consistency information;

[0024] Retrieve the single-byte position point and the single-byte information based on the byte consistency information;

[0025] Combine the single-byte information based on the adjacent single-byte position points to form adjacent combined byte information;

[0026] Retrieve the combined byte count value based on the adjacent combined byte information;

[0027] According to the corresponding relationship between the reference byte count value and the preset byte selection count value, determine the byte selection count value corresponding to the reference byte count value;

[0028] Based on the comparison result of the combined byte count value and the byte selection count value, adjacent combined byte information is selected as adjacent selected byte information, and the adjacent selected byte information is used as similar byte information.

[0029] Optionally, the method for determining adjacent selected byte information includes:

[0030] Judge whether the combined byte count value is greater than the byte selection count value;

[0031] If so, the adjacent combined byte information corresponding to the combined byte count value greater than the byte selection count value is used as the adjacent selected byte information;

[0032] If not, calculate the difference between the combined byte count value and the byte selection count value as the count deviation value;

[0033] According to the corresponding relationship between the count deviation value and the preset position deviation reference distance value, determine the position deviation reference distance value corresponding to the count deviation value;

[0034] Based on the adjacent combined byte information, retrieve the edge position points of the combined byte;

[0035] Calculate the distance value between adjacent combined byte edge position points as the edge position distance value;

[0036] According to the comparison result between the position deviation reference distance value and the edge position distance value, select adjacent combined byte information as the edge selected byte information, and use the edge selected byte information as the adjacent selected byte information.

[0037] Optionally, the method for selecting edge selected byte information includes:

[0038] Judge whether the edge position distance value is less than the position deviation reference distance value;

[0039] If so, the adjacent combined byte information corresponding to the edge position distance value less than the position deviation reference distance value is used as the edge combined byte information;

[0040] Analyze the coincidence situation between the edge combined byte information and the source reference byte information as the edge combined coincidence rate;

[0041] Based on the comparison result between the edge combined coincidence rate and the preset edge combined reference coincidence rate, select the edge combined byte information as the edge selected byte information;

[0042] If not, analyze the deviation situation between the adjacent combined byte information and the source reference byte information as the adjacent combined deviation value;

[0043] Based on the comparison result between the adjacent combination deviation value and the preset deviation reference value, select the adjacent combination byte information and use it as the edge selection byte information.

[0044] Optionally, the method for determining similar meaning information includes:

[0045] According to the corresponding relationship between the similar byte information and the preset similar byte meaning information, determine the similar byte meaning information corresponding to the similar byte information;

[0046] Use the data byte information other than the similar byte information as the difference byte information;

[0047] According to the corresponding relationship between the difference byte information and the preset difference byte meaning information, determine the difference byte meaning information corresponding to the difference byte information;

[0048] According to the corresponding relationship between the similar byte meaning information and the preset relevant meaning vocabulary information, determine the relevant meaning vocabulary information corresponding to the similar byte meaning information;

[0049] Judge whether the difference byte meaning information contains the relevant meaning vocabulary information;

[0050] If so, combine the similar byte meaning information and the difference byte meaning information and use it as the similar meaning information;

[0051] If not, according to the corresponding relationship between the data byte information and the preset data byte comprehensive meaning information, determine the data byte comprehensive meaning information corresponding to the data byte information, and use the data byte comprehensive meaning information as the similar meaning information.

[0052] Optionally, the method for determining the restored data information includes:

[0053] Retrieve the requirement type information based on the restoration requirement information;

[0054] According to the corresponding relationship between the requirement type information and the preset requirement type vocabulary information, determine the requirement type vocabulary information corresponding to the requirement type information;

[0055] Judge whether the data meaning information contains the similar byte meaning information;

[0056] If so, determine the restored similar data information according to the consistency between the relevant meaning vocabulary information and the requirement type vocabulary information, and use the restored similar data information as the restored data information;

[0057] If not, combine based on the requirement type vocabulary information to form the requirement comprehensive meaning information;

[0058] According to the corresponding relationship between the comprehensive meaning information of the requirement and the preset source information of the requirement meaning, determine the source information of the requirement meaning corresponding to the comprehensive meaning information of the requirement;

[0059] Use the source information of the requirement meaning as the source information of the data and re-analyze the data meaning information to obtain it.

[0060] Optionally, the method for determining the restored similar data information includes:

[0061] According to the corresponding relationship between the requirement type information and the preset type data requirement type information, determine the type data requirement type information corresponding to the requirement type information;

[0062] Judge whether the relevant meaning vocabulary information is consistent with the requirement type vocabulary information;

[0063] If it is, then based on the type data requirement type information, adjust the type of the similar byte meaning information to obtain the similar byte requirement data information;

[0064] Based on the type data requirement type information, adjust the type of the different byte meaning information to obtain the different byte requirement data information, and combine the similar byte requirement data information and the different byte requirement data information as the restored similar data information;

[0065] If it is not, then based on the requirement type vocabulary information, select the similar byte meaning information and the different byte meaning information as the requirement type selected meaning information, and use the similar meaning information other than the requirement type selected meaning information as the requirement type remaining meaning information;

[0066] Based on the type data requirement type information, adjust the type of the requirement type selected meaning information to obtain the selected meaning requirement data information;

[0067] Based on the type data requirement type information, adjust the type of the requirement type remaining meaning information to obtain the remaining meaning requirement data information, and combine the selected meaning requirement data information and the remaining meaning requirement data information as the restored similar data information.

[0068] In a second aspect, the present invention provides a system for restoring Protobuf format data, adopting the following technical solution:

[0069] A system for restoring Protobuf format data includes:

[0070] An acquisition module, configured to acquire Protobuf format data information and restoration requirement information;

[0071] A memory, configured to store the program of the method for restoring Protobuf format data as described in any item of the first aspect;

[0072] The processor loads and executes the program in the memory.

[0073] In a third aspect, the present invention provides an intelligent terminal, adopting the following technical solution:

[0074] An intelligent terminal includes a memory and a processor. A computer program capable of being loaded and executed by the processor for the method of restoring Protobuf format data as described in any one of the first aspects is stored on the memory.

[0075] In summary, the present invention includes at least one of the following beneficial technical effects:

[0076] 1. By obtaining the Protobuf format data information and the restoration requirement information, and retrieving the data byte information and the data source information, querying and determining the source reference byte information through the data source information, determining the data meaning information through the source reference byte information and the data byte information, and determining and outputting the restored data information through the restoration requirement information and the data meaning information, it is convenient to restore Protobuf data lacking a Protobuf definition file.

[0077] 2. By judging whether there is a consistency between the source reference byte information and the data byte information, and when there is a consistency, defining the consistent byte information and the remaining byte information, respectively querying and determining the consistent byte meaning information and the remaining byte meaning information, and then combining them to form the comprehensive byte meaning information as the data meaning information, selecting the similar byte information through the source reference byte information and the data byte information, and determining the similar meaning information as the data meaning information through the similar byte information and the data byte information, thereby improving the accuracy of the obtained data meaning information.

[0078] 3. By retrieving the reference single byte information and the reference byte count value through the source reference byte information, and defining the byte consistency information to retrieve the single byte position point and the single byte information, thereby combining to obtain the adjacent combined byte information and retrieving the combined byte count value, querying and determining the byte selection count value through the reference byte count value, analyzing the comparison result between the combined byte count value and the byte selection count value, thereby selecting the adjacent combined byte information as the adjacent selected byte information, and using the adjacent selected byte information as the similar byte information, thereby improving the accuracy of the obtained similar byte information. BRIEF DESCRIPTION OF THE DRAWINGS

[0079] Figure 1 is the flowchart of the method for restoring Protobuf format data in an embodiment of the present application;

[0080] Figure 2 is the flowchart of the method for determining data meaning information in an embodiment of the present application;

[0081] Figure 3 is a flowchart of a method for selecting similar byte information in an embodiment of the present application;

[0082] Figure 4 is a flowchart of a method for determining adjacent selected byte information in an embodiment of the present application;

[0083] Figure 5 is a flowchart of a method for selecting edge selected byte information in an embodiment of the present application;

[0084] Figure 6 is a flowchart of a method for determining similar meaning information in an embodiment of the present application;

[0085] Figure 7 is a flowchart of a method for determining restored data information in an embodiment of the present application. Detailed implementation manners

[0086] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments.

[0087] A method for restoring Protobuf format data, which obtains Protobuf format data information and restoration requirement information, and determines and combines the byte meanings in the Protobuf format data according to the data source or restoration requirement, so as to obtain the final restored data information, thereby facilitating the restoration of Protobuf data lacking a Protobuf definition file.

[0088] Refer to Figure 1 , an embodiment of the present invention discloses a method for restoring Protobuf format data, which includes:

[0089] Step S100: Obtain Protobuf format data information and restoration requirement information.

[0090] Among them, the Protobuf format data information refers to information such as the specific bytes and source situation of the data in the Protobuf format, and the restoration requirement information refers to the requirement information corresponding to the restoration of the Protobuf format data. Both the Protobuf format data information and the restoration requirement information are obtained through pre-input.

[0091] Step S101: Retrieve data byte information and data source information based on the Protobuf format data information.

[0092] Among them, the Protobuf format data information includes data byte information and data source information. The data byte information refers to the byte information corresponding to the data in Protobuf format, and the data source information refers to the source situation information corresponding to the data in Protobuf format. Retrieving the data byte information and the data source information through the Protobuf format data information facilitates subsequent use.

[0093] Step S102: Determine the source reference byte information corresponding to the data source information according to the correspondence between the data source information and the preset source reference byte information.

[0094] Among them, the source reference byte information refers to the reference byte information used to indicate the data meaning in the data source. Different data source information corresponds to different source reference byte information. The source reference byte information is obtained by querying from a database storing different data source information and the corresponding source reference byte information, and this database is obtained through input. Querying and determining the source reference byte information through the data source information facilitates subsequent use.

[0095] Step S103: Determine the data meaning information according to the source reference byte information and the data byte information.

[0096] Among them, the data meaning information refers to the meaning information corresponding to each byte in the Protobuf format data. By analyzing the source reference byte information and the data byte information, the data meaning information is determined to facilitate subsequent use. The specific determination steps of the data meaning information refer to Step S200 to Step S206.

[0097] Step S104: Determine the restored data information according to the restoration requirement information and the data meaning information, and output the restored data information.

[0098] Among them, the restored data information refers to the data information after restoring the Protobuf format data according to the restoration requirements. By analyzing the restoration requirement information and the data meaning information, the restored data information is determined and the restored data information is output, so as to facilitate the restoration of Protobuf data lacking the Protobuf definition file. The specific determination steps of the restored data information refer to Step S700 to Step S706.

[0099] In Figure 1 In the shown Step S103, in order to further ensure the rationality of the data meaning information, it is necessary to perform a further separate analysis and calculation on the data meaning information. Specifically, it is described in detail through Figure 2 the steps shown.

[0100] Refer to Figure 2, the method for determining data meaning information includes the following steps:

[0101] Step S200: Determine whether the source reference byte information and the data byte information are consistent. If yes, execute Step S201; if no, execute Step S205.

[0102] Among them, by determining whether the source reference byte information and the data byte information are consistent, it is thereby determined whether the meaning bytes corresponding to the source in the data bytes are consistent.

[0103] Step S201: Use the data byte information that is consistent with the source reference byte information as the consistent byte information, and use the data byte information other than the consistent byte information as the remaining byte information.

[0104] Among them, the consistent byte information refers to the byte information corresponding to when it is consistent with the source reference byte, and the remaining byte information refers to the byte information corresponding to except for the byte consistency. When the source reference byte information and the data byte information are consistent, it indicates that the meaning bytes corresponding to the source in the data bytes are consistent at this time. Therefore, the consistent byte information and the remaining byte information are defined for convenient subsequent use.

[0105] Step S202: According to the corresponding relationship between the consistent byte information and the preset consistent byte meaning information, determine the consistent byte meaning information corresponding to the consistent byte information.

[0106] Among them, the consistent byte meaning information refers to the meaning information corresponding to the byte that is consistent with the source reference byte. Different consistent byte information corresponds to different consistent byte meaning information. The consistent byte meaning information is obtained by querying from a database that stores different consistent byte information and the corresponding consistent byte meaning information, and this database is obtained through pre-input. Determining the consistent byte meaning information by querying the consistent byte information is convenient for subsequent use.

[0107] Step S203: According to the corresponding relationship between the remaining byte information and the preset remaining byte meaning information, determine the remaining byte meaning information corresponding to the remaining byte information.

[0108] Among them, the remaining byte meaning information refers to the meaning information corresponding to the byte that is inconsistent with the source reference byte. Different remaining byte information corresponds to different remaining byte meaning information, which is obtained by querying from a database. This database is obtained through pre-input. Determining the remaining byte meaning information by querying the remaining byte information is convenient for subsequent use.

[0109] Step S204: Combine the consistent byte meaning information and the remaining byte meaning information to form comprehensive byte meaning information, and use the comprehensive byte meaning information as the data meaning information.

[0110] Among them, the comprehensive byte meaning information refers to the comprehensive meaning information corresponding to all bytes. By combining the consistent byte meaning information and the remaining byte meaning information to form the comprehensive byte meaning information, and using the comprehensive byte meaning information as the data meaning information, the accuracy of the obtained data meaning information can be improved.

[0111] Step S205: Select similar byte information based on the source reference byte information and the data byte information.

[0112] Among them, the similar byte information refers to the byte information corresponding to the case where bytes are similar. When there is no consistency between the source reference byte information and the data byte information, it indicates that there is no consistency between the bytes of the data and the meaning bytes corresponding to the source at this time. Therefore, by analyzing the source reference byte information and the data byte information, the similar byte information is selected for subsequent use. The specific selection steps of the similar byte information refer to Step S300 to Step S306.

[0113] Step S206: Determine the similar meaning information based on the similar byte information and the data byte information, and use the similar meaning information as the data meaning information.

[0114] Among them, the similar meaning information refers to the meaning information corresponding to the existence of similar bytes. By analyzing the similar byte information and the data byte information, the similar meaning information is determined, and the similar meaning information is used as the data meaning information to improve the accuracy of the obtained data meaning information. The specific determination steps of the similar meaning information refer to Step S600 to Step S606.

[0115] In Figure 2 In the shown Step S205, in order to further ensure the rationality of the similar byte information, further separate analysis and calculation of the similar byte information are required. Specifically, it is described in detail through the steps shown in Figure 3 shown steps.

[0116] Referring to Figure 3 , the selection method of the similar byte information includes the following steps:

[0117] Step S300: Retrieve the reference single-byte information and the reference byte count value based on the source reference byte information.

[0118] Among them, the source reference byte information includes the reference single-byte information and the reference byte count value. The reference single-byte information refers to the single reference byte information in the data source, and the reference byte count value refers to the count value of the reference bytes in the data source. By retrieving the reference single-byte information and the reference byte count value through the source reference byte information, it is convenient for subsequent use.

[0119] Step S301: Select the byte information in the data byte information that is the same as the reference single-byte information and use it as the byte-identical information.

[0120] Among them, the byte-identical information refers to the byte information that is the same as the reference single byte. By selecting the byte information in the data byte information that is the same as the reference single byte and using it as the byte-identical information, it is convenient for subsequent use.

[0121] Step S302: Retrieve the single-byte position point and the single-byte information based on the byte-identical information.

[0122] Among them, the byte-identical information includes the single-byte position point and the single-byte information. The single-byte position point refers to the position point corresponding to the single byte, and the single-byte information refers to the byte information corresponding to the single byte. Retrieving the single-byte position point and the single-byte information through the byte-identical information is convenient for subsequent use.

[0123] Step S303: Combine the single-byte information based on adjacent single-byte position points to form adjacent combined byte information.

[0124] Among them, the adjacent combined byte information refers to the byte information after combining adjacent single bytes. By combining the single-byte information corresponding to adjacent single-byte position points to form adjacent combined byte information, it is convenient for subsequent use.

[0125] Step S304: Retrieve the combined byte count value based on the adjacent combined byte information.

[0126] Among them, the combined byte count value refers to the byte count value corresponding to the combined byte. Count the single bytes in the adjacent combined byte information and retrieve the count result as the combined byte count value, which is convenient for subsequent use.

[0127] Step S305: Determine the byte selection count value corresponding to the reference byte count value according to the corresponding relationship between the reference byte count value and the preset byte selection count value.

[0128] Among them, the byte selection count value refers to the reference count value required when selecting a combined byte similar to the reference byte. Different reference byte count values correspond to different byte selection count values, and the byte selection count value is obtained by querying a database storing the reference byte count value and the corresponding byte selection count value. Querying and determining the byte selection count value through the reference byte count value is convenient for subsequent use.

[0129] Step S306: Select the adjacent combined byte information and use it as the adjacent selected byte information according to the comparison result between the combined byte count value and the byte selection count value, and use the adjacent selected byte information as the similar byte information.

[0130] Among them, the adjacent selected byte information refers to the combined byte information selected based on the adjacency of bytes. By analyzing the comparison result between the value of the number of combined bytes and the value of the number of byte selections, the adjacent combined byte information is selected and used as the adjacent selected byte information, and the adjacent selected byte information is used as the similar byte information to improve the accuracy of the obtained similar byte information. The specific selection steps of the adjacent selected byte information refer to Step S400 to Step S406.

[0131] In Figure 3 In the shown Step S306, in order to further ensure the rationality of the adjacent selected byte information, it is necessary to perform further separate analysis and calculation on the adjacent selected byte information, which is specifically described in detail through Figure 4 the steps shown.

[0132] Referring to Figure 4 , the method for determining the adjacent selected byte information includes the following steps:

[0133] Step S400: Determine whether the value of the number of combined bytes is greater than the value of the number of byte selections. If it is, execute Step S401; if not, execute Step S402.

[0134] Among them, by determining whether the value of the number of combined bytes is greater than the value of the number of byte selections, it is determined whether the combined bytes can be directly selected.

[0135] Step S401: Use the adjacent combined byte information corresponding to the value of the number of combined bytes greater than the value of the number of byte selections as the adjacent selected byte information.

[0136] Among them, when the value of the number of combined bytes is greater than the value of the number of byte selections, it means that the combined bytes can be directly selected at this time. Therefore, the adjacent combined byte information corresponding to the value of the number of combined bytes greater than the value of the number of byte selections is used as the adjacent selected byte information.

[0137] Step S402: Calculate the difference between the value of the number of combined bytes and the value of the number of byte selections and use it as the number deviation value.

[0138] Among them, the number deviation value refers to the deviation value when there is a deviation in the number. When the value of the number of combined bytes is not greater than the value of the number of byte selections, it means that the combined bytes cannot be directly selected at this time. Therefore, the difference between the value of the number of combined bytes and the value of the number of byte selections is calculated and used as the number deviation value for subsequent use.

[0139] Step S403: Determine the position deviation reference distance value corresponding to the number deviation value according to the corresponding relationship between the number deviation value and the preset position deviation reference distance value.

[0140] Among them, the position deviation reference distance value refers to the maximum distance value that allows position deviation to occur with the number of deviations. Different numbers of deviation values correspond to different position deviation reference distance values. The position deviation reference distance value is obtained by querying from a database that stores different numbers of deviation values and the corresponding position deviation reference distance values. This database is obtained through pre-input. Querying and determining the position deviation reference distance value based on the number of deviations is convenient for subsequent use.

[0141] Step S404: Retrieve the combined byte edge position points based on the adjacent combined byte information.

[0142] Among them, the combined byte edge position point refers to the position point where the edge byte of the combined byte is located. The edge byte of the combined byte is retrieved through the adjacent combined byte information, and the position point where this edge byte is located is used as the combined byte edge position point, which is convenient for subsequent use.

[0143] Step S405: Calculate the distance value between adjacent combined byte edge position points and use it as the edge position distance value.

[0144] Among them, the edge position distance value refers to the distance value between the respective edge positions when two combined bytes are adjacent. By calculating the distance value between adjacent combined byte edge position points and using it as the edge position distance value, it is convenient for subsequent use.

[0145] Step S406: Based on the comparison result between the position deviation reference distance value and the edge position distance value, select the adjacent combined byte information as the edge selected byte information, and use the edge selected byte information as the adjacent selected byte information.

[0146] Among them, the edge selected byte information refers to the byte information obtained by selecting bytes based on the distance situation at the edge. By analyzing the comparison result between the position deviation reference distance value and the edge position distance value, the adjacent combined byte information is selected as the edge selected byte information, and the edge selected byte information is used as the adjacent selected byte information, improving the accuracy of the obtained adjacent selected byte information. The specific selection method of the adjacent selected byte information refers to Step S500 to Step S505.

[0147] In Figure 4 the shown Step S406, in order to further ensure the rationality of the edge selected byte information, it is necessary to perform further separate analysis and calculation on the edge selected byte information. Specifically, it is described in detail through the Figure 5 shown steps.

[0148] Referring to Figure 5 , the selection method of the edge selected byte information includes the following steps:

[0149] Step S500: Determine whether the edge position distance value is less than the position deviation reference distance value. If yes, execute Step S501; if no, execute Step S504.

[0150] Among them, by determining whether the edge position distance value is less than the position deviation reference distance value, it is judged whether the edge positions are too far apart when two combined bytes are adjacent.

[0151] Step S501: Take the adjacent combined byte information corresponding to the edge position distance value less than the position deviation reference distance value as the edge combined byte information.

[0152] Among them, the edge combined byte information refers to the comprehensive byte information of two combined bytes when the edge spacing is satisfied. When the edge position distance value is less than the position deviation reference distance value, it indicates that the edge positions are not too far apart when two combined bytes are adjacent. Therefore, the adjacent combined byte information corresponding to the edge position distance value less than the position deviation reference distance value is taken as the edge combined byte information, which is convenient for subsequent use.

[0153] Step S502: Analyze the coincidence situation between the edge combined byte information and the source reference byte information and use it as the edge combined coincidence rate.

[0154] Among them, the edge combined coincidence rate refers to the coincidence rate between the combined byte after combination according to the edge distance and the reference byte. By calculating the coincidence situation between the edge combined byte information and the source reference byte information and using it as the edge combined coincidence rate, it is convenient for subsequent use.

[0155] Step S503: Based on the comparison result between the edge combined coincidence rate and the preset edge combined reference coincidence rate, select the edge combined byte information and use it as the edge selected byte information.

[0156] Among them, the edge combined reference coincidence rate refers to the minimum coincidence rate required for selection. By comparing the edge combined coincidence rate with the preset edge combined reference coincidence rate, and selecting the edge combined byte information corresponding to the edge combined coincidence rate greater than the edge combined reference coincidence rate and using it as the edge selected byte information, the accuracy of the obtained edge selected byte information is improved.

[0157] Step S504: Analyze the deviation situation between the adjacent combined byte information and the source reference byte information and use it as the adjacent combined deviation value.

[0158] Among them, the adjacent combination deviation value refers to the deviation degree value between the combined byte and the reference byte. When the edge position distance value is not less than the position deviation reference distance value, it indicates that the edge position spacing is too far when the two combined bytes are adjacent at this time. Therefore, by analyzing and calculating the deviation between the adjacent combined byte information and the source reference byte information and using it as the adjacent combination deviation value, it is convenient for subsequent use.

[0159] Step S505: Based on the comparison result between the adjacent combination deviation value and the preset deviation reference value, select the adjacent combined byte information and use it as the edge selection byte information.

[0160] Among them, the deviation reference value refers to the minimum deviation degree value required for selection. By analyzing the comparison result between the adjacent combination deviation value and the preset deviation reference value, the adjacent combined byte information corresponding to the adjacent combination deviation value greater than the deviation reference value is selected and used as the edge selection byte information, improving the accuracy of the obtained edge selection byte information.

[0161] In Figure 2 In step S206 shown, in order to further ensure the rationality of the similar meaning information, it is necessary to perform further separate analysis and calculation on the similar meaning information. Specifically, it is described in detail through the Figure 6 steps shown.

[0162] Referring to Figure 6 , the method for determining the similar meaning information includes the following steps:

[0163] Step S600: According to the corresponding relationship between the similar byte information and the preset similar byte meaning information, determine the similar byte meaning information corresponding to the similar byte information.

[0164] Among them, the similar byte meaning information refers to the meaning information corresponding to the similar bytes. Different similar byte information corresponds to different similar byte meaning information. The similar byte meaning information is obtained by querying from a database storing different similar byte information and the corresponding similar byte meaning information, and this database is obtained through pre-input. Determining the similar byte meaning information by querying the similar byte information is convenient for subsequent use.

[0165] Step S601: Use the data byte information other than the similar byte information as the difference byte information.

[0166] Among them, the difference byte information refers to the byte information corresponding to the inconsistency with the similar byte information. By using the data byte information other than the similar byte information as the difference byte information, it is convenient for subsequent use.

[0167] Step S602: Determine the differential byte meaning information corresponding to the differential byte information according to the correspondence between the differential byte information and the preset differential byte meaning information.

[0168] Among them, the differential byte meaning information refers to the meaning information corresponding to the differential byte. Different differential byte information corresponds to different differential byte meaning information. The differential byte meaning information is obtained by querying from a database that stores different differential byte information and the corresponding differential byte meaning information, and this database is obtained through pre-input. Querying and determining the differential byte meaning information through the differential byte information facilitates subsequent use.

[0169] Step S603: Determine the relevant meaning vocabulary information corresponding to the similar byte meaning information according to the correspondence between the similar byte meaning information and the preset relevant meaning vocabulary information.

[0170] Among them, the relevant meaning vocabulary information refers to the vocabulary information corresponding to the meaning related to the similar byte. Different similar byte meaning information corresponds to different relevant meaning vocabulary information. The relevant meaning vocabulary information is obtained by querying from a database that stores similar byte meaning information and the corresponding relevant meaning vocabulary information, and this database is obtained through pre-input. Querying and determining the relevant meaning vocabulary information through the similar byte meaning information facilitates subsequent use.

[0171] Step S604: Judge whether the differential byte meaning information contains the relevant meaning vocabulary information. If yes, execute Step S605; if no, execute Step S606.

[0172] Among them, by judging whether the differential byte meaning information contains the relevant meaning vocabulary information, it is thus judged whether the meaning of the similar byte and the meaning of the differential byte can be used as similar meaning information.

[0173] Step S605: Combine the similar byte meaning information and the differential byte meaning information and use them as the similar meaning information.

[0174] Among them, when the differential byte meaning information contains the relevant meaning vocabulary information, it indicates that at this time, the meaning of the similar byte and the meaning of the differential byte can be used as the similar meaning information. Therefore, the similar byte meaning information and the differential byte meaning information are combined and used as the similar meaning information to improve the accuracy of the obtained similar meaning information.

[0175] Step S606: Determine the comprehensive data byte meaning information corresponding to the data byte information according to the correspondence between the data byte information and the preset comprehensive data byte meaning information, and use the comprehensive data byte meaning information as the similar meaning information.

[0176] Among them, the comprehensive meaning information of data bytes refers to the meaning information obtained by synthesizing the meanings of each byte in the data bytes. Different data byte information corresponds to different comprehensive meaning information of data bytes. The comprehensive meaning information of data bytes is obtained by querying from a database that stores different data byte information and the corresponding comprehensive meaning information of data bytes, and this database is obtained through pre-input.

[0177] When the differential byte meaning information does not contain relevant meaning vocabulary information, it indicates that at this time, the meanings of similar bytes and the meanings of differential bytes cannot be used as similar meaning information. Therefore, the comprehensive meaning information of data bytes is determined by querying the data byte information, and the comprehensive meaning information of data bytes is used as the similar meaning information to improve the accuracy of the obtained similar meaning information.

[0178] In Figure 1 In step S104 shown, in order to further ensure the rationality of restoring data information, it is necessary to perform further separate analysis and calculation on the restored data information, and the specific details are described through Figure 7 the steps shown.

[0179] Referring to Figure 7 , the method for determining the restored data information includes the following steps:

[0180] Step S700: Retrieve the demand type information based on the restoration requirement information.

[0181] Among them, the restoration requirement information includes the demand type information. The demand type information refers to the type information that the data needs to be restored to when restoring the data. Retrieving the demand type information through the restoration requirement information facilitates subsequent use.

[0182] Step S701: Determine the demand type vocabulary information corresponding to the demand type information according to the correspondence between the demand type information and the preset demand type vocabulary information.

[0183] Among them, the demand type vocabulary information refers to the vocabulary information corresponding to indicating the demand type. Different demand type information corresponds to different demand type vocabulary information. The demand type vocabulary information is obtained by querying from a database that stores different demand type information and the corresponding demand type vocabulary information, and this database is obtained through pre-input. Determining the demand type vocabulary information by querying the demand type information facilitates subsequent use.

[0184] Step S702: Determine whether the data meaning information contains similar byte meaning information. If yes, execute step S703; if no, execute step S704.

[0185] Among them, by determining whether the data meaning information contains similar byte meaning information, it is judged whether it is necessary to re-analyze the data meaning information to obtain it.

[0186] Step S703: According to the consistency between the relevant meaning vocabulary information and the demand type vocabulary information, determine the restored similar data information, and use the restored similar data information as the restored data information.

[0187] Among them, the restored similar data information refers to the data information restored according to the similarity of bytes. When the data meaning information contains similar byte meaning information, it means that it is not necessary to re-analyze the data meaning information at this time. Therefore, by analyzing the consistency between the relevant meaning vocabulary information and the demand type vocabulary information, the restored similar data information is determined, and the restored similar data information is used as the restored data information to improve the accuracy of the obtained restored data information. The specific determination steps of the restored similar data information refer to Step S800 to Step S806.

[0188] Step S704: Combine based on the demand type vocabulary information to form the comprehensive demand meaning information.

[0189] Among them, the comprehensive demand meaning information refers to the comprehensive meaning information that the vocabulary corresponding to the demand type can express. When the data meaning information does not contain similar byte meaning information, it means that it is necessary to re-analyze the data meaning information at this time. Therefore, by combining the demand type vocabulary information, the comprehensive demand meaning information is formed to facilitate subsequent use.

[0190] Step S705: According to the corresponding relationship between the comprehensive demand meaning information and the preset demand meaning source information, determine the demand meaning source information corresponding to the comprehensive demand meaning information.

[0191] Among them, the demand meaning source information refers to the source information corresponding to the data with demand meaning. Different comprehensive demand meaning information corresponds to different demand meaning source information. The demand meaning source information is obtained by querying from a database that stores different comprehensive demand meaning information and the corresponding demand meaning source information, and this database is obtained through pre-input. Querying and determining the demand meaning source information through the comprehensive demand meaning information facilitates subsequent use.

[0192] Step S706: Use the demand meaning source information as the data source information and re-analyze the data meaning information to obtain it.

[0193] Among them, by using the demand meaning source information as the data source information and re-analyzing the data meaning information to obtain it, the restored data information is re-analyzed to improve the accuracy of the obtained restored data information.

[0194] In Figure 7 In step S703 shown above, in order to further ensure the rationality of restoring similar data information, it is necessary to perform a further separate analysis and calculation on the restored similar data information, which will be specifically described in detail through the steps shown below.

[0195] The method for determining the restored similar data information includes the following steps:

[0196] Step S800: According to the correspondence between the demand type information and the preset type data demand type information, determine the type data demand type information corresponding to the demand type information.

[0197] Among them, the type data demand type information refers to the data type information corresponding to the demand type. Different demand type information corresponds to different type data demand type information. The type data demand type information is obtained by querying from a database that stores different demand type information and the corresponding type data demand type information, and this database is obtained through pre-input. Querying and determining the type data demand type information through the demand type information is convenient for subsequent use.

[0198] Step S801: Determine whether the relevant meaning vocabulary information is consistent with the demand type vocabulary information. If it is, execute step S802; if not, execute step S804.

[0199] Among them, by determining whether the relevant meaning vocabulary information is consistent with the demand type vocabulary information, it is thus determined whether data adjustment can be directly performed on the similar byte meaning and the different byte meaning.

[0200] Step S802: Based on the type data demand type information, perform type adjustment on the similar byte meaning information to obtain the similar byte demand data information.

[0201] Among them, the similar byte demand data information refers to the data information after adjusting the similar byte meaning to the data type corresponding to the type data demand type information. When the relevant meaning vocabulary information is consistent with the demand type vocabulary information, it indicates that data adjustment can be directly performed on the similar byte meaning and the different byte meaning at this time. Therefore, type adjustment is performed on the similar byte meaning information through the type data demand type information, thereby obtaining the similar byte demand data information, which is convenient for subsequent use.

[0202] Step S803: Based on the type data demand type information, perform type adjustment on the different byte meaning information to obtain the different byte demand data information, and combine the similar byte demand data information and the different byte demand data information as the restored similar data information.

[0203] Among them, the differential byte requirement data information refers to the data information obtained by adjusting the meaning of the differential byte to the data type corresponding to the category data requirement type information. By adjusting the type of the differential byte meaning information through the category data requirement type information, the differential byte requirement data information is obtained, and the similar byte requirement data information and the differential byte requirement data information are combined as the restored similar data information to improve the accuracy of the obtained restored similar data information.

[0204] Step S804: Based on the requirement category vocabulary information, select the similar byte meaning information and the differential byte meaning information as the requirement category selected meaning information, and use the similar meaning information other than the requirement category selected meaning information as the requirement category remaining meaning information.

[0205] Among them, the requirement category selected meaning information refers to the meaning information selected based on the requirement category vocabulary with consistent vocabulary, and the requirement category remaining meaning information refers to the meaning information without consistent vocabulary with the requirement category vocabulary. When the relevant meaning vocabulary information is consistent with the requirement category vocabulary information, it indicates that the data adjustment of the similar byte meaning and the differential byte meaning cannot be directly performed at this time. Therefore, the requirement category selected meaning information is selected, and the requirement category remaining meaning information is defined for subsequent use.

[0206] Step S805: Based on the category data requirement type information, adjust the type of the requirement category selected meaning information to obtain the selected meaning requirement data information.

[0207] Among them, the selected meaning requirement data information refers to the data information obtained by adjusting the requirement category selected meaning to the data type corresponding to the category data requirement type information. By adjusting the type of the requirement category selected meaning information through the category data requirement type information, the selected meaning requirement data information is obtained for subsequent use.

[0208] Step S806: Based on the category data requirement type information, adjust the type of the requirement category remaining meaning information to obtain the remaining meaning requirement data information, and combine the selected meaning requirement data information and the remaining meaning requirement data information as the restored similar data information.

[0209] Among them, the remaining meaning requirement data information refers to the data information obtained by adjusting the remaining meaning to the data type corresponding to the category data requirement type information. By adjusting the type of the requirement category remaining meaning information through the category data requirement type information, the remaining meaning requirement data information is obtained, and the selected meaning requirement data information and the remaining meaning requirement data information are combined as the restored similar data information to improve the accuracy of the obtained restored similar data information.

[0210] Based on the same inventive concept, an embodiment of the present invention provides a system for restoring Protobuf format data, including:

[0211] An acquisition module, configured to acquire Protobuf format data information and restoration requirement information;

[0212] A memory, configured to store a program of the method for restoring Protobuf format data as described above;

[0213] A processor, configured to load and execute the program in the memory.

[0214] Based on the same inventive concept, an embodiment of the present invention provides an intelligent terminal, including a memory and a processor, and a computer program capable of being loaded and executed by the processor is stored on the memory, which is the method for restoring Protobuf format data as described above.

[0215] Those skilled in the art can clearly understand that for the convenience and conciseness of description, only the above division of each functional module is used as an example. In actual applications, the above functions can be allocated to different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working processes of the systems, devices, and units described above can refer to the corresponding processes in the foregoing method embodiments, and will not be elaborated herein.

[0216] The above is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions falling within the concept of the present invention belong to the protection scope of the present invention. It should be noted that for those of ordinary skill in the art, several improvements and refinements made without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.

Claims

1. A method for restoring Protobuf format data, characterized in that: include: Obtain Protobuf format data information and restore requirement information; Retrieve data byte information and data source information based on Protobuf format data information; According to the correspondence between the data source information and the preset source reference byte information, the source reference byte information corresponding to the data source information is determined; Determine data meaning information based on source reference byte information and data byte information; Determine the restored data information according to the restoration requirement information and the data meaning information, and output the restored data information; Methods for determining data meaning information include: Determine whether the source reference byte information and the data byte information are consistent; If yes, the data byte information that is consistent with the source reference byte information is taken as consistent byte information, and the data byte information other than the consistent byte information is taken as remaining byte information; According to the correspondence between the consistent byte information and the preset consistent byte meaning information, the consistent byte meaning information corresponding to the consistent byte information is determined; According to the correspondence between the remaining byte information and the preset remaining byte meaning information, the remaining byte meaning information corresponding to the remaining byte information is determined; Combining the consistent byte meaning information with the remaining byte meaning information to form comprehensive byte meaning information, and using the comprehensive byte meaning information as data meaning information; If not, similar byte information is selected based on the source reference byte information and the data byte information; Similar meaning information is determined according to the similar byte information and the data byte information, and the similar meaning information is used as the data meaning information.

2. The method for restoring Protobuf format data according to claim 1, characterized in that: The selection method of similar byte information includes: Retrieve reference single byte information and reference byte value based on source reference byte information; Select the data byte information that is consistent with the reference single byte information and use it as the byte consistency information; Retrieve single-byte position points and single-byte information based on byte consistency information; Combining the single byte information based on adjacent single-byte position points to form adjacent combined byte information; Retrieve the value of the combined byte based on the adjacent combined byte information; According to the corresponding relationship between the reference byte value and the preset byte selection value, the byte selection value corresponding to the reference byte value is determined; According to the comparison result between the combined byte number value and the byte selection number value, adjacent combined byte information is selected and used as adjacent selected byte information, and the adjacent selected byte information is used as similar byte information.

3. The method for restoring Protobuf format data according to claim 2, characterized in that: The method for determining the adjacent selected byte information includes: Determine whether the combined byte value is greater than the byte selection value; If yes, the adjacent combined byte information corresponding to the combined byte value greater than the byte selection value is used as the adjacent selected byte information; If not, the difference between the combined byte number value and the byte selection number value is calculated and used as the number deviation value; According to the correspondence between the number deviation value and the preset position deviation reference distance value, the position deviation reference distance value corresponding to the number deviation value is determined; Retrieving the edge position point of the combined byte based on the adjacent combined byte information; Calculate the distance between adjacent combined byte edge position points and use it as the edge position distance value; According to the comparison result between the position deviation reference distance value and the edge position distance value, adjacent combined byte information is selected and used as edge selected byte information, and the edge selected byte information is used as adjacent selected byte information.

4. The method for restoring Protobuf format data according to claim 3, characterized in that: The edge selection byte information selection method includes: Determine whether the edge position distance value is less than the position deviation reference distance value; If yes, the adjacent combination byte information corresponding to the edge position distance value that is smaller than the position deviation reference distance value is used as the edge combination byte information; Analyze the overlap between the edge combination byte information and the source reference byte information and use it as the edge combination overlap rate; Based on the comparison result of the edge combination coincidence rate and the preset edge combination reference coincidence rate, the edge combination byte information is selected and used as the edge selection byte information; If not, then analyze the deviation between the adjacent combination byte information and the source reference byte information and use it as the adjacent combination deviation value; Based on the comparison result between the adjacent combination deviation value and the preset deviation reference value, the adjacent combination byte information is selected and used as the edge selected byte information.

5. The method for restoring Protobuf format data according to claim 1, characterized in that: Methods for determining information with similar meanings include: Determine the similar byte meaning information corresponding to the similar byte information according to the correspondence between the similar byte information and the preset similar byte meaning information; The data byte information other than the similar byte information is used as the difference byte information; According to the correspondence between the difference byte information and the preset difference byte meaning information, the difference byte meaning information corresponding to the difference byte information is determined; According to the correspondence between the similar byte meaning information and the preset related meaning vocabulary information, the related meaning vocabulary information corresponding to the similar byte meaning information is determined; Determine whether the difference byte meaning information contains relevant meaning vocabulary information; If yes, then the similar byte meaning information and the different byte meaning information are combined and used as the similar meaning information; If not, the data byte comprehensive meaning information corresponding to the data byte information is determined according to the correspondence between the data byte information and the preset data byte comprehensive meaning information, and the data byte comprehensive meaning information is used as the similar meaning information.

6. The method for restoring Protobuf format data according to claim 5, characterized in that: Methods for determining restored data information include: Retrieve demand type information based on restored demand information; According to the correspondence between the demand type information and the preset demand type vocabulary information, the demand type vocabulary information corresponding to the demand type information is determined; Determine whether the data meaning information contains similar byte meaning information; If yes, then according to the consistency between the relevant meaning vocabulary information and the demand type vocabulary information, the restored similar data information is determined, and the restored similar data information is used as the restored data information; If not, combining based on the demand type vocabulary information to form demand comprehensive meaning information; According to the correspondence between the demand comprehensive meaning information and the preset demand meaning source information, the demand meaning source information corresponding to the demand comprehensive meaning information is determined; The demand meaning source information is used as the data source information and the data meaning information is re-analyzed and obtained.

7. The method for restoring Protobuf format data according to claim 6, characterized in that: Methods for restoring similar data information include: According to the correspondence between the demand type information and the preset type data demand type information, the type data demand type information corresponding to the demand type information is determined; Determine whether the relevant meaning vocabulary information is consistent with the demand type vocabulary information; If yes, then type adjustment is performed on the similar byte meaning information based on the category data requirement type information to obtain similar byte requirement data information; Based on the category data requirement type information, type adjustment is performed on the difference byte meaning information to obtain the difference byte requirement data information, and the similar byte requirement data information is combined with the difference byte requirement data information to serve as the restored similar data information; If not, similar byte meaning information and different byte meaning information are selected based on the demand type vocabulary information and used as the demand type selected meaning information, and similar meaning information other than the demand type selected meaning information is used as the demand type remaining meaning information; Based on the category data requirement type information, type adjustment is performed on the requirement category selection meaning information to obtain the selection meaning requirement data information; Based on the category data requirement type information, the type of the requirement category remaining meaning information is adjusted to obtain the remaining meaning requirement data information, and the selected meaning requirement data information is combined with the remaining meaning requirement data information to serve as restored similar data information.

8. A Protobuf format data restoration system, characterized in that: include: The acquisition module is used to obtain Protobuf format data information and restore required information; A memory for storing a program of a method for restoring Protobuf format data according to any one of claims 1 to 7; The processor loads and executes the program in the memory.

9. An intelligent terminal, characterized in that: The invention comprises a memory and a processor, wherein the memory stores a computer program which can be loaded by the processor and executes the method for restoring Protobuf format data as claimed in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method and system for restoring Protobuf format data in network traffic

    CN117852524A