CN114510489B - Enterprise index tree construction method, device, equipment and medium - Google Patents
Enterprise index tree construction method, device, equipment and medium Download PDFInfo
- Publication number
- CN114510489B CN114510489B CN202210176747.7A CN202210176747A CN114510489B CN 114510489 B CN114510489 B CN 114510489B CN 202210176747 A CN202210176747 A CN 202210176747A CN 114510489 B CN114510489 B CN 114510489B
- Authority
- CN
- China
- Prior art keywords
- word
- relation
- index
- statement
- word set
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000010276 construction Methods 0.000 title claims abstract description 55
- 238000005259 measurement Methods 0.000 claims abstract description 58
- 238000000034 method Methods 0.000 claims abstract description 38
- 150000001875 compounds Chemical class 0.000 claims description 30
- 239000003607 modifier Substances 0.000 claims description 30
- 238000003860 storage Methods 0.000 claims description 18
- 238000004590 computer program Methods 0.000 claims description 15
- 238000001914 filtration Methods 0.000 claims description 15
- 238000013329 compounding Methods 0.000 claims description 5
- 238000012545 processing Methods 0.000 abstract description 11
- 239000000284 extract Substances 0.000 abstract description 9
- 239000003795 chemical substances by application Substances 0.000 description 70
- 239000000463 material Substances 0.000 description 14
- 230000008569 process Effects 0.000 description 12
- 238000005516 engineering process Methods 0.000 description 11
- 230000007246 mechanism Effects 0.000 description 7
- 238000013473 artificial intelligence Methods 0.000 description 5
- 238000004891 communication Methods 0.000 description 5
- 238000010586 diagram Methods 0.000 description 5
- 230000006870 function Effects 0.000 description 5
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 238000011161 development Methods 0.000 description 3
- 230000005540 biological transmission Effects 0.000 description 2
- 238000013461 design Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 238000004519 manufacturing process Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000008520 organization Effects 0.000 description 2
- 238000002360 preparation method Methods 0.000 description 2
- 238000012384 transportation and delivery Methods 0.000 description 2
- 230000001960 triggered effect Effects 0.000 description 2
- 238000004458 analytical method Methods 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 238000013523 data management Methods 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000013135 deep learning Methods 0.000 description 1
- 235000019800 disodium phosphate Nutrition 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 238000007726 management method Methods 0.000 description 1
- 230000005055 memory storage Effects 0.000 description 1
- 238000003058 natural language processing Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/22—Indexing; Data structures therefor; Storage structures
- G06F16/2228—Indexing structures
- G06F16/2246—Trees, e.g. B+trees
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/22—Indexing; Data structures therefor; Storage structures
- G06F16/2282—Tablespace storage structures; Management thereof
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2458—Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
- G06F16/2465—Query processing support for facilitating data mining operations in structured databases
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q40/00—Finance; Insurance; Tax strategies; Processing of corporate or income taxes
- G06Q40/08—Insurance
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Databases & Information Systems (AREA)
- General Physics & Mathematics (AREA)
- Business, Economics & Management (AREA)
- Software Systems (AREA)
- Data Mining & Analysis (AREA)
- General Engineering & Computer Science (AREA)
- Finance (AREA)
- Accounting & Taxation (AREA)
- Probability & Statistics with Applications (AREA)
- Computational Linguistics (AREA)
- Mathematical Physics (AREA)
- Fuzzy Systems (AREA)
- Development Economics (AREA)
- Economics (AREA)
- Marketing (AREA)
- Strategic Management (AREA)
- Technology Law (AREA)
- General Business, Economics & Management (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention relates to the field of data processing, and provides an enterprise index tree construction method, device, equipment and medium, which can extract main words and object words in a relation table, prepare for the association of subsequent data, fuse attribute data of each object to the relation table together to form a basic fact wide table, enable the data in the table to be more comprehensive, further enable the index tree generated subsequently to be more accurate, generate tree nodes based on a tracing mode, automatically generate names of indexes, reduce artificial participation, generate index trees of target business based on the names of the indexes under each tree node and the relation table, further automatically derive owner labels of the indexes according to attribute fields and measurement logic, realize the automatic construction of the index tree, and improve the efficiency and accuracy of data processing without artificial participation. The invention also relates to a blockchain technique, and the index tree can be stored on a blockchain node.
Description
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a method, an apparatus, a device, and a medium for constructing an enterprise index tree.
Background
Along with the continuous development of data management technology, more and more insurance enterprises are performing digital transformation, performing data modeling and analysis on the business, and realizing data operation so as to improve the enterprise operation efficiency, wherein the construction of a data index system is a core link of the data operation.
For example, in sales areas such as insurance companies, it is necessary to construct a data index system to support insurance sales business.
However, in the prior art, a technical developer analyzes the requirements, designs SQL (Structured Query Language ) codes by experience, performs data statistics to obtain indexes, and performs manual naming and classification management.
Disclosure of Invention
The embodiment of the invention provides an enterprise index tree construction method, device, equipment and medium, which aim to solve the problem of unclear construction of business indexes.
In a first aspect, an embodiment of the present invention provides a method for constructing an enterprise index tree, including:
Responding to an index tree construction instruction of a target service, acquiring a metadata table of the target service from a configuration database as a relation table, and extracting relation words from the relation table to construct a relation word set;
Traversing the relation table for each relation word in the relation word set to obtain the foreign key ID of each relation word, and constructing a main word set and an object word set of each relation word according to the foreign key ID of each relation word;
Through the foreign key ID of each relation word, associating each object in the relation table, the main word set and the object word set to obtain a basic fact wide table;
Acquiring a non-foreign key ID and a pre-configured constraint word set of each relation word, selecting constraint words from the constraint word set to construct a modifier word set, and generating a filtering sentence according to the modifier word set and the non-foreign key ID, wherein an owner label of each modifier word in the modifier word set is configured according to the corresponding relation word;
Randomly selecting at least one object from the ground truth wide table as a target dimension, and generating a grouping statement based on the target dimension;
Measuring each object in the basic fact wide table based on a measurement statement, and generating at least one tree node based on a measurement result of the measurement statement;
Splicing the filtering statement, the grouping statement and the measurement statement to obtain a target statement;
Traversing the data in the configuration database by using the target sentence to obtain an index under each tree node;
acquiring a pre-configured naming template, and matching indexes under each tree node in the naming template by utilizing the indexes under each tree node to generate the name of the index under each tree node;
And generating an index tree of the target service based on the names of the indexes under each tree node and the relation table.
According to a preferred embodiment of the present invention, the constructing the subject word set and the object word set of each relationship word according to the foreign key ID of each relationship word includes:
Acquiring attribute fields corresponding to foreign key IDs of each relationship word from the relationship table;
extracting field names of attribute fields corresponding to foreign key IDs of each related word;
When the field names correspond to users, adding attribute fields corresponding to the field names as subject words to the subject word set, and configuring owner labels of each subject word in the subject word set as corresponding field names; or alternatively
When the field names correspond to non-users, attribute fields corresponding to the field names are added to the object word set as object words, and an owner tag of each object word in the object word set is configured to be the corresponding field name.
According to a preferred embodiment of the present invention, the associating each object in the relation table, the subject word set, and the object word set by the foreign key ID of each relation word to obtain a basic fact broad table includes:
acquiring a data table of each subject word in the subject word set from the configuration database, and acquiring a data table of each object word in the object word set;
constructing an associated sentence based on the foreign key ID of each related word;
and associating the relation table with the data table of each subject word and associating the relation table with the data table of each object word by using the association statement to obtain the basic fact wide table.
According to a preferred embodiment of the present invention, the measuring each object in the ground truth wide table based on the measurement statement, and generating at least one tree node based on the measurement result of the measurement statement includes:
Measuring each object in the foundation fact wide table by adopting a COUNT statement to obtain the number of each object as a first basic index, and obtaining an owner label of each object as a tree node corresponding to the first basic index;
measuring the numerical value objects corresponding to the non-foreign key IDs in the basic fact wide table by adopting SUM sentences to obtain the SUM of each numerical value object as a second basic index, and obtaining the owner label of each numerical value object as a tree node corresponding to the second basic index;
and compounding each object in the foundation fact broad table by adopting the COUNT statement and the SUM statement to obtain a compound object, comparing and measuring the compound object to obtain the ratio of the compound object as a compound index, and obtaining a tree node corresponding to the molecule of the ratio of the compound object as the tree node of the compound index.
According to a preferred embodiment of the present invention, the matching in the naming template by using the index under each tree node includes:
Acquiring the target dimension, the constraint word, the table name of the relation table and the measurement name corresponding to the measurement result from the index under each tree node;
And sequentially splicing the target dimension, the constraint word, the table name of the relation table and the measurement name corresponding to the measurement result to obtain the name of the index under each tree node.
According to a preferred embodiment of the present invention, the generating the index tree of the target service based on the names of the indexes under each tree node and the relationship table includes:
acquiring the table names of the relation table, and establishing a root node according to the table names of the relation table;
connecting the root node with each tree node as a starting point to obtain a theme layer;
And expanding the theme layer according to the names of the indexes under each tree node to obtain the index tree of the target service.
According to a preferred embodiment of the present invention, after generating the index tree of the target service based on the names of the indexes under each tree node and the relation table, the method further includes:
generating a query statement according to indexes in the index tree;
Acquiring data from the configuration database based on the query statement;
And sending the acquired data to the appointed terminal equipment.
In a second aspect, an embodiment of the present invention provides an enterprise index tree construction apparatus, including:
The construction unit is used for responding to an index tree construction instruction of a target service, acquiring a metadata table of the target service from a configuration database as a relation table, and extracting relation words from the relation table to construct a relation word set;
the construction unit is further configured to traverse the relationship table for each relationship word in the relationship word set to obtain an external key ID of each relationship word, and construct a body word set and an object word set of each relationship word according to the external key ID of each relationship word;
The association unit is used for associating each object in the relation table, the main word set and the object word set through the foreign key ID of each relation word to obtain a basic fact wide table;
the generation unit is used for acquiring a non-external key ID of each relation word and a preset constraint word set, selecting constraint words from the constraint word set to construct a modifier set, and generating a filtering sentence according to the modifier set and the non-external key ID, wherein an owner tag of each modifier in the modifier set is configured according to a corresponding relation word;
the generating unit is further used for arbitrarily selecting at least one object from the basic fact wide table as a target dimension and generating a grouping statement based on the target dimension;
the generating unit is further used for measuring each object in the basic fact wide table based on a measurement statement, and generating at least one tree node based on a measurement result of the measurement statement;
the splicing unit is used for splicing the filtering statement, the grouping statement and the measurement statement to obtain a target statement;
The traversing unit is used for traversing the data in the configuration database by utilizing the target sentence to obtain an index under each tree node;
The generation unit is further used for acquiring a pre-configured naming template, and matching the indexes under each tree node in the naming template by utilizing the indexes under each tree node to generate the names of the indexes under each tree node;
The generating unit is further configured to generate an index tree of the target service based on the name of the index under each tree node and the relationship table.
In a third aspect, an embodiment of the present invention further provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and capable of running on the processor, where the processor implements the method for constructing an enterprise index tree according to the first aspect when executing the computer program.
In a fourth aspect, an embodiment of the present invention further provides a computer readable storage medium, where the computer readable storage medium stores a computer program, where the computer program when executed by a processor causes the processor to perform the enterprise index tree construction method described in the first aspect above.
The embodiment of the invention provides an enterprise index tree construction method, device, equipment and medium, which can respond to an index tree construction instruction of a target service, acquire a metadata table of the target service from a configuration database as a relation table, extract relation words from the relation table to construct a relation word set, traverse the relation table for each relation word in the relation word set to obtain an external key ID of each relation word, construct a main word set and an object word set of each relation word according to the external key ID of each relation word, extract main words and object words in the relation table to prepare for association of subsequent data, associate the relation table, the main word set and each object in the object word set through the external key ID of each relation word, combine attribute data of each object into the relation table, form the relation table, enable data in the table to be more comprehensive, further enable the subsequently generated tree to obtain a corresponding main word set and an object word set of each relation word, extract the main word and the object word in the relation table, generate a corresponding relation word from a constraint sentence based on at least, generate a constraint sentence based on at least, take at least one constraint sentence, take the relation word as a constraint sentence, take at least, take a constraint sentence based on the relation word from the relation word set, take at least, take a constraint sentence, take at least from the relation sentence, take at least to be a corresponding relation word, take a constraint sentence, take at least, take a corresponding relation word from the constraint sentence, take at least form, take at least take a corresponding relation word, take a constraint sentence, take at least form, take a corresponding relation word, take a corresponding relation item form, and a form are generated form are, the method comprises the steps of splicing the filtering statement, the grouping statement and the measurement statement to obtain a target statement, traversing data in the configuration database by utilizing the target statement to obtain indexes under each tree node, obtaining a pre-configured naming template, utilizing the indexes under each tree node to match in the naming template, generating names of the indexes under each tree node, automatically generating names of the indexes, reducing artificial participation, and generating an index tree of the target service based on the names of the indexes under each tree node and the relation table.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic flow chart of an enterprise index tree construction method according to an embodiment of the present invention;
FIG. 2 is a schematic block diagram of an enterprise index tree construction device provided by an embodiment of the present invention;
fig. 3 is a schematic block diagram of a computer device according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
It should be understood that the terms "comprises" and "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in this specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in the present specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes such combinations.
Referring to fig. 1, a flow chart of an enterprise index tree construction method according to an embodiment of the present invention is shown.
S10, responding to an index tree construction instruction of a target service, acquiring a metadata table of the target service from a configuration database as a relation table, and extracting relation words from the relation table to construct a relation word set.
In at least one embodiment of the present invention, the target business may include any business process of an enterprise, such as a business process of an insurance agent online visiting a customer.
In at least one embodiment of the present invention, the index tree construction instruction may be triggered by a related art developer, and the present invention is not limited.
In at least one embodiment of the present invention, the obtaining the metadata table of the target service from the configuration database as the relationship table includes:
acquiring a service name of the target service;
Inquiring in the configuration database according to the service name;
and taking the queried metadata table corresponding to the service name as the relation table, and taking the table name of the metadata table as the table name of the relation table.
Wherein the configuration database may comprise a database of an enterprise executing the target service.
For example: for the online visiting customer business process of the agent, the relation table may be an online visiting table.
In at least one embodiment of the present invention, the extracting the relational terms from the relational table to construct a set of relational terms includes:
Acquiring a relation field in the relation table, and taking a value corresponding to the relation field as the relation word;
and combining the relational words to obtain the relational word set.
For example: for an agent online visit customer business process, the relationship words may include, but are not limited to: sharing and online visiting.
S11, traversing the relation table for each relation word in the relation word set to obtain the foreign key ID of each relation word, and constructing a main word set and an object word set of each relation word according to the foreign key ID of each relation word.
In at least one embodiment of the present invention, the constructing the subject word set and the object word set of each relationship word according to the foreign key ID of each relationship word includes:
Acquiring attribute fields corresponding to foreign key IDs of each relationship word from the relationship table;
extracting field names of attribute fields corresponding to foreign key IDs of each related word;
When the field names correspond to users, adding attribute fields corresponding to the field names as subject words to the subject word set, and configuring owner labels of each subject word in the subject word set as corresponding field names; or alternatively
When the field names correspond to non-users, attribute fields corresponding to the field names are added to the object word set as object words, and an owner tag of each object word in the object word set is configured to be the corresponding field name.
Taking the above example, for the relation word "online visit", the attribute field agent, client, and meeting room are obtained in the relation table through the foreign key ID, wherein the agent and client belong to the user type, therefore, the agent and client are added into the subject word set, and the corresponding owner labels are configured as "agent" and "client"; the meeting room is not of the user type, and therefore, the meeting room is added to the set of object words and the corresponding owner tag is configured as "meeting room".
By the method, the main words and the object words in the relation table can be extracted, and preparation is made for association of subsequent data.
And S12, associating each object in the relation table, the main word set and the object word set through the foreign key ID of each relation word to obtain a basic fact broad table.
In at least one embodiment of the present invention, the associating each object in the relationship table, the subject word set, and the object word set by the foreign key ID of each relationship word, to obtain a basic fact broad table includes:
acquiring a data table of each subject word in the subject word set from the configuration database, and acquiring a data table of each object word in the object word set;
constructing an associated sentence based on the foreign key ID of each related word;
and associating the relation table with the data table of each subject word and associating the relation table with the data table of each object word by using the association statement to obtain the basic fact wide table.
The above example is accepted, the relation table is an online visit table, each object in the subject word set and the object word set corresponding to the foreign key ID is an agent, a client, a meeting room, and a scheme material, the data tables (agent table, client table, meeting room table, and scheme material table) corresponding to the agent, client, meeting room, and scheme material are obtained from the configuration database, and association is performed by using JOIN to construct an association statement, and then the relation table, agent table, client table, meeting room table, and scheme material table are combined as sub-tables to obtain the foundation fact wide table.
Specifically, the data table corresponding to each object is used to store own attribute data of each object, for example: the agent table may store data such as sex, age, working time of the agent, etc.
Specifically, the constructed association statement may be an SQL (Structured Query Language ) statement, and the association is performed by adopting a JOIN statement in the SQL, and the obtained association statement may be expressed as:
On-line visiting table
JOIN agent table ON-line visit table agent=agent table ID
JOIN customer table ON-line visit table customer = customer table ID
JOIN meeting room table ON-line visit table, meeting room = meeting room table ID
The JOIN scheme materials table ON line visit table scheme materials = scheme materials table ID.
In the above embodiment, by associating the relationship table with each object in the subject word set and the object word set, the attribute data of each object (i.e., each subject word and each object word) itself can be integrated into the relationship table, and the basic fact width table is formed, so that the data in the table is more comprehensive, and further, the index tree generated later is more accurate.
S13, acquiring a non-foreign key ID and a pre-configured constraint word set of each relation word, selecting constraint words from the constraint word set to construct a modifier word set, and generating a filtering statement according to the modifier word set and the non-foreign key ID, wherein an owner tag of each modifier word in the modifier word set is configured according to the corresponding relation word.
In this embodiment, the constraint word set is used to store words with constraint effects, and specifically, the constraint word set may include words for constraint time, words for constraint place, and the like.
The above example is carried out, and the constraint word set can comprise visit time and visit place.
In this embodiment, the constraint word set may be obtained by analyzing historical service data, or may be formulated by related staff, which is not limited by the present invention.
Further, the constraint word construction modifier set can be selected from the constraint word set according to the received service requirement, or the constraint word construction modifier set can be randomly selected from the constraint word set, and the method is not limited.
In the above example, the visit time may be selected from the constraint word set as a constraint word, the owner tag corresponding to the visit time may be configured as "online visit", the constraint word has a value of approximately 30 days, and a key value pair date_key=online visit table is obtained.
WHERE DATE (online visit table. Visit time) > = date_sub (CURDATE (), INTERVAL 30 day).
S14, at least one object is arbitrarily selected from the basic fact wide table to serve as a target dimension, and a grouping statement is generated based on the target dimension.
Following the above example, selecting "mechanism" from the at least one object as the target dimension, the generated grouping statement may be expressed as:
GROUP BY agent table.
Further, agents in the sub-table "agent table" of the ground truth wide table will be grouped by the dimension "organization".
And S15, measuring each object in the foundation fact wide table based on a measurement statement, and generating at least one tree node based on a measurement result of the measurement statement.
Specifically, the measuring each object in the basic fact wide table based on the measuring statement, and generating at least one tree node based on the measuring result of the measuring statement comprises:
Measuring each object in the foundation fact wide table by adopting a COUNT statement to obtain the number of each object as a first basic index, and obtaining an owner label of each object as a tree node corresponding to the first basic index;
measuring the numerical value objects corresponding to the non-foreign key IDs in the basic fact wide table by adopting SUM sentences to obtain the SUM of each numerical value object as a second basic index, and obtaining the owner label of each numerical value object as a tree node corresponding to the second basic index;
and compounding each object in the foundation fact broad table by adopting the COUNT statement and the SUM statement to obtain a compound object, comparing and measuring the compound object to obtain the ratio of the compound object as a compound index, and obtaining a tree node corresponding to the molecule of the ratio of the compound object as the tree node of the compound index.
Following the example above, the metric statement may be:
COUNT (online visitor table: agent), the measurement name is "agent number", because "online visitor table: agent" field is foreign key ID, its owner label is "agent", so the owner label of the index is deduced as "agent";
The COUNT (online visit list, client), the measurement name is "client number", because the online visit list, client field is the foreign key ID, its owner label is "client", so the index owner label is derived as "client"; SUM (on-line visit list. Duration), the measurement name is "duration SUM", the index owner is "on-line visit", because the "on-line visit list. Duration" field is a non-foreign key, its owner label is "on-line visit", so the index owner label is deduced as "on-line visit"; SUM (online visit list) time/COUNT (online visit list agent), the measure is named as SUM of time_agent number_ratio, the index owner is online visit, and the main index (molecule) "SUM (online visit list) time" owner label is online visit, so the index owner label is deduced to be online visit.
By the embodiment, the tree node can be generated based on the tracing mode.
S16, splicing the filtering statement, the grouping statement and the measurement statement to obtain a target statement.
For example: the spliced complete target sentence may be:
SELECT COUNT (ground truth table. Subject id)
FROM relationship table JOIN body table ON relationship table body id = body table id
JOIN body table ON relation object id = object table id
JOIN…
WHERE TRUE AND key_1=value_1…AND key_n=value_n
GROUP BY dimention_1,dimention_2,…,dimention_n。
In this embodiment, the filtering statement, the grouping statement and the metric statement are spliced to obtain the target statement, so as to query data in the configuration database.
In the embodiment, the generated target statement is close to available production, so that development efficiency is improved.
And S17, traversing the data in the configuration database by using the target sentence to obtain the index under each tree node.
By traversing, a specific index value under each tree node can be obtained from the configuration database.
S18, obtaining a pre-configured naming template, and utilizing indexes under each tree node to match in the naming template to generate names of the indexes under each tree node.
In this embodiment, the naming template may be configured according to actual requirements, and the naming template only plays a role in standardization and guidance, so the configuration mode is not limited.
In at least one embodiment of the present invention, the matching in the naming template by using the index under each tree node includes:
Acquiring the target dimension, the constraint word, the table name of the relation table and the measurement name corresponding to the measurement result from the index under each tree node;
And sequentially splicing the target dimension, the constraint word, the table name of the relation table and the measurement name corresponding to the measurement result to obtain the name of the index under each tree node.
In the example, the constraint word is about 30 days, the dimension word corresponding to the target dimension is a mechanism, and the table name of the relation table is a single online visit. The index name generation rule is as follows: dimension word-modifier value-business process name-measurement name, which is applied to the indexes generated before to obtain the name of each index:
I1: the number of visiting agent on the mechanism-near 30 days-single line is indicated by the index owner label "
I2: the number of visiting-clients on the mechanism-nearly 30 days-single line is that the index owner label is 'client'
And I3: mechanism-near 30 days-single person online visit-time sum, index owner label is "online visit"
And I4: the mechanism is 30 days close, the single person is online visit, the total time is the number of agent, and the index owner is labeled as online visit.
By the embodiment, the names of the indexes can be automatically generated, and human participation is reduced.
And S19, generating an index tree of the target service based on the names of the indexes under each tree node and the relation table.
In at least one embodiment of the present invention, the generating the index tree of the target service based on the names of the indexes under each tree node and the relation table includes:
acquiring the table names of the relation table, and establishing a root node according to the table names of the relation table;
connecting the root node with each tree node as a starting point to obtain a theme layer;
And expanding the theme layer according to the names of the indexes under each tree node to obtain the index tree of the target service.
With the above example, first, a root node single person line visit is created.
And then creating an agent, a client and online visiting three child nodes as the topic layer.
And further mounting each data index under a corresponding tree node in the theme layer. For example: for the index of 'mechanism-near 30 days-single line visit-agent number', the index owner label is 'agent', a tree node corresponding to the 'agent' is found from the theme layer, a leaf node named 'mechanism-near 30 days-single line visit-agent number' is created under the tree node, the automatic classification of indexes is completed, and the like, and an index tree of the business process of visiting clients on the agent line is formed.
According to the embodiment, the owner label of the index can be automatically deduced according to the attribute field and the measurement logic, the automatic construction of the index tree is realized, human participation is not needed, and the efficiency and the accuracy of data processing are improved.
In at least one embodiment of the present invention, after generating the index tree of the target service based on the names of the indexes under each tree node and the relationship table, the method further includes:
generating a query statement according to indexes in the index tree;
Acquiring data from the configuration database based on the query statement;
And sending the acquired data to the appointed terminal equipment.
In this embodiment, the specified terminal device may be a terminal device of a related worker, such as an intelligent terminal of an insurance agent, etc.
Through the implementation mode, the data can be further acquired from the database in a targeted mode based on the constructed index tree, the data can be conveniently analyzed and modeled, the data operation is realized, and the enterprise operation efficiency is improved.
It should be noted that, in order to further ensure the security of the data and avoid the data from being tampered maliciously, the index tree may be stored on a blockchain node.
According to the technical scheme, the method and the system can respond to the index tree construction instruction of the target service, obtain the metadata table of the target service from the configuration database as a relation table, extract relation words from the relation table to construct a relation word set, traverse the relation table for each relation word in the relation word set to obtain the external key ID of each relation word, construct a main body word set and an object word set of each relation word according to the external key ID of each relation word, extract the main body word and the object word in the relation table, prepare for association of subsequent data, associate the relation table, the main body word set and each object in the object word set through the external key ID of each relation word, obtain a basic fact wide table, fuse attribute data of each object to the relation table, form the basic fact wide table, enable data in the table to be more comprehensive, further enable the index tree generated subsequently to be more comprehensive, obtain the main body word set and the object word set in the relation word set, prepare for association of subsequent data, generate a modification sentence based on at least one constraint sentence from the relation word set, generate a constraint sentence based on at least, and the constraint sentence based on the constraint sentence, at least from the relation sentence, and at least one of the basic sentence, the constraint sentence is generated, the basic sentence is based on at least one of the relation sentence is generated, and the constraint sentence is generated, and the basic sentence is generated, at least based on the constraint sentence is generated, and the constraint sentence is based on the constraint sentence, and the constraint sentence is generated, and the constraint sentence is at least on the constraint sentence, and the constraint sentence is generated, and the basic sentence, the method comprises the steps of grouping sentences and measuring sentences to obtain target sentences, traversing data in the configuration database by using the target sentences to obtain indexes under each tree node, obtaining a pre-configured naming template, matching the indexes under each tree node in the naming template to generate names of the indexes under each tree node, automatically generating the names of the indexes, reducing artificial participation, and generating an index tree of the target service based on the names of the indexes under each tree node and the relation table.
The embodiment of the invention also provides an enterprise index tree construction device which is used for executing any embodiment of the enterprise index tree construction method. Specifically, referring to fig. 2, fig. 2 is a schematic block diagram of an enterprise index tree construction device according to an embodiment of the present invention.
As shown in fig. 2, the enterprise index tree construction apparatus 100 includes: a construction unit 101, an association unit 102, a generation unit 103, a splicing unit 104 and a traversing unit 105.
The construction unit 101 acquires a metadata table of a target service as a relationship table from a configuration database in response to an index tree construction instruction for the target service, and extracts a relationship word construction relationship word set from the relationship table.
In at least one embodiment of the present invention, the target business may include any business process of an enterprise, such as a business process of an insurance agent online visiting a customer.
In at least one embodiment of the present invention, the index tree construction instruction may be triggered by a related art developer, and the present invention is not limited.
In at least one embodiment of the present invention, the obtaining the metadata table of the target service from the configuration database as the relationship table includes:
acquiring a service name of the target service;
Inquiring in the configuration database according to the service name;
and taking the queried metadata table corresponding to the service name as the relation table, and taking the table name of the metadata table as the table name of the relation table.
Wherein the configuration database may comprise a database of an enterprise executing the target service.
For example: for the online visiting customer business process of the agent, the relation table may be an online visiting table.
In at least one embodiment of the present invention, the extracting, by the construction unit 101, a set of relationship words from the relationship table includes:
Acquiring a relation field in the relation table, and taking a value corresponding to the relation field as the relation word;
and combining the relational words to obtain the relational word set.
For example: for an agent online visit customer business process, the relationship words may include, but are not limited to: sharing and online visiting.
For each relationship word in the relationship word set, the construction unit 101 traverses the relationship table to obtain the foreign key ID of each relationship word, and constructs the subject word set and the object word set of each relationship word according to the foreign key ID of each relationship word.
In at least one embodiment of the present invention, the constructing unit 101 constructs a subject word set and an object word set of each relationship word according to the foreign key ID of each relationship word, including:
Acquiring attribute fields corresponding to foreign key IDs of each relationship word from the relationship table;
extracting field names of attribute fields corresponding to foreign key IDs of each related word;
When the field names correspond to users, adding attribute fields corresponding to the field names as subject words to the subject word set, and configuring owner labels of each subject word in the subject word set as corresponding field names; or alternatively
When the field names correspond to non-users, attribute fields corresponding to the field names are added to the object word set as object words, and an owner tag of each object word in the object word set is configured to be the corresponding field name.
Taking the above example, for the relation word "online visit", the attribute field agent, client, and meeting room are obtained in the relation table through the foreign key ID, wherein the agent and client belong to the user type, therefore, the agent and client are added into the subject word set, and the corresponding owner labels are configured as "agent" and "client"; the meeting room is not of the user type, and therefore, the meeting room is added to the set of object words and the corresponding owner tag is configured as "meeting room".
By the method, the main words and the object words in the relation table can be extracted, and preparation is made for association of subsequent data.
The association unit 102 associates each object in the relationship table, the subject word set and the object word set by the foreign key ID of each relationship word, and obtains a basic fact broad table.
In at least one embodiment of the present invention, the associating unit 102 associates each object in the relationship table, the subject word set, and the object word set by using the foreign key ID of each relationship word, and the obtaining the ground truth wide table includes:
acquiring a data table of each subject word in the subject word set from the configuration database, and acquiring a data table of each object word in the object word set;
constructing an associated sentence based on the foreign key ID of each related word;
and associating the relation table with the data table of each subject word and associating the relation table with the data table of each object word by using the association statement to obtain the basic fact wide table.
The above example is accepted, the relation table is an online visit table, each object in the subject word set and the object word set corresponding to the foreign key ID is an agent, a client, a meeting room, and a scheme material, the data tables (agent table, client table, meeting room table, and scheme material table) corresponding to the agent, client, meeting room, and scheme material are obtained from the configuration database, and association is performed by using JOIN to construct an association statement, and then the relation table, agent table, client table, meeting room table, and scheme material table are combined as sub-tables to obtain the foundation fact wide table.
Specifically, the data table corresponding to each object is used to store own attribute data of each object, for example: the agent table may store data such as sex, age, working time of the agent, etc.
Specifically, the constructed association statement may be an SQL (Structured Query Language ) statement, and the association is performed by adopting a JOIN statement in the SQL, and the obtained association statement may be expressed as:
On-line visiting table
JOIN agent table ON-line visit table agent=agent table ID
JOIN customer table ON-line visit table customer = customer table ID
JOIN meeting room table ON-line visit table, meeting room = meeting room table ID
The JOIN scheme materials table ON line visit table scheme materials = scheme materials table ID.
In the above embodiment, by associating the relationship table with each object in the subject word set and the object word set, the attribute data of each object (i.e., each subject word and each object word) itself can be integrated into the relationship table, and the basic fact width table is formed, so that the data in the table is more comprehensive, and further, the index tree generated later is more accurate.
The generating unit 103 obtains a non-foreign key ID and a pre-configured constraint word set of each relation word, selects a constraint word from the constraint word set to construct a modifier set, and generates a filtering sentence according to the modifier set and the non-foreign key ID, wherein an owner tag of each modifier in the modifier set is configured according to a corresponding relation word.
In this embodiment, the constraint word set is used to store words with constraint effects, and specifically, the constraint word set may include words for constraint time, words for constraint place, and the like.
The above example is carried out, and the constraint word set can comprise visit time and visit place.
In this embodiment, the constraint word set may be obtained by analyzing historical service data, or may be formulated by related staff, which is not limited by the present invention.
Further, the constraint word construction modifier set can be selected from the constraint word set according to the received service requirement, or the constraint word construction modifier set can be randomly selected from the constraint word set, and the method is not limited.
In the above example, the visit time may be selected from the constraint word set as a constraint word, the owner tag corresponding to the visit time may be configured as "online visit", the constraint word has a value of approximately 30 days, and a key value pair date_key=online visit table is obtained.
WHERE DATE (online visit table. Visit time) > = date_sub (CURDATE (), INTERVAL 30 day).
The generating unit 103 arbitrarily selects at least one object from the ground truth wide table as a target dimension, and generates a grouping sentence based on the target dimension.
Following the above example, selecting "mechanism" from the at least one object as the target dimension, the generated grouping statement may be expressed as:
GROUP BY agent table.
Further, agents in the sub-table "agent table" of the ground truth wide table will be grouped by the dimension "organization".
The generating unit 103 performs a metric on each object in the ground truth wide table based on a metric statement, and generates at least one tree node based on a metric result of the metric statement.
Specifically, the generating unit 103 measures each object in the ground truth wide table based on a measurement statement, and generates at least one tree node based on a measurement result of the measurement statement includes:
Measuring each object in the foundation fact wide table by adopting a COUNT statement to obtain the number of each object as a first basic index, and obtaining an owner label of each object as a tree node corresponding to the first basic index;
measuring the numerical value objects corresponding to the non-foreign key IDs in the basic fact wide table by adopting SUM sentences to obtain the SUM of each numerical value object as a second basic index, and obtaining the owner label of each numerical value object as a tree node corresponding to the second basic index;
and compounding each object in the foundation fact broad table by adopting the COUNT statement and the SUM statement to obtain a compound object, comparing and measuring the compound object to obtain the ratio of the compound object as a compound index, and obtaining a tree node corresponding to the molecule of the ratio of the compound object as the tree node of the compound index.
Following the example above, the metric statement may be:
COUNT (online visitor table: agent), the measurement name is "agent number", because "online visitor table: agent" field is foreign key ID, its owner label is "agent", so the owner label of the index is deduced as "agent";
The COUNT (online visit list, client), the measurement name is "client number", because the online visit list, client field is the foreign key ID, its owner label is "client", so the index owner label is derived as "client"; SUM (on-line visit list. Duration), the measurement name is "duration SUM", the index owner is "on-line visit", because the "on-line visit list. Duration" field is a non-foreign key, its owner label is "on-line visit", so the index owner label is deduced as "on-line visit"; SUM (online visit list) time/COUNT (online visit list agent), the measure is named as SUM of time_agent number_ratio, the index owner is online visit, and the main index (molecule) "SUM (online visit list) time" owner label is online visit, so the index owner label is deduced to be online visit.
By the embodiment, the tree node can be generated based on the tracing mode.
The splicing unit 104 splices the filtering statement, the grouping statement and the measurement statement to obtain a target statement.
For example: the spliced complete target sentence may be:
SELECT COUNT (ground truth table. Subject id)
FROM relationship table JOIN body table ON relationship table body id = body table id
JOIN body table ON relation object id = object table id
JOIN…
WHERE TRUE AND key_1=value_1…AND key_n=value_n
GROUP BY dimention_1,dimention_2,…,dimention_n。
In this embodiment, the filtering statement, the grouping statement and the metric statement are spliced to obtain the target statement, so as to query data in the configuration database.
In the embodiment, the generated target statement is close to available production, so that development efficiency is improved.
The traversing unit 105 traverses the data in the configuration database by using the target sentence to obtain the index under each tree node.
By traversing, a specific index value under each tree node can be obtained from the configuration database.
The generating unit 103 acquires a pre-configured naming template, and matches in the naming template with the index under each tree node, generating the name of the index under each tree node.
In this embodiment, the naming template may be configured according to actual requirements, and the naming template only plays a role in standardization and guidance, so the configuration mode is not limited.
In at least one embodiment of the present invention, the generating unit 103 matches the index under each tree node in the naming template, and generating the name of the index under each tree node includes:
Acquiring the target dimension, the constraint word, the table name of the relation table and the measurement name corresponding to the measurement result from the index under each tree node;
And sequentially splicing the target dimension, the constraint word, the table name of the relation table and the measurement name corresponding to the measurement result to obtain the name of the index under each tree node.
In the example, the constraint word is about 30 days, the dimension word corresponding to the target dimension is a mechanism, and the table name of the relation table is a single online visit. The index name generation rule is as follows: dimension word-modifier value-business process name-measurement name, which is applied to the indexes generated before to obtain the name of each index:
I1: the number of visiting agent on the mechanism-near 30 days-single line is indicated by the index owner label "
I2: the number of visiting-clients on the mechanism-nearly 30 days-single line is that the index owner label is 'client'
And I3: mechanism-near 30 days-single person online visit-time sum, index owner label is "online visit"
And I4: the mechanism is 30 days close, the single person is online visit, the total time is the number of agent, and the index owner is labeled as online visit.
By the embodiment, the names of the indexes can be automatically generated, and human participation is reduced.
The generating unit 103 generates an index tree of the target service based on the names of the indexes under each tree node and the relationship table.
In at least one embodiment of the present invention, the generating unit 103 generating the index tree of the target service based on the names of the indexes under each tree node and the relationship table includes:
acquiring the table names of the relation table, and establishing a root node according to the table names of the relation table;
connecting the root node with each tree node as a starting point to obtain a theme layer;
And expanding the theme layer according to the names of the indexes under each tree node to obtain the index tree of the target service.
With the above example, first, a root node single person line visit is created.
And then creating an agent, a client and online visiting three child nodes as the topic layer.
And further mounting each data index under a corresponding tree node in the theme layer. For example: for the index of 'mechanism-near 30 days-single line visit-agent number', the index owner label is 'agent', a tree node corresponding to the 'agent' is found from the theme layer, a leaf node named 'mechanism-near 30 days-single line visit-agent number' is created under the tree node, the automatic classification of indexes is completed, and the like, and an index tree of the business process of visiting clients on the agent line is formed.
According to the embodiment, the owner label of the index can be automatically deduced according to the attribute field and the measurement logic, the automatic construction of the index tree is realized, human participation is not needed, and the efficiency and the accuracy of data processing are improved.
In at least one embodiment of the present invention, after generating an index tree of the target service based on the names of the indexes under each tree node and the relation table, a query statement is generated according to the indexes in the index tree;
Acquiring data from the configuration database based on the query statement;
And sending the acquired data to the appointed terminal equipment.
In this embodiment, the specified terminal device may be a terminal device of a related worker, such as an intelligent terminal of an insurance agent, etc.
Through the implementation mode, the data can be further acquired from the database in a targeted mode based on the constructed index tree, the data can be conveniently analyzed and modeled, the data operation is realized, and the enterprise operation efficiency is improved.
It should be noted that, in order to further ensure the security of the data and avoid the data from being tampered maliciously, the index tree may be stored on a blockchain node.
According to the technical scheme, the method and the system can respond to the index tree construction instruction of the target service, obtain the metadata table of the target service from the configuration database as a relation table, extract relation words from the relation table to construct a relation word set, traverse the relation table for each relation word in the relation word set to obtain the external key ID of each relation word, construct a main body word set and an object word set of each relation word according to the external key ID of each relation word, extract the main body word and the object word in the relation table, prepare for association of subsequent data, associate the relation table, the main body word set and each object in the object word set through the external key ID of each relation word, obtain a basic fact wide table, fuse attribute data of each object to the relation table, form the basic fact wide table, enable data in the table to be more comprehensive, further enable the index tree generated subsequently to be more comprehensive, obtain the main body word set and the object word set in the relation word set, prepare for association of subsequent data, generate a modification sentence based on at least one constraint sentence from the relation word set, generate a constraint sentence based on at least, and the constraint sentence based on the constraint sentence, at least from the relation sentence, and at least one of the basic sentence, the constraint sentence is generated, the basic sentence is based on at least one of the relation sentence is generated, and the constraint sentence is generated, and the basic sentence is generated, at least based on the constraint sentence is generated, and the constraint sentence is based on the constraint sentence, and the constraint sentence is generated, and the constraint sentence is at least on the constraint sentence, and the constraint sentence is generated, and the basic sentence, the method comprises the steps of grouping sentences and measuring sentences to obtain target sentences, traversing data in the configuration database by using the target sentences to obtain indexes under each tree node, obtaining a pre-configured naming template, matching the indexes under each tree node in the naming template to generate names of the indexes under each tree node, automatically generating the names of the indexes, reducing artificial participation, and generating an index tree of the target service based on the names of the indexes under each tree node and the relation table.
The enterprise index tree construction means described above may be implemented in the form of a computer program which is executable on a computer device as shown in fig. 3.
Referring to fig. 3, fig. 3 is a schematic block diagram of a computer device according to an embodiment of the present invention. The computer device 500 is a server, and the server may be a stand-alone server or a server cluster formed by a plurality of servers. The server may be an independent server, or may be a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and basic cloud computing services such as big data and artificial intelligence platforms.
Wherein artificial intelligence (ARTIFICIAL INTELLIGENCE, AI) is the theory, method, technique, and application system that uses a digital computer or a digital computer-controlled machine to simulate, extend, and expand human intelligence, sense the environment, acquire knowledge, and use knowledge to obtain optimal results.
Artificial intelligence infrastructure technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technologies, operation/interaction systems, mechatronics, and the like. The artificial intelligence software technology mainly comprises a computer vision technology, a robot technology, a biological recognition technology, a voice processing technology, a natural language processing technology, machine learning/deep learning and other directions.
With reference to FIG. 3, the computer device 500 includes a processor 502, a memory, and a network interface 505, connected by a system bus 501, where the memory may include a storage medium 503 and an internal memory 504.
The storage medium 503 may store an operating system 5031 and a computer program 5032. The computer program 5032, when executed, may cause the processor 502 to perform an enterprise index tree construction method.
The processor 502 is used to provide computing and control capabilities to support the operation of the overall computer device 500.
The internal memory 504 provides an environment for the execution of a computer program 5032 in the storage medium 503, which computer program 5032, when executed by the processor 502, causes the processor 502 to perform an enterprise index tree construction method.
The network interface 505 is used for network communication, such as providing for transmission of data information, etc. It will be appreciated by those skilled in the art that the architecture shown in fig. 3 is merely a block diagram of some of the architecture relevant to the present inventive arrangements and is not limiting of the computer device 500 to which the present inventive arrangements may be implemented, and that a particular computer device 500 may include more or fewer components than shown, or may combine some of the components, or have a different arrangement of components.
The processor 502 is configured to execute a computer program 5032 stored in a memory, so as to implement the enterprise index tree construction method disclosed in the embodiment of the present invention.
Those skilled in the art will appreciate that the embodiment of the computer device shown in fig. 3 is not limiting of the specific construction of the computer device, and in other embodiments, the computer device may include more or less components than those shown, or certain components may be combined, or a different arrangement of components. For example, in some embodiments, the computer device may include only a memory and a processor, and in such embodiments, the structure and function of the memory and the processor are consistent with the embodiment shown in fig. 3, and will not be described again.
It should be appreciated that in embodiments of the present invention, the Processor 502 may be a central processing unit (Central Processing Unit, CPU), the Processor 502 may also be other general purpose processors, digital signal processors (DIGITAL SIGNAL processors, DSPs), application SPECIFIC INTEGRATED Circuits (ASICs), off-the-shelf Programmable gate arrays (Field-Programmable GATE ARRAY, FPGA) or other Programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. Wherein the general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
In another embodiment of the invention, a computer-readable storage medium is provided. The computer readable storage medium may be a nonvolatile computer readable storage medium or a volatile computer readable storage medium. The computer readable storage medium stores a computer program, wherein the computer program when executed by a processor implements the enterprise index tree construction method disclosed in the embodiments of the present invention.
The blockchain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm and the like. The blockchain (Blockchain), essentially a de-centralized database, is a string of data blocks that are generated in association using cryptographic methods, each of which contains information from a batch of network transactions for verifying the validity (anti-counterfeit) of its information and generating the next block. The blockchain may include a blockchain underlying platform, a platform product services layer, an application services layer, and the like.
The data in this case were obtained legally.
It will be clearly understood by those skilled in the art that, for convenience and brevity of description, specific working procedures of the apparatus, device and unit described above may refer to corresponding procedures in the foregoing method embodiments, which are not repeated herein. Those of ordinary skill in the art will appreciate that the elements and algorithm steps described in connection with the embodiments disclosed herein may be embodied in electronic hardware, in computer software, or in a combination of the two, and that the elements and steps of the examples have been generally described in terms of function in the foregoing description to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the several embodiments provided by the present invention, it should be understood that the disclosed apparatus, device and method may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, and for example, the division of the units is merely a logical function division, there may be another division manner in actual implementation, or units having the same function may be integrated into one unit, for example, multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed. In addition, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices, or elements, or may be an electrical, mechanical, or other form of connection.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiment of the present invention.
The invention is operational with numerous general purpose or special purpose computer system environments or configurations. For example: personal computers, server computers, hand-held or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like. The invention may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The invention may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
In addition, each functional unit in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units may be stored in a storage medium if implemented in the form of software functional units and sold or used as stand-alone products. Based on such understanding, the technical solution of the present invention is essentially or a part contributing to the prior art, or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a magnetic disk, an optical disk, or other various media capable of storing program codes.
While the invention has been described with reference to certain preferred embodiments, it will be understood by those skilled in the art that various changes and substitutions of equivalents may be made and equivalents will be apparent to those skilled in the art without departing from the scope of the invention. Therefore, the protection scope of the invention is subject to the protection scope of the claims.
Claims (7)
1. An enterprise index tree construction method, comprising:
Responding to an index tree construction instruction of a target service, acquiring a metadata table of the target service from a configuration database as a relation table, and extracting relation words from the relation table to construct a relation word set;
Traversing the relation table for each relation word in the relation word set to obtain the foreign key ID of each relation word, and constructing a main word set and an object word set of each relation word according to the foreign key ID of each relation word;
Through the foreign key ID of each relation word, associating each object in the relation table, the main word set and the object word set to obtain a basic fact wide table;
Acquiring a non-foreign key ID and a pre-configured constraint word set of each relation word, selecting constraint words from the constraint word set to construct a modifier word set, and generating a filtering sentence according to the modifier word set and the non-foreign key ID, wherein an owner label of each modifier word in the modifier word set is configured according to the corresponding relation word;
Randomly selecting at least one object from the ground truth wide table as a target dimension, and generating a grouping statement based on the target dimension;
Measuring each object in the basic fact wide table based on a measurement statement, and generating at least one tree node based on a measurement result of the measurement statement;
Splicing the filtering statement, the grouping statement and the measurement statement to obtain a target statement;
Traversing the data in the configuration database by using the target sentence to obtain an index under each tree node;
acquiring a pre-configured naming template, and matching indexes under each tree node in the naming template by utilizing the indexes under each tree node to generate the name of the index under each tree node;
Generating an index tree of the target service based on the names of the indexes under each tree node and the relation table;
the constructing the subject word set and the object word set of each relationship word according to the foreign key ID of each relationship word comprises the following steps:
Acquiring attribute fields corresponding to foreign key IDs of each relationship word from the relationship table;
extracting field names of attribute fields corresponding to foreign key IDs of each related word;
When the field names correspond to users, adding attribute fields corresponding to the field names as subject words to the subject word set, and configuring owner labels of each subject word in the subject word set as corresponding field names; or alternatively
When the field names correspond to non-users, adding attribute fields corresponding to the field names as object words to the object word set, and configuring an owner tag of each object word in the object word set as a corresponding field name;
The step of obtaining a basic fact broad table by associating the relation table, the main word set and each object in the object word set through the foreign key ID of each relation word comprises the following steps:
acquiring a data table of each subject word in the subject word set from the configuration database, and acquiring a data table of each object word in the object word set;
constructing an associated sentence based on the foreign key ID of each related word;
The relation table is associated with the data table of each subject word by using the association statement, and the relation table is associated with the data table of each object word, so that the foundation fact wide table is obtained;
The measuring each object in the ground truth wide table based on the measuring statement, and generating at least one tree node based on the measuring result of the measuring statement comprises:
Measuring each object in the foundation fact wide table by adopting a COUNT statement to obtain the number of each object as a first basic index, and obtaining an owner label of each object as a tree node corresponding to the first basic index;
measuring the numerical value objects corresponding to the non-foreign key IDs in the basic fact wide table by adopting SUM sentences to obtain the SUM of each numerical value object as a second basic index, and obtaining the owner label of each numerical value object as a tree node corresponding to the second basic index;
and compounding each object in the foundation fact broad table by adopting the COUNT statement and the SUM statement to obtain a compound object, comparing and measuring the compound object to obtain the ratio of the compound object as a compound index, and obtaining a tree node corresponding to the molecule of the ratio of the compound object as the tree node of the compound index.
2. The method for constructing an enterprise index tree according to claim 1, wherein said matching in the naming template by using the index under each tree node includes:
Acquiring the target dimension, the constraint word, the table name of the relation table and the measurement name corresponding to the measurement result from the index under each tree node;
And sequentially splicing the target dimension, the constraint word, the table name of the relation table and the measurement name corresponding to the measurement result to obtain the name of the index under each tree node.
3. The method for constructing an enterprise index tree according to claim 1, wherein said generating an index tree of the target service based on the names of the indexes under each tree node and the relation table comprises:
acquiring the table names of the relation table, and establishing a root node according to the table names of the relation table;
connecting the root node with each tree node as a starting point to obtain a theme layer;
And expanding the theme layer according to the names of the indexes under each tree node to obtain the index tree of the target service.
4. The method of claim 1, further comprising, after generating the index tree of the target service based on the names of the indexes under each tree node and the relationship table:
generating a query statement according to indexes in the index tree;
Acquiring data from the configuration database based on the query statement;
And sending the acquired data to the appointed terminal equipment.
5. An enterprise index tree construction apparatus, comprising:
The construction unit is used for responding to an index tree construction instruction of a target service, acquiring a metadata table of the target service from a configuration database as a relation table, and extracting relation words from the relation table to construct a relation word set;
the construction unit is further configured to traverse the relationship table for each relationship word in the relationship word set to obtain an external key ID of each relationship word, and construct a body word set and an object word set of each relationship word according to the external key ID of each relationship word;
The association unit is used for associating each object in the relation table, the main word set and the object word set through the foreign key ID of each relation word to obtain a basic fact wide table;
the generation unit is used for acquiring a non-external key ID of each relation word and a preset constraint word set, selecting constraint words from the constraint word set to construct a modifier set, and generating a filtering sentence according to the modifier set and the non-external key ID, wherein an owner tag of each modifier in the modifier set is configured according to a corresponding relation word;
the generating unit is further used for arbitrarily selecting at least one object from the basic fact wide table as a target dimension and generating a grouping statement based on the target dimension;
the generating unit is further used for measuring each object in the basic fact wide table based on a measurement statement, and generating at least one tree node based on a measurement result of the measurement statement;
the splicing unit is used for splicing the filtering statement, the grouping statement and the measurement statement to obtain a target statement;
The traversing unit is used for traversing the data in the configuration database by utilizing the target sentence to obtain an index under each tree node;
The generation unit is further used for acquiring a pre-configured naming template, and matching the indexes under each tree node in the naming template by utilizing the indexes under each tree node to generate the names of the indexes under each tree node;
the generating unit is further configured to generate an index tree of the target service based on the name of the index under each tree node and the relationship table;
The construction unit constructs a subject word set and an object word set of each relationship word according to the foreign key ID of each relationship word, and the construction unit comprises:
Acquiring attribute fields corresponding to foreign key IDs of each relationship word from the relationship table;
extracting field names of attribute fields corresponding to foreign key IDs of each related word;
When the field names correspond to users, adding attribute fields corresponding to the field names as subject words to the subject word set, and configuring owner labels of each subject word in the subject word set as corresponding field names; or alternatively
When the field names correspond to non-users, adding attribute fields corresponding to the field names as object words to the object word set, and configuring an owner tag of each object word in the object word set as a corresponding field name;
the association unit associates each object in the relation table, the subject word set and the object word set through the foreign key ID of each relation word, and the obtaining of the basic fact broad table comprises:
acquiring a data table of each subject word in the subject word set from the configuration database, and acquiring a data table of each object word in the object word set;
constructing an associated sentence based on the foreign key ID of each related word;
The relation table is associated with the data table of each subject word by using the association statement, and the relation table is associated with the data table of each object word, so that the foundation fact wide table is obtained;
the generating unit measures each object in the ground truth wide table based on a measurement statement, and generates at least one tree node based on a measurement result of the measurement statement includes:
Measuring each object in the foundation fact wide table by adopting a COUNT statement to obtain the number of each object as a first basic index, and obtaining an owner label of each object as a tree node corresponding to the first basic index;
measuring the numerical value objects corresponding to the non-foreign key IDs in the basic fact wide table by adopting SUM sentences to obtain the SUM of each numerical value object as a second basic index, and obtaining the owner label of each numerical value object as a tree node corresponding to the second basic index;
and compounding each object in the foundation fact broad table by adopting the COUNT statement and the SUM statement to obtain a compound object, comparing and measuring the compound object to obtain the ratio of the compound object as a compound index, and obtaining a tree node corresponding to the molecule of the ratio of the compound object as the tree node of the compound index.
6. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the enterprise index tree construction method of any one of claims 1 to 4 when the computer program is executed.
7. A computer readable storage medium, characterized in that the computer readable storage medium stores a computer program, which when executed by a processor causes the processor to perform the enterprise index tree construction method according to any one of claims 1 to 4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210176747.7A CN114510489B (en) | 2022-02-25 | 2022-02-25 | Enterprise index tree construction method, device, equipment and medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210176747.7A CN114510489B (en) | 2022-02-25 | 2022-02-25 | Enterprise index tree construction method, device, equipment and medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114510489A CN114510489A (en) | 2022-05-17 |
CN114510489B true CN114510489B (en) | 2024-11-05 |
Family
ID=81554320
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210176747.7A Active CN114510489B (en) | 2022-02-25 | 2022-02-25 | Enterprise index tree construction method, device, equipment and medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114510489B (en) |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111949743A (en) * | 2020-07-31 | 2020-11-17 | 上海中通吉网络技术有限公司 | Method, device and equipment for acquiring network operation data |
CN112506946A (en) * | 2020-12-03 | 2021-03-16 | 平安科技(深圳)有限公司 | Service data query method, device, equipment and storage medium |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7310624B1 (en) * | 2000-05-02 | 2007-12-18 | International Business Machines Corporation | Methods and apparatus for generating decision trees with discriminants and employing same in data classification |
CN103793422B (en) * | 2012-10-31 | 2017-05-17 | 国际商业机器公司 | Methods for generating cube metadata and query statements on basis of enhanced star schema |
US10566081B2 (en) * | 2016-12-09 | 2020-02-18 | International Business Machines Corporation | Method and system for automatic knowledge-based feature extraction from electronic medical records |
CN112819305A (en) * | 2021-01-22 | 2021-05-18 | 平安普惠企业管理有限公司 | Service index analysis method, device, equipment and storage medium |
-
2022
- 2022-02-25 CN CN202210176747.7A patent/CN114510489B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111949743A (en) * | 2020-07-31 | 2020-11-17 | 上海中通吉网络技术有限公司 | Method, device and equipment for acquiring network operation data |
CN112506946A (en) * | 2020-12-03 | 2021-03-16 | 平安科技(深圳)有限公司 | Service data query method, device, equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN114510489A (en) | 2022-05-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103177068B (en) | According to the system and method for existence compatible rule merging source record | |
Rudolf et al. | The graph story of the SAP HANA database | |
US10346358B2 (en) | Systems and methods for management of data platforms | |
CN111831636B (en) | Data processing method, device, computer system and readable storage medium | |
CN107092666B (en) | For the system, method and storage medium of network | |
CN111507709B (en) | Data tracing system | |
CN109684330A (en) | User's portrait base construction method, device, computer equipment and storage medium | |
US20180268491A1 (en) | Cognitive regulatory compliance automation of blockchain transactions | |
CN109408811B (en) | Data processing method and server | |
CN104412265A (en) | Updating a search index used to facilitate application searches | |
US8959076B2 (en) | Managing a service catalog through crowdsourcing | |
CN114138985B (en) | Text data processing method and device, computer equipment and storage medium | |
CN111813956A (en) | Knowledge graph construction method and device, and information penetration method and system | |
US20110145005A1 (en) | Method and system for automatic business content discovery | |
CN110414259B (en) | Method and equipment for constructing data category and realizing data sharing | |
CN113377758A (en) | Data quality auditing engine and auditing method thereof | |
US20190387056A1 (en) | Irc-infoid data standardization for use in a plurality of mobile applications | |
US9652740B2 (en) | Fan identity data integration and unification | |
CN110968571A (en) | Big data analysis and processing platform for financial information service | |
Abid et al. | Towards a smart city ontology | |
US8862609B2 (en) | Expanding high level queries | |
CN116541411A (en) | SQL sentence acquisition method, report generation device, computer equipment and storage medium | |
ES2900746T3 (en) | Systems and methods to effectively distribute warning messages | |
US20200380022A1 (en) | Auto derivation of summary data using machine learning | |
CN114510489B (en) | Enterprise index tree construction method, device, equipment and medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant |