Method, system and terminal for restoring data in Protobuf format

By obtaining and analyzing Protobuf format data information, the problem of not being able to restore Protobuf data without the lack of definition files is solved, and the accurate restoration of data and accurate analysis of meaning is achieved.

CN119783632AActive Publication Date: 2025-04-08SHANGHAI YVIEW TECHNOLOGY CO LTD

Patent Information

Application Number
CN202510274399.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-10
Publication Date
2025-04-08
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 CN119783632A_ABST
    Figure CN119783632A_ABST
Patent Text Reader

Abstract

The invention relates to a method, a system and a terminal for restoring data in a Probuf format, and relates to the technical field of data processing, the method comprises the following steps: acquiring data information in the Probuf format and restoration demand information; calling data byte information and data source information based on the data information in the Protobuf format; determining source reference byte information corresponding to the data source information according to a corresponding relation between the data source information and preset source reference byte information; determining data meaning information according to the source reference byte information and the data byte information; and determining restoration data information according to the restoration demand information and the data meaning information, and outputting the restoration data information. The method and the device have the advantage that the protobuf data lacking the protobuf definition file can be conveniently restored.
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 needs. It includes the entire life cycle from data collection, storage, cleaning, conversion, analysis to visualization.

[0003] Protobuf is often used in network communications 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 human-readable or program-processable structured data, the Protobuf data needs to be restored. Currently, when restoring Protobuf data in network traffic, the Protobuf definition file (i.e., .proto file) is generally obtained, and then the Protobuf definition file is compiled to generate code, and then the serialized Protobuf binary data is read, so that the binary data is deserialized into an object by using the generated code to complete the restoration.

[0004] When the Protobuf data lacks a Protobuf definition file, it is inconvenient to restore the Protobuf data. Summary of the invention

[0005] In order to facilitate the restoration of Protobuf data lacking a 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, which adopts the following technical solution: A method for restoring Protobuf format data, comprising: 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.

[0007] Optionally, the method for determining the data meaning information includes: 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.

[0008] Optionally, the method for selecting 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.

[0009] Optionally, 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.

[0010] Optionally, the method for selecting edge selection byte information 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.

[0011] Optionally, a method for determining similar meaning information includes: 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.

[0012] Optionally, a method for determining the restored data information includes: 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.

[0013] Optionally, a method for restoring similar data information includes: 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.

[0014] In a second aspect, the present invention provides a system for restoring Protobuf format data, which adopts the following technical solution: A Protobuf format data restoration system, comprising: The acquisition module is used to obtain Protobuf format data information and restore required information; A memory for storing a program of the method for restoring Protobuf format data as described in any one of the first aspects; The processor loads and executes the program in the memory.

[0015] In a third aspect, the present invention provides an intelligent terminal, which adopts the following technical solution: An intelligent terminal comprises a memory and a processor, wherein the memory stores a computer program that can be loaded by the processor and executes a method for restoring Protobuf format data as described in any one of the first aspects.

[0016] In summary, the present invention includes at least one of the following beneficial technical effects: 1. By acquiring the Protobuf format data information and restoration requirement information and retrieving the data byte information and data source information, determining the source reference byte information through the data source information query, determining the data meaning information through the source reference byte information and the data byte information, and determining and outputting the restoration data information through the restoration requirement information and the data meaning information, it is convenient to restore the Protobuf data that lacks the Protobuf definition file; 2. By judging whether the source reference byte information and the data byte information are consistent, and when there is 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 comprehensive byte meaning information as data meaning information, selecting similar byte information through the source reference byte information and the data byte information, and determining similar meaning information through the similar byte information and the data byte information as data meaning information, thereby improving the accuracy of the acquired data meaning information; 3. Retrieve benchmark single byte information and benchmark byte value through source benchmark byte information, and define byte consistency information to retrieve single byte position point and single byte information, so as to combine and obtain adjacent combined byte information and retrieve combined byte value, determine byte selection value through benchmark byte value query, analyze the comparison result between combined byte value and byte selection value, so as to select adjacent combined byte information and use it as adjacent selected byte information, and use adjacent selected byte information as similar byte information, so as to improve the accuracy of similar byte information obtained. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 This is a flow chart of a method for restoring Protobuf format data according to an embodiment of the present application; Figure 2 is a flow chart of a method for determining data meaning information in an embodiment of the present application; Figure 3 is a flow chart of a method for selecting similar byte information according to an embodiment of the present application; Figure 4 is a flow chart of a method for determining adjacent selected byte information according to an embodiment of the present application; Figure 5 is a flow chart of a method for selecting edge selection byte information according to an embodiment of the present application; Figure 6 is a flow chart of a method for determining similar meaning information in an embodiment of the present application; Figure 7 It is a flow chart of a method for determining restored data information according to an embodiment of the present application. DETAILED DESCRIPTION

[0018] The present invention is further described in detail below in conjunction with the accompanying drawings and embodiments.

[0019] A method for restoring Protobuf format data obtains Protobuf format data information and restoration requirement information and determines and combines the meanings of bytes in Protobuf format data according to data sources or restoration requirements, thereby obtaining final restoration data information, thereby facilitating the restoration of Protobuf data lacking a Protobuf definition file.

[0020] Reference Figure 1 , an embodiment of the present invention discloses a method for restoring Protobuf format data, which comprises: Step S100: Obtain Protobuf format data information and restoration requirement information.

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

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

[0023] 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 the Protobuf format, and the data source information refers to the source information corresponding to the data in the Protobuf format. The data byte information and data source information are retrieved through the Protobuf format data information to facilitate subsequent use.

[0024] 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.

[0025] The source reference byte information refers to the reference byte information in the data source used to indicate the meaning of the data. 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 corresponding source reference byte information. The database is obtained after input. The source reference byte information is determined by querying the data source information to facilitate subsequent use.

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

[0027] The data meaning information refers to the meaning information corresponding to each byte in the Protobuf format data. The data meaning information is determined by analyzing the source reference byte information and the data byte information, so as to facilitate subsequent use. The specific steps for determining the data meaning information refer to steps S200 to S206.

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

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

[0030] exist Figure 1 In step S103, in order to further ensure the rationality of the data meaning information, it is necessary to further analyze and calculate the data meaning information separately, specifically by Figure 2 The steps shown are explained in detail.

[0031] Reference Figure 2 , the method for determining the data meaning information includes the following steps: 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.

[0032] Among them, by judging whether the source reference byte information and the data byte information are consistent, it is judged whether the meaning bytes in the data bytes are consistent with the meaning bytes corresponding to the source.

[0033] Step S201: 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.

[0034] Among them, consistent byte information refers to the byte information corresponding to the source reference byte, and remaining byte information refers to the byte information corresponding to the byte other than the consistent byte. When the source reference byte information is consistent with the data byte information, it means that the meaning byte in the data byte is consistent with the source byte, so the consistent byte information and the remaining byte information are defined for subsequent use.

[0035] Step S202: Determine the consistent byte meaning information corresponding to the consistent byte information according to the correspondence between the consistent byte information and the preset consistent byte meaning information.

[0036] The consistent byte meaning information refers to the meaning information corresponding to the byte 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 storing different consistent byte information and the corresponding consistent byte meaning information, which is obtained by pre-entering the database. The consistent byte meaning information is determined by querying the consistent byte information to facilitate subsequent use.

[0037] Step S203: determining the remaining byte meaning information corresponding to the remaining byte information according to the correspondence between the remaining byte information and the preset remaining byte meaning information.

[0038] 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 in the database after pre-input. The remaining byte meaning information is determined by querying the remaining byte information, which is convenient for subsequent use.

[0039] Step S204: 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.

[0040] Among them, the comprehensive byte meaning information refers to the comprehensive meaning information corresponding to all bytes. The consistent byte meaning information is combined with the remaining byte meaning information to form the comprehensive byte meaning information, and the comprehensive byte meaning information is used as the data meaning information, thereby improving the accuracy of the acquired data meaning information.

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

[0042] Among them, similar byte information refers to the byte information corresponding to the byte when the bytes are similar. When the source reference byte information and the data byte information are not consistent, it means that the meaning byte corresponding to the source in the byte of the data is not consistent, so by analyzing the source reference byte information and the data byte information, similar byte information is selected to facilitate subsequent use. The specific steps of selecting similar byte information refer to steps S300 to S306.

[0043] Step S206: Determine 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.

[0044] The similar meaning information refers to the meaning information corresponding to the similar bytes. The similar meaning information is determined by analyzing the similar byte information and the data byte information, and the similar meaning information is used as the data meaning information to improve the accuracy of the acquired data meaning information. The specific steps for determining the similar meaning information refer to steps S600 to S606.

[0045] exist Figure 2 In step S205, in order to further ensure the rationality of the similar byte information, it is necessary to further analyze and calculate the similar byte information separately. Figure 3 The steps shown are explained in detail.

[0046] Reference Figure 3 , the method for selecting similar byte information includes the following steps: Step S300: Retrieve reference single byte information and reference byte value based on source reference byte information.

[0047] The source reference byte information includes reference single byte information and reference byte number value. The reference single byte information refers to the single reference byte information in the data source, and the reference byte number value refers to the reference byte number value in the data source. The reference single byte information and reference byte number value are retrieved through the source reference byte information for subsequent use.

[0048] Step S301: Select the data byte information that is consistent with the reference single byte information and use it as byte consistency information.

[0049] The byte consistency information refers to the byte information that is consistent with the benchmark single byte. By selecting the byte information that is consistent with the benchmark single byte information in the data byte information and using it as the byte consistency information, subsequent use is facilitated.

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

[0051] The byte consistency information includes a single-byte position point and single-byte information. The single-byte position point refers to the position point corresponding to a single byte, and the single-byte information refers to the byte information corresponding to a single byte. The single-byte position point and single-byte information are retrieved through the byte consistency information to facilitate subsequent use.

[0052] Step S303: combining single byte information based on adjacent single-byte position points to form adjacent combined byte information.

[0053] Among them, the adjacent combined byte information refers to the byte information after combining adjacent single bytes. The adjacent combined byte information is formed by combining the single byte information corresponding to the adjacent single-byte position points, which is convenient for subsequent use.

[0054] Step S304: Retrieve the value of the combined byte based on the adjacent combined byte information.

[0055] The combined byte value refers to the byte value corresponding to the combined bytes. The individual bytes therein are counted through adjacent combined byte information, and the counting result is retrieved as the combined byte value for subsequent use.

[0056] Step S305: Determine a byte selection number value corresponding to the reference byte number value according to the corresponding relationship between the reference byte number value and the preset byte selection number value.

[0057] The byte selection number value refers to the reference number value required when selecting a combination byte similar to the reference byte. Different reference byte number values ​​correspond to different byte selection number values. The byte selection number value is obtained by querying from a database storing reference byte number values ​​and corresponding byte selection number values. The byte selection number value is determined by querying the reference byte number value to facilitate subsequent use.

[0058] Step S306: 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.

[0059] Among them, the adjacent selected byte information refers to the combined byte information selected according to the adjacent situation of the bytes, and the adjacent combined byte information is selected and used as the adjacent selected byte information by analyzing the comparison result of the combined byte number value and the byte selection number value, 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 steps S400 to S406.

[0060] exist Figure 3 In step S306, in order to further ensure the rationality of the adjacent selected byte information, it is necessary to further analyze and calculate the adjacent selected byte information separately, specifically by Figure 4 The steps shown are explained in detail.

[0061] Reference Figure 4 , the method for determining adjacent selected byte information comprises the following steps: Step S400: Determine whether the combined byte value is greater than the byte selection value. If yes, execute step S401; if no, execute step S402.

[0062] Here, by judging whether the combined byte value is greater than the byte selection value, it is judged whether the combined byte can be directly selected.

[0063] Step S401: 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.

[0064] Among them, when the combined byte value is greater than the byte selection value, it means that the combined bytes can be directly selected at this time, so 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.

[0065] Step S402: Calculate the difference between the combined byte number value and the byte selection number value and use it as the number deviation value.

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

[0067] Step S403: determining a position deviation reference distance value corresponding to the number deviation value according to a correspondence between the number deviation value and a preset position deviation reference distance value.

[0068] The position deviation reference distance value refers to the maximum distance value that the number of deviations can allow the position deviation to generate. Different number deviation values ​​correspond to different position deviation reference distance values. The position deviation reference distance value is obtained by querying from a database storing different number deviation values ​​and corresponding position deviation reference distance values. The database is obtained after pre-input. The position deviation reference distance value is determined by querying the number deviation value to facilitate subsequent use.

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

[0070] Among them, the edge position point of the combined byte refers to the position point of the edge byte of the combined byte. The edge byte of the combined byte is retrieved through the adjacent combined byte information, and the position point of the edge byte is used as the edge position point of the combined byte for subsequent use.

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

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

[0073] Step S406: 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.

[0074] Among them, the edge selection byte information refers to the byte information after the bytes are selected according to the distance of the edge, and the adjacent combination byte information is selected and used as the edge selection byte information by analyzing the comparison result between the position deviation reference distance value and the edge position distance value, and the edge selection byte information is used as the adjacent selection byte information to improve the accuracy of the acquired adjacent selection byte information. The specific selection method of the adjacent selection byte information refers to steps S500 to S505.

[0075] exist Figure 4 In step S406, in order to further ensure the rationality of the edge selection byte information, it is necessary to further analyze and calculate the edge selection byte information separately, specifically by Figure 5 The steps shown are explained in detail.

[0076] Reference Figure 5 , the method for selecting edge selection byte information includes the following steps: 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.

[0077] Among them, by judging 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 the positions of two combined bytes are adjacent.

[0078] Step S501: taking the adjacent combined byte information corresponding to the edge position distance value that is smaller than the position deviation reference distance value as the edge combined byte information.

[0079] Among them, the edge combination byte information refers to the comprehensive byte information of two combination bytes when the edge spacing meets. When the edge position distance value is less than the position deviation reference distance value, it means that the edge position spacing of the two combination bytes is not too far when they are adjacent, so the adjacent combination byte information corresponding to the edge position distance value less than the position deviation reference distance value is used as the edge combination byte information, so as to facilitate subsequent use.

[0080] Step S502: Analyze the overlap between the edge combination byte information and the source reference byte information and use it as the edge combination overlap rate.

[0081] Among them, the edge combination overlap rate refers to the overlap rate between the combined bytes and the reference bytes after combining according to the edge distance. The overlap between the edge combination byte information and the source reference byte information is calculated and used as the edge combination overlap rate for subsequent use.

[0082] Step S503: Based on the comparison result between the edge combination coincidence rate and the preset edge combination reference coincidence rate, edge combination byte information is selected and used as edge selection byte information.

[0083] The edge combination reference coincidence rate refers to the minimum coincidence rate required for selection. By comparing the edge combination coincidence rate with the preset edge combination reference coincidence rate, the edge combination byte information corresponding to the edge combination coincidence rate greater than the edge combination reference coincidence rate is selected and used as the edge selection byte information, thereby improving the accuracy of the obtained edge selection byte information.

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

[0085] Among them, the adjacent combination deviation value refers to the deviation between the combination byte and the reference byte. When the edge position distance value is not less than the position deviation reference distance value, it means that the edge position distance between the two combination bytes is too far apart when they are adjacent. Therefore, the deviation between the adjacent combination byte information and the source reference byte information is analyzed and calculated as the adjacent combination deviation value, which is convenient for subsequent use.

[0086] Step S505: 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 selection byte information.

[0087] The deviation reference value refers to the minimum deviation value required for selection. By analyzing the comparison result of the adjacent combination deviation value and the preset deviation reference value, the adjacent combination 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, thereby improving the accuracy of the obtained edge selection byte information.

[0088] exist Figure 2 In step S206, in order to further ensure the rationality of the similar meaning information, it is necessary to further analyze and calculate the similar meaning information separately, specifically by Figure 6 The steps shown are explained in detail.

[0089] Reference Figure 6 , the method for determining similar meaning information includes the following steps: Step S600: Determine 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.

[0090] The similar byte meaning information refers to the meaning information corresponding to similar bytes, and 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 corresponding similar byte meaning information, and the database is obtained after pre-input. The similar byte meaning information is determined by querying the similar byte information, which is convenient for subsequent use.

[0091] Step S601: taking data byte information except similar byte information as difference byte information.

[0092] 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, subsequent use is facilitated.

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

[0094] The difference byte meaning information refers to the meaning information corresponding to the difference byte, and different difference byte information corresponds to different difference byte meaning information. The difference byte meaning information is obtained by querying from a database storing different difference byte information and corresponding difference byte meaning information, and the database is obtained after pre-input. The difference byte meaning information is determined by querying the difference byte information, which is convenient for subsequent use.

[0095] 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.

[0096] The relevant meaning vocabulary information refers to the vocabulary information corresponding to the meaning of the similar bytes, and different similar byte meaning information corresponds to different relevant meaning vocabulary information. The relevant meaning vocabulary information is obtained by querying from a database storing similar byte meaning information and corresponding relevant meaning vocabulary information, and the database is obtained after pre-input. The relevant meaning vocabulary information is determined by querying the similar byte meaning information, which is convenient for subsequent use.

[0097] Step S604: Determine whether the difference byte meaning information contains relevant meaning vocabulary information. If yes, execute step S605; if no, execute step S606.

[0098] Here, by judging whether the difference byte meaning information contains relevant meaning vocabulary information, it is judged whether the meaning of the similar byte and the meaning of the difference byte can be used as similar meaning information.

[0099] Step S605: The similar byte meaning information and the different byte meaning information are combined and used as the similar meaning information.

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

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

[0102] Among them, the data byte comprehensive meaning information refers to the meaning information after the meaning of each byte in the data byte is integrated. Different data byte information corresponds to different data byte comprehensive meaning information. The data byte comprehensive meaning information is obtained by querying from a database storing different data byte information and the corresponding data byte comprehensive meaning information. The database is obtained after pre-input.

[0103] When the difference byte meaning information does not contain relevant meaning vocabulary information, it means that the meaning of the similar bytes and the meaning of the difference bytes cannot be used as similar meaning information at this time. Therefore, the comprehensive meaning information of the data bytes is determined through data byte information query, and the comprehensive meaning information of the data bytes is used as similar meaning information to improve the accuracy of the obtained similar meaning information.

[0104] exist Figure 1 In step S104, in order to further ensure the rationality of the restored data information, it is necessary to further analyze and calculate the restored data information. Figure 7 The steps shown are explained in detail.

[0105] Reference Figure 7 , the method for determining the restored data information includes the following steps: Step S700: Retrieve requirement type information based on the restoration requirement information.

[0106] The restoration demand information includes demand type information. The demand type information refers to the type information that needs to be restored when restoring the data. The demand type information is retrieved by restoring the demand information to facilitate subsequent use.

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

[0108] The demand type vocabulary information refers to the vocabulary information corresponding to the demand type, and different demand type information corresponds to different demand type vocabulary information. The demand type vocabulary information is obtained by querying from a database storing different demand type information and corresponding demand type vocabulary information, and the database is obtained after pre-input. The demand type vocabulary information is determined by querying the demand type information to facilitate subsequent use.

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

[0110] Herein, by judging whether the data meaning information contains similar byte meaning information, it is judged whether the data meaning information needs to be analyzed and obtained again.

[0111] Step S703: Determine the restored similar data information according to the consistency between the related meaning vocabulary information and the demand category vocabulary information, and use the restored similar data information as the restored data information.

[0112] 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 there is no need to re-analyze and obtain 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 restored data information obtained. The specific determination steps of restoring the similar data information refer to steps S800 to S806.

[0113] Step S704: combining the demand category vocabulary information to form demand comprehensive meaning information.

[0114] Among them, the comprehensive meaning information of the demand refers to the comprehensive meaning information that can be expressed by the vocabulary corresponding to the demand type. When the data meaning information does not contain similar byte meaning information, it means that the data meaning information needs to be analyzed and obtained again. Therefore, the demand type vocabulary information is combined to form the comprehensive meaning information of the demand, which is convenient for subsequent use.

[0115] Step S705: Determine the demand meaning source information corresponding to the demand comprehensive meaning information according to the correspondence between the demand comprehensive meaning information and the preset demand meaning source information.

[0116] The demand meaning source information refers to the source information corresponding to the data with demand meaning. Different demand comprehensive meaning information corresponds to different demand meaning source information. The demand meaning source information is obtained by querying from a database storing different demand comprehensive meaning information and corresponding demand meaning source information. The database is obtained after pre-input. The demand meaning source information is determined by querying the demand comprehensive meaning information to facilitate subsequent use.

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

[0118] Among them, by taking the demand meaning source information as the data source information and re-analyzing and acquiring the data meaning information, the restored data information is re-analyzed to improve the accuracy of the restored data information obtained.

[0119] exist Figure 7 In step S703 shown, in order to further ensure the rationality of the restored similar data information, it is necessary to perform further separate analysis and calculation on the restored similar data information, which is specifically described in detail through the following steps.

[0120] The method for restoring similar data information includes the following steps: Step S800: Determine the category data requirement type information corresponding to the requirement category information according to the correspondence between the requirement category information and the preset category data requirement type information.

[0121] The category data requirement type information refers to the data type information corresponding to the requirement category. Different requirement category information corresponds to different category data requirement type information. The category data requirement type information is obtained by querying from a database storing different requirement category information and corresponding category data requirement type information. The database is obtained after pre-input. The category data requirement type information is determined by querying the requirement category information to facilitate subsequent use.

[0122] Step S801: Determine whether the relevant meaning vocabulary information is consistent with the demand category vocabulary information. If yes, execute step S802; if no, execute step S804.

[0123] Among them, by judging whether the relevant meaning vocabulary information is consistent with the demand type vocabulary information, it is judged whether the data adjustment of the similar byte meanings and the different byte meanings can be directly performed.

[0124] Step S802: Based on the category data requirement type information, type adjustment is performed on the similar byte meaning information to obtain similar byte requirement data information.

[0125] Among them, the similar byte demand data information refers to the data information after the similar byte meaning is adjusted 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 means that the similar byte meaning and the difference byte meaning can be directly adjusted at this time. Therefore, the similar byte meaning information is type-adjusted through the type data demand type information, thereby obtaining the similar byte demand data information, which is convenient for subsequent use.

[0126] Step S803: Based on the category data requirement type information, the difference byte meaning information is type-adjusted 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 restore the similar data information.

[0127] The difference byte requirement data information refers to data information after the difference byte meaning is adjusted to the data type corresponding to the type data requirement type information. The difference byte meaning information is type-adjusted by the type data requirement type information, thereby obtaining the difference byte requirement data information, and combining the similar byte requirement data information with the difference byte requirement data information as the restored similar data information, thereby improving the accuracy of the restored similar data information obtained.

[0128] Step S804: Based on the demand type vocabulary information, similar byte meaning information and different byte meaning information are selected as demand type selected meaning information, and similar meaning information except the demand type selected meaning information is used as demand type remaining meaning information.

[0129] Among them, the requirement type selection meaning information refers to the meaning information with consistent words selected based on the requirement type vocabulary, and the requirement type remaining meaning information refers to the meaning information with no consistent words with the requirement type vocabulary. When the relevant meaning vocabulary information is consistent with the requirement type vocabulary information, it means that the data adjustment of the similar byte meaning and the different byte meaning cannot be directly performed at this time, so the requirement type selection meaning information is selected, and the requirement type remaining meaning information is defined for subsequent use.

[0130] Step S805: 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.

[0131] The selected meaning requirement data information refers to the data information after the requirement type selection meaning is adjusted to the data type corresponding to the type data requirement type information. The type of the requirement type selection meaning information is adjusted through the type data requirement type information to obtain the selected meaning requirement data information, which is convenient for subsequent use.

[0132] Step S806: Based on the category data requirement type information, the remaining meaning information of the requirement category is type-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.

[0133] The remaining meaning demand data information refers to the data information after the remaining meaning is adjusted to the data type corresponding to the category data demand type information. The category data demand type information is used to adjust the type of the remaining meaning information of the demand category, thereby obtaining the remaining meaning demand data information, and combining the selected meaning demand data information with the remaining meaning demand data information as the restored similar data information, thereby improving the accuracy of the obtained restored similar data information.

[0134] Based on the same inventive concept, an embodiment of the present invention provides a system for restoring Protobuf format data, including: The acquisition module is used to obtain Protobuf format data information and restore required information; A memory for storing a program of the method for restoring data in the Protobuf format as described above; The processor loads and executes the program in the memory.

[0135] Based on the same inventive concept, an embodiment of the present invention provides an intelligent terminal, including a memory and a processor, wherein the memory stores a computer program that can be loaded by the processor and executes the method for restoring Protobuf format data as described above.

[0136] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, 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 process of the system, device and unit described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0137] 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 under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications 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.

2. The method for restoring Protobuf format data according to claim 1, characterized in that: 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.

3. The method for restoring Protobuf format data according to claim 2, 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.

4. The method for restoring Protobuf format data according to claim 3, 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.

5. The method for restoring Protobuf format data according to claim 4, 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.

6. The method for restoring Protobuf format data according to claim 2, 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.

7. The method for restoring Protobuf format data according to claim 6, 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.

8. The method for restoring Protobuf format data according to claim 7, 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.

9. 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 8; The processor loads and executes the program in the memory.

10. 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 8.

Citation Information

Patent Citations

  • HBASE database analysis method and system based on Protobuf protocol

    CN112925768A

  • Decoding processing method and device, computer equipment and storage medium

    CN115276889A

  • Improved encoding and decoding method and device based on Protobuf

    CN116880848A

  • USB data encryption transmission method

    CN117478310A

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

    CN117852524A

Cited By

  • Protobuf format data restoration method and system, and terminal

    WO2026188735A1