Data storage method, device, equipment and storage medium based on metadata
By analyzing the historical storage data of the Bureau of Statistics, building storage templates and splitting the data, the problem of huge data volume in metadata management is solved, the data management needs of the Bureau of Statistics are realized, the complexity of the data volume is reduced and the management efficiency is improved. .
Patent Information
- Application Number
- CN202311297678.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-09
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2043-10-09
AI Technical Summary
When managing statistical data through metadata management methods in the prior art, the amount of data is too large and complex to meet the data management needs of the Bureau of Statistics.
By obtaining the historical storage data of the Bureau of Statistics, we analyze the business indicators, build a storage template, split the data to be stored according to the business indicators, and store the split data in the corresponding storage template to achieve effective management of statistical data.
It reduces the complexity of the data to be stored, improves the convenience and efficiency of data management, and meets the data management needs of the Bureau of Statistics.
Smart Images

Figure CN117312319B
Abstract
Description
Technical Field
[0001] The present application relates to the field of data management statistics, and in particular to a metadata-based data storage method, device, equipment and storage medium. Background Art
[0002] With the advancement of informatization within the Statistics Bureau, the current Statistics Bureau has implemented multiple informatization projects, each of which stores a large amount of statistical data. Since there are multiple independent business systems within the Statistics Bureau, statistical data are scattered and stored in various business systems, and the indicator calibers corresponding to the statistical data stored by different business systems have various specifications, which makes the statistical data stored in multiple subsystems form information islands, and the statistical data stored between different subsystems are difficult to share. In the prior art, the data is stored by establishing metadata for management, thereby meeting the data sharing needs between different subsystems within the Statistics Bureau.
[0003] The metadata management methods disclosed in the prior art include: data discovery, data catalog, data dictionary, data search and discovery, and data lineage analysis functions.
[0004] Since the statistical data stored in the Statistics Bureau have strong industry attributes and different schemes emphasize different focuses, the amount of data used to manage statistical data using the metadata management methods disclosed in the prior art is too large to meet the data management needs of the Statistics Bureau. Summary of the invention
[0005] The main purpose of this application is to provide a metadata-based data storage method, device, equipment and storage medium, aiming to solve the technical problem that when managing statistical data through the metadata management method disclosed in the prior art, the amount of data is too large and complex to meet the data management needs of the Statistics Bureau.
[0006] To achieve the above object, the present application provides a metadata-based data storage method, the data storage method comprising the following steps:
[0007] Obtain statistical historical storage data and determine the corresponding business indicators;
[0008] Based on the business indicators, construct multiple storage templates for storing actual data;
[0009] Splitting the data to be stored based on the storage template, and obtaining the classification type and storage data corresponding to the data to be stored;
[0010] The classification type of the data to be stored and the storage data are converted to generate a storage template for storing the data, and the object is stored in the storage template.
[0011] Optionally, the step of constructing a plurality of storage templates for storing actual data based on the acquired business indicators includes:
[0012] Based on the business indicator, obtaining indicator classification categories and category attribute data;
[0013] Based on the indicator classification categories and category attribute data, multiple storage templates are constructed.
[0014] Optionally, the plurality of storage templates include: a data storage table and a category storage table;
[0015] Among them, the data storage table is configured to store category attribute data, and the data storage table includes a metadata data table; the category storage table is configured to store indicator classification categories, and the category storage table includes: a metadata indicator code table, a directory indicator table, a grouping indicator table and / or a combination indicator table.
[0016] Optionally, the step of splitting the data to be stored based on the constructed storage template includes:
[0017] Get the data to be stored and determine the corresponding data type;
[0018] When the data type of the data to be stored is single-index data, the data to be stored is split based on the constructed storage template.
[0019] Optionally, the step of splitting the data to be stored based on the constructed storage template further includes:
[0020] When the acquired data to be stored is grouped index data, a combination structure corresponding to the data to be stored is acquired, and the data to be stored is split into single index data according to the combination structure, and then the data to be stored is split based on the constructed storage template.
[0021] Optionally, the step of converting the classification type of the data to be stored and the storage data to generate a storage template for storing the data includes:
[0022] Obtaining the classification type and the stored data, and converting the classification type and the stored data into data codes;
[0023] Transcoding the data code to generate a database primary key;
[0024] The database primary key is combined to generate an object for storage in the storage template.
[0025] Optionally, the step of transcoding the data encoding to generate a database primary key includes:
[0026] The data encoding is processed by UUID generation or distributed Snowflake ID generation to generate a database primary key.
[0027] In addition, to achieve the above-mentioned purpose, the present application also provides a metadata-based data storage device, the data storage device comprising:
[0028] The indicator acquisition module is configured to acquire statistical historical storage data and determine corresponding business indicators;
[0029] A template building module is configured to build a plurality of storage templates for storing actual data based on the acquired business indicators;
[0030] A data splitting module is configured to split the data to be stored based on the constructed storage template, and obtain the classification type and storage data corresponding to the data to be stored;
[0031] The data storage module is configured to convert the classification type of the data to be stored and the storage data, generate a template for storing the data in the storage template, and store the object in the storage template.
[0032] In addition, to achieve the above-mentioned purpose, the present application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are performed:
[0033] Obtain statistical historical storage data and determine the corresponding business indicators;
[0034] Based on the business indicators, construct multiple storage templates for storing actual data;
[0035] Splitting the data to be stored based on the storage template, and obtaining the classification type and storage data corresponding to the data to be stored;
[0036] The classification type of the data to be stored and the storage data are converted to generate a storage template for storing the data, and the object is stored in the storage template.
[0037] In addition, to achieve the above-mentioned purpose, the present application also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0038] Obtain statistical historical storage data and determine the corresponding business indicators;
[0039] Based on the business indicators, construct multiple storage templates for storing actual data;
[0040] Splitting the data to be stored based on the storage template, and obtaining the classification type and storage data corresponding to the data to be stored;
[0041] The classification type of the data to be stored and the storage data are converted to generate a storage template for storing the data, and the object is stored in the storage template.
[0042] The beneficial effects that can be achieved by this application.
[0043] The embodiments of the present application propose a metadata-based data storage method, device, equipment and storage medium. The method provided by the present application obtains business indicators that can characterize the content of statistical data by analyzing historical storage data counted by the Statistics Bureau, and then builds a storage template based on the obtained business indicators; at the same time, each data to be stored is separately split according to the obtained business indicators, and then the split data to be stored is stored in the corresponding storage template; since the data to be stored is split according to the business indicators, it is convenient to screen out the complex objective expressions of the data to be stored, and thus to a certain extent, the probability of a large amount of data to be stored can be reduced; at the same time, the split statistical data is added to the storage template, and the acquired statistical data is managed, thereby achieving the purpose of meeting the data management needs of the Statistics Bureau. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 A schematic diagram of a data storage method based on metadata according to an embodiment of the present application;
[0045] Figure 2 A schematic diagram of a flow chart of a metadata-based data storage method according to another embodiment of the present application;
[0046] Figure 3 Schematic diagram of the functional modules of the metadata-based data storage device according to an embodiment of the present application.
[0047] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0048] 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.
[0049] The main solution of the embodiment of the present application is: by acquiring the historical storage data counted by the Statistics Bureau, the business indicators that can characterize the content of the statistical data are analyzed, and then a storage template is constructed according to the acquired business indicators; at the same time, each data to be stored is separately split according to the acquired business indicators, and then the split data to be stored is stored in the corresponding storage template; since the data to be stored is split according to the business indicators, it is convenient to screen out the complicated objective description of the data to be stored, and thus to a certain extent, the probability of a large amount of data to be stored can be reduced; at the same time, the split statistical data is added to the storage template, and the acquired statistical data is managed, so as to achieve the purpose of meeting the data management needs of the Statistics Bureau.
[0050] The metadata management methods disclosed in the prior art include: data discovery, data catalog, data dictionary, data search and discovery, and data lineage analysis functions. However, since the statistical data stored in the Statistics Bureau has strong industry attributes and different schemes emphasize different focuses, the amount of data used to manage statistical data using the metadata management methods disclosed in the prior art is too large and complex to meet the data management needs of the Statistics Bureau.
[0051] The present application provides a solution, which enables the business indicators that can characterize the content of the statistical data to be obtained by analyzing the historical storage data collected by the Statistics Bureau, and then constructing a storage template based on the obtained business indicators; at the same time, each data to be stored is separately split according to the obtained business indicators, and then the split data to be stored is stored in the corresponding storage template; since the data to be stored is split according to the business indicators, it is convenient to screen out the complicated objective descriptions of the data to be stored, and thus to a certain extent, the probability of a large amount of data to be stored can be reduced; at the same time, the split statistical data is added to the storage template, and then the acquired statistical data is managed, so as to achieve the purpose of meeting the data management needs of the Statistics Bureau.
[0052] Reference Figure 1 The present application first provides a metadata-based data storage method. The data storage method provided by the present application includes: step S10, step S20, step S30 and step S40.
[0053] Step S10, obtaining statistical historical storage data and determining corresponding business indicators.
[0054] In the specific implementation process, the historical storage data is the statistical data corresponding to different fields recorded by the Statistics Bureau in the course of its work over the years, which is used to screen and obtain important business indicators in the corresponding fields. The historical storage data in this embodiment is the data counted by the Statistics Bureau. Since the Statistics Bureau has multiple subsystems, and the business indicators corresponding to the historical data counted in different subsystems are different, it is necessary to perform analysis based on the historical storage data obtained by the Statistics Bureau, so as to obtain the business indicator data corresponding to the historical storage data, and build a business indicator library through the obtained business indicators, so as to facilitate the subsequent splitting of the data to be split in the business indicator library, thereby achieving the purpose of reducing the redundancy of actual data.
[0055] Exemplarily, the historical storage data is data in the economic field, and the business indicators are the basic attributes of the actual valid data in the economic field, specifically including time, region, indicator, unit and data attributes; when the Statistics Bureau processes the data storage corresponding to the economic field, it is split based on the main basic attributes of the business data storage. The basic attributes of the corresponding data in the economic field include time, region, indicator, unit and data attributes, so as to facilitate the subsequent splitting of the corresponding economic field data based on the basic attributes, thereby greatly reducing the length of the actual data and improving the convenience of extracting valid attributes in the actual data.
[0056] Step S20: construct multiple storage templates for storing actual data based on the acquired business indicators.
[0057] In the specific implementation process, the storage template is used to store the split data to be stored. By constructing a storage template corresponding to the obtained business indicators, the convenience of data management can be improved. Obtaining economic field data corresponding to statistical data can facilitate the construction of storage templates for users to store actual data to a certain extent, so that the data to be stored can be split and added to the corresponding storage template, thereby achieving the purpose of storing actual data. At the same time, by constructing storage templates, the efficiency of data management can be improved.
[0058] Exemplarily, based on the acquired business indicators, a business indicator set can be constructed. The business indicator set is also called a business indicator library. By constructing a storage module based on the business indicators in the business indicator library, the corresponding data can be split and managed through the storage module. This can improve the convenience of managing the actual data to a certain extent, and can also reduce the complexity of storing the actual data, thereby facilitating the management of actual statistical data within the Statistics Bureau.
[0059] Step S30: Separately split each data to be stored based on the constructed storage template, and obtain the classification type and storage data corresponding to each data to be stored.
[0060] By statistically analyzing the business indicators corresponding to the historical storage data and splitting the data to be stored according to the business indicators, the actual data to be stored can be split into multiple classification types and storage data containing only basic attributes, thereby greatly reducing the amount of memory occupied by the data to be stored and improving the efficiency of managing the data to be stored.
[0061] Step S40, converting the acquired classification type and storage data, generating a storage template for storing the object, and storing the object in the storage template.
[0062] By splitting the data to be stored into classification types and storage data, and then storing the generated objects into storage templates, the convenience of managing data can be improved. This can not only manage the indicators of statistical data based on a unified standard format, but also improve the convenience of managing actual data.
[0063] The present application analyzes the historical storage data collected by the Statistics Bureau to obtain business indicators that can characterize the content of the statistical data, and then constructs a storage template based on the obtained business indicators; at the same time, each data to be stored is split separately according to the obtained business indicators, and then the split data to be stored is stored in the corresponding storage template; since the data to be stored is split according to the business indicators, it is convenient to screen out the complex objective descriptions of the data to be stored, and thus to a certain extent, the probability of a large amount of data to be stored can be reduced; at the same time, the split statistical data is added to the storage template, which is convenient for managing the acquired statistical data, thereby meeting the data management needs of the Statistics Bureau; at the same time, the business indicators related to the data to be stored are obtained to achieve the purpose of reducing the amount of data to be stored; the present application can not only facilitate the management of data, but also reduce the probability of omissions in the data storage process.
[0064] As an optional implementation, based on the above Figure 1 In the embodiment shown, in order to further simplify the management of the data to be stored, when executing the step of constructing multiple storage templates for storing actual data based on the acquired business indicators, the data storage method provided by the present application includes: obtaining indicator classification categories and category attribute data based on the acquired business indicators; and constructing multiple storage templates based on the indicator classification categories and category attribute data.
[0065] By obtaining indicator classification categories and category attribute data based on the acquired business indicators, and then building a storage template according to the category attribute data, the efficiency of splitting the actual data based on business indicators can be greatly improved. By adding the split data to the storage module to build an actual table for counting the data to be stored, the convenience of managing the actual data is improved.
[0066] As an optional implementation, the construction of multiple storage templates includes: a data storage table and a category storage table; wherein the data storage table is configured to store category attribute data, and the data storage table includes a metadata data table; the category storage table is configured to store indicator classification categories, and the category storage table includes: a metadata indicator code table, a directory indicator table, a grouping indicator table and / or a combination indicator table.
[0067] The metadata data table includes column names, types and comments. The column names include: MACRODATAID, COMBINEID, YEAR, MONTH, TIMEFRAMECODE, UNITCODE, INDCTATTR, DATA, OPERUSERID, OPERDATE, MODIFYUSERID and MODIFYDATE; the types include string and time; the comments include: primary key, combined indicator ID, year, month, time type code, unit, data attribute, data, operator, operation time, modifier, modification time. The constructed metadata data table is shown in Table 1.
[0068] Table 1 Metadata data table
[0069]
[0070] The metadata indicator code table includes column names, types and comments. The column names include: INDCTID, INDCTNAME, INDCTCODE, INDCTTYPE, UNITCODE, INDCTEXPLAN, FILLEXPLAIN, STATUS, DATATYPE, OPERUSERID, OPERDATE, MODIFYUSERID and MODIFYDATE; the types include string and time; the comments include: primary key, indicator name, indicator code, indicator type, unit code, indicator explanation, filling instructions, enablement status, data type, operator, operation time, modifier and modification time. The constructed metadata indicator code table is shown in Table 2.
[0071] Table 2 Metadata indicator code table
[0072]
[0073] The directory index table includes column names, types and comments. The column names include: CATALOGID, CATALOGNAME, STATUS, CATALOGCODE, OPERUSERID, OPERDATE, MODIFYUSERID and MODIFYDATE; the types include string and time; the comments include: primary key, directory name, directory status, directory code, operator, operation time, modifier and modification time. The constructed directory index table is shown in Table 3.
[0074] Table 3 Catalog Index Table
[0075]
[0076] The grouping indicator table includes column names, types and comments. The column names include: GROUPID, GROUPNAME, STATUS, ORGANIZEID, OPERUSERID, OPERDATE, MODIFYUSERID and MODIFYDATE; the types include string and time; the comments include: primary key, group name, group status, organization ID, operator, operation time, modifier and modification time. The constructed grouping indicator table is shown in Table 4.
[0077] Table 4 Grouping index table
[0078]
[0079] The combined index table includes column names, types and comments. The column names include: COMBINEID, TOWNCODE, MACROINDCTCODE, DATATYPE, GROUPGROUPID and CATALOGCATALOGID; the types include strings; and the comments include: primary key, region code, index code, data type, grouping type and catalog type. The constructed combined index table is shown in Table 5.
[0080] Table 5 Combination index table
[0081]
[0082] As an optional implementation, refer to Figure 2 , based on the above Figure 1 In the illustrated embodiment, before the step of separately splitting each data to be stored based on the constructed storage template, the data storage method provided by the present application also includes: obtaining the data to be stored, and determining the data type of the corresponding actual data; when the obtained data to be stored is single-indicator data, splitting the data to be stored based on the business indicator of the corresponding data to be stored; when the obtained data to be stored is grouped indicator data, obtaining the combination structure of the corresponding data to be stored, and splitting the data to be stored into single-indicator data based on the combination structure, and then splitting the split data to be stored.
[0083] For example, when splitting a single data indicator "The GDP of City A in 2022 is XXX billion yuan", it can be split into objects of "Time: 2022; Region: City A; Indicator: GDP; Unit: 100 million yuan; Data attribute: absolute value" according to time, region, indicator, unit, and data attribute.
[0084] When splitting the grouped indicator data "In 2022, the GDP of City A is XXX billion yuan; in 2022, the GDP of the primary industry of City A is XXX billion yuan; in 2022, the GDP of the secondary industry of City A is XXX billion yuan; in 2022, the GDP of the tertiary industry of City A is XXX billion yuan", since the primary industry, secondary industry, and tertiary industry are a group, they together constitute the GDP. Therefore, it can be split into the following four objects:
[0085] “Time: 2022; Region: City A; Indicator: Regional GDP; Unit: 100 million yuan; Data attribute: absolute value”;
[0086] “Time: 2022; Region: City A; Indicator: Regional GDP; Unit: 100 million yuan; Data attribute: absolute value”;
[0087] “Time: 2022; Region: City A; Indicator: primary industry; Unit: 100 million yuan; Data attribute: absolute value”;
[0088] “Time: 2022; Region: City A; Indicator: Secondary Industry; Unit: 100 million yuan; Data attribute: Absolute value”;
[0089] "Time: 2022; Region: City A; Indicator: tertiary industry; Unit: 100 million yuan; Data attribute: absolute value".
[0090] By judging the data type of the data to be stored, when the corresponding data type to be stored is single indicator data, since the single indicator data has a small amount of data and occupies less memory, it is easy to directly split the single indicator data, and at the same time, it is possible to split and obtain metadata for describing the data with less memory; and when the corresponding data to be stored is grouped indicator data, the corresponding grouped indicator data is split according to the combined structure, and then the split grouped indicator data is further split, which can reduce the probability of data loss during the splitting process.
[0091] As an optional implementation, based on the above Figure 1 In the embodiment shown, the step of converting the acquired classification type and storage data includes: acquiring the classification type and storage data, converting the classification type and storage data into data codes; transcoding the data codes to generate database primary keys; and combining the database primary keys to generate objects for storage in the storage template.
[0092] Optionally, the step of transcoding the obtained data code to generate a database primary key includes: processing the obtained data code in a UUID generation manner to generate a database primary key; UUID is a Universally Unique Identifier, that is, a universally unique identifier.
[0093] Optionally, the step of transcoding the obtained data code to generate a database primary key includes: processing the obtained data code by means of distributed snowflake ID generation to generate a database primary key; the distributed snowflake ID is an algorithm for generating a globally unique and increasing ID in a distributed system.
[0094] For example, "time: 2022; region: city A; indicator: regional gross domestic product; unit: 100 million yuan; data attribute: absolute value" can be converted into the following format through data encoding: "time: 2022->year:2022; region: city A->area:A; indicator: regional gross domestic product->indicator:GDP; unit: 100 million yuan->unit:yuan_100000000";
[0095] Then, an object is generated by UUID generation, and the object is expressed as {"id:", "ad20e6b3-3bdd-777f-779f-7c746d3ba3bf", "year": "2022", "area": "A", "indicator": "GDP", "unit": "yuan_100000000", "value": "XXX"}.
[0096] In addition, to achieve the above purpose, refer to Figure 3 The present application also provides a metadata-based data storage device, which includes: an indicator acquisition module 310, a template construction module 320, a data splitting module 330 and a data storage module 340.
[0097] The indicator acquisition module 310 is configured to acquire statistical historical storage data and determine corresponding business indicators.
[0098] Since there are multiple subsystems in the Statistics Bureau, and the business indicators corresponding to the historical data counted in different subsystems are different, it is necessary to perform analysis based on the historical storage data obtained by the Statistics Bureau. The business indicator data corresponding to the historical storage data is obtained by the indicator acquisition module 310, and a business indicator library is constructed based on the obtained business indicators, so as to facilitate the subsequent splitting of the data to be split in the business indicator library, thereby achieving the purpose of reducing the redundancy of actual data.
[0099] Exemplarily, when the Statistics Bureau processes the data storage corresponding to the economic field, the indicator acquisition module 310 splits the data based on the main attributes of the business data storage. The basic attributes of the corresponding data in the economic field include time, region, indicator, unit and data attributes, so as to facilitate the subsequent splitting of the corresponding economic field data based on the basic attributes, thereby greatly reducing the length of the actual data and improving the convenience of extracting valid attributes in the actual data.
[0100] The template construction module 320 is in communication connection with the indicator acquisition module 320 , and the template construction module 320 is configured to construct a plurality of storage templates for storing actual data based on the acquired business indicators.
[0101] By obtaining economic field data corresponding to statistical data through the template construction module 320, it is possible to facilitate, to a certain extent, the construction of a storage template for users to store actual data, so that the data to be stored can be split and added to the corresponding storage template, thereby achieving the purpose of storing the actual data. At the same time, by constructing a storage template, the efficiency of data management can be improved.
[0102] Exemplarily, based on the acquired business indicator library, a storage module is constructed through the indicator construction module 320 in the business indicator library, and the corresponding data is split and managed through the storage module. This can improve the convenience of managing actual data to a certain extent, and can also reduce the complexity of storing actual data, thereby facilitating the management of actual statistical data within the Statistics Bureau.
[0103] The data splitting module 330 is in communication connection with the template construction module 320, and the data splitting module 330 is configured to split the data to be stored based on the constructed storage template, and obtain the classification type and storage data corresponding to the data to be stored.
[0104] The data splitting module 330 is based on the business indicators corresponding to the statistical historical storage data, and the data to be stored is split according to the business indicators. The actual data to be stored is split into multiple classification types and storage data containing only basic attributes, thereby greatly shortening the amount of memory occupied by the data to be stored, and at the same time improving the efficiency of managing the data to be stored.
[0105] The data storage module 340 is in communication connection with the data splitting module 330, and the data storage module 340 is configured to convert the acquired classification type and storage data, generate an object for storing in the storage template, and store the object in the storage template.
[0106] The data to be stored is split into classification types and storage data through the data storage module 340, and then the generated objects are stored in the storage template to improve the convenience of managing data. It can not only manage the indicators of statistical data based on a unified standard format, but also improve the convenience of managing actual data.
[0107] In some embodiments, the present application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the metadata-based data storage method of the above-mentioned various embodiments when executing the computer program.
[0108] In some embodiments, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the metadata-based data storage method of the above-mentioned various embodiments is implemented.
[0109] The method provided in the embodiment of the present application analyzes the historical storage data counted by the Statistics Bureau to obtain business indicators that can characterize the content of the statistical data, and then builds a storage template based on the obtained business indicators; at the same time, each data to be stored is split separately according to the obtained business indicators, and then the split data to be stored is stored in the corresponding storage template; since the data to be stored is split according to the business indicators, it is convenient to screen out the complex objective descriptions of the data to be stored, and thus to a certain extent, the probability of a large amount of data to be stored can be reduced; at the same time, the split statistical data is added to the storage template, and the acquired statistical data is managed, thereby achieving the purpose of meeting the data management needs of the Statistics Bureau.
[0110] 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), magnetic 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).
[0111] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A data storage method based on metadata, characterized in that: The data storage method comprises the following steps: Obtain statistical historical storage data, determine corresponding business indicators, and build a business indicator library based on the business indicators to split the data to be split; the historical storage data is data statistically collected by the Statistics Bureau, specifically, the historical storage data is data in the economic field; the business indicators are basic attributes of actual effective data in the economic field, specifically including time, region, indicator, unit and data attributes; Based on the business indicators, the data in the economic field are split according to basic attributes including time, region, indicator, unit and data attributes to obtain indicator classification categories and category attribute data, and based on the business indicators, a plurality of storage templates for storing the data in the economic field after the splitting based on the business indicators are constructed, wherein the storage templates include a data storage table and a category storage table, wherein the data storage table is configured to store category attribute data, and the category storage table is configured to store indicator classification categories; Separately split the data to be stored based on the business indicator, and obtain multiple classification types and storage data containing only basic attributes; wherein, when the data type of the data to be stored is single indicator data, split the data to be stored based on the constructed storage template; when the acquired data to be stored is grouping indicator data, obtain the combination structure of the corresponding data to be stored, and split the data to be stored into single indicator data according to the combination structure, and then split the data to be stored based on the constructed storage template; Converting the classification type of the data to be stored and the storage data, generating an object for storing in the storage template, and storing the object in the storage template, specifically includes: Obtaining the classification type and stored data, and converting the classification type and stored data into data codes in the form of key-value pairs; Transcoding the data code to generate a database primary key, specifically including: processing the data code by UUID generation, or processing the data code by distributed snowflake ID generation to generate a database primary key; The database primary key is combined to generate an object for storage in the storage template.
2. The metadata-based data storage method according to claim 1, characterized in that: Place The data storage table is configured to store category attribute data, and the data storage table includes a metadata data table; The category storage table is configured to store indicator classification categories, and the category storage table includes: a metadata indicator code table, a directory indicator table, a grouping indicator table and / or a combination indicator table.
3. A data storage device for implementing the method according to claim 1, characterized in that: The data storage device comprises: The indicator acquisition module (310) is configured to acquire statistical historical storage data and determine corresponding business indicators; A template construction module (320) is configured to construct a plurality of storage templates for storing actual data based on the business indicator; A data splitting module (330) is configured to split the data to be stored based on the storage template, and obtain the classification type and storage data corresponding to the data to be stored; The data storage module (340) is configured to convert the classification type of the data to be stored and the storage data, generate an object for storage in the storage template, and store the object in the storage template.
4. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 2 are implemented.
5. 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 2 are implemented.
