Data warehouse tag management method and device

By acquiring and managing change operation records of tag relationships in the data warehouse, the problem of low efficiency in dimension table tag changes in existing technologies is solved, achieving efficient tag management and data warehouse flexibility.

CN117194587BActive Publication Date: 2025-10-31SHENZHEN KAIFA TECH (CHENGDU) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311153265.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-07
Publication Date
2025-10-31
Estimated Expiration
2043-09-07

AI Technical Summary

Technical Problem

In existing data warehouses, label changes to dimension tables are inefficient and difficult to make flexible label changes within the existing data warehouse dimension tables, necessitating the reconstruction of dimension tables and fact tables.

Method used

By obtaining the data analysis results from the data warehouse, the target field is identified and its labeling relationship in the dimension table is obtained. Operation records are generated, and the data warehouse changes the labels based on the operation records, including adding, deleting, or editing labeling relationships.

Benefits of technology

It enables efficient label changes within existing data warehouses, avoiding the tedious process of rebuilding dimension and fact tables, and improving the flexibility and efficiency of the data warehouse.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117194587B_ABST
    Figure CN117194587B_ABST
Patent Text Reader

Abstract

This application provides a label management method and apparatus for a data warehouse. The method includes: acquiring data analysis results from the data warehouse; determining a target field in the data analysis results according to preset standards; determining the dimension table containing the target field based on the target field; obtaining the labeling relationship between the label and the target field in the dimension table based on the dimension table; performing a change operation on the labeling relationship; generating an operation record for the change operation on the labeling relationship; sending the operation record to the data warehouse; and the data warehouse changing the label of the target field in the dimension table according to the operation record. This application solves the problem that label changes cannot be easily performed on dimension tables in existing data warehouses.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing, specifically to a method and apparatus for tag management in a data warehouse. Background Technology

[0002] With the increasing demand for data analysis and mining in today's society, the development of data warehouses has been rapid. Data warehouses perform data analysis by linking fact tables with dimension tables. The field types in the dimension tables are fixed after generation. When analyzing data based on dimension tables, it's only possible to analyze the entire field table or the fields labeled with existing tags. Changing field labels in the dimension table is inconvenient, making it difficult to perform individual summary analysis on fields with changed labels.

[0003] Adding labels to dimension tables requires rebuilding the dimension tables in the data warehouse, and possibly even rebuilding all fact tables and dimension tables. This makes changing labels in dimension tables in a data warehouse extremely inefficient.

[0004] Therefore, how to change labels in existing data warehouse dimension tables is a pressing issue that needs to be addressed. Summary of the Invention

[0005] The purpose of this application is to solve the technical problem of how to change labels in existing data warehouse dimension tables.

[0006] According to one aspect of the embodiments of this application, this application provides a tag management method for a data warehouse, the method comprising:

[0007] Obtain the data analysis results from the data warehouse, wherein the data analysis results contain several fields;

[0008] The target field is determined in the data analysis results according to preset criteria. The target field is a field in the data analysis results that meets the preset criteria.

[0009] Based on the target field, determine the dimension table in which the target field is located;

[0010] Based on the dimension table, obtain the labeling relationship between the label and the target field in the dimension table, and perform a change operation on the labeling relationship;

[0011] An operation record is generated for each change operation to the tagging relationship, and the operation record is sent to the data warehouse.

[0012] The data warehouse changes the labels of the target fields in the dimension table based on the operation records.

[0013] According to one aspect of the embodiments of this application, before obtaining the data analysis results of the data warehouse, the method further includes:

[0014] The data entering the data warehouse is cleaned and standardized to obtain standardized data;

[0015] Data is extracted from the standardized data according to the preset analysis dimensions, and a dimension table is generated with one analysis dimension as the primary key.

[0016] A fact table is generated using the primary key of the dimension table as a foreign key, wherein a foreign key in the fact table is the same as the primary key of the dimension table.

[0017] The fields in the fact table and / or dimension table are filtered to obtain the data analysis results.

[0018] According to one aspect of the embodiments of this application, before obtaining the labeling relationship between the label and the target field in the dimension table based on the dimension table, and before performing a change operation on the labeling relationship, the method includes:

[0019] Obtain the labeling relationship between each field and label in each dimension table of the data warehouse, and record and store the labeling relationship.

[0020] According to one aspect of the embodiments of this application, the change operation includes a tag relationship addition operation, wherein obtaining the tag relationship between the label and the target field in the dimension table based on the dimension table, and performing a change operation on the tag relationship, includes:

[0021] Obtain the target label based on the target field;

[0022] Perform a label relationship addition operation on the label relationship to add a label relationship between the target label and the target field in the dimension table.

[0023] According to one aspect of the embodiments of this application, the data warehouse modifies the labels of target fields in the dimension table based on the operation records, including:

[0024] Based on the added record of the marked relationship in the operation record, the data warehouse creates a new label column in the dimension table, and adds target labels to the target field in the dimension table through the newly created label column.

[0025] According to one aspect of the embodiments of this application, the change operation includes a tag relationship deletion operation, wherein obtaining the tag relationship between the label and the target field in the dimension table based on the dimension table, and performing a change operation on the tag relationship, includes:

[0026] Based on the dimension table, obtain the established tagging relationship between the label and the target field in the dimension table;

[0027] Perform a deletion operation on the tag relationship, deleting the tag relationship between the tag and the target field.

[0028] According to one aspect of the embodiments of this application, the data warehouse modifies the labels of target fields in the dimension table based on the operation records, including:

[0029] Based on the deletion records of the marked relationships in the operation records, the label column corresponding to the target field in the dimension table is deleted.

[0030] According to one aspect of the embodiments of this application, after the data warehouse changes the label of the target field in the dimension table based on the operation record, the method further includes:

[0031] Based on data requirements, select multiple tags as object tags;

[0032] Based on the object label, obtain the content of the field marked by the object label.

[0033] According to one aspect of an embodiment of this application, obtaining the content of the field marked by the object tag based on the object tag includes:

[0034] Based on the object label, obtain the dimension table containing the field corresponding to the object label;

[0035] The fields with the object labels are summarized, and the content of the fields is obtained.

[0036] According to one aspect of the embodiments of this application, this application provides a tag management device for a data warehouse, the device comprising:

[0037] The acquisition module is used to acquire the data analysis results of the data warehouse, which contain several fields;

[0038] The determination module is used to determine the target field in the data analysis results according to preset criteria. The target field is a field in the data analysis results that meets the preset criteria.

[0039] The dimension table confirmation module is used to determine the dimension table in which the target field is located based on the preset standard and the target field.

[0040] The tag management module is used to obtain the tagging relationship between the tag and the target field in the dimension table based on the dimension table, and to perform modification operations on the tagging relationship;

[0041] The message interaction module is used to generate an operation record for the change operation of the tag relationship and send the operation record to the data warehouse;

[0042] The data warehouse labeling module is used to change the labels of target fields in the dimension table based on the operation records.

[0043] This application first obtains the labeling relationship between the target field and the label in the dimension table, then performs a change operation on the labeling relationship, records the change operation to generate an operation record, and the data warehouse can know from the operation record that the label of a target field in a certain dimension table has changed. Then, the data warehouse changes the label of the target field in the dimension table according to the operation record. This solves the problem that existing technologies cannot perform label changes in existing data warehouse dimension tables.

[0044] Other features and advantages of this application will become apparent from the following detailed description, or may be learned in part from practice of this application.

[0045] It should be understood that the above general description and the following detailed description are merely exemplary and do not limit this application. Attached Figure Description

[0046] The above and other objectives, features and advantages of this application will become more apparent from a detailed description of exemplary embodiments thereof with reference to the accompanying drawings.

[0047] Figure 1 A flowchart of a data warehouse tag management method according to an embodiment of this application is shown.

[0048] Figure 2 A flowchart illustrating the acquisition of data analysis results according to an embodiment of this application is shown.

[0049] Figure 3 A flowchart illustrating a foreign key association of a dimension table having one primary key and multiple foreign keys based on a fact table according to an embodiment of this application is shown.

[0050] Figure 4 The diagram illustrates a flowchart of a process according to an embodiment of this application, which describes obtaining the labeling relationship between a label and a target field in a dimension table, and performing a modification operation on the labeling relationship.

[0051] Figure 5 The diagram illustrates a flowchart of a process according to an embodiment of this application, which describes obtaining the labeling relationship between a label and a target field in a dimension table, and performing a modification operation on the labeling relationship.

[0052] Figure 6 The diagram illustrates a flowchart of retrieving field content from the data warehouse based on the labels after changing the labels of a target field in the dimension table according to the operation records, according to an embodiment of this application.

[0053] Figure 7 A flowchart illustrating the process of obtaining the content of a field marked by an object tag based on an object tag, according to one embodiment of this application, is shown.

[0054] Figure 8 A schematic diagram of a data warehouse tag management device according to an embodiment of this application is shown.

[0055] Figure 9 A hardware structure diagram of a tag management method for implementing a data warehouse according to an embodiment of this application is shown. Detailed Implementation

[0056] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, they are provided to make the description of this application more comprehensive and complete, and to fully convey the concept of the exemplary embodiments to those skilled in the art. The drawings are merely illustrative of this application and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted.

[0057] Furthermore, the described features, structures, or characteristics can be combined in any suitable manner in one or more exemplary embodiments. Numerous specific details are provided in the following description to give a full understanding of exemplary embodiments of this application. However, those skilled in the art will recognize that the technical solutions of this application can be practiced with one or more of the specific details omitted, or other methods, components, steps, etc., can be employed. In other instances, well-known structures, methods, implementations, or operations are not shown or described in detail to avoid obscuring various aspects of this application.

[0058] Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.

[0059] Please see Figure 1 , Figure 1 A flowchart illustrating a data warehouse tag management method according to an embodiment of this application is shown. This application embodiment provides the steps of a data warehouse tag management method, including:

[0060] Step S110: Obtain the data analysis results from the data warehouse. The data analysis results contain several fields.

[0061] Step S120: Determine the target field in the data analysis results according to the preset criteria. The target field is the field in the data analysis results that meets the preset criteria.

[0062] Step S130: Determine the dimension table containing the target field based on the target field;

[0063] Step S140: Based on the dimension table, obtain the labeling relationship between the label and the target field in the dimension table, and perform a change operation on the labeling relationship;

[0064] Step S150: Generate an operation record for the change operation of the tag relationship, and send the operation record to the data warehouse;

[0065] In step S160, the data warehouse changes the labels of the target fields in the dimension table based on the operation records.

[0066] The above six steps are described in detail below.

[0067] It should be clarified that this application provides a data warehouse tag management method, which identifies the fields requiring tag management based on the data analysis results of the data warehouse. Therefore, before applying the method provided in this application, it is necessary to obtain the data analysis results of the data warehouse. Data analysis results refer to the output results obtained by the data warehouse through analysis and processing of its stored data.

[0068] In step S110, after the data warehouse obtains the data analysis results, it stores them in a data table used to store the data analysis results and displays them to the user. The user-selected data analysis results are retrieved from this data table for tag management. The data table includes measures, foreign keys in the fact table of the data warehouse, primary keys in the dimension table, and other fields in the dimension table. A measure refers to the specific numerical value of a field, such as electricity consumption, sales amount, or number of orders.

[0069] Please see Figure 2 , Figure 2 A flowchart illustrating the process of obtaining data analysis results according to an embodiment of this application is shown. Embodiments of this application provide steps for obtaining data analysis results, including:

[0070] Step S210: Clean and standardize the data entering the data warehouse to obtain standardized data;

[0071] Step S220: Extract data from the standardized data according to the preset analysis dimensions, and generate a dimension table with one analysis dimension as the primary key;

[0072] Step S230: Generate a fact table using the primary key of the dimension table as a foreign key, wherein a foreign key in the fact table is the same as the primary key of the dimension table;

[0073] Step S240: Filter the fields in the fact table and / or dimension table to obtain the data analysis results.

[0074] The above four steps will be described in detail below.

[0075] In step S210, the data warehouse cleans and normalizes the data input from the data source. Data cleaning refers to deleting duplicate or incomplete data; data normalization refers to converting all data into the same data format. For example, various date data in the data are represented as "2015, 01, 01", "2015 / 01 / 01", and "January 1, 2015". Normalizing the date data makes them all represented in the format "2015 / 01 / 01" to facilitate subsequent data processing.

[0076] It needs to be clarified that data sources include, but are not limited to, business data, web page data, and data generated by terminal applications. To adapt to different application scenarios, data warehouse data sources are deployed in different ways.

[0077] It's important to clarify that the data in a data warehouse can be referred to as facts, which are the objects of data analysis. Facts, also known as factual data, are typically measured or recorded data, such as electricity consumption, sales revenue, and order quantity. Facts include metrics, which are the numerical values ​​that the factual data is intended to analyze, such as specific figures for sales revenue, order quantity, and electricity consumption.

[0078] In step S220, the data is cleaned and normalized to obtain normalized data. Then, data extraction is performed on the normalized data according to preset analysis dimensions, and a dimension table is generated with one analysis dimension as the primary key. Analysis dimension refers to the perspective from which data is analyzed, such as time, region, product, etc. Dimensions are filtering and classification methods used in data analysis.

[0079] Based on the analysis dimensions, the standardized data is filtered to obtain data related to the analysis dimensions. Then, the relevant data is classified according to the analysis dimensions. Finally, the data corresponding to the same analysis dimension is integrated from the classified data to obtain the dimension data corresponding to each analysis dimension.

[0080] For each analytical dimension, generate a dimension table by using the analytical dimension as the primary key and the corresponding dimension data as the content. The dimension table includes the key-value pairs corresponding to each field name, as well as the attributes of each field. The labels that mark each field can also be considered field attributes.

[0081] In step S230, a fact table is generated using the primary key of the dimension table as the foreign key. The primary key of the fact table is the same as that of the dimension table. Data from each dimension table is aggregated, and the key values ​​corresponding to each field are used to represent each field in each dimension table, thus obtaining the fact table. A mapping relationship is established between the foreign keys of the fact table and the primary keys of the dimension tables, enabling the mutual association between the fact table and the dimension tables. Based on the dimension table associated with the foreign key of the fact table, the specific field corresponding to each key value can be clearly identified.

[0082] The fact table includes foreign keys, and all foreign keys together form the primary key of the fact table. Each foreign key is a part of the primary key, and each field under a foreign key has a corresponding key value, which is recorded in the dimension table corresponding to the foreign key. It is important to note that the fact table contains measure attributes to measure each row of data in the fact table.

[0083] It should be clarified that in this application, the number of fact tables and dimension tables can be increased or decreased arbitrarily according to the needs of data analysis. When the data warehouse generates multiple fact tables with different analysis dimensions as the primary keys, multiple fact tables may have the same foreign key, and thus, multiple fact tables can simultaneously have relationships with the same dimension table.

[0084] Please see Figure 3 , Figure 3 A flowchart illustrating a foreign key association of a dimension table having one primary key and multiple foreign keys based on a fact table, according to an embodiment of this application, is shown. This application provides steps for foreign key association of a dimension table having one primary key and multiple foreign keys, including:

[0085] Step S231: Based on the foreign key of the fact table, associate the first-level dimension table with one primary key and multiple foreign keys, where the primary key of the first-level dimension table is the same as the foreign key of the fact table;

[0086] Step S232: Based on the foreign key of the first dimension table, associate a second-level dimension table with a primary key, wherein the primary key of the second-level dimension table is the same as the foreign key of the first dimension table.

[0087] The two steps described above are described in detail below.

[0088] It is important to clarify that, in order to avoid too many foreign keys in the fact table, which would lead to redundancy due to too many foreign keys linking to too many dimension tables, the dimension tables are divided into first-level dimension tables and second-level dimension tables. The first-level dimension tables are directly related to the fact table, while the second-level dimension tables are related to the first-level dimension tables.

[0089] In step S231, a mapping relationship is established between the foreign key in the fact table and the primary key in the first-level dimension table, so that the fact table and the first-level dimension table are interconnected. The foreign key in the fact table and the primary key in the first-level dimension table that establish the mapping relationship belong to the same analysis dimension. The first-level dimension table can display the field contents of the analysis dimension corresponding to its primary key. In addition, the first-level dimension table also contains foreign keys formed by other analysis dimensions.

[0090] In step S232, the dimension data corresponding to each foreign key in the first-level dimension table forms a second-level dimension table. The primary key of the second-level dimension table is the foreign key of the first-level dimension table. A mapping relationship is established between the foreign key of the first-level dimension table and the primary key of the second-level dimension table, so that the first-level dimension table and the second-level dimension table are mutually related.

[0091] In step S240, according to user instructions, when it is necessary to obtain the content of certain fields in the data warehouse specification data as data analysis results, the dimension table and / or fact table in which the required field is located are determined according to the required field. Then, the required field is searched in each field of the dimension table and / or fact table to obtain the content of the required field. Finally, the content of the required field is summarized to obtain the data analysis results.

[0092] In step S120, the target field is confirmed in the data analysis results according to the preset criteria. It should be noted that the preset criteria refer to the criteria for filtering fields in the data analysis results based on the measurement values ​​to confirm which field is the target field.

[0093] For example, in the analysis results, electricity consumption is used as a metric, and a metric value greater than 1000 kWh is used as a preset standard. In other words, the user field is filtered, and the preset standard is "electricity consumption greater than 1000 kWh". Thus, the "user" field with "electricity consumption greater than 1000 kWh" in the data analysis results is determined as the target field.

[0094] Please refer to Table 1, which shows a target field attribute information table according to an embodiment of the present application, which records the attribute information of the target field.

[0095] Table 1

[0096]

[0097] It is important to clarify that each field in the data analysis results, dimension table, and fact table has a corresponding attribute information table. When a field is created, its attributes are obtained. When an operation is performed on a field to change its attributes, the attributes of that field will be changed accordingly. When you need to view the attribute information of a field, the attribute information is displayed in the form of Table 1.

[0098] Therefore, in step S130, the attribute information table of the target field is obtained according to the target field, and the dimension table where the target field is located is confirmed according to the table name of the dimension table where the target field is located in the attribute information table of the target field.

[0099] In step S140, after learning the table name of the dimension table where the target field is located, the table name is used as the search term to search and obtain the tag relationship between the label and the target field in the dimension table.

[0100] It's important to clarify that the dimension table has a label column, with each label having its own separate label column. This label column displays the current labeling status in the dimension table. The labeling relationship records which dimension table the existing label is in and which field it labels. A labeling relationship can indicate that a field is labeled, or it can indicate that a field is not labeled, meaning the labeling relationship is null.

[0101] After obtaining the labeling relationship between the target field and the label in the dimension table, changes are made to this labeling relationship. It's important to clarify that these changes include adding, deleting, and modifying the labeling relationships.

[0102] In one embodiment of this application, before obtaining the labeling relationship between the labels and the target fields in the dimension table, all label columns in each dimension table of the data warehouse are queried to obtain the mapping relationship between each label and the field of the current dimension table, i.e., the labeling relationship. Finally, these labeling relationships are stored in a designated data table, which is a preset data table used to store the labeling relationships.

[0103] The label relationship records which dimension table the label belongs to, and which specific field in the dimension table the label labels.

[0104] In step S150, when the labeling relationship between the label and the target field in the dimension table is changed, an operation record is recorded. The operation record indicates the change in the labeling relationship between the target field and the label in the dimension table. The operation record is then sent to the data warehouse. It should be noted that when there is more than one data warehouse, the operation record is sent to each data warehouse simultaneously. In one embodiment of this application, after receiving the operation record, the data warehouse checks whether the dimension table recorded in the operation record exists. If the dimension table exists, when the labeling relationship change operation is an add operation, a label column is directly created to label the target field; when the labeling relationship change operation is a delete or edit operation, it checks whether there are label columns that need to be deleted or edited, and if so, deletes or edits them.

[0105] For details of the operation log, please refer to Table 2, which shows an operation log information table according to an embodiment of this application.

[0106] Table 2

[0107]

[0108]

[0109] As shown in Table 2, the operation log information table records changes in the labeling relationship between the target labels and the target fields in the dimension tables. The operation log information table stores every operation record. It indicates which label column in which dimension table was modified and what changes were made.

[0110] In step S160, the data warehouse searches for the dimension table based on the target field recorded in the operation record and the table name of the dimension table. It then searches for the label column where the target is located in the dimension table. Finally, based on the operation type and target label in the operation record, it performs changes on the label column corresponding to the target field.

[0111] Locate the corresponding dimension table in the data warehouse, find the target field in the dimension table, and finally change the label of the target field based on the operation record.

[0112] Please see Figure 4 , Figure 4 This document illustrates a flowchart illustrating an embodiment of the present application, showing how to obtain the labeling relationship between a label and a target field in a dimension table, and how to modify the labeling relationship. The modification operation includes adding a labeling relationship. This embodiment provides step S140, which involves obtaining the labeling relationship between a label and a target field in a dimension table and modifying the labeling relationship.

[0113] Step S141a: Obtain the target label based on the target field;

[0114] Step S142a: Perform a label relationship addition operation on the label relationship, adding the label relationship between the label and the target field in the dimension table;

[0115] The two steps described above are described in detail below.

[0116] In step S141a, after determining the target field, target labels describing the characteristics of the target field are obtained based on the target field. It should be clarified that the acquisition of target labels involves three steps: First, the user selects labels displayed on the interface, including preset labels and user-defined labels; second, based on the correspondence between preset labels and target fields, the target label corresponding to the target field is obtained; third, the user directly creates a new label as the target label for the target field, and this label is added to a configuration file for future label lookup or use.

[0117] In step S142a, after obtaining the target label of the target field, a labeling relationship between the target field and the target label is established. Since the labeling relationship between the target field and the label includes the labeling relationship between the target field and each label, establishing a labeling relationship between the target field and the target label adds another labeling relationship between the target field and the label.

[0118] It should be clarified that, in one embodiment of this application, before establishing a tagging relationship between the target field and the target tag, there may be no tagging relationship between the target field and various tags, that is, the tagging relationship between the target field and the tag may be null. Alternatively, tagging relationships can be added. For example, when the tagging relationship between the target field and the tag is null, a tagging relationship between the target field and the target tag is added through steps S141a and S142a. At this time, the tagging relationship between the target field and the tag includes the newly added tagging relationship between the target field and the target tag.

[0119] In another embodiment of this application, adding a tagging relationship includes two methods. First, the target field is displayed, allowing the user to virtually add a tag to the target field. The user-added tag becomes the target tag, establishing a tagging relationship between the target field and the target tag. Second, the tagging relationship is added via an API (Application Programming Interface) call. Specifically, based on the operation record of tagging relationship changes, program code representing the tagging relationship between the target field and the target tag is generated. This program code is input into the API to call and run the program code, thereby creating a new tagging relationship between the target field and the target tag, adding a tagging relationship between the target field and the tag.

[0120] When adding a labeling relationship between a target field and a target label, an operation record is generated as an "addition record" to document the addition of the labeling relationship. After the addition record is generated, it is automatically sent to the data warehouse. The data warehouse receiving end receives the addition record, determines which field in which dimension table will be labeled by the target label based on the addition record, and then creates a label column corresponding to the target label in the dimension table where the target field is located, so that the target label labels the target field.

[0121] Please see Figure 5 , Figure 5This document illustrates a flowchart illustrating an embodiment of the present application, showing how to obtain the labeling relationship between a label and a target field in a dimension table, and how to modify the labeling relationship. The modification operation includes a label deletion operation. This embodiment provides step S140, which involves obtaining the labeling relationship between a label and a target field in a dimension table and modifying the labeling relationship.

[0122] Step S141b: Based on the dimension table, obtain the established label relationship between the label and the target field in the dimension table;

[0123] Step S142b: Perform a tag relationship deletion operation on the tag relationship, and delete the tag relationship between the tag and the target field;

[0124] The two steps described above will be described in detail below.

[0125] In step S141b, after determining which dimension table the target field belongs to, the labeling relationship between the target field and each label in the dimension table is first obtained by querying the dimension table.

[0126] In step S142b, a labeling relationship is selected from the labeling relationships between the target field and each label for deletion, and an operation record is generated as a deletion record to record the deletion of the labeling relationship. After the deletion record is generated, it is sent to the data warehouse. The label that marks the target field in the deleted labeling relationship is designated as the target label.

[0127] The data warehouse receives deleted records, determines which label in which field of which dimension table was deleted based on the specific content of the deleted record, and then deletes the label column containing the target label from the dimension table containing the target field.

[0128] In one embodiment of this application, label change further includes label editing, where the edited label is the target label. Specifically, the established tagging relationship between the target label and the target field in the dimension table is obtained from the dimension table. One tagging relationship is selected, and an editing operation is performed on the tagging relationship to edit the tagging relationship between the target label and the target field. An operation record is generated as an edit record to record the editing operation on the tagging relationship. The edit record is sent to the data warehouse. The data warehouse, based on the edit record, finds the dimension table where the target field is located and edits the label column where the target label is located in the dimension table. For example, in the user electricity consumption dimension table, users with monthly electricity consumption greater than 1000 kWh were originally labeled as "abnormal electricity consumption users". After the label change, only users with monthly electricity consumption greater than 2000 kWh are labeled as "abnormal electricity consumption users".

[0129] Please refer to Table 3, which shows an information table of the tagging relationship between target fields and target tags according to an embodiment of this application.

[0130] Table 3

[0131]

[0132]

[0133] As shown in Table 3, Table 3 shows the labeling relationship information between target fields and target labels. Each labeling relationship has a corresponding labeling relationship information table, which shows which label has a labeling relationship with which field in the dimension table, and how long the labeling relationship can last and when it expires.

[0134] In one embodiment of this application, when it is necessary to view the tag information recorded in a certain tag relationship, the tag relationship ID (id, IDentity identity identification number) can be searched to obtain the information table of the tag relationship. If it is further desired to know the dimension table where the tag recorded in the tag relationship is located, the tag ID is obtained from the tag relationship information table, and then the field information table is obtained from the field ID. The table name of the dimension table where the field is located is obtained from the field information table, which is the dimension table where the tag is located.

[0135] Please refer to Table 4, which shows a target label information table according to an embodiment of this application.

[0136] Table 4

[0137] Fields meaning id Target tag id target_name Target label name target_name_encrypt Fields marked by target tags target_type Target tag type target_level Target tag level target_value Target label value target_comment Target label annotation create_time Creation time is_delete Delete?

[0138] Table 4 shows the detailed information of the target tags. In this application, each tag has a corresponding tag information table. The corresponding tag information table can be retrieved by querying the tag ID to obtain the relevant information of the tag.

[0139] In one embodiment of this application, the operation record information table (see Table 2) can retrieve relevant information from the target field information table (see Table 1) and the target tag information table (see Table 4) based on the target field id and target tag id contained therein, so that users can conveniently query the relevant information of the target field and the target tag according to the operation record information table.

[0140] The tag relationship table (see Table 3) contains the target field `id` and target tag `id`. It can also access information from the target field related information table (see Table 1) and the target tag information table (see Table 4) to confirm the dimension table containing the target field. This allows users to easily query the relevant content of the target field and target tag based on the tag relationship table.

[0141] It should be clarified that, in one embodiment of this application, for time-sensitive tags, the timeliness of these tags is queried at set intervals. If a tag is found to have expired, the tagging relationship recording the tag's marking status is found based on that tag, and the tagging relationship is deleted. An operation record for deleting the tagging relationship is generated and sent to the data warehouse. Based on this operation record, the data warehouse finds the dimension table containing fields marked by expired tags and deletes the tag column corresponding to the expired tag in the dimension table.

[0142] In another embodiment of this application, when the data warehouse modifies the label column of a dimension table based on operation records, it generates execution records. To ensure that the data warehouse does not miss or repeatedly modify the label column of the dimension table based on the operation records, the data warehouse compares the execution records within a set time period with the received operation records at regular intervals to check for omissions or duplicate executions. For example, the data warehouse compares the execution records within the most recent 5 minutes with the received operation records every 5 minutes to check for omissions or duplicate executions.

[0143] In another embodiment of this application, the data warehouse periodically queries all tag relationships to confirm whether the tag relationships have changed. If a change in the tag relationship is found and an operation record is generated but not sent to the data warehouse, the data warehouse obtains the operation record and, based on the operation record, modifies the label column of the dimension table, for example, by adding a label column, deleting a label column, or changing a label column.

[0144] Please see Figure 6 , Figure 6 This document illustrates a flowchart illustrating how, according to an embodiment of this application, after changing the label of a target field in a dimension table based on the operation record, the field content is retrieved from the data warehouse based on the label. This embodiment provides steps for retrieving field information from the data warehouse based on the label after changing the label of a target field in a dimension table based on the operation record, including:

[0145] Step S310: Select multiple labels as object labels according to data requirements;

[0146] Step S320: Obtain the content of the field marked by the object label based on the object label.

[0147] The two steps described above are described in detail below.

[0148] In step S310, after the data warehouse performs changes on the label columns in the dimension table according to the operation records, the user needs to call the fields marked by the labels according to the data requirements. At this time, the labels that mark the required fields are called object labels.

[0149] In step S320, the tagging relationship of the recorded object tags is retrieved based on the object tags. Then, the field corresponding to the object tag is determined based on the tagging relationship, and the content of the field is obtained, thus satisfying the user's data needs. It should be noted that, in one embodiment of this application, the tagging relationship records the tags and the specific content of the fields they tag. This includes field attribute information, field name, corresponding key value, the dimension table it belongs to, creation time, etc.

[0150] Please see Figure 7 , Figure 7 This document illustrates a flowchart illustrating the process of obtaining the content of a field marked by an object tag based on an object tag, according to an embodiment of this application. The embodiments of this application provide steps for obtaining the content of a field marked by an object tag based on an object tag, including:

[0151] Step S321: Based on the object label, obtain the dimension table containing the field corresponding to the object label;

[0152] Step S322: Summarize the fields with object labels and obtain the content of the fields.

[0153] The two steps described above are described in detail below.

[0154] In step S321, based on the object label, the labeling relationship that records the object label marking situation is found, and then based on the labeling relationship, the dimension table where the object label is located is determined.

[0155] In step S322, the dimension table containing the object labels is obtained from the data warehouse, and then the fields with object labels in the dimension table are summarized to obtain the content of the fields with object labels.

[0156] In one embodiment of this application, when there are multiple object labels, the dimension table in which the object label is located is determined based on the object label. Then, based on the table name of the dimension table, multiple dimension tables in which the object label is located are searched in the data warehouse. Fields in each dimension table that have object labels are summarized to obtain fields that have multiple labels.

[0157] In another embodiment of this application, when there are multiple object labels, multiple dimension tables containing the object labels are obtained in the data warehouse. Based on the label column of the dimension table, the field with any of the above object labels is found, and then the data is summarized to obtain a field containing at least one object label.

[0158] Please see Figure 8 , Figure 8 A schematic diagram of a data warehouse tag management device according to an embodiment of this application is shown. The data warehouse tag management device according to an embodiment of this application mainly includes the following modules:

[0159] The acquisition module 810 is used to acquire the data analysis results of the data warehouse, wherein the data analysis results contain several fields;

[0160] The determination module 820 is used to determine the target field in the data analysis results according to preset standards, wherein the target field is a field in the data analysis results that meets the preset standards.

[0161] The dimension table confirmation module 830 is used to determine the dimension table in which the target field is located based on the preset standard and the target field.

[0162] The tag management module 840 is used to obtain the tag relationship between the tag and the target field in the dimension table according to the dimension table, and to perform a change operation on the tag relationship;

[0163] The message interaction module 850 is used to generate an operation record for the change operation of the tag relationship and send the operation record to the data warehouse;

[0164] The data warehouse label operation module 860 is used to change the labels of target fields in the dimension table according to the operation records.

[0165] A data warehouse tag management method according to an embodiment of this application can be provided by... Figure 9 This is achieved through label management devices. See below for reference. Figure 9 This application describes a tag management device according to embodiments thereof. Figure 9 The label management device shown is merely an example and should not impose any limitations on the functionality and scope of the embodiments of this application.

[0166] like Figure 9 As shown, the tag management device may be represented as a general-purpose computing device. Components of the tag management device may include, but are not limited to: at least one processing unit 810, at least one storage unit 820, and a bus 830 connecting different system components (including storage unit 820 and processing unit 810).

[0167] The storage unit stores program code that can be executed by the processing unit 810, causing the processing unit 810 to perform the steps described in the exemplary method description section of this specification according to various exemplary embodiments of the present invention. For example, the processing unit 810 can perform actions such as... Figure 3 The steps shown are as follows.

[0168] Storage unit 820 may include a readable medium in the form of a volatile storage unit, such as random access memory (RAM) 8201 and / or cache memory 8202, and may further include a read-only memory (ROM) 8203.

[0169] The storage unit 820 may also include a program / utility 8204 having a set (at least one) of program modules 8205, including but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of these examples may include an implementation of a network environment.

[0170] Bus 830 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of the various bus structures.

[0171] The tag management device can also communicate with one or more external devices 700 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), one or more devices that enable users to interact with the tag management device, and / or any device that enables the tag management device to communicate with one or more other computing devices (e.g., routers, modems, etc.). This communication can be performed via input / output (I / O) interface 850. Furthermore, the tag management device can also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via network adapter 860. As shown, network adapter 860 communicates with other modules of the point cloud camera 12 via bus 830. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with the tag management device, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0172] Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, terminal device, or network device, etc.) to execute the method according to the embodiments of this application.

[0173] In an exemplary embodiment of this application, a computer program medium is also provided, on which computer-readable instructions are stored, which, when executed by a computer's processor, cause the computer to perform the methods described in the above method embodiments.

[0174] According to one embodiment of this application, a program product for implementing the methods in the above-described method embodiments is also provided. This product may employ a portable compact disc read-only memory (CD-ROM) and include program code, and may run on a terminal device, such as a personal computer. However, the program product of this invention is not limited thereto. In this document, a readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.

[0175] The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0176] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of sending, propagating, or transmitting programs for use by or in conjunction with an instruction execution system, apparatus, or device.

[0177] The program code contained on the readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.

[0178] Program code for performing the operations of this invention can be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java and C++, and conventional procedural programming languages ​​such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0179] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to the embodiments of this application, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.

[0180] Furthermore, although the steps of the method in this application are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in that specific order, or that all the steps shown must be performed to achieve the desired result. Additional or alternative steps may be omitted, multiple steps may be combined into one step, and / or a step may be broken down into multiple steps.

[0181] Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, mobile terminal, or network device, etc.) to execute the method according to the embodiments of this application.

[0182] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention filed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not claimed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the appended claims.

Claims

1. A tag management method for a data warehouse, characterized in that, The method includes: The data entering the data warehouse is cleaned and standardized to obtain standardized data; data is extracted from the standardized data according to preset analysis dimensions, and a dimension table is generated with one analysis dimension as the primary key; a fact table is generated with the primary key of the dimension table as the foreign key, and a foreign key of the fact table is the same as the primary key of the dimension table; the fields in the fact table and / or the dimension table are filtered to obtain data analysis results, which contain several fields; The target field is determined in the data analysis results according to preset criteria. The target field is the field in the data analysis results that meets the preset criteria. Based on the target field, obtain the attribute information table of the target field, and based on the table name of the dimension table in the target field attribute information table, confirm the dimension table in which the target field is located; Based on the dimension table, obtain the labeling relationship between the label and the target field in the dimension table, and perform a change operation on the labeling relationship; An operation record is generated for each change operation to the tagging relationship, and the operation record is sent to the data warehouse. The data warehouse changes the labels of the target fields in the dimension table based on the operation records; The change operation includes adding a label relationship, and the data warehouse changes the label of the target field in the dimension table according to the operation record, including: Obtain the target label based on the target field; perform a label relationship addition operation on the label relationship to add a label relationship between the target label and the target field in the dimension table; based on the label relationship addition record in the operation record, the data warehouse creates a new label column in the dimension table, and adds the target label to the target field in the dimension table through the newly created label column.

2. The method according to claim 1, characterized in that, Before performing a change operation on the labeling relationship, the process includes: (The steps described above are not directly related to the steps and can be omitted.) Obtain the labeling relationship between each field and label in each dimension table of the data warehouse, and record and store the labeling relationship.

3. The method according to claim 1, characterized in that, The change operation includes a tag relationship deletion operation. The step of obtaining the tag relationship between the label and the target field in the dimension table based on the dimension table, and then performing a change operation on the tag relationship, further includes: Based on the dimension table, obtain the established tagging relationship between the label and the target field in the dimension table; Perform a deletion operation on the tag relationship, deleting the tag relationship between the tag and the target field.

4. The method according to claim 3, characterized in that, The data warehouse, based on the operation records, modifies the labels of target fields in the dimension table, including: Based on the deletion records of the marked relationships in the operation records, the label column corresponding to the target field in the dimension table is deleted.

5. The method according to claim 1, characterized in that, After the data warehouse changes the label of the target field in the dimension table according to the operation record, the method further includes: Based on data requirements, select multiple tags as object tags; Based on the object label, obtain the content of the field marked by the object label.

6. The method according to claim 5, characterized in that, The step of obtaining the content of the field marked by the object tag based on the object tag includes: Based on the object label, obtain the dimension table containing the field corresponding to the object label; The fields with the object labels are summarized, and the content of the fields is obtained.

7. A tag management device for a data warehouse, characterized in that, The device includes: The acquisition module is used to clean and standardize the data entering the data warehouse to obtain standardized data; extract data from the standardized data according to preset analysis dimensions, and generate a dimension table with one analysis dimension as the primary key; generate a fact table with the primary key of the dimension table as the foreign key, wherein a foreign key of the fact table is the same as the primary key of the dimension table; filter the fields in the fact table and / or the dimension table to obtain data analysis results, wherein the data analysis results contain several fields; The determination module is used to determine the target field in the data analysis results according to preset criteria. The target field is a field in the data analysis results that meets the preset criteria. The dimension table confirmation module is used to obtain the attribute information table of the target field based on the target field, and to confirm the dimension table where the target field is located based on the table name of the dimension table where the target field is located in the attribute information table of the target field. The tag management module is used to obtain the tagging relationship between the tag and the target field in the dimension table based on the dimension table, and to perform modification operations on the tagging relationship; The message interaction module is used to generate an operation record for the change operation of the tag relationship and send the operation record to the data warehouse; A data warehouse labeling operation module is used to change the labels of target fields in the dimension table based on the operation records. The device is further configured such that the change operation includes a tag relationship addition operation, and the data warehouse, based on the operation record, performs tag changes on the target field in the dimension table, including: Obtain the target label based on the target field; perform a label relationship addition operation on the label relationship to add a label relationship between the target label and the target field in the dimension table; based on the label relationship addition record in the operation record, the data warehouse creates a new label column in the dimension table, and adds the target label to the target field in the dimension table through the newly created label column.

Citation Information

Patent Citations

  • A method and system for optimizing label data

    CN108959580A

  • Label management system, label operation method and data table operation method and device

    CN113297197A