Business form field-driven dynamic index generation method and system
By constructing a business form query configuration tree and generating a minimum effective field adjustment tree using a Bayesian algorithm, index adjustments are automatically executed, solving the problem that index strategies in traditional systems cannot adapt to business changes, and achieving efficient dynamic index management and rapid response.
Patent Information
- Application Number
- CN202511518192.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-23
- Publication Date
- 2026-01-27
- Estimated Expiration
- 2045-10-23
AI Technical Summary
In traditional data reporting and management systems, business form query functions rely on hard-coded implementation, resulting in slow system response to business changes, high development and maintenance costs, and static database indexing strategies cannot adapt to dynamic changes in business form field configurations, leading to redundant indexes, invalid composite indexes, and decreased query efficiency.
By constructing a business form query configuration tree, combining Bayesian and optimization algorithms to generate a minimum effective field adjustment tree, automatically executing index adjustments using an index strategy engine, and optimizing the index through a closed-loop feedback mechanism, dynamic index management is achieved.
It significantly reduces the complexity and resource overhead of index changes, improves the system's response speed and adaptability to changes in business form query requirements, and ensures query stability and accuracy.
Smart Images

Figure CN120994670B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of index generation technology, and in particular relates to a dynamic index generation method and system driven by business form fields. Background Technology
[0002] In traditional data reporting and management systems, business form query functions often rely on hard-coding. Developers need to pre-create database indexes for specific fields based on fixed business requirements and write backend query logic. However, as business grows, users frequently add or adjust queryable fields, query condition types, and complex combinations of conditions. This forces developers to repeatedly modify code, adjust indexes, and redeploy the system, resulting in slow system response to business changes and high development and maintenance costs. Furthermore, in existing technologies, static database indexing strategies cannot adapt to dynamic changes in business form field configurations. When field query validity, hierarchical relationships between fields, or query logic combinations change, the system cannot automatically detect and adjust the index structure, leading to a large number of redundant indexes, invalid composite indexes, and query mode mismatches. This not only wastes storage space and degrades write performance but also prevents the query optimizer from effectively utilizing indexes, forcing it to perform full table scans, ultimately causing database query efficiency degradation and reduced system response speed. Summary of the Invention
[0003] To address the shortcomings of existing technologies, this invention proposes a dynamic index generation method and system driven by business form fields. This method constructs a business form query configuration tree and generates a minimum effective field adjustment tree based on real-time configuration changes, combining Bayesian and optimization algorithms. It accurately identifies the fields requiring adjustment and their associated query operations, dynamically generating an index optimization scheme with the goal of minimizing change constraints and maximizing query fit. The index strategy engine automatically executes index adjustments and utilizes a closed-loop feedback mechanism for continuous optimization, significantly reducing the complexity and resource overhead of index changes. This effectively improves the system's response rate and adaptability to changes in business form query requirements, achieving high-performance, highly available dynamic index management.
[0004] To achieve the above objectives, the present invention provides the following technical solution:
[0005] Methods for generating dynamic indexes driven by business form fields include:
[0006] Based on the query configuration items of form fields in the business form configuration subsystem, a graph algorithm and a tree-structured database are used to obtain the business form query configuration tree;
[0007] By combining real-time configuration change operations of query configuration items for form fields in the business form configuration subsystem with an optimal traversal strategy, the minimum effective field adjustment tree is obtained with the goal of minimizing change constraints and maximizing fit.
[0008] Based on the minimum effective field adjustment tree, the database index creation or adjustment statement is obtained through the index strategy engine;
[0009] The system automatically executes the database index creation or adjustment statements to adjust the business form query configuration tree and responds to the real-time query requirements of newly added business forms. When any query requirement is abnormal, the system locates the real-time query requirement of the business form and the corresponding updated query index.
[0010] The real-time query requirements of the business forms and the corresponding updated query index are fed back to the optimal traversal strategy for real-time updates until all query requirements are met.
[0011] Specifically, the minimum effective field adjustment tree is obtained by extracting the query fields to be changed and the corresponding associated query fields from the business form query configuration tree, considering the complexity of the change operations, the query permissions of the query operators corresponding to single or compound query fields, the fine-grained query indicators, and the parent-child hierarchical relationship. It is obtained by traversing a preset objective function constructed from the minimum change constraints and the maximum fit, using a Bayesian algorithm and an optimal traversal strategy. The fit is represented by the query anomaly probability obtained by the Bayesian algorithm during the query process of the modified business form query configuration tree for the business form, and is used to associate and represent the effectiveness of the modified business form query configuration tree.
[0012] The process of obtaining the minimum change constraint is as follows: based on the parent-child hierarchical relationship of the business form query configuration tree, taking the field to be changed as the initial parent field, traversing each associated child field corresponding to the initial parent field, and using the Bayesian algorithm, with the query permissions, query fine-grained indicators and dependency degree corresponding to the parent field and the associated child field as conditions, calculating the conditional probability that each associated child field needs to be adjusted with the corresponding parent field.
[0013] Related subfields with conditional probabilities below a preset threshold are excluded, and the set of remaining fields is used as the minimum change constraint for the current change operation; the fine-grained query metric is constructed based on the selectivity of the query results of the single or compound query operator corresponding to each single or compound query field, and is used to optimize the accuracy of the query index.
[0014] Specifically, the process of obtaining the business form query configuration tree includes:
[0015] Based on the business form text information and text parsing algorithm, a form metadata field table is obtained; the form metadata field table includes at least the form ID, field and corresponding ID set, field association pointer, field association logical relationship operator set and field query combination dependency relationship, field query validity status label, field data type and constraint attribute, query operator mapping set, historical query frequency, and form business affiliation label.
[0016] The root node is constructed using the form ID and the form business belonging label; the field-driven node layer is constructed using the fields and their corresponding ID sets, field data types and constraint attributes and field association pointers; the query configuration node layer is constructed using the set of field association logical relationship operators; and the target index layer is constructed using the business form information data.
[0017] Based on the root node, the connection relationships between each field node in the field-driven node layer, the connection relationships between query operation nodes in the query configuration node layer, the connection relationships between target index character nodes in the target index layer, and the form ID and field ID, a first cross-layer driven connection is constructed. A second cross-layer driven combined connection is constructed based on the set of field association logic relationship operators and the field query combination dependency relationship. A third cross-layer driven index connection is constructed based on the set of query operator mappings and the historical query frequencies corresponding to the corresponding fields and query operators. Finally, a business form query configuration tree is constructed using a graph neural network and a tree-structured database.
[0018] Specifically, the process of obtaining the first cross-layer driver connection includes:
[0019] Based on the form ID, fields and corresponding ID sets, construct the first one-to-many connection sequence between the root node and the field-driven node layer;
[0020] Based on the business form attribution tags and field attribute features, text feature extraction algorithms are used to obtain business domain classification features, field-related business indicator type features, periodic association matching features, and scenario constraint matching features.
[0021] Based on business domain classification features, field-related business indicator type features, periodic association matching features, and scenario constraint matching features, the query-driven association degree between the business form and each field is obtained through association analysis algorithms.
[0022] Based on the field query validity status label, obtain the corresponding binary label, the binary label includes 1 and 0, 1 corresponds to the field being valid, and 0 corresponds to the field being disabled;
[0023] The binary label and the query-driven correlation are embedded into the first connection sequence to construct the first cross-layer driving connection.
[0024] Specifically, the process of obtaining the field-driven node layer includes:
[0025] Based on the binary labels, fields and corresponding ID sets, field data types and constraint attributes, and field association pointers in the first cross-layer driving connection, valid fields are filtered through availability verification rules to obtain a basic list of valid fields;
[0026] Based on the effective field base list, extract the parent-child field hierarchical relationship features from the field association pointers to construct a vertical query dependency chain, and at the same time extract the horizontal causal features of the corresponding same-level associated query fields for each field to construct a horizontal query causal chain.
[0027] A field-driven node layer is constructed by combining the vertical query dependency chain and the horizontal query causal chain corresponding to all fields with a graph neural network.
[0028] Specifically, the process of constructing the lateral query causal chain includes: obtaining the correlation degree between any two fields of the same level based on the fixedness of the logical operators in the combined query, the intersection ratio of the query result sets of the two fields, the mutual constraint degree of the field query conditions, and the business semantic association score combined with the association analysis algorithm, as the lateral connection between the corresponding two fields; and obtaining the lateral query causal chain based on the lateral connection between the two fields of the same level and the field nodes constructed by the corresponding two fields.
[0029] The process of constructing the vertical query dependency chain is as follows: extract the query enable control degree of the parent field to its child field, the constraint degree of the child field's value range on the parent field, the reference depth of the child field's query logic to the parent field, the passive adjustment rate of the child field when the parent field changes, and the data lineage relationship between the parent and child fields, combined with the infectious disease model, to construct the query dependency degree between any parent and child fields, which serves as the vertical connection between the parent and child nodes constructed for the corresponding parent and child fields; based on all parent and child nodes and their corresponding vertical connections, the vertical query dependency chain is constructed.
[0030] Specifically, the construction process of the second cross-layer driven composite connection includes:
[0031] Based on the set of field association logical relationship operators, combined with the entity-relationship extraction algorithm, we obtain the operator-combination-field node information set;
[0032] Based on the operator-combination-field node information set, the association matching algorithm is used to match the associated field IDs of the field association logical relationship operator and the list of associated field IDs of the field query combination dependency relationship with the IDs of the valid field nodes in the field-driven node layer, and the valid field nodes corresponding to the operator and combination dependency are filtered out to obtain the operator-combination-valid field node matching set.
[0033] Specifically, the construction process of the second cross-layer driven composite connection also includes:
[0034] Based on the matching set of operator-combination-effective field nodes, the fitness algorithm is used to evaluate the fitness of each operator-combination with the corresponding effective field node, taking the fitness of the operator type and the data type of the effective field node, and the consistency of the combinational logic structure with the vertical query dependency chain and the horizontal query causal chain as evaluation targets. The fitness of each operator-combination with the corresponding effective field node is calculated, and the operator-combination-effective field node combination with the fitness greater than or equal to the preset fitness threshold is retained to obtain the qualified operator-combination-field node set.
[0035] Based on the set of qualified operators, combinations, and field nodes, and according to the combination logic structure of field query combination dependencies, the corresponding valid field nodes are connected through the associated field association logic operators to obtain a combination connection containing valid field nodes, association operators, and combination logic. At the same time, the vertical dependency identifier or horizontal causal identifier corresponding to each combination connection is marked to obtain the second cross-layer driven combination connection.
[0036] Specifically, the construction process of the third cross-layer driven index join includes:
[0037] Based on the target index layer, query operator mapping set, and field-driven node layer, we extract the index type, index-related field identifier, operator type, operator-field mapping relationship, effective field node identifier, and historical query frequency to obtain the index-operator-field hierarchical information set.
[0038] Based on the index-operator-field hierarchical information set, the operator-associated field identifier is matched with the valid field node identifier through the field identifier matching algorithm, and the operator type is matched with the index-adapted operation type through the matching algorithm to obtain the index-operator-valid field matching set;
[0039] Based on the index-operator-valid field matching set, the matching degree between the operator and the field data type, the matching degree between the operator and the index type, and the priority score based on the historical query frequency are calculated by a multi-dimensional matching degree evaluation algorithm. The combination that reaches the preset threshold of comprehensive matching degree is retained to obtain the qualified index-operator-field set.
[0040] Based on the qualified index-operator-field set, the connection unit construction algorithm establishes the association connection between effective field nodes, query operators and target index nodes according to the mapping relationship between operators and fields, and obtains the basic index connection unit set marked with historical query frequency weight and adaptation status identifier;
[0041] Based on the basic index connection unit set, the structural compatibility between the connection unit and the field-driven node layer and the target index layer is verified by a hierarchical compatibility verification algorithm. Connection units that have logical conflicts or destroy the hierarchical structure are eliminated to obtain a compatible index connection unit set.
[0042] Based on the set of compatible index connection units, they are sorted according to the product of historical query frequency weight and fit score. Based on the sorted set of compatible index connection units, the query configuration node layer and the target index layer are bound according to the mapping relationship between operators and fields, thus completing the third cross-layer driven index connection.
[0043] A dynamic index generation system driven by business form fields includes: a configuration tree module, a parsing module, an index building module, and an exception handling module;
[0044] The configuration tree module obtains the business form query configuration tree based on the query configuration items of form fields in the business form configuration subsystem, combined with graph algorithms and tree databases.
[0045] The parsing module is used to obtain the real-time configuration change operations of the query configuration items of the form fields in the business form configuration subsystem. Combined with the optimal traversal strategy, with the goal of minimizing change constraints and maximizing fit, it obtains the minimum effective field adjustment tree.
[0046] The index building module adjusts the tree based on the minimum effective fields and obtains the database index creation or adjustment statement through the index strategy engine;
[0047] The exception adjustment module is used to automatically execute the database index creation or adjustment statements to adjust the business form query configuration tree and respond to the real-time query requirements of newly added business forms. When any query requirement is abnormal, it locates the real-time query requirement of the business form and the corresponding updated query index; it feeds the real-time query requirement of the business form and the corresponding updated query index back to the optimization traversal strategy for real-time updates until all query requirements are met.
[0048] Compared with the prior art, the beneficial effects of the present invention are:
[0049] This invention addresses the shortcomings of existing technologies by constructing a minimum effective field adjustment tree to accurately identify the query fields and related adjustment fields that most need to be changed. Combining key elements such as adjustment depth and query permissions, adjustments are made only to necessary fields and query operations, significantly reducing redundant changes and greatly simplifying the modification of business form query configurations. Based on Bayesian and optimization algorithms, it achieves maximum fit while satisfying minimum change constraints, ensuring the accuracy and effectiveness of adjustments. An index strategy engine automatically generates and executes index creation or adjustment statements, combined with a real-time feedback mechanism to quickly respond to new query requests, significantly improving the system's response rate to business form changes. Furthermore, by locating abnormal queries and dynamically optimizing indexes, a closed-loop adjustment mechanism is formed, continuously adapting to the dynamic changes of business forms, ensuring query stability and accuracy, and enhancing the system's adaptability to complex business scenarios. Attached Figure Description
[0050] Figure 1 This is a flowchart of the dynamic index generation method driven by business form fields according to the present invention;
[0051] Figure 2 This is a module diagram of the dynamic index generation system driven by business form fields in this invention. Detailed Implementation
[0052] Example 1
[0053] Please see Figure 1 The present invention provides an embodiment of a dynamic index generation method driven by business form fields, the steps of which include:
[0054] S1. Based on the query configuration items of form fields in the business form configuration subsystem, combine graph algorithm and tree database to obtain the business form query configuration tree;
[0055] S2. Obtain the real-time configuration change operations of the query configuration items of the form fields in the business form configuration subsystem. Combine the optimal traversal strategy with the goal of minimizing change constraints and maximizing fit to obtain the minimum effective field adjustment tree.
[0056] S3. Based on the minimum effective field adjustment tree, obtain the database index creation or adjustment statement through the index strategy engine. It should be further explained that the index strategy engine in this embodiment is constructed and trained by combining the minimum effective field adjustment tree with the highest matching degree in the historical change process with the code automatic generation algorithm. It is used to parse the minimum effective field adjustment tree and generate the database index creation or adjustment statement according to the result.
[0057] S4. Automatically execute the database index creation or adjustment statement to adjust the business form query configuration tree, and respond to the real-time query requirements of newly added business forms. When any query requirement is abnormal, locate the real-time query requirement of the business form and the corresponding updated query index.
[0058] S5. Feed the real-time query requirements of the business forms and the corresponding updated query index back to the optimization traversal strategy for real-time updates until all query requirements are met.
[0059] It should be further explained that the process of obtaining the business form query configuration tree in this embodiment includes:
[0060] Based on the business form text information and the text parsing algorithm, a form metadata field table is obtained; the form metadata field table includes at least the form ID, fields and corresponding ID sets, field association pointers, field association logical relationship operator set and field query combination dependency relationship, field query validity status label, field data type and constraint attribute, query operator mapping set, historical query frequency, and form business attribution label; the text parsing algorithm is preferably an entity-relation extraction model built by the BERT model.
[0061] The root node is constructed using the form ID and the form business belonging label; the field-driven node layer is constructed using the fields and their corresponding ID sets, field data types and constraint attributes and field association pointers; the query configuration node layer is constructed using the set of field association logical relationship operators; and the target index layer is constructed using the business form information data.
[0062] Based on the root node, the connection relationships between each field node in the field-driven node layer, the connection relationships between query operation nodes in the query configuration node layer, the connection relationships between target index character nodes in the target index layer, and the form ID and field ID, a first cross-layer driven connection is constructed. A second cross-layer driven combined connection is constructed based on the set of field association logic relationship operators and the field query combination dependency relationship. A third cross-layer driven index connection is constructed based on the set of query operator mappings and the historical query frequencies corresponding to the corresponding fields and query operators. Then, through graph neural networks and tree databases, a business form query configuration tree is constructed.
[0063] It should be further explained that the process of obtaining the first cross-layer driver connection in this embodiment also includes:
[0064] Based on the form ID, fields, and corresponding ID sets, a first one-to-many connection sequence is constructed between the root node and the field-driven node layer. It should be further noted that in this embodiment, the first one-to-many connection sequence is constructed based on the form ID and each field ID in the field-driven node layer.
[0065] Based on the business form's attribution tags and field attribute features, a text feature extraction algorithm is used to obtain business domain classification features, field-related business indicator type features, periodic association matching features, and scenario constraint matching features. The business domain classification features characterize the consistency between the business form and the field's business domain, providing a domain-dimensional basis for the association matching of the business form and the field. The field-related business indicator type features characterize the association attributes between the field and the core business indicators of the business form, clarifying the field's core support for the business form's query requirements. The periodic association matching features characterize the adaptability of the field's query cycle to the business cycle of the business form, ensuring that the field's query logic conforms to the time-dimensional business requirements of the business form. The scenario constraint matching features characterize the fit between the field's query scenario and the target query scenario of the business form, ensuring that the field query operation meets the scenario-specific constraints of the business form.
[0066] Based on business domain classification features, field-related business indicator type features, periodic association matching features, and scenario constraint matching features, an association analysis algorithm is used to obtain the query-driven association degree between the business form and each field. It should be further explained that the query-driven association degree between the business form and each field in this embodiment, as a core indicator for measuring the degree of matching between fields and form business requirements, plays a crucial role in accurately filtering fields that highly match the form query requirements. This provides a quantitative basis for subsequent effective field extraction, hierarchical structure construction, and cross-layer connection establishment: fields with high association degrees are prioritized for inclusion in the effective field set, serving as core or key auxiliary nodes supporting form queries, ensuring that form query configuration focuses on core business needs; fields with low association degrees are identified as unnecessary fields, reducing redundant information from interfering with the query logic, lowering configuration complexity and maintenance costs, and providing efficient query response capabilities, thereby improving the accuracy and adaptability of form queries from the source.
[0067] Based on the field query validity status label, obtain the corresponding binary label, the binary label includes 1 and 0, 1 corresponds to the field being valid, and 0 corresponds to the field being disabled;
[0068] The binary label and the query-driven correlation are embedded into the first connection sequence to construct the first cross-layer driven connection;
[0069] It should be further explained that the process of obtaining the field-driven node layer in this embodiment also includes:
[0070] Based on the binary labels, fields and corresponding ID sets, field data types and constraint attributes, and field association pointers in the first cross-layer driver connection, valid fields are filtered through availability verification rules to obtain a basic list of valid fields; wherein the availability verification rules include at least the following: the field query validity status is enabled, the data type is adapted to the business query scenario, and the constraint attributes meet the basic query requirements;
[0071] It should be further explained that the process of filtering valid fields and obtaining a basic list of valid fields through availability verification rules in this embodiment includes:
[0072] Iterate through all the ID fields in the first cross-layer driver connection, and extract the binary label, data type and constraint attribute corresponding to each field one by one;
[0073] Read the binary label of each field, and proceed to the next verification step if and only if the label value is enabled;
[0074] When proceeding to the next verification step, the field data type is matched with the predefined set of queryable data types. When the field data type meets the matching requirements, the field constraint attributes are checked to see if they include a valid value range definition, a non-null constraint, and a default value definition, and if all constraint attributes meet the basic requirements of the business query. The queryable data types include at least numeric, date / time, character, and enumeration types, excluding data types such as large binary objects and extremely long text that are not suitable for the query scenario.
[0075] For fields that pass all three validations, add their field ID, data type, and constraint attributes to the basic list of valid fields; for fields that fail any validation, record the specific reason for failure and the validation timestamp.
[0076] Once all fields have been validated, the output will contain a valid basic list of fields with complete attribute information for all validated fields.
[0077] Based on the effective field base list, extract the parent-child field hierarchical relationship features from the field association pointers to construct a vertical query dependency chain, and at the same time extract the horizontal causal features of the corresponding same-level associated query fields for each field to construct a horizontal query causal chain.
[0078] It should be further explained that the construction process of the horizontal query causal chain in this embodiment includes: based on the fixedness of the logical operators of any two fields of the same level in the combined query, the intersection ratio of the query result sets of the two fields, the mutual constraint of the field query conditions, and the business semantic association score combined with the association analysis algorithm, the association degree between any two fields of the same level is obtained as the horizontal connection between the corresponding two fields.
[0079] Based on the horizontal connection between two fields of the same level and the field nodes constructed from the corresponding two fields, a horizontal query causal chain is obtained;
[0080] It should be further explained that the process of obtaining the lateral query causal chain in this embodiment includes:
[0081] A1: Obtain historical query log data corresponding to the target business scenario. First, define the scope of fields of the same level. Fields of the same level are those belonging to the same business form and having no parent-child hierarchical dependency relationship. Filter all query records containing any two fields of the same level from the historical query log data, and use these query records as the target analysis record set. Perform logical operator analysis on the target analysis record set, count the number of query records in which two fields of the same level are connected by the same logical operator, and simultaneously count the total number of query records in the target analysis record set where two fields of the same level appear simultaneously. Calculate the ratio of the number of query records in which two fields of the same level are connected by the same logical operator to the total number of query records where two fields of the same level appear simultaneously, and determine this ratio as the logical operator fixation score of the two fields of the same level.
[0082] A2: Obtain the query execution result data corresponding to the target analysis record set in A1. The query execution result data is the query result set corresponding to the two same-level fields after each query record in the target analysis record set is executed; perform statistics on the two field query result sets corresponding to each query record to obtain the number of intersection records and the number of union records between the two result sets; calculate the ratio of the number of intersection records to the number of union records of the two field query result sets in each query record, calculate the mean of this ratio for all query records, and determine the calculated mean as the intersection ratio of the two same-level field query result sets.
[0083] A3: Collect query condition value data of two fields of the same level in A1 during historical queries. The query condition value data refers to the specific values or value ranges set for the two fields in each query. Based on the query condition constraint relationship, construct a Bayesian model, using the query condition value data of one field as the model input variable and the query condition value data of the other field as the model output variable. Calculate the probability of the output variable's value range being restricted when the input variable takes a specific value using the Bayesian model. The probability of the value range being restricted represents the degree to which the input variable's value restricts the output variable's value range. Calculate a weighted average of the probability of the value range being restricted for all specific values of the input variables, and determine the average value as the mutual constraint degree of the query conditions for the two fields of the same level.
[0084] A4: Obtain the business form text information corresponding to the target business scenario. The business form text information includes the business form name, functional description text of each field, and business association rule document between fields. Using knowledge graph construction technology, extract entities and entity relationships from the business form text information. The entities are the fields in the business form, and the entity relationships are the business association logic between the fields. Based on the extracted entities and entity relationships, construct a business knowledge graph for the target business scenario. Based on this business knowledge graph, use a semantic analysis algorithm to analyze the association path length and association relationship type importance of any two fields of the same level in the knowledge graph. Calculate the semantic matching degree of the two fields based on the association path length and association relationship type importance, and determine the semantic matching degree as the business semantic association score of the two fields of the same level.
[0085] A5: Determine the weighting rules for the logical operator fixation score obtained from A1, the intersection ratio obtained from A2, the mutual constraint degree obtained from A3, and the business semantic association score obtained from A4. The weighting rules are set by business domain experts based on the query requirements of the target business scenario, and the sum of the weights of all indicators is 1. A weighted average algorithm is used to multiply the score of each indicator by its corresponding weight, and then the weighted scores are summed. The summation result is determined as the comprehensive association degree between any two fields of the same level.
[0086] A6: Set a comprehensive relevance threshold, which is determined based on the effectiveness standard of horizontal association of fields in the target business scenario; use a graph construction algorithm, taking any two fields of the same level as nodes in the graph, and determine whether the comprehensive relevance of the two nodes reaches the preset relevance threshold; if the preset relevance threshold is reached, establish a horizontal connection between the two nodes; obtain the conditional probability of each associated sub-field adjusted with its corresponding parent field, where the parent field is the field with business dominance in the horizontal association, and the conditional probability is obtained based on the statistics of historical field adjustment records; calculate the product of the conditional probability and the comprehensive relevance score of the corresponding horizontal connection; based on the HSV color space mapping rules, map the product result to the corresponding color parameters, where the color parameters include hue, saturation, and brightness. The larger the product result, the higher the saturation and the more the hue matches the key identification color of the target business scenario, and the brightness is kept within a preset moderate range; embed the mapped color parameters into the corresponding horizontal connection to form a horizontal query causal chain with visual color identification.
[0087] The process of constructing the vertical query dependency chain is as follows: Extract the query enable control degree of the parent field on its child field, the constraint degree of the child field's value range on the parent field, the reference depth of the child field's query logic on the parent field, the passive adjustment rate of the child field when the parent field changes, and the data lineage relationship between parent and child fields combined with an infectious disease model to construct the query dependency degree between any parent and child fields, which serves as the vertical connection between parent and child nodes constructed for the corresponding parent and child fields; based on all parent and child nodes and their corresponding vertical connections, a vertical query dependency chain is constructed; the query enable control degree of the parent field on its child field is based on whether the child field's query permission is enabled on the premise that the parent field's query permission is enabled, and the number of times this premise is met as a percentage of the total child field queries. The degree of constraint of the subfield's value range on the parent field is represented by the proportion of the number of times the valid value set of the subfield is limited by the current value of the parent field to the total number of queries on the subfield; the reference depth of the subfield's query logic to the parent field is represented by the number of levels in the subfield's query conditions that directly or indirectly contain the query results of the parent field; the passive adjustment rate of the subfield when the parent field changes is represented by the proportion of the number of times the subfield must be adjusted synchronously due to business logic after the query configuration of the parent field changes to the total number of changes to the parent field; the data lineage relationship between parent and child fields is represented by whether the data generation of the subfield depends on the data calculation or filtering results of the parent field, and the degree to which this dependency relationship is explicitly defined in the business rules.
[0088] It should be further explained that the more detailed implementation process of the vertical query dependency chain in this embodiment includes:
[0089] Step 1: First, define the scope of parent and child fields in the business form within the target business scenario. These parent and child fields are determined based on the hierarchical logical relationship and data dependency relationship of the business form; that is, the parent field plays a dominant and controlling role in the query logic, and the child field is the field for which the query requires the existence of the parent field. Extract five dependency features between parent and child fields and establish a correspondence between them and the core parameters of the infectious disease model:
[0090] The query enable control degree of the parent field on its child field corresponds to the basic transmission source strength of the infectious disease model. The query enable control degree is the degree of control that the parent field's query permission enable status has on the child field's query permission enablement. The basic transmission source strength is used to characterize the basic ability of the parent field to exert a dependent influence on its child field by virtue of this control degree.
[0091] The constraint degree of the subfield's value range on the parent field corresponds to the susceptibility of the infectious disease model. The constraint degree is the degree to which the effective value range of the subfield is limited by the current value of the parent field. The susceptibility is used to characterize the degree to which the subfield is susceptible to the influence of the parent field's dependence based on this constraint degree.
[0092] The reference depth of the subfield query logic to the parent field corresponds to the propagation path length of the infectious disease model. The reference depth is the number of levels in the subfield query conditions that directly or indirectly reference the parent field query results. The propagation path length is used to characterize the hierarchical distance from which the parent field's dependency influence is passed to the subfield through the reference level.
[0093] The passive adjustment rate of the child field when the parent field changes corresponds to the historical propagation frequency of the infectious disease model. The passive adjustment rate is the frequency at which the child field must be adjusted synchronously due to business logic after the query configuration of the parent field changes. The historical propagation frequency represents the actual frequency at which the parent field's dependency influence is passed to the child field based on this adjustment frequency in the historical process.
[0094] The data lineage relationship between parent and child fields corresponds to the transmission affinity in an infectious disease model. This data lineage relationship comprises two core dimensions. The first dimension is the degree to which the child field's data generation process depends on the calculation or filtering results of the parent field. Specifically, it refers to whether the child field needs to rely on the parent field's calculation results (such as values derived from the parent field's data) or filtering results (such as data selected from a dataset limited by the parent field) as a basis when generating data. The more direct and irreplaceable this dependency, the higher the data lineage relationship under this dimension. The second dimension is the explicit representation of this dependency in business rules. The degree of definition specifically refers to whether the business rules clearly and explicitly define the data dependency relationship between parent and child fields through formal documentation, system configuration, or code logic. The more standardized and clear the definition, the higher the data lineage correlation in this dimension. As a core parameter of the infectious disease model, the propagation affinity characterizes the intrinsic correlation strength of the parent and child fields based on the above data lineage correlation, supporting the transmission of dependency effects. That is, the higher the data lineage correlation, the tighter the intrinsic correlation between parent and child fields, the higher the value of propagation affinity, and the easier it is for the dependency effects of the parent field (such as query configuration changes, permission adjustments, etc.) to be transmitted to the child field.
[0095] Step 2: Based on the basic propagation source strength and susceptibility determined in Step 1, the initial propagation probability is obtained by multiplication calculation. The logic of the multiplication calculation is that the basic propagation source strength represents the ability of the parent field to generate dependent influence, and the susceptibility represents the degree to which the child field accepts the influence. The product of the two can quantify the possibility that the dependent influence of the parent field is initially transmitted to the child field, thus forming the initial propagation probability.
[0096] Step 3: Based on the initial propagation probability obtained in Step 2 and the propagation path length determined in Step 1, the initial propagation probability is corrected using a path attenuation correction algorithm to obtain the path correction probability; wherein, the execution process of the path attenuation correction algorithm includes:
[0097] First, a preset hierarchy-decay association rule is constructed. This rule is based on the historical parent-child field dependency transmission data of the target business scenario. It analyzes the linear relationship between the field reference hierarchy and the degree of dependency of the child field on the parent field. It is constructed by combining a linear function. The variable of the linear function is the reference hierarchy, and the function result is the decay ratio of the dependency influence transmission under the corresponding hierarchy.
[0098] Based on the above hierarchical-attenuation association rules and propagation path length, the path attenuation coefficient is calculated, which is the attenuation ratio of the dependency influence corresponding to the propagation path length.
[0099] The path decay coefficient is multiplied by the initial propagation probability to obtain the path correction probability. This process uses the reference hierarchy distance to quantify and decay the dependency propagation probability, so as to reflect the business logic that the deeper the hierarchy, the weaker the dependency impact.
[0100] Step 4: Based on the obtained path correction probability and the determined historical propagation frequency, the path correction probability is enhanced to obtain an enhanced propagation probability; the specific process of the enhancement is as follows:
[0101] The preset frequency enhancement rule is derived from the statistical analysis of historical parent-child field adjustment cases in the target business scenario. That is, the higher the historical propagation frequency, the more times the parent field's dependency influence has been passed to the child field in the past, and the greater the corresponding enhancement coefficient.
[0102] Based on the above frequency enhancement rules, the enhancement coefficients corresponding to the historical propagation frequencies are determined;
[0103] Multiplying the path correction probability by the enhancement coefficient yields the enhanced propagation probability, which reflects the enhancing effect of past propagation frequency on the probability of current dependency propagation.
[0104] Step 5: Based on the enhanced propagation probability obtained in Step 4 and the propagation affinity determined in Step 1, the enhanced propagation probability is weighted using a weighted calculation algorithm to finally obtain the dependency propagation probability between parent and child fields. The execution logic of the weighted calculation algorithm is as follows: Propagation affinity is used as a weight coefficient. This weight coefficient is a parameter quantified based on the parent-child field data lineage relationship (the degree to which the child field data generation depends on the calculation or filtering results of the parent field data and the degree of explicit definition of this dependency relationship in the business rules). The higher the parent-child field data lineage relationship, the larger the weight coefficient value; the lower the relationship, the smaller the weight coefficient value. The enhanced propagation probability (the initial probability value of the parent field dependency influence being transmitted to the child field after path attenuation correction and historical propagation frequency enhancement) is multiplied by this weight coefficient, and the dependency propagation probability is adjusted through numerical calculation. The weighting factor is used to assess the likelihood of dependency propagation, especially when the parent-child data relationships are high. A large weighting factor amplifies and enhances the propagation probability, increasing the final dependency propagation probability. This technique demonstrates the strengthening effect of close intrinsic relationships on the likelihood of dependency propagation. Conversely, when the parent-child data relationships are low, a small weighting factor reduces and enhances the propagation probability, decreasing the final dependency propagation probability. This technique demonstrates the weakening effect of loose intrinsic relationships on the likelihood of dependency propagation. Simultaneously, the weighting factor values are validated based on the business rules of the target business scenario (such as business logic specifications for field data generation and business constraints on parent-child field relationships) to confirm their matching degree with the actual business dependency relationship, ensuring that the weighted calculation results accurately reflect the true likelihood of dependency propagation between parent and child fields in the business scenario.
[0105] Step 6: Based on the dependency propagation probability values between parent and child fields obtained in Step 5, divide them into four dependency levels using a preset probability threshold range. The preset probability threshold range is determined by: combining the query stability requirements of the target business scenario, statistically analyzing historical parent-child field dependency failure cases, and analyzing the probability of child field query anomalies under different dependency probabilities, thereby determining the probability range corresponding to each dependency level.
[0106] When the dependency propagation probability value is in the range [0.8, 1.0], it is classified as a strong dependency level;
[0107] When the dependency propagation probability value is in the interval [0.5, 0.8), it is classified as medium dependency level;
[0108] When the dependency propagation probability value is in the interval [0.2, 0.5), it is classified as a weak dependency level;
[0109] When the probability value of dependency propagation is in the interval [0.0, 0.2), it is classified as a dependency-free level.
[0110] Step 7: Based on the dependency levels defined in Step 6, obtain the quantized values corresponding to each dependency level through a preset level-quantized value mapping rule. The level-quantized value mapping rule is constructed based on the following: analyzing the degree of influence of different dependency levels on the query logic of parent and child fields. The higher the degree of influence, the larger the corresponding quantized value. Among them, the strong dependency level corresponds to the highest quantized value because it has the greatest impact on the query logic; the medium dependency level corresponds to a medium quantized value, and its degree of influence is second; the weak dependency level corresponds to a lower quantized value, and its degree of influence is weaker; the no dependency level corresponds to a zero value because it has no impact on the query logic; and the quantized value needs to be used for the identification and differentiation of subsequent vertical connections between parent and child nodes.
[0111] Step 8: Based on the quantization value obtained in Step 7, assign corresponding connection line identifiers to the vertical connections between parent and child nodes according to the preset connection line identifier rules; the connection line identifier rules are obtained by mapping the quantization value corresponding to the dependency level with the point weight corresponding to the connection line.
[0112] Step 9: Based on the connector identifiers obtained in Step 8 and the quantization values obtained in Step 7, establish vertical connections between corresponding parent and child nodes through preset node connection logic, thereby obtaining the vertical query dependency chain; the node connection logic includes:
[0113] Determine the position of parent and child nodes in the business form query configuration tree, using the parent field node as the starting point of the vertical connection and the child field node as the ending point of the vertical connection.
[0114] Based on the corresponding connection line identifier, draw a vertical connection line between the start end and the end end, and associate the quantification value with the connection line to clarify the quantification information of the dependence strength of the connection;
[0115] Verify the correctness of the established vertical connections by checking whether the hierarchical relationship between the parent and child fields is consistent with the business logic and whether the connector identifier and quantification value match the dependency level. Once the verification is successful, a vertical query dependency chain is formed.
[0116] Step 10: Obtain the vertical query dependency chain corresponding to all fields in the target business scenario, and at the same time obtain the horizontal query causal chain corresponding to each field. Use the vertical query dependency chain and the horizontal query causal chain as edge data of the graph structure, and use each field as node data of the graph structure. Input the graph structure data into the graph neural network, and use the graph neural network to learn and extract the dependency relationship features and association relationship features between nodes to construct a structured field association network. Perform validity verification on the field association network to ensure that the relationship between nodes and edges in the network conforms to the business form query logic. After the verification is passed, the field-driven node layer is obtained.
[0117] It should be further explained that the construction process of the second cross-layer driver composite connection in this embodiment includes:
[0118] Based on a set of field association logic relationship operators, combined with an entity-relationship extraction algorithm, an operator-combination-field node information set is obtained. This set includes field query combination dependencies and a field-driven node layer. The operator type, operator-associated field ID, and operator priority are extracted from the field association logic relationship operator set; the combination logic structure, combination-associated field ID list, and combination query validity status are extracted from the field query combination dependency relationship; and the ID, field data type, vertically dependent parent or child node ID, and horizontally associated field ID are extracted from the field-driven node layer. The operator type is used to determine the logical type of the query operation in the query configuration node layer, providing logical rules for field combination. The operator-associated field ID is used to accurately bind the operator to the valid field node in the field-driven node layer, ensuring the operator's target is... Correct; Operator priority is used to clarify the execution order of multiple operator combinations in the query configuration node layer, ensuring the orderliness of logical operations; Combinatorial logic structure is used to construct the combinational logic framework of the query configuration node layer, providing a structural basis for field combination; Combination associated field ID list is used to limit the range of fields participating in the combination, clarifying the field composition of the combination; Combination query validity status is used to filter valid combinations and exclude invalid combinations, ensuring the validity of the connection; The ID of the valid field node serves as a unique identifier, ensuring accurate association between operators, combinations, and field nodes in the field-driven node layer; Field data type is used to verify the compatibility between operators and fields, ensuring the legality of logical operations; Vertical dependency parent or child node ID and horizontal association field ID are respectively associated with the vertical query dependency chain and the horizontal query causal chain, ensuring that the second cross-layer driven combination connection conforms to the hierarchical and sibling relationships between fields, maintaining structural consistency.
[0119] Based on the operator-combination-field node information set, the association matching algorithm is used to match the associated field IDs of the field association logical relationship operator and the list of associated field IDs of the field query combination dependency relationship with the IDs of the valid field nodes in the field-driven node layer, filter out the valid field nodes corresponding to the operator and combination dependency, and obtain the operator-combination-valid field node matching set.
[0120] Based on the matching set of operator-combination-effective field nodes, the fitness algorithm is used to evaluate the fitness of each operator-combination with the corresponding effective field node, taking the fitness of the operator type and the data type of the effective field node, and the consistency of the combinational logic structure with the vertical query dependency chain and the horizontal query causal chain as evaluation targets. The fitness of each operator-combination with the corresponding effective field node is calculated, and the operator-combination-effective field node combination with the fitness greater than or equal to the preset fitness threshold is retained to obtain the qualified operator-combination-field node set.
[0121] It should be further explained that the process of obtaining the criterion operator-combination-field node set in this embodiment includes:
[0122] B1: Based on the operator type and the data type of the valid field node, obtain the type fit score through predefined type fit mapping rules; the construction process of the type fit mapping rules is as follows:
[0123] B1.1. Define the range of operator types involved in the target business scenario, including basic logic operators, comparison operators, aggregation operators, etc., with each operator type corresponding to a specific logical function;
[0124] B1.2 Define the data type range of valid field nodes, including numeric, character, date / time, enumeration, etc., each data type corresponds to specific data characteristics;
[0125] B1.3 Analyze the matching probability between different operator types and different data types. Based on the legality of business query logic, determine the data types that each operator type can match and the degree of matching. The degree of matching includes complete matching, partial matching, and no matching at all.
[0126] B1.4 Assign a corresponding fit score to each matching degree. A perfect fit corresponds to the highest score, a partial fit corresponds to the medium score, and a perfect misfit corresponds to the lowest score, thus forming a type fit mapping rule.
[0127] B1.5 Substitute the operator type and the data type of the valid field node into the type adaptation mapping rule, query the corresponding matching degree and score, and determine the score as the type adaptation score.
[0128] B2: Based on the vertical query dependency chain of the combinational logic structure and valid field nodes, the vertical consistency score is obtained through the structural consistency evaluation algorithm; the execution process of the structural consistency evaluation algorithm is as follows:
[0129] B2.1 Analyze the combinational logic structure, extract the hierarchical relationship between the field nodes contained therein, and clarify the parent node field, child node field, and the hierarchical nesting relationship between parent and child nodes;
[0130] B2.2 Extract the vertical query dependency chain of valid field nodes, and clarify the parent-child dependency relationship of field nodes in the chain, including the control relationship of the parent field node on its child field node and the dependency relationship of the child field node on the parent field node;
[0131] B2.3 Compare the hierarchical relationship in the combinational logic structure with the parent-child dependency relationship in the vertical query dependency chain: If the parent-child node correspondence is completely consistent and the nesting depth is the same, it is determined to be completely consistent; if the parent-child node correspondence is partially consistent, or the nesting depth is different but the core parent-child relationship is consistent, it is determined to be partially consistent; if the parent-child node correspondence is completely mismatched, it is determined to be completely inconsistent.
[0132] B2.4. Based on the consistency determination results, assign vertical consistency scores, with complete consistency corresponding to the highest score, partial consistency corresponding to the medium score, and complete inconsistency corresponding to the lowest score.
[0133] B3: Based on the lateral query causal chain of the combinational logic structure and valid field nodes, the lateral consistency score is obtained through the causal correlation evaluation algorithm; the execution process of the causal correlation evaluation algorithm is as follows:
[0134] B3.1 Analyze the combinational logic structure, extract the logical connection relationships between field nodes of the same level, and clarify the logical operators used for the connection and the related meaning expressed by the operators;
[0135] B3.2 Extract the horizontal query causal chain of valid field nodes, and clarify the relationship between field nodes of the same level in the chain, including the strength of the relationship, the direction of the relationship, and the business semantics of the relationship;
[0136] B3.3 Analyze the consistency between the logical connection relationships in the combinational logic structure and the association relationships in the horizontal query causal chain: If the meaning of the logical connection relationship completely matches the business semantics of the association relationship, and the logical tightness corresponding to the association strength is consistent, it is judged as completely consistent; if the meaning partially matches, or the logical tightness corresponding to the association strength is different but the core association direction is consistent, it is judged as partially consistent; if the meaning completely does not match, or the association direction is opposite, it is judged as completely inconsistent.
[0137] B3.4. Based on the consistency determination results, assign horizontal consistency scores, with complete consistency corresponding to the highest score, partial consistency corresponding to the medium score, and complete inconsistency corresponding to the lowest score.
[0138] B4: Based on the type fit score obtained from B1, the vertical consistency score obtained from B2, and the horizontal consistency score obtained from B3, a comprehensive fit score is obtained through a weighted summation algorithm; the execution process of the weighted summation algorithm is as follows:
[0139] B4.1 Determine the weight coefficients for each score. The weight coefficients are set based on the degree of influence of each factor on the effectiveness of the query combination in the target business scenario. They are derived by business domain experts in combination with historical successful query cases, and the sum of all weight coefficients is 1.
[0140] B4.2 Multiply the type fit score, vertical consistency score, and horizontal consistency score by their respective weight coefficients to obtain the weighted values of each score.
[0141] B4.3. Add all the weighted values together, and the sum is the comprehensive fit score of the operator-combination-effective field node combination.
[0142] B5: Based on the comprehensive fit score obtained from B4 and the preset fit threshold, the set of qualified operators-combinations-field nodes is obtained through a threshold comparison and filtering algorithm; the execution process of the threshold comparison and filtering algorithm is as follows:
[0143] B5.1 Determine the preset adaptability threshold. This threshold is derived from the statistical analysis of the comprehensive adaptability score of historical effective query combinations in the target business scenario. Ensure that the threshold can distinguish between effective and ineffective combinations, and the query success rate of effective combinations must reach the preset standard.
[0144] B5.2 Compare the overall fit score of each operator-combination-effective field node combination with the preset fit threshold;
[0145] B5.3. Retain combinations whose overall fit score is greater than or equal to the preset fit threshold, and remove combinations whose overall fit score is less than the preset fit threshold.
[0146] B5.4. Perform a second validity check on the retained combinations, checking whether the operators, field nodes and logical relationships in the combinations conform to the business query rules. After the check passes, a set of qualified operators-combinations-field nodes is formed.
[0147] B6: Based on the set of qualified operators, combinations, and field nodes obtained from B5, and according to the combination logic structure of field query combination dependencies, the corresponding valid field nodes are connected through the associated field association logic operators to obtain the second cross-layer driving combination connection. The specific process is as follows:
[0148] B6.1 Analyze the combinational logic structure corresponding to each combination in the target operator-combination-field node set, and clarify the connection order of field nodes, the type of operator used, and the logical operation rules;
[0149] B6.2 According to the connection order of the combinational logic structure, connect the valid field nodes with the associated field association logic operators in sequence to form a combinational connection unit containing valid field nodes, association operators, and combinational logic;
[0150] B6.3. Label each composite join unit with a corresponding dependency identifier: If there is a parent-child hierarchical relationship between the field nodes in the composite join unit, and this relationship is consistent with the vertical query dependency chain, then label it with a vertical dependency identifier; if the field nodes in the composite join unit are at the same level, and the association relationship is consistent with the horizontal query causal chain, then label it with a horizontal causal identifier.
[0151] B6.4 Perform integrity verification on the labeled combined connection units to ensure that each unit contains complete and valid field nodes, association operators, combination logic and dependency identifiers, and that there are no logical conflicts between the elements;
[0152] B6.5 Integrate all verified combined connection units according to business query logic to form a complete second cross-layer driven combined connection.
[0153] It should be further explained that the construction process of the second cross-layer driver composite connection in this embodiment includes:
[0154] Based on the aforementioned compliant operator-combination-field node set, the combined logic structure defined in the field query combination dependency relationship is extracted through the combination logic parsing unit. In the business form query configuration tree, the field is the data entity unit being queried (e.g., order amount), the operator is the logical operator acting on the field (e.g., greater than), and the combination defines the logical structure and relationship between multiple field-operator conditions (e.g., AND, OR). These three elements form the "compliant operator-combination-field node set" through association matching and fit calculation, thereby constructing an executable query logic module. For example, the field "order amount" and the operator ">" form condition E, the field "order status" and the operator "IN" form condition F, and then conditions E, F, and condition C are integrated into a complete query rule through the combination (E AND F) OR C.
[0155] Based on the aforementioned combinational logic structure, the corresponding valid field nodes are connected to the associated field association logic operators through a node connection algorithm, forming a triplet connection unit containing field nodes, logic operators, and combinational logic.
[0156] The dependency characteristics of each connection unit are determined by the dependency analysis algorithm: when there is a hierarchical relationship between the field nodes in the connection unit, a vertical dependency label is marked; when there is a sibling relationship between the field nodes in the connection unit, a horizontal causal label is marked.
[0157] The integrity and consistency of each connection unit are verified by a connection verification algorithm to ensure that each connection unit contains three elements: complete field nodes, logical operators, and combinational logic.
[0158] All verified connection units are aggregated using a structural integration algorithm to form a complete second cross-layer driven composite connection. For example, consider a compliant combination consisting of field A, field B, and the logical operator AND:
[0159] First, we analyze the combinational logic structure: A AND B;
[0160] Connect field node A and field node B using the AND operator to form the connection unit {A, B, AND};
[0161] Analyze the relationship between fields A and B: If A is the parent field of B, mark it with a vertical dependency indicator; if A and B are sibling fields, mark it with a horizontal causal indicator.
[0162] After verifying that the connection unit contains all the necessary elements, it is integrated into the second cross-layer drive composite connection.
[0163] It should be further explained that the construction process of the third cross-layer driving index connection in this embodiment includes:
[0164] Based on the target index layer, query operator mapping set, and field-driven node layer, the index type, index-associated field identifier, operator type, operator-field mapping relationship, valid field node identifier, and historical query frequency are extracted to obtain an index-operator-field hierarchical information set. It should be further explained that the index type in this embodiment is used to clarify the category attribute of the index in the target index layer, providing a type benchmark for index-operator adaptation; the index-associated field identifier is used to establish an association between the index of the target index layer and the corresponding field, ensuring that the index points to the correct field object; the operator type is used to define the logical type of the query operation, providing a basis for index adaptation operation requirements; the operator-field mapping relationship is used to establish the correspondence rules between the operator and the field, ensuring that the operator is applicable to the matching field; the valid field node identifier serves as a unique identifier, ensuring accurate binding of the index, operator, and valid field in the field-driven node layer; and the historical query frequency is used to quantify the usage frequency of the operator and index, providing a basis for priority ranking of joins.
[0165] Based on the index-operator-field hierarchical information set, the operator-associated field identifier is matched with the valid field node identifier through the field identifier matching algorithm, and the operator type is matched with the index-adapted operation type through the matching algorithm to obtain the index-operator-valid field matching set;
[0166] The process of obtaining the index-operator-valid field matching set is as follows:
[0167] D1: Obtain the index-operator-field hierarchical information set corresponding to the target business scenario. This information set is formed by integrating the index attribute data of the target index layer, the operator configuration data of the query operator mapping set, and the valid field data of the field-driven node layer. First, perform structured information extraction on this information set, focusing on the core information directly related to subsequent matching, specifically including operator-associated field identifiers, valid field node identifiers, operator types, and index-adapted operation types. Among them, the operator-associated field identifier is the identifier information pre-bound in the preset configuration file by the query operator to uniquely point to a certain business field. This identifier is extracted from the operator configuration data and must correspond to the actual identifier of the business field. The valid field node identifier is the unique identifier corresponding to the valid field that has been confirmed to participate in the query after the field-driven node layer has undergone availability verification (including query validity, data type compatibility, etc.). This identifier is extracted from the valid field data. The operator type is the identifier used to define the logical function category of the query operator, such as comparison operators used to implement precise comparisons, logic operators used to implement multi-condition combinations, etc. This type is extracted from the operator configuration data. The index-adapted operation type is the identifier of the target index layer. The various indexes determine the range of query operation types that can be responded to normally based on their own technical characteristics (such as index structure and query support capabilities). This type is extracted from the index attribute data. Then, the extracted core information is standardized. For identifier information (such as operator-associated field identifiers and valid field node identifiers), a preset unified coding rule is used for standardization. This coding rule predefines the constituent elements and their order of arrangement of the identifiers. The constituent elements include business domain identifiers, form attribution identifiers, and field sequence identifiers, ensuring that identifiers from different sources are completely consistent in character composition, length, and expression logic. For example, the same field identifier from different systems will have the same business domain prefix and form attribution suffix after standardization. For type information (such as operator types and index-adapted operation types), a preset unified expression form is used for standardization. This expression form predefines the standard naming format of the types. Operator types are uniformly named "operator function category - specific operation name", and index-adapted operation types are uniformly named "index structure type - supported operation category". Through the above standardization process, the matching deviation caused by the difference in format of information from different sources is eliminated, ensuring that subsequent matching operations have a consistent benchmark, and finally forming a standardized dataset to be matched.
[0168] D2: Using the standardized dataset to be matched obtained in D1 as the basis, a field identifier matching algorithm is used to perform field identifier matching operations. First, the set of operator-associated field identifiers and the set of valid field node identifiers are separated from the standardized dataset. The standardized operator-associated field identifiers are determined as the baseline key value for matching. The selection of this baseline key value is based on the pre-defined association between operators and fields. Using the field identifiers bound to operators as the baseline ensures that operators can be accurately associated with the corresponding valid field nodes. Next, for each baseline key value, a full traversal search and comparison is performed in the standardized set of valid field node identifiers. During the search, each character is compared according to the standardized character format to ensure that the identifiers are completely identical in character order, character content, and completeness of expression. If an identifier that is completely identical to the current base key value is found in the set of valid field node identifiers, then the operator is considered to have successfully matched the corresponding valid field node in terms of field identifier. If, after traversing the entire set of valid field node identifiers, no identifier that is completely identical to the current base key value is found, then the match is considered to have failed. After the matching operation is completed, all successfully matched association records are retained. These records must completely contain the unique identifier of the operator, the corresponding operator-associated field identifier, and the successfully matched valid field node identifier to ensure that the association is traceable. At the same time, all unmatched association records are removed, including records where the operator-associated field identifier does not exist in the set of valid field node identifiers or where the identifier format has not passed the standardization validation, thus forming a field identifier matching subset.
[0169] D3: Using the field identifier matching subset obtained in D2 as the operation input, a type matching algorithm is used to perform type compatibility verification on the operators that have completed field identifier matching. First, a preset set of adaptation rules for operator types and index-adapted operation types is obtained. This set of rules is constructed based on the technical characteristics of various indexes in the target index layer and the logical functions of query operators, clearly defining the range of operator types corresponding to each index-adapted operation type. For example, due to its technical characteristics, a hash index only supports exact match queries, and the operator types corresponding to its adapted operation type only include exact comparison operators; a B-tree index supports exact match and range queries, and the operator types corresponding to its adapted operation type include exact comparison operators and range comparison operators. Then, for each associated record in the field identifier matching subset, the operator type of the operator in the record is extracted, and at the same time, the standardized unmatched dataset obtained in D1 is searched... The index-matching operation type of the associated index of the operator is determined by the index association identifier of the operator. The extracted operator type and the found index-matching operation type are compared according to the matching rule set for compliance. If the rule set determines that the operator type falls within the range defined by the index-matching operation type of its associated index, the type match is considered successful. If the rule set determines that the operator type does not fall within the above-defined range, the type match is considered unsuccessful. After verification, all successfully matched association records are retained. These records must fully contain the unique identifier of the index, the unique identifier of the operator, and the unique identifier of the valid field node to ensure that the association relationship of the three is complete and verifiable. At the same time, all unsuccessful association records are removed, including records where the operator type is outside the index-matching range or the index-matching operation type is not clearly defined, thus forming a type-matching subset.
[0170] D4: Using the field identifier matching subset obtained in D2 and the type matching subset obtained in D3 as common inputs, an association integration algorithm is used to perform the integration and structuring of the associated data. Specifically: First, the core identifier information contained in each associated record in both subsets is extracted to construct an associated data tuple with unique index identifiers, unique operator identifiers, and unique valid field node identifiers as elements. Each data tuple must completely correspond to one associated record, and the three types of identifiers in the tuple must be able to uniquely determine a set of index-operator-valid field node association relationships. Second, consistency filtering is performed on the associated data tuples of the two subsets. The filtering criteria are that the unique index identifiers, unique operator identifiers, and unique valid field node identifiers in the tuples are completely consistent to ensure the filtering... The resulting tuples are associated data that exist simultaneously in the field identifier matching subset and the type matching subset; third, based on the associated data tuples obtained by filtering, according to the fixed correspondence between index-operator-valid field node, a hierarchical mounting operation is performed in combination with the tree database. During the mounting process, the index corresponding to the unique identifier of the index is used as the root node of the tree structure, the operator adapted by the index (corresponding to the unique identifier of the operator) is used as the child node under the root node, and the valid field node adapted by the operator (corresponding to the unique identifier of the valid field node) is used as the leaf node under the child node. This ensures that the hierarchical relationship of the tree structure is completely consistent with the association logic of index-operator-valid field node. Through association integration and hierarchical mounting operations, the index-operator-valid field matching set is obtained.
[0171] Based on the index-operator-valid field matching set, the matching degree between the operator and the field data type, the matching degree between the operator and the index type, and the priority score based on the historical query frequency are calculated by the matching degree evaluation algorithm. The combination that reaches the preset threshold of comprehensive matching degree is retained to obtain the qualified index-operator-field set.
[0172] Based on the qualified index-operator-field set, the connection unit construction algorithm establishes the association connection between effective field nodes, query operators and target index nodes according to the mapping relationship between operators and fields, and obtains the basic index connection unit set marked with historical query frequency weight and adaptation status identifier;
[0173] Based on the basic index connection unit set, the structural compatibility between the connection unit and the field-driven node layer and the target index layer is verified by a hierarchical compatibility verification algorithm. Connection units that have logical conflicts or destroy the hierarchical structure are eliminated to obtain a compatible index connection unit set.
[0174] It should be further explained that the process of obtaining the compatible index linking unit set in this embodiment includes:
[0175] G1. Based on the basic index join unit set, a join unit information extraction algorithm is used to traverse each join unit and extract its core information to form a join unit core information set. The basic index join unit set includes valid field nodes, query operators, the relationship between target index nodes, historical query frequency weights, and adaptation status identifiers. The core information includes: valid field node IDs and their hierarchical attributes in the field-driven node layer, including parent node ID, child node ID, vertical dependency level, and horizontally related field IDs; query operator type; target index node IDs and their hierarchical attributes in the target index layer, including index level, parent index node ID, and the set of supported operator types; and the cross-layer association path of the join unit, i.e., the mapping relationship from field nodes to index nodes via operators.
[0176] G2. Based on the core information set of the connection unit and the vertical query dependency chain and horizontal query causal chain in the field-driven node layer, verification is performed using a field-layer dual compatibility verification algorithm, specifically including:
[0177] Check whether the field node in the join unit conforms to the parent-child relationship rules defined in the vertical query dependency chain; when the field is a child node, verify that its parent node has been correctly associated and that the current operator has not exceeded the constraint range set by the parent node; when the field is a parent node, verify that the index node it is connected to has the ability to cover the potential query requirements of its child nodes.
[0178] Check whether the connection relationship between the field node and the related fields in the horizontal query causal chain is consistent; for fields with causal relationships, their operator logic must be consistent, and a connection unit should not be established for a single related field while ignoring other necessary related fields;
[0179] After completing the above verification, output the field layer compatibility verification results;
[0180] G3. Based on the field layer compatibility verification results and the index hierarchy structure and index rules defined in the target index layer, a triple compatibility verification algorithm is used to perform the verification. The index rules at least include the types of operators supported by the index and the range of fields covered by the index; specifically including:
[0181] Check whether the level of the target index node matches the level of the field node, prohibit low-level index nodes from connecting to high-level field nodes, and ensure that the underlying index nodes on which the high-level index nodes depend have established valid connection units.
[0182] Verify whether the type of the current query operator is included in the set of operator types supported by the target index node;
[0183] Check whether the field range covered by the target index node includes all associated fields of the current field node;
[0184] After completing the above verification, output the index layer compatibility verification result;
[0185] G4. Based on the index layer compatibility verification results, each connection unit is judged according to the following preset rules using a conflict and hierarchy violation determination algorithm:
[0186] If a connection unit violates the vertical dependency rule or the horizontal association rule, it is determined to be a logical conflict. The specific process includes:
[0187] Iterate through all vertical dependencies of the field nodes in the join unit, checking if the parent node ID exists in the current set of valid join units. If it exists, further verify whether the value range of the current operator exceeds the range defined by the constraint condition of its parent node. If a parent node is missing or the operator is out of bounds, mark it as a violation of the vertical dependency rule.
[0188] The system queries the causal chain horizontally to obtain the set of all required field IDs that are causally related to the given field node. It then checks whether these related fields are correctly associated in the current connection unit or other related units, and verifies that the operator logic used by all related fields is consistent. If any required related fields are missing or the operator logic is inconsistent, it is marked as a violation of the lateral association rule.
[0189] If any of the above rules is violated, the connection unit is determined to have a logical conflict, and the determination result of each connection unit is output.
[0190] If a join unit violates the index hierarchy matching rule or the index coverage rule, it is determined to be a violation of the hierarchy structure. The specific process includes:
[0191] The index level value of the target index node is compared with the level value of the field node. If the index level value is lower than the field level value, it is determined that a low-level index is joining a high-level field, violating the level matching rule. Simultaneously, if the target index is a high-level index node, it is checked whether the join units corresponding to all its dependent base index nodes have been established and are valid. If any base index join units are missing, it is also determined to be a violation of the level matching rule.
[0192] Retrieve the set of covered fields declared by the target index node, as well as the set of IDs of the current field node and all its associated fields. If the set of covered fields is not a superset of the set of associated field IDs, meaning there are associated fields not covered by the index, then the index coverage rule is violated.
[0193] If any of the above rules are violated, the connection unit is determined to have disrupted the hierarchical structure, and the determination result for each connection unit is output.
[0194] If there are no violations as described above, the system is deemed to be without abnormalities, and the determination result for each connection unit is output.
[0195] Based on the join unit determination results, join units that are determined to be logically conflicting or disrupt the hierarchical structure are removed through a join unit filtering and sorting algorithm. Join units without abnormalities are retained. Then, the retained join units are sorted in the order of field node level → index node level to obtain a set of compatible index join units.
[0196] Based on the set of compatible index connection units, they are sorted according to the product of historical query frequency weight and fit score. Based on the sorted set of compatible index connection units, the query configuration node layer and the target index layer are bound according to the mapping relationship between operators and fields, thus completing the third cross-layer driven index connection.
[0197] It should be further explained that the minimum effective field adjustment tree in this embodiment is based on the business form query configuration tree, which extracts the query fields to be changed and the corresponding associated query fields. This involves considering the complexity of the change operations, the query permissions of the query operators corresponding to single or compound query fields, the fine-grained query indicators, and the parent-child hierarchical relationship. The tree is obtained by traversing the data using a Bayesian algorithm and an optimal traversal strategy, combined with a preset minimum change constraint and maximum fit objective. The fit is represented by the query anomaly probability detected by the Bayesian algorithm during the query process for the business form, and is used to characterize the effectiveness of the modified business form query configuration tree. The fit is characterized by the following technical means and is used to characterize the effectiveness of the modified business form query configuration tree: for the modified business form query configuration tree and its corresponding business form, the fit is determined by the following parameters: During a single query operation, the system uses historical query anomaly data of the business form, field relationships in the modified business form query configuration tree, query operator configuration, and field query permission attributes as input parameters. A Bayesian algorithm is employed to calculate the probability of potential anomalies such as data filtering logic conflicts, field permission mismatches, and abnormal query results. This probability directly represents the fit. The magnitude of the query anomaly probability is correlated with the fit and the effectiveness of the modified business form query configuration tree. A lower query anomaly probability indicates a higher fit, stronger adaptability of the modified business form query configuration tree to the business form query logic, and higher effectiveness. Conversely, a higher query anomaly probability indicates a lower fit, weaker adaptability of the modified business form query configuration tree to the business form query logic, and lower effectiveness.
[0198] It should be further explained that the construction process of the minimum effective field adjustment tree in this embodiment includes:
[0199] S2.1 Based on the business form query configuration tree, receive and parse the business requirement change instructions input from the outside, and extract the explicitly specified query fields that need to be changed to form an initial change set; using each field in the initial change set as the starting point of traversal, use the depth-first search algorithm to traverse the vertical query dependency chain to obtain all hierarchical related fields, and at the same time use the breadth-first search algorithm to traverse the horizontal query causal chain to obtain all sibling related fields; perform a union operation on the initial change set and all obtained related field sets, remove duplicate fields, and generate the complete set of fields to be adjusted;
[0200] S2.2. Based on the complete set of fields to be adjusted, calculate the complexity value of the change operation for each field one by one using a multi-factor weighted calculation algorithm, specifically including:
[0201] Data type conversion difficulty coefficient calculation: Based on the source data type and target data type of the field to be evaluated, a predefined type compatibility rule matrix is queried for matching. This matrix is established according to the SQL standard and the type conversion specifications of mainstream database products. The conversion operation is divided into multiple security levels according to the potential data precision loss and semantic consistency risk, and the corresponding preset difficulty level coefficient is output.
[0202] Based on the set of constraints defined on the fields, semantic analysis and dependency resolution are performed by the parser integrated with the Apache Calcite SQL validation framework. The logical expression complexity of the constraints, the number of associated objects, and the validation overhead are calculated, and a quantified constraint redefinition complexity value is output.
[0203] Based on the associated pointer attributes defined in the business form query configuration tree, the direct and indirect field network is analyzed using a graph traversal algorithm. The total number of affected associated fields is counted and standardized using a logarithmic function model, and the adjustment magnitude coefficient is output.
[0204] Based on the depth level of the field in the query configuration tree structure, the system calculates and outputs a depth coefficient that is negatively correlated with the depth value using a preset exponential decay weight model.
[0205] Based on the difficulty level coefficient, constraint redefinition complexity value, adjustment magnitude coefficient, and hierarchy depth coefficient, a weighted summation algorithm is used for comprehensive calculation. The weight coefficients corresponding to the difficulty level coefficient, constraint redefinition complexity value, adjustment magnitude coefficient, and hierarchy depth coefficient are predetermined based on the specific business scenario requirements using the AHP (Analytic Hierarchy Process) method. The change operation complexity value of each field is output.
[0206] S2.3. Based on the complete set of fields to be adjusted, the query permission attributes and fine-grained query metrics of each field node are extracted from the business form query configuration tree using an attribute extractor. The query permission attributes include readable, writable, and filterable status indicators. The fine-grained query metrics are obtained by analyzing the historical query result selectivity of the corresponding query operators of the fields.
[0207] S2.4. Based on the complete set of fields to be adjusted and their associated information, a network model is constructed using a Bayesian network construction engine, specifically including:
[0208] Fields are used as nodes, and the parent-child hierarchical relationship and horizontal association relationship between fields are used as directed edges;
[0209] The prior probability of a node is determined by the reciprocal of the normalized complexity value of the field change operation;
[0210] Conditional probability is calculated by combining the dependency level between fields, the strength of the association, and the matching degree of query permissions.
[0211] The network includes the fit of fine-grained metrics to the query as an observation variable, which is calculated by comparing the similarity between the current fine-grained metrics of the field and the expected metrics after the change.
[0212] S2.5. Based on the Bayesian network model, an improved A* algorithm is used for optimal traversal search, specifically including:
[0213] The objective function is to minimize the total complexity of field change operations.
[0214] The constraint is that the fit is not lower than a preset threshold. The fit is obtained by performing a query test after the change in a real-time simulator, collecting three indicators: query failure rate, result error rate and performance degradation rate, and then calculating the comprehensive anomaly probability and taking the reciprocal.
[0215] A dynamic pruning strategy is used during the traversal. The path search is terminated immediately when the cumulative change complexity of the path exceeds the preset limit or the real-time fit is lower than the threshold.
[0216] Output the adjusted subset of fields that satisfy the constraints and are optimal for the objective function;
[0217] S2.6. Based on the optimal field adjustment subset, a tree structure reconstruction algorithm is used to construct the minimum effective field adjustment tree, specifically including:
[0218] Establish a tree structure based on the parent-child hierarchical relationship of the fields in the original business form query configuration tree;
[0219] Preserve the horizontal relationships between fields as auxiliary connections;
[0220] Label each field node with a complete set of change attributes, including change operation complexity values, query permission attributes, and fine-grained query metrics;
[0221] Generate a separate, minimal effective field adjustment tree that contains only the minimum set of fields that must be adjusted to meet the change requirements and their complete related information.
[0222] It should be further explained that the specific process of traversing using the optimized traversal strategy in this embodiment includes:
[0223] Based on the business form query configuration tree, the starting point for traversal is the query field to be changed specified by the external business requirement change instruction. By traversing the vertical query dependency chain and the horizontal query causal chain in the configuration tree, all directly or indirectly related query fields are obtained, forming a complete set of fields to be adjusted. A Bayesian network construction algorithm is used to build a network model with fields as nodes and parent-child hierarchical relationships and horizontal association relationships between fields as edges. The node probability distribution is determined by the complexity of the change operation obtained by weighted summation of the difficulty of field data type conversion, the complexity of constraint redefinition, the adjustment range of association pointers, and the field hierarchy depth, as well as the query permission identifier and query fine-grained indicators of the fields. Based on this Bayesian network model, a heuristic search algorithm is used with the joint optimization objectives of minimum change constraints and maximum fit. As an optimal traversal method, it starts from the root node, performs a depth-first traversal along the parent-child hierarchical relationship, and expands breadth-first along the horizontal causal chain, dynamically calculating the cumulative change operation complexity and fit score under different paths. Among them, the minimum change constraint is determined by calculating the conditional probability between the parent field and the associated child field and applying a preset probability threshold for filtering. The fit score is represented by the inverse of the comprehensive anomaly probability of the changed query configuration tree in terms of query failure rate, result error rate, and performance degradation rate. During the traversal, branches that exceed the change range or have a fit score lower than the preset threshold are pruned in real time. Finally, the set of field nodes covered by the path with the lowest cumulative change complexity and the highest fit score is selected, organized according to the original tree hierarchy and association relationship, and the change attributes of each field are marked to generate an independent minimum effective field adjustment tree.
[0224] The process of obtaining the minimum change constraint is as follows: based on the parent-child hierarchical relationship of the business form query configuration tree, taking the field to be changed as the initial parent field, traversing each associated child field corresponding to the initial parent field, and using the Bayesian algorithm, with the query permissions, query fine-grained indicators and dependency degree corresponding to the parent field and the associated child field as conditions, calculating the conditional probability that each associated child field needs to be adjusted with the corresponding parent field.
[0225] Related subfields with conditional probabilities below a preset threshold are excluded, and the set of remaining fields is used as the minimum change constraint for the current change operation; the fine-grained query metric is constructed based on the selectivity of the query results of the single or compound query operator corresponding to each single or compound query field, and is used to optimize the accuracy of the query index.
[0226] It should be further explained that the process of creating or adjusting database indexes in this embodiment includes:
[0227] S3.1: Perform a traversal operation on the minimum effective field adjustment tree, using either level-order traversal or breadth-first traversal to ensure coverage of all field nodes in the tree. During the traversal, extract the complete attribute information for each field node. This attribute information specifically includes field identifier, data type, change operation complexity value, query permission attribute, query fine-grained index, parent-child hierarchical relationship identifier, and horizontal association relationship identifier. The field identifier is the unique identifier used to distinguish the field, obtained from the field metadata of the business form query configuration tree. The data type is the category attribute of the data stored in the field, including numeric, character, date / time, etc. The change operation complexity value is an index that quantifies the workload required to modify the field, calculated based on the number of business logic nodes associated with the field, the impact of the modification on the downstream query chain, and the field data... The more tables involved and the wider the scope of influence, the more nodes involved, and the higher the complexity value. Query permission attributes indicate whether a field has relevant query permissions, including whether it includes filtering permissions (i.e., whether the field can be used as a query filter condition), read-only permissions, etc. Query granularity metrics describe the selectivity of the field in a query. Selectivity is represented by the uniqueness of the field's values; the more unique the field values, the more accurate the target data filtered during the query, and the higher the selectivity. Parent-child hierarchy identifiers represent the information indicating the parent-child relationship between this field and other fields, specifically the identifier of the parent field (if a parent field exists) or a list of child field identifiers (if child fields exist). Horizontal association identifiers represent the information indicating the relationship between this field and other fields at the same level, specifically a list of related field identifiers at the same level.
[0228] S3.2: Based on the field node attribute information extracted in S3.1, generate a set of candidate index schemes. The specific operations are as follows: First, filter the fields that meet the basic conditions for index generation, then generate single-column or composite index candidate schemes for different conditions, and assign the corresponding index types; specifically:
[0229] S3.2.1 Filter fields that explicitly contain filtering permissions in the query permission attribute and whose change operation complexity value is lower than a preset threshold. Generate a single-column index candidate scheme for each field that meets the conditions. The preset threshold is based on the historical change operation data of the target business scenario. Specifically, it is calculated by statistically analyzing the complexity value corresponding to the average workload in historical change operations. Fields with a value lower than this have lower modification costs and are suitable for creating a separate index.
[0230] S3.2.2 Based on the parent-child hierarchical relationship identifier and horizontal association identifier of the fields, determine the field combinations with business relationships (such as fields with parent-child hierarchies, fields at the same level that frequently appear together in query conditions). Use a combination generation algorithm to generate candidate schemes for composite indexes. The combination generation algorithm is either a greedy algorithm or an Apriori algorithm. If a greedy algorithm is used, fields with high query frequency and high data selectivity are selected first and added to the combination, gradually expanding until the number of combined fields reaches a preset upper limit. If an Apriori algorithm is used, frequent field combinations are mined based on the frequency of fields appearing together in query conditions as the field composition of the composite index. After generating candidate schemes for composite indexes, sort the fields in the composite index according to a predefined field order rule. The field order rule is based on the data selectivity and query frequency of the fields. Fields with high data selectivity and high query frequency are ranked at the top of the composite index to improve index filtering efficiency.
[0231] S3.2.3. Based on the data type of the field and the predefined index type mapping rules, assign a corresponding index type to each candidate index scheme. The predefined index type mapping rules are constructed based on the query characteristics and index technology characteristics of different data types. For example, numeric fields are suitable for B-tree indexes (supporting range queries and exact queries), character fields are assigned hash indexes if they are often used for exact matching queries, and B-tree indexes if they are often used for prefix matching queries. Date and time fields are suitable for B-tree indexes (supporting time range queries).
[0232] S3.3: A predefined cost model is used to evaluate each candidate indexing scheme from multiple dimensions, and a scheme decision is made through a multi-objective optimization function. Specifically, the query performance improvement of each candidate scheme is calculated first, various cost indicators are statistically analyzed, and finally the optimal scheme is selected through an optimization algorithm.
[0233] Specifically, S3.3.1, based on historical query log data of the target business scenario, calculates the query frequency (i.e., the number of times the field appears as a query condition) of the field corresponding to each candidate index scheme in historical queries, and calculates the data selectivity of the field. The data selectivity is a quantitative indicator of the index's ability to filter data. It is determined by the ratio of the number of records returned by the query under common query value conditions (such as equal to, greater than, less than, range inclusive, etc.) to the total number of records in the data table. The smaller the ratio, the higher the selectivity and the higher the accuracy of data filtering. Combining historical query frequency and data selectivity, the degree of improvement of each candidate index scheme on query performance is calculated using a predefined performance evaluation formula. The higher the query frequency and the higher the data selectivity, the greater the performance improvement.
[0234] S3.3.2. Based on the real-time collected database storage data, calculate the storage cost of each candidate index scheme (i.e., the storage space occupied by the index in the database); analyze the index's write maintenance mechanism to calculate the write maintenance cost (i.e., the time and resource consumption required to synchronously update the index when data is added, modified, or deleted in the data table); assess the impact of index adjustments on the existing business system to obtain the change compatibility cost. The change compatibility cost is used to measure the degree of impact of index adjustments on the operation of the existing system. Specifically, it is determined by analyzing factors such as whether business services need to be suspended during the index adjustment process, whether it will cause existing query statements to be blocked, and whether existing application configurations need to be modified. The greater the impact, the higher the change compatibility cost.
[0235] S3.3.3. With four optimization objectives—maximizing query performance gains (i.e., the degree of query performance improvement), minimizing storage costs, minimizing write maintenance costs, and minimizing change compatibility costs—a multi-objective optimization algorithm is used to optimize and screen all candidate index schemes. The multi-objective optimization algorithm is either a constrained genetic algorithm or a non-dominated sorting genetic algorithm. If a constrained genetic algorithm is used, preset constraints are set, including at least a preset proportion of the total available storage space of the database in terms of storage costs and a preset impact threshold in terms of change compatibility costs. Through selection, crossover, and mutation operations of the genetic algorithm, schemes that meet the constraints and perform better in the four optimization objectives are screened. If a non-dominated sorting genetic algorithm is used, all candidate schemes are hierarchically divided through non-dominated sorting, and the scheme at the highest level (i.e., no other scheme is better than this scheme in all four optimization objectives) is screened to obtain the Pareto optimal solution set.
[0236] S3.4: Execute the generation and output of the final index strategy. First, obtain a predefined business rule base. This business rule base is built based on the business priorities and technical requirements of the target business scenario and contains rule entries for different business scenarios (e.g., for core business query scenarios, prioritize the solution with the highest query performance improvement; for non-core business scenarios, prioritize the solution with the lowest storage and maintenance costs; for scenarios prioritizing system stability, prioritize the solution with the lowest change compatibility costs). Based on the rule entries in the business rule base, match each solution in the Pareto optimal solution set obtained in S3.3 and select the solution that best matches the priority of the current business scenario as the final index strategy. According to the specific requirements of the final index strategy (e.g., adding an index, adjusting an existing index, rebuilding an index, deleting a useless index), generate corresponding database index operation statements. These index operation statements include one or more of CREATEINDEX (for adding an index), ALTERINDEX (for adjusting the attributes or structure of an existing index), REINDEX (for rebuilding an index to optimize index performance), and DROPINDEX (for deleting an unused index). The syntax of the operation statements conforms to the specifications of the target database management system to ensure that they can be directly executed in the database.
[0237] This embodiment achieves intelligent optimization and dynamic adjustment of database indexes by constructing a business form query configuration tree and a minimum effective field adjustment tree, bringing significant benefits in several aspects. Query performance is greatly improved. Based on the multi-level association between the field-driven node layer and the target index layer, and the weighting of historical query frequency, the system can accurately generate index strategies that highly match the business query pattern. This allows high-frequency query conditions to directly hit efficient indexes, reducing full table scans, significantly shortening query response time, and enhancing the system's concurrency support capabilities. System maintenance costs are significantly reduced. Through automated parsing of form metadata, adaptive construction of the query configuration tree, and a minimum change adjustment mechanism, the cumbersome workload of traditional manual index tuning is avoided, improving operational efficiency. Furthermore, the change process strictly relies on field validity verification and compatibility rules, ensuring the accuracy and security of index adjustments, and avoiding index redundancy and conflicts without manual intervention. Business adaptability is also enhanced. Relying on cross-layer driven connections and dynamic correlation calculation, the system can perceive business changes in real time and quickly generate a minimum adjustment scheme through Bayesian networks and optimization algorithms. This ensures that the index strategy always maintains a high degree of consistency with business needs, significantly reducing the business query anomaly rate. Resource utilization is optimized. Through a multi-objective cost model and Pareto optimal solution selection, query performance is improved while comprehensively balancing storage overhead, write costs, and change compatibility, reducing overall system resource consumption and achieving a balance between high performance and low cost. These effects directly stem from the core technical mechanisms of this embodiment. Structured modeling based on text parsing and graph neural networks ensures a deep fit between the indexing strategy and business logic; cross-layer driven connections and dynamic weight allocation achieve accuracy and adaptability in index generation; and minimum adjustment trees and multi-objective optimization guarantee efficiency in changes and system stability. Overall, this solution not only solves the problems of reliance on experience, slow response, and error susceptibility in traditional database index management, but also provides a systematic, adaptive, and continuously optimizing intelligent index management paradigm with extremely high engineering application value and promising prospects for promotion.
[0238] Example 2
[0239] Please see Figure 2 Another embodiment of the present invention provides a dynamic index generation system driven by business form fields, comprising: a configuration tree module, a parsing module, an index building module, and an exception adjustment module;
[0240] The configuration tree module, based on the query configuration items of form fields in the business form configuration subsystem, combines graph algorithms and a tree-structured database to obtain the business form query configuration tree;
[0241] The parsing module is used to obtain real-time configuration change operations for query configuration items of form fields in the business form configuration subsystem. Combined with an optimal traversal strategy, it aims to obtain a minimum effective field adjustment tree with the goals of minimizing change constraints and maximizing fit. This minimum effective field adjustment tree is obtained by extracting the change operation complexity of the query fields to be changed and their corresponding related adjustment fields from the business form query configuration tree, the query permissions of query operators corresponding to single or compound query fields, query fine-grained indicators, and parent-child hierarchical relationships. It is obtained through a Bayesian algorithm and an optimal traversal strategy, using a preset objective function constructed from minimum change constraints and maximum fit. The fit is determined by the query anomalies detected by the Bayesian algorithm during the query process for the business form, based on the changed business form query configuration tree. A constant probability representation is used to associate the validity of the modified business form query configuration tree. The process of obtaining the minimum change constraint is as follows: based on the hierarchical relationship of the business form query configuration tree, taking the field to be changed as the initial parent field, traversing each associated sub-field corresponding to the initial parent field, and using the Bayesian algorithm, calculating the conditional probability that each associated sub-field needs to be adjusted with the corresponding parent field, based on the query permissions, fine-grained query indicators, and dependency degree corresponding to the parent field and the associated sub-field; excluding associated sub-fields with conditional probabilities lower than a preset threshold, and the set of remaining fields is used as the minimum change constraint for the current change operation; the fine-grained query indicator is constructed based on the selectivity of the query results of the single or compound query operators corresponding to each single or compound query field, and is used to optimize the accuracy of the query index.
[0242] The index building module adjusts the tree based on the minimum effective fields and obtains the database index creation or adjustment statement through the index strategy engine;
[0243] The exception adjustment module is used to automatically execute the database index creation or adjustment statements to adjust the business form query configuration tree and respond to the real-time query requirements of newly added business forms. When any query requirement is abnormal, it locates the real-time query requirement of the business form and the corresponding updated query index; it feeds the real-time query requirement of the business form and the corresponding updated query index back to the optimization traversal strategy for real-time updates until all query requirements are satisfied.
[0244] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments under the guidance of the present invention without departing from the spirit and scope of the claims. All of these variations are within the protection scope of the present invention.
Claims
1. A dynamic index generation method driven by business form fields, characterized in that, include: Based on the query configuration items of form fields in the business form configuration subsystem, a graph algorithm and a tree-structured database are used to obtain the business form query configuration tree; By combining real-time configuration change operations of query configuration items for form fields in the business form configuration subsystem with an optimal traversal strategy, the minimum effective field adjustment tree is obtained with the goal of minimizing change constraints and maximizing fit. Based on the minimum effective field adjustment tree, the database index creation or adjustment statement is obtained through the index strategy engine; The system automatically executes the database index creation or adjustment statements to adjust the business form query configuration tree and responds to the real-time query requirements of newly added business forms. When any query requirement is abnormal, the system locates the real-time query requirement of the business form and the corresponding updated query index. The real-time query requirements of the business forms and the corresponding updated query index are fed back to the optimization traversal strategy for real-time updates until all query requirements are met. The minimum effective field adjustment tree is derived from the business form query configuration tree by extracting the query fields to be changed and the complexity of the change operations of the corresponding associated query fields, the query permissions of the query operators corresponding to single or compound query fields, the fine-grained query indicators, and the parent-child hierarchical relationship. It is obtained by traversing a preset objective function constructed from the minimum change constraints and the maximum fit, using a Bayesian algorithm and an optimal traversal strategy. The fit is represented by the query anomaly probability obtained by the Bayesian algorithm during the query process of the modified business form query configuration tree for the business form, and is used to associate and represent the effectiveness of the modified business form query configuration tree. The process of obtaining the minimum change constraint is as follows: based on the parent-child hierarchical relationship of the business form query configuration tree, taking the field to be changed as the initial parent field, traversing each associated child field corresponding to the initial parent field, and using the Bayesian algorithm, with the query permissions, query fine-grained indicators and dependency degree corresponding to the parent field and the associated child field as conditions, calculating the conditional probability that each associated child field needs to be adjusted with the corresponding parent field. Related subfields with conditional probabilities below a preset threshold are excluded, and the set of remaining fields is used as the minimum change constraint for the current change operation; the fine-grained query metric is constructed based on the selectivity of the query results of the single or compound query operator corresponding to each single or compound query field, and is used to optimize the accuracy of the query index.
2. The dynamic index generation method driven by business form fields as described in claim 1, characterized in that, The process of obtaining the business form query configuration tree includes: Based on the business form text information and text parsing algorithm, a form metadata field table is obtained; the form metadata field table includes at least the form ID, field and corresponding ID set, field association pointer, field association logical relationship operator set and field query combination dependency relationship, field query validity status label, field data type and constraint attribute, query operator mapping set, historical query frequency, and form business affiliation label. The root node is constructed using the form ID and the form business belonging label; the field-driven node layer is constructed using the fields and their corresponding ID sets, field data types and constraint attributes and field association pointers; the query configuration node layer is constructed using the set of field association logical relationship operators; and the target index layer is constructed using the business form information data. Based on the root node, the connection relationships between each field node in the field-driven node layer, the connection relationships between query operation nodes in the query configuration node layer, the connection relationships between target index character nodes in the target index layer, and the form ID and field ID, a first cross-layer driven connection is constructed. A second cross-layer driven combined connection is constructed based on the set of field association logic relationship operators and the field query combination dependency relationship. A third cross-layer driven index connection is constructed based on the set of query operator mappings and the historical query frequencies corresponding to the corresponding fields and query operators. Finally, a business form query configuration tree is constructed using a graph neural network and a tree-structured database.
3. The dynamic index generation method driven by business form fields as described in claim 2, characterized in that, The process of obtaining the first cross-layer driver connection includes: Based on the form ID, fields and corresponding ID sets, construct the first one-to-many connection sequence between the root node and the field-driven node layer; Based on the business form attribution tags and field attribute features, text feature extraction algorithms are used to obtain business domain classification features, field-related business indicator type features, periodic association matching features, and scenario constraint matching features. Based on business domain classification features, field-related business indicator type features, periodic association matching features, and scenario constraint matching features, the query-driven association degree between the business form and each field is obtained through association analysis algorithms. Based on the field query validity status label, obtain the corresponding binary label, the binary label includes 1 and 0, 1 corresponds to the field being valid, and 0 corresponds to the field being disabled; The binary label and the query-driven correlation are embedded into the first connection sequence to construct the first cross-layer driving connection.
4. The dynamic index generation method driven by business form fields as described in claim 3, characterized in that, The process of obtaining the field-driven node layer includes: Based on the binary labels, fields and corresponding ID sets, field data types and constraint attributes, and field association pointers in the first cross-layer driving connection, valid fields are filtered through availability verification rules to obtain a basic list of valid fields; Based on the effective field base list, extract the parent-child field hierarchical relationship features from the field association pointers to construct a vertical query dependency chain, and at the same time extract the horizontal causal features of the corresponding same-level associated query fields for each field to construct a horizontal query causal chain. A field-driven node layer is constructed by combining the vertical query dependency chain and the horizontal query causal chain corresponding to all fields with a graph neural network.
5. The dynamic index generation method driven by business form fields as described in claim 4, characterized in that, The process of constructing the horizontal query causal chain includes: obtaining the correlation degree between any two fields of the same level based on the fixedness of the logical operators in the combined query, the intersection ratio of the query result sets of the two fields, the mutual constraint degree of the field query conditions, and the business semantic association score combined with the association analysis algorithm, as the horizontal connection between the corresponding two fields; and obtaining the horizontal query causal chain based on the horizontal connection between the two fields of the same level and the field nodes constructed by the corresponding two fields. The process of constructing the vertical query dependency chain is as follows: extract the query enable control degree of the parent field to its child field, the constraint degree of the child field's value range on the parent field, the reference depth of the child field's query logic to the parent field, the passive adjustment rate of the child field when the parent field changes, and the data lineage relationship between the parent and child fields, combined with the infectious disease model, to construct the query dependency degree between any parent and child fields, which serves as the vertical connection between the parent and child nodes constructed for the corresponding parent and child fields; based on all parent and child nodes and their corresponding vertical connections, the vertical query dependency chain is constructed.
6. The dynamic index generation method driven by business form fields as described in claim 5, characterized in that, The construction process of the second cross-layer driver composite connection includes: Based on the set of field association logical relationship operators, combined with the entity-relationship extraction algorithm, we obtain the operator-combination-field node information set; Based on the operator-combination-field node information set, the association matching algorithm is used to match the associated field IDs of the field association logical relationship operator and the list of associated field IDs of the field query combination dependency relationship with the IDs of the valid field nodes in the field-driven node layer, and the valid field nodes corresponding to the operator and combination dependency are filtered out to obtain the operator-combination-valid field node matching set.
7. The dynamic index generation method driven by business form fields as described in claim 6, characterized in that, The construction process of the second cross-layer driver composite connection also includes: Based on the matching set of operator-combination-effective field nodes, the fitness algorithm is used to evaluate the fitness of each operator-combination with the corresponding effective field node, taking the fitness of the operator type and the data type of the effective field node, and the consistency of the combinational logic structure with the vertical query dependency chain and the horizontal query causal chain as evaluation targets. The fitness of each operator-combination with the corresponding effective field node is calculated, and the operator-combination-effective field node combination with the fitness greater than or equal to the preset fitness threshold is retained to obtain the qualified operator-combination-field node set. Based on the set of qualified operators, combinations, and field nodes, and according to the combination logic structure of field query combination dependencies, the corresponding valid field nodes are connected through the associated field association logic operators to obtain a combination connection containing valid field nodes, association operators, and combination logic. At the same time, the vertical dependency identifier or horizontal causal identifier corresponding to each combination connection is marked to obtain the second cross-layer driven combination connection.
8. The dynamic index generation method driven by business form fields as described in claim 7, characterized in that, The construction process of the third cross-layer driven index join includes: Based on the target index layer, query operator mapping set, and field-driven node layer, we extract the index type, index-related field identifier, operator type, operator-field mapping relationship, effective field node identifier, and historical query frequency to obtain the index-operator-field hierarchical information set. Based on the index-operator-field hierarchical information set, the operator-associated field identifier is matched with the valid field node identifier through the field identifier matching algorithm, and the operator type is matched with the index-adapted operation type through the matching algorithm to obtain the index-operator-valid field matching set; Based on the index-operator-valid field matching set, the matching degree between the operator and the field data type, the matching degree between the operator and the index type, and the priority score based on the historical query frequency are calculated by a multi-dimensional matching degree evaluation algorithm. The combination that reaches the preset threshold of comprehensive matching degree is retained to obtain the qualified index-operator-field set. Based on the qualified index-operator-field set, the connection unit construction algorithm establishes the association connection between the effective field node, the query operator and the target index node according to the mapping relationship between the operator and the field, and obtains the basic index connection unit set marked with historical query frequency weight and adaptation status identifier; Based on the basic index connection unit set, the structural compatibility between the connection unit and the field-driven node layer and the target index layer is verified by a hierarchical compatibility verification algorithm. Connection units that have logical conflicts or destroy the hierarchical structure are eliminated to obtain a compatible index connection unit set. Based on the set of compatible index connection units, they are sorted according to the product of historical query frequency weight and fit score. Based on the sorted set of compatible index connection units, the query configuration node layer and the target index layer are bound according to the mapping relationship between operators and fields, thus completing the third cross-layer driven index connection.
9. A dynamic index generation system driven by business form fields, used to implement the dynamic index generation method driven by business form fields as described in any one of claims 1-8, characterized in that, include: Configuration tree module, parsing module, index building module, and exception handling module; The configuration tree module obtains the business form query configuration tree based on the query configuration items of form fields in the business form configuration subsystem, combined with graph algorithms and tree databases. The parsing module is used to obtain the real-time configuration change operations of the query configuration items of the form fields in the business form configuration subsystem. Combined with the optimal traversal strategy, with the goal of minimizing change constraints and maximizing fit, it obtains the minimum effective field adjustment tree. The index building module adjusts the tree based on the minimum effective fields and obtains the database index creation or adjustment statement through the index strategy engine; The exception adjustment module is used to automatically execute the database index creation or adjustment statements to adjust the business form query configuration tree and respond to the real-time query requirements of newly added business forms. When any query requirement is abnormal, it locates the real-time query requirement of the business form and the corresponding updated query index; it feeds the real-time query requirement of the business form and the corresponding updated query index back to the optimization traversal strategy for real-time updates until all query requirements are met.
Citation Information
Patent Citations
Method and device for constructing index data
CN114860721A
Data processing method and device, computer equipment and storage medium
CN117875286A