Heterogeneous data encoding, decoding method and device, computer equipment and storage medium

By converting heterogeneous data into an ordered mapping table structure and encoding processing, the problem of wasteful storage and low decoding performance of heterogeneous data encoding in the prior art is solved, and more efficient storage and decoding performance is achieved.

CN114238334BActive Publication Date: 2025-04-25SHANGHAI LIANYING ZHIYUAN MEDICAL TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111560125.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-20
Publication Date
2025-04-25
Estimated Expiration
2041-12-20

AI Technical Summary

Technical Problem

Existing heterogeneous data encoding methods have problems of storage waste and decoding performance losses, especially in systems based on the MPP big data analysis engine IMPALA.

Method used

By converting heterogeneous data into an ordered mapping table structure and encoding it, an encoded byte stream is generated. This method uses unique identification values ​​to map one by one, saving storage space and improving decoding performance.

Benefits of technology

Improves storage utilization and decoding performance, reduces storage waste, and improves data analysis efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114238334B_ABST
    Figure CN114238334B_ABST
Patent Text Reader

Abstract

This application relates to a method, apparatus, computer device, and storage medium for encoding and decoding heterogeneous data. The encoding method includes: acquiring heterogeneous data to be encoded; assigning a unique identifier value to each field in the heterogeneous data; converting the heterogeneous data into an ordered mapping table structure; and encoding the ordered mapping table structure to generate an encoded byte stream. The decoding method includes: generating a data table view of the heterogeneous data to be decoded based on the information of each field in the heterogeneous data to be decoded, and the mapping relationship between the field name and its corresponding unique identifier value; if the unique identifier value corresponding to each field can be found in the data table of the heterogeneous data to be decoded, decoding the heterogeneous data to be decoded to obtain the decoded data. This method can improve storage utilization and decoding performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of data structure, and in particular to a heterogeneous data encoding and decoding method, apparatus, computer equipment and storage medium. Background Art

[0002] In the system based on the MPP big data analysis engine IMPALA, a separate storage solution is generally adopted for heterogeneous data. Data with the same data organization form is stored in the same data table, or heterogeneous data is serialized into strings using JSON and stored in the same data table. When creating a data table in a general database, the data name and data type of each field need to be clearly specified. Although there is support for complex structure types such as MAP, its MAP field type generally does not support the use of generics. At the same time, if JSON string storage is used, there is a disadvantage of performance loss in decoding during data analysis.

[0003] The existing heterogeneous data is encoded and stored in JSON format strings, which results in a large storage waste and a large performance loss during decoding. Summary of the invention

[0004] Based on this, it is necessary to provide a heterogeneous data encoding, decoding method, device, computer equipment and storage medium that can improve storage utilization and decoding performance in response to the above technical problems.

[0005] A heterogeneous data encoding method, the method comprising:

[0006] Obtaining heterogeneous data to be encoded; each field in the heterogeneous data to be encoded is assigned a unique identification value;

[0007] Converting the to-be-encoded heterogeneous data into an ordered mapping table structure; the ordered mapping table structure includes a field value of each field and a unique identification value of each field, and the field name of each field and the unique identification value of each field are mapped one by one;

[0008] The ordered mapping table structure is encoded to generate an encoded byte stream.

[0009] In one embodiment, converting the to-be-encoded heterogeneous data into an ordered mapping table structure comprises:

[0010] Obtaining the field name of each field in the heterogeneous data to be encoded;

[0011] The field name of each field in the to-be-encoded heterogeneous data is matched one-to-one with the unique identification value of each field to obtain an ordered mapping table structure.

[0012] In one embodiment, encoding the ordered mapping table structure to generate an encoded byte stream includes:

[0013] Based on the ordered mapping table structure, generating an index area and data value information corresponding to the ordered mapping table structure; the index area includes a plurality of index records;

[0014] Based on the index area and data value information corresponding to the ordered mapping table structure, an encoded byte stream is generated.

[0015] In one embodiment, generating an encoded byte stream based on the index area and data value information corresponding to the ordered mapping table structure includes:

[0016] Merging the index area and data value information corresponding to the ordered mapping table structure to obtain merged data;

[0017] The combined data is used as an encoded byte stream.

[0018] A heterogeneous data decoding method, the method comprising:

[0019] Acquire field information of each field in the heterogeneous data to be decoded; the heterogeneous data to be decoded is an encoded byte stream; the field information includes a unique identification value of each field;

[0020] Generate a data table view of the heterogeneous data to be decoded based on the field information of each field in the heterogeneous data to be decoded and the mapping relationship between the field name of each field and its corresponding unique identification value;

[0021] If a unique identification value corresponding to each field can be obtained by searching in the data table of the heterogeneous data to be decoded, the heterogeneous data to be decoded is decoded to obtain decoded data.

[0022] In one embodiment, the decoding of the to-be-decoded heterogeneous data to obtain decoded data includes:

[0023] Obtaining index area and data value information corresponding to the heterogeneous data to be decoded;

[0024] Decoding is performed based on the index area and data value information corresponding to the heterogeneous data to be decoded to obtain decoded data.

[0025] In one embodiment, the decoding process is performed based on the index area and data value information corresponding to the heterogeneous data to be decoded, and the decoded data is obtained, including:

[0026] The unique identification value in the field information is searched in the index area. When the unique identification value is the same as the corresponding unique identification value in an index entry in the index area, the corresponding value can be obtained according to the data value information associated with the index entry.

[0027] A heterogeneous data encoding device, the device comprising:

[0028] A first acquisition module is used to acquire heterogeneous data to be encoded; each field in the heterogeneous data to be encoded is assigned a unique identification value;

[0029] A first generating module is used to convert the to-be-encoded heterogeneous data into an ordered mapping table structure; the ordered mapping table structure includes a field value of each field and a unique identification value of each field, and the field name of each field and the unique identification value of each field are mapped one by one;

[0030] The encoding module is used to encode the ordered mapping table structure to generate an encoded byte stream.

[0031] A heterogeneous data decoding device, the device comprising:

[0032] The second acquisition module is used to acquire field information of each field in the heterogeneous data to be decoded; the heterogeneous data to be decoded is an encoded byte stream; the field information includes a unique identification value of each field;

[0033] A second generating module is used to generate a data table view of the heterogeneous data to be decoded based on the field information of each field in the heterogeneous data to be decoded, and the mapping relationship between the field name of each field and its corresponding unique identification value;

[0034] The decoding module is used to decode the heterogeneous data to be decoded and obtain the decoded data when a unique identification value corresponding to each field can be queried in a data table of the heterogeneous data to be decoded.

[0035] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0036] Obtaining heterogeneous data to be encoded; each field in the heterogeneous data to be encoded is assigned a unique identification value;

[0037] Converting the to-be-encoded heterogeneous data into an ordered mapping table structure; the ordered mapping table structure includes a field value of each field and a unique identification value of each field, and the field name of each field and the unique identification value of each field are mapped one by one;

[0038] The ordered mapping table structure is encoded to generate an encoded byte stream.

[0039] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0040] Acquire field information of each field in the heterogeneous data to be decoded; the heterogeneous data to be decoded is an encoded byte stream; the field information includes a unique identification value of each field;

[0041] Generate a data table view of the heterogeneous data to be decoded based on the field information of each field in the heterogeneous data to be decoded and the mapping relationship between the field name of each field and its corresponding unique identification value;

[0042] If a unique identification value corresponding to each field can be obtained by searching in the data table of the heterogeneous data to be decoded, the heterogeneous data to be decoded is decoded to obtain decoded data.

[0043] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps:

[0044] Obtaining heterogeneous data to be encoded; each field in the heterogeneous data to be encoded is assigned a unique identification value;

[0045] Converting the to-be-encoded heterogeneous data into an ordered mapping table structure; the ordered mapping table structure includes a field value of each field and a unique identification value of each field, and the field name of each field and the unique identification value of each field are mapped one by one;

[0046] The ordered mapping table structure is encoded to generate an encoded byte stream.

[0047] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps:

[0048] Acquire field information of each field in the heterogeneous data to be decoded; the heterogeneous data to be decoded is an encoded byte stream; the field information includes a unique identification value of each field;

[0049] Generate a data table view of the heterogeneous data to be decoded based on the field information of each field in the heterogeneous data to be decoded and the mapping relationship between the field name of each field and its corresponding unique identification value;

[0050] If a unique identification value corresponding to each field can be obtained by searching in the data table of the heterogeneous data to be decoded, the heterogeneous data to be decoded is decoded to obtain decoded data.

[0051] The above-mentioned heterogeneous data encoding method, device, computer equipment and storage medium obtain heterogeneous data to be encoded, each field in the heterogeneous data to be encoded is assigned a unique identification value, and the heterogeneous data to be encoded is converted into an ordered mapping table structure. The ordered mapping table structure contains the field value of each field and the unique identification value of each field. The field name of each field and the unique identification value of each field are mapped one by one. The ordered mapping table structure is encoded to generate an encoded byte stream. By converting the heterogeneous data to be encoded into an ordered mapping table structure, storage space is saved and decoding performance is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] Figure 1 A diagram of an application environment of a heterogeneous data encoding and decoding method in one embodiment;

[0053] Figure 2 A schematic diagram of a flow chart of a heterogeneous data encoding method in one embodiment;

[0054] Figure 3 1 is a flow chart of a heterogeneous data decoding method according to an embodiment;

[0055] Figure 4 is a structural block diagram of a heterogeneous data encoding device in one embodiment;

[0056] Figure 5 is a structural block diagram of a heterogeneous data decoding device in one embodiment;

[0057] Figure 6 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0058] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0059] The heterogeneous data encoding and decoding method provided in this application can be applied to Figure 1 In the application environment shown, the terminal 102 communicates with the server 104 through a network. The terminal 102 may be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, and portable wearable devices, and the server 104 may be implemented as an independent server or a server cluster consisting of multiple servers.

[0060] In one embodiment, Figure 2 As shown, a heterogeneous data encoding method is provided, which is applied to Figure 1 The server in the example is used to illustrate the following steps:

[0061] Step 202, obtaining heterogeneous data to be encoded; each field in the heterogeneous data to be encoded is assigned a unique identification value.

[0062] Specifically, the heterogeneous data to be encoded contains no less than one field, and each field is assigned a unique identification value through the metadata management platform. The unique identification value is also called an id value in this embodiment; the id value is used to sort and store the fields in the heterogeneous data to be encoded, which facilitates the use of binary search for fast retrieval when retrieving specific fields of the heterogeneous data to be encoded; the metadata management platform assigns a unique identification value to each field, which is conducive to saving storage space.

[0063] Step 204, converting the to-be-encoded heterogeneous data into an ordered mapping table structure; the ordered mapping table structure includes the field value of each field and the unique identification value of each field, and the field name of each field and the unique identification value of each field are mapped one by one.

[0064] Specifically, the heterogeneous data to be encoded is converted into an ordered mapping table structure. This ordered mapping table can be a tree data structure implemented by a balanced binary tree. The ordered mapping table structure contains the field value of each field and the unique identification value of each field. The field name of each field and the unique identification value of each field are mapped one-to-one, that is, the heterogeneous data to be encoded is converted into mapping data in which the unique identification value of each field corresponds to the field name of each field, such as a TreeMap structure in which the unique identification value of each field corresponds to the field name of each field.

[0065] Step 206: Encode the ordered mapping table structure to generate an encoded byte stream.

[0066] Specifically, after obtaining the ordered mapping table structure, the ordered mapping table structure is encoded to generate an encoded byte stream; wherein the encoded data structure includes at least one of a modulus, an index rule, an index area, and data value information; the index area contains multiple index records; the modulus is used to mark the version number of the encoded data structure; each index record contains at least one of a field identification value, a length of the field value, and an offset of a storage location of the field value; the offset of the storage location of the field value is used to determine the position of the field.

[0067] In the above-mentioned heterogeneous data encoding method, heterogeneous data to be encoded are obtained, each field in the heterogeneous data to be encoded is assigned a unique identification value, and the heterogeneous data to be encoded are converted into an ordered mapping table structure, the ordered mapping table structure contains the field value of each field and the unique identification value of each field, the field name of each field and the unique identification value of each field are mapped one by one, the ordered mapping table structure is encoded, and an encoded byte stream is generated. By converting the heterogeneous data to be encoded into an ordered mapping table structure, storage space is saved and decoding performance is improved.

[0068] In one embodiment, converting the to-be-encoded heterogeneous data into an ordered mapping table structure comprises:

[0069] Obtaining the field name of each field in the heterogeneous data to be encoded;

[0070] The field name of each field in the to-be-encoded heterogeneous data is matched one-to-one with the unique identification value of each field to obtain an ordered mapping table structure.

[0071] Specifically, when converting the heterogeneous data to be encoded into an ordered mapping table structure, first obtain the field name of each field in the heterogeneous data to be encoded, such as age, name, etc. When age = 28, age is the field name, and 28 is the field value corresponding to the field; then, map the field name of each field in the data to be encoded to the unique identification value of the field one by one, so that the original field name and field value can be converted into an ordered mapping table of the field unique identification id and the field value.

[0072] In this embodiment, the field name of each field in the to-be-encoded heterogeneous data is obtained, and each field name in the to-be-encoded heterogeneous data is mapped one by one to a unique identification value corresponding to the field, thereby converting the original heterogeneous data into an ordered mapping table structure of field unique identification values ​​and field values, wherein the field name and the unique identification value of the field are stored in a metadata platform, so that when the encoded data is decoded, it has the advantages of fast decoding speed and maintaining its original field name.

[0073] In one embodiment, encoding the ordered mapping table structure to generate an encoded byte stream includes:

[0074] Based on the ordered mapping table structure, generating an index area and data value information corresponding to the ordered mapping table structure; the index area includes a plurality of index records;

[0075] Based on the index area and data value information corresponding to the ordered mapping table structure, an encoded byte stream is generated.

[0076] Specifically, when encoding the ordered mapping table, based on the ordered mapping table structure, the index area and data value information corresponding to the ordered mapping table structure are generated; according to the index area and data value information corresponding to the ordered mapping table structure, the encoded data structure is generated. The encoded data structure includes at least one of a modulus, an index rule, an index area, and data value information; wherein the modulus is equivalent to the version number of the encoded data structure, which is used for updating, and the modulus is not required when the encoded data structure does not need to be updated. The index area contains multiple index records, wherein each index record contains at least one of a field identification value, a length of the field value, and an offset of a storage location of the field value, and the offset of the storage location of the field value is used to determine the location of the field.

[0077] In this embodiment, based on the ordered mapping table structure, the index area and data value information corresponding to the ordered mapping table structure are generated, and based on the index area and data value information corresponding to the ordered mapping table structure, the encoded byte stream is generated. By encoding the index area and data value information of the ordered mapping table structure, the storage space occupied by the heterogeneous data to be encoded is reduced, and the decoding performance can be improved.

[0078] In one embodiment, generating an encoded byte stream based on the index area and data value information corresponding to the ordered mapping table structure includes:

[0079] Merging the index area and data value information corresponding to the ordered mapping table structure to obtain merged data;

[0080] The combined data is used as an encoded byte stream.

[0081] Specifically, when encoding according to the index area and data value information corresponding to the ordered mapping table structure, the index area and data value information corresponding to the ordered mapping table structure are merged to obtain the merged data, and the merged data is used as an encoded byte stream, and the encoded byte stream contains the index area and data value information.

[0082] In this embodiment, the index area and data value information corresponding to the ordered mapping table structure are merged and processed, and the merged data is obtained as the encoded byte stream. By merging the index area and the data value information, encoding of the heterogeneous data to be encoded is achieved, the storage space occupied by the heterogeneous data to be encoded is reduced, and the decoding performance can be improved.

[0083] In one embodiment, Figure 3 As shown, a heterogeneous data decoding method is provided, which is applied to Figure 1 The server in the example is used to illustrate the following steps:

[0084] Step 302, obtaining field information of each field in the heterogeneous data to be decoded; the heterogeneous data to be decoded is an encoded byte stream; the field information includes a unique identification value of each field.

[0085] Specifically, decoding the encoded byte stream first requires obtaining the field information of each field in the heterogeneous data to be decoded, and the field information of each field can be obtained by querying the metadata management platform; the field information here includes the field identification value (the field name can be obtained through the mapping relationship between the field name and the field's unique identification value), the field type and the field name. Among them, the heterogeneous data to be decoded contains no less than one field, and each field contains a unique identification value assigned by the metadata management platform. The unique identification value is also called an id value in this embodiment; the id value is used to sort and store each field in the heterogeneous data to be decoded, and it is convenient to use binary search for fast retrieval when retrieving specific fields of the heterogeneous data to be decoded.

[0086] Step 304 : Generate a data table view of the heterogeneous data to be decoded based on the field information of each field in the heterogeneous data to be decoded and the mapping relationship between the field name of each field and its corresponding unique identification value.

[0087] Specifically, a data table view of the heterogeneous data to be decoded is generated based on the information of each field in the heterogeneous data to be decoded, and the mapping relationship between each field and its corresponding unique identification value; wherein the data table view is a logical table that can be queried and analyzed using SQL syntax.

[0088] Step 306: If the unique identification value corresponding to each field can be queried in the data table of the heterogeneous data to be decoded, the heterogeneous data to be decoded is decoded to obtain decoded data.

[0089] Specifically, the query is performed based on the unique identification value of the field to be queried. If the unique identification value corresponding to each field can be queried in the data table view of the heterogeneous data to be decoded, the heterogeneous data to be decoded is decoded according to the unique identification value of each field to obtain the field value corresponding to the unique identification value, that is, the decoded data.

[0090] In this embodiment, field information of each field in the heterogeneous data to be decoded is obtained, and a data table view of the heterogeneous data to be decoded is generated based on the information of each field in the heterogeneous data to be decoded and the mapping relationship between each field and its corresponding unique identification value. When the unique identification value corresponding to each field can be queried in the data table of the heterogeneous data to be decoded, the heterogeneous data to be decoded is decoded to obtain the decoded data. The decoded fields are obtained by constructing a data table view of the heterogeneous data to be decoded, thereby improving the decoding efficiency.

[0091] In one embodiment, the decoding process of the to-be-decoded heterogeneous data to obtain decoded data includes:

[0092] Obtaining index area and data value information corresponding to the heterogeneous data to be decoded;

[0093] Decoding is performed based on the index area and data value information corresponding to the heterogeneous data to be decoded to obtain decoded data.

[0094] Specifically, a traversal query is performed based on the unique identification value, and based on the index area corresponding to the heterogeneous data to be decoded, multiple index records in the index area are obtained. When the unique identification value is matched in the index record in the index area, the offset of the field value storage location is obtained, and the position of the field is determined by the offset of the field value storage location to obtain the decoded data value.

[0095] In this embodiment, the index area and data value information corresponding to the heterogeneous data to be decoded are obtained, decoding processing is performed based on the index area and data value information corresponding to the heterogeneous data to be decoded, and the decoded data is obtained. By querying and matching the unique identification value in the index area, fast decoding of the encoded data is achieved, thereby improving the decoding rate.

[0096] In one embodiment, performing decoding processing based on the index area and data value information corresponding to the heterogeneous data to be decoded to obtain the decoded data includes:

[0097] The unique identification value in the field information is searched in the index area. When the unique identification value is the same as the corresponding unique identification value in an index entry in the index area, the corresponding value can be obtained according to the data value information associated with the index entry.

[0098] Specifically, an index record is obtained from the index area, and a search is performed in the index area according to the unique identification value of the field information. When the unique identification value is the same as the unique identification value in a certain index entry in the index area, the value corresponding to the keyword is obtained according to the data value information as the decoded data. When searching in the index area according to the unique identification value of the field information, a search can be performed by binary search to determine whether the unique identification values ​​are the same. If they are the same, the field value corresponding to the unique identification value is obtained, and then the value corresponding to the keyword is obtained as the decoded data. If the unique identification values ​​are different, determine whether the unique identification value is greater than the unique identification value in the middle index record within the index range. If it is greater, continue to search from the index area after the middle index entry until the unique identification values ​​are the same; similarly, if it is less, continue to search from the index area before the middle index entry until the unique identification values ​​are the same, and obtain the value corresponding to the same unique identification value as the decoded data.

[0099] In this embodiment, index records are obtained based on the index area, and a search is performed in the index area according to the unique identification value in the field information. When the unique identification value is the same as the unique identification value in an index entry in the index area, the value corresponding to the keyword is obtained as the decoded data according to the data value information, and the unique identification value is matched through binary search, thereby improving the matching efficiency of the unique identification value and the decoding rate.

[0100] It should be understood that although Figure 2-3 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 2-3 At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.

[0101] In one embodiment, Figure 4 As shown, a heterogeneous data encoding device is provided, including: a first acquisition module 401, a first generation module 402 and an encoding module 403, wherein:

[0102] The first acquisition module 401 is used to acquire heterogeneous data to be encoded; each field in the heterogeneous data to be encoded is assigned a unique identification value;

[0103] The first generating module 402 is used to convert the to-be-encoded heterogeneous data into an ordered mapping table structure; the ordered mapping table structure includes a field value of each field and a unique identification value of each field, and the field name of each field and the unique identification value of each field are mapped one by one;

[0104] The encoding module 403 is used to encode the ordered mapping table structure to generate an encoded byte stream.

[0105] In one embodiment, the first generating module 402 is specifically used for:

[0106] Obtaining the field name of each field in the heterogeneous data to be encoded;

[0107] Map each field name to the unique identification value of the field;

[0108] The association between the field name and the field value is converted into an association between a unique identification value and the field value, and an ordered mapping table structure that needs to be encoded is obtained.

[0109] In one embodiment, the encoding module 403 is specifically used for:

[0110] Based on the ordered mapping table structure, generating an index area and data value information corresponding to the ordered mapping table structure; the index area includes a plurality of index records;

[0111] Based on the index area and data value information corresponding to the ordered mapping table structure, an encoded byte stream is generated.

[0112] In one embodiment, the encoding module 403 is specifically used for:

[0113] Merging the index area and data value information corresponding to the ordered mapping table structure to obtain merged data;

[0114] The combined data is used as an encoded byte stream.

[0115] The above-mentioned heterogeneous data encoding device obtains heterogeneous data to be encoded, each field in the heterogeneous data to be encoded is assigned a unique identification value, and converts the heterogeneous data to be encoded into an ordered mapping table structure. The ordered mapping table structure contains the field value of each field and the unique identification value of each field. The field name of each field and the unique identification value of each field are mapped one by one. The ordered mapping table structure is encoded to generate an encoded byte stream. By converting the heterogeneous data to be encoded into an ordered mapping table structure, storage space is saved and decoding performance is improved.

[0116] In one embodiment, Figure 5 As shown, a heterogeneous data encoding device is provided, including: a second acquisition module 501, a second generation module 502 and a decoding module 503, wherein:

[0117] The second acquisition module 501 is used to acquire field information of each field in the heterogeneous data to be decoded; the heterogeneous data to be decoded is an encoded byte stream; the field information includes a unique identification value of each field;

[0118] The second generating module 502 is used to generate a data table view of the heterogeneous data to be decoded based on the field information of each field in the heterogeneous data to be decoded, and the mapping relationship between the field name of each field and its corresponding unique identification value;

[0119] The decoding module 503 is used to decode the heterogeneous data to be decoded to obtain decoded data when a unique identification value corresponding to each field can be queried in the data table of the heterogeneous data to be decoded.

[0120] In one embodiment, the decoding module 503 is specifically used for:

[0121] Obtaining index area and data value information corresponding to the heterogeneous data to be decoded;

[0122] Decoding is performed based on the index area and data value information corresponding to the heterogeneous data to be decoded to obtain decoded data.

[0123] In one embodiment, the decoding module 503 is further specifically configured to:

[0124] The unique identification value in the field information is searched in the index area. When the unique identification value is the same as the corresponding unique identification value in an index entry in the index area, the corresponding value can be obtained according to the data value information associated with the index entry.

[0125] The above-mentioned heterogeneous data decoding device obtains field information of each field in the heterogeneous data to be decoded, and generates a data table view of the heterogeneous data to be decoded based on the information of each field in the heterogeneous data to be decoded and the mapping relationship between the field name of each field and its corresponding unique identification value. When the unique identification value corresponding to each field can be queried in the data table of the heterogeneous data to be decoded, the heterogeneous data to be decoded is decoded to obtain the decoded data. The decoded fields are obtained by constructing a data table view of the heterogeneous data to be decoded, thereby improving the decoding efficiency.

[0126] For the specific definition of the heterogeneous data encoding and decoding device, please refer to the definition of the heterogeneous data encoding and decoding method above, which will not be repeated here. Each module in the above-mentioned heterogeneous data encoding and decoding device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0127] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 6 As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a heterogeneous data encoding and decoding method is implemented.

[0128] Those skilled in the art will understand that Figure 6The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0129] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0130] Obtaining heterogeneous data to be encoded; each field in the heterogeneous data to be encoded is assigned a unique identification value;

[0131] Converting the to-be-encoded heterogeneous data into an ordered mapping table structure; the ordered mapping table structure includes a field value of each field and a unique identification value of each field, and the field name of each field and the unique identification value of each field are mapped one by one;

[0132] The ordered mapping table structure is encoded to generate an encoded byte stream.

[0133] In one embodiment, when the processor executes the computer program, the following steps are further implemented: obtaining the field name of each field in the heterogeneous data to be encoded;

[0134] The field name of each field in the to-be-encoded heterogeneous data is matched one-to-one with the unique identification value of each field to obtain an ordered mapping table structure.

[0135] In one embodiment, when the processor executes the computer program, the following steps are further implemented: based on the ordered mapping table structure, generating an index area and data value information corresponding to the ordered mapping table structure; the index area includes a plurality of index records;

[0136] Based on the index area and data value information corresponding to the ordered mapping table structure, an encoded byte stream is generated.

[0137] In one embodiment, when the processor executes the computer program, the following steps are further implemented: merging the index area and data value information corresponding to the ordered mapping table structure to obtain merged data;

[0138] The combined data is used as an encoded byte stream.

[0139] In one embodiment, when the processor executes the computer program, the following steps are further implemented: obtaining field information of each field in the heterogeneous data to be decoded; the heterogeneous data to be decoded is an encoded byte stream; the field information includes a unique identification value of each field;

[0140] Generate a data table view of the heterogeneous data to be decoded based on the field information of each field in the heterogeneous data to be decoded and the mapping relationship between the field name of each field and its corresponding unique identification value;

[0141] If a unique identification value corresponding to each field can be obtained by searching in the data table of the heterogeneous data to be decoded, the heterogeneous data to be decoded is decoded to obtain decoded data.

[0142] In one embodiment, when the processor executes the computer program, the following steps are further implemented: obtaining the index area and data value information corresponding to the heterogeneous data to be decoded;

[0143] Decoding is performed based on the index area and data value information corresponding to the heterogeneous data to be decoded to obtain decoded data.

[0144] In one embodiment, when the processor executes the computer program, the following steps are also implemented: searching in the index area according to the unique identification value in the field information, and when the unique identification value is the same as the corresponding unique identification value in an index entry in the index area, the corresponding value can be obtained according to the data value information associated with the index entry.

[0145] The above-mentioned computer device obtains heterogeneous data to be encoded, each field in the heterogeneous data to be encoded is assigned a unique identification value, and converts the heterogeneous data to be encoded into an ordered mapping table structure. The ordered mapping table structure contains the field value of each field and the unique identification value of each field. The field name of each field and the unique identification value of each field are mapped one by one. The ordered mapping table structure is encoded to generate an encoded byte stream. By converting the heterogeneous data to be encoded into an ordered mapping table structure, storage space is saved and decoding performance is improved.

[0146] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0147] Obtaining heterogeneous data to be encoded; each field in the heterogeneous data to be encoded is assigned a unique identification value;

[0148] Converting the to-be-encoded heterogeneous data into an ordered mapping table structure; the ordered mapping table structure includes a field value of each field and a unique identification value of each field, and the field name of each field and the unique identification value of each field are mapped one by one;

[0149] The ordered mapping table structure is encoded to generate an encoded byte stream.

[0150] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: obtaining the field name of each field in the heterogeneous data to be encoded;

[0151] The field name of each field in the to-be-encoded heterogeneous data is matched one-to-one with the unique identification value of each field to obtain an ordered mapping table structure.

[0152] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: based on the ordered mapping table structure, generating an index area and data value information corresponding to the ordered mapping table structure; the index area includes a plurality of index records;

[0153] Based on the index area and data value information corresponding to the ordered mapping table structure, an encoded byte stream is generated.

[0154] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: merging the index area and data value information corresponding to the ordered mapping table structure to obtain merged data;

[0155] The combined data is used as an encoded byte stream.

[0156] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: obtaining field information of each field in the heterogeneous data to be decoded; the heterogeneous data to be decoded is an encoded byte stream; the field information includes a unique identification value of each field;

[0157] Generate a data table view of the heterogeneous data to be decoded based on the field information of each field in the heterogeneous data to be decoded and the mapping relationship between the field name of each field and its corresponding unique identification value;

[0158] If a unique identification value corresponding to each field can be obtained by searching in the data table of the heterogeneous data to be decoded, the heterogeneous data to be decoded is decoded to obtain decoded data.

[0159] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: obtaining the index area and data value information corresponding to the heterogeneous data to be decoded;

[0160] Decoding is performed based on the index area and data value information corresponding to the heterogeneous data to be decoded to obtain decoded data.

[0161] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: searching in the index area according to the unique identification value in the field information, and when the unique identification value is the same as the corresponding unique identification value in an index entry in the index area, the corresponding value can be obtained according to the data value information associated with the index entry.

[0162] The above-mentioned storage medium obtains heterogeneous data to be encoded, each field in the heterogeneous data to be encoded is assigned a unique identification value, and the heterogeneous data to be encoded is converted into an ordered mapping table structure. The ordered mapping table structure contains the field value of each field and the unique identification value of each field. The field name of each field and the unique identification value of each field are mapped one by one. The ordered mapping table structure is encoded to generate an encoded byte stream. By converting the heterogeneous data to be encoded into an ordered mapping table structure, storage space is saved and decoding performance is improved.

[0163] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0164] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0165] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A heterogeneous data encoding method, characterized in that: The method comprises: Obtaining heterogeneous data to be encoded; each field in the heterogeneous data to be encoded is assigned a unique identification value; Converting the to-be-encoded heterogeneous data into an ordered mapping table structure; the ordered mapping table structure includes a field value of each field and a unique identification value of each field, and the field name of each field and the unique identification value of each field are mapped one by one; The ordered mapping table structure is encoded to generate an encoded byte stream; the encoded byte stream includes an index area and data value information.

2. The method according to claim 1, characterized in that The encoding process of the ordered mapping table structure to generate an encoded byte stream comprises: Based on the ordered mapping table structure, generating an index area and data value information corresponding to the ordered mapping table structure; the index area includes a plurality of index records; Based on the index area and data value information corresponding to the ordered mapping table structure, an encoded byte stream is generated.

3. The method according to claim 2, characterized in that The generating the encoded byte stream based on the index area and data value information corresponding to the ordered mapping table structure comprises: Merging the index area and data value information corresponding to the ordered mapping table structure to obtain merged data; The combined data is used as an encoded byte stream.

4. A heterogeneous data decoding method, characterized in that: The method comprises: Acquire field information of each field in the heterogeneous data to be decoded; the heterogeneous data to be decoded is an encoded byte stream; the field information includes a unique identification value of each field; the encoded byte stream includes an index area and data value information; Generate a data table view of the heterogeneous data to be decoded based on the field information of each field in the heterogeneous data to be decoded and the mapping relationship between the field name of each field and its corresponding unique identification value; If a unique identification value corresponding to each field can be queried in the data table view of the heterogeneous data to be decoded, the heterogeneous data to be decoded is decoded to obtain decoded data.

5. The method according to claim 4, characterized in that The decoding process of the to-be-decoded heterogeneous data to obtain decoded data comprises: Obtaining index area and data value information corresponding to the heterogeneous data to be decoded; Decoding is performed based on the index area and data value information corresponding to the heterogeneous data to be decoded to obtain decoded data.

6. The method according to claim 5, characterized in that The decoding process is performed based on the index area and data value information corresponding to the heterogeneous data to be decoded, and the decoded data is obtained, comprising: The unique identification value in the field information is searched in the index area. When the unique identification value is the same as the corresponding unique identification value in an index entry in the index area, the corresponding value can be obtained according to the data value information associated with the index entry.

7. A heterogeneous data encoding device, characterized in that: The device comprises: A first acquisition module is used to acquire heterogeneous data to be encoded; each field in the heterogeneous data to be encoded is assigned a unique identification value; A first generating module is used to convert the to-be-encoded heterogeneous data into an ordered mapping table structure; the ordered mapping table structure includes a field value of each field and a unique identification value of each field, and the field name of each field and the unique identification value of each field are mapped one by one; The encoding module is used to encode the ordered mapping table structure to generate an encoded byte stream; the encoded byte stream includes an index area and data value information.

8. A heterogeneous data decoding device, characterized in that: The device comprises: The second acquisition module is used to acquire field information of each field in the heterogeneous data to be decoded; the heterogeneous data to be decoded is an encoded byte stream; the field information includes a unique identification value of each field; the encoded byte stream includes an index area and data value information; A second generating module is used to generate a data table view of the heterogeneous data to be decoded based on the field information of each field in the heterogeneous data to be decoded, and the mapping relationship between the field name of each field and its corresponding unique identification value; The decoding module is used to decode the heterogeneous data to be decoded and obtain the decoded data when a unique identification value corresponding to each field can be queried in the data table view of the heterogeneous data to be decoded.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Data storage method and device

    CN106815267A

  • Binary protocol encoding and decoding method and apparatus

    CN109104405A