A Metadata-Driven Dynamic Form Generation and Cross-Database Adaptation Method

By constructing a metadata attribute graph and a machine learning model, the coupling problem in dynamic form generation and cross-database adaptation was solved, achieving efficient cross-database data mapping and layout optimization, and improving the system's flexibility and user experience.

CN120743967BActive Publication Date: 2025-11-14NANJING LAICHEN TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511254477.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-04
Publication Date
2025-11-14
Estimated Expiration
2045-09-04

AI Technical Summary

Technical Problem

Existing metadata-driven dynamic form generation and cross-database adaptation suffer from high coupling between business logic and UI, difficult maintenance, lack of multi-dimensional contextual intelligent optimization capabilities, poor scalability of the data persistence layer, low performance of validation logic, inability to meet real-time interaction requirements, and lack of collaborative editing and conflict intent retention mechanisms, resulting in system rigidity and high costs.

Method used

By constructing the original metadata attribute graph, dynamic form layouts are generated based on semantic tags and cross-database requirements. Machine learning models are used to make context-aware layout decisions, enabling cross-database mapping and incremental data flow. Graph pattern decomposition and topological sorting are used for adaptive mapping to generate cross-database adaptation solutions.

Benefits of technology

It achieves intelligent adaptation across the entire link from the user interface to the database, improving data interaction efficiency, reducing the number of interaction round trips and redundant data transmission, reducing system complexity and maintenance costs, and improving system flexibility and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120743967B_ABST
    Figure CN120743967B_ABST
Patent Text Reader

Abstract

This invention discloses a metadata-driven dynamic form generation and cross-database adaptation method, belonging to the field of data architecture technology. The method includes: establishing an original metadata attribute graph; generating a device-optimized form interaction data graph for each user permission based on the original metadata attribute graph and the user roles and device parameters of the calling forms; performing cross-database mapping adaptation analysis to verify the interaction paths between forms and the cross-database requirements of the target database type, generating a device-optimized form data adaptation database for each user permission; compiling rules based on real-time user input of multi-source heterogeneous data and the execution logic in the original metadata attribute graph, marking the incremental propagation path in the device-optimized form interaction data graph for each user permission, and updating the device-optimized form data adaptation database for each user permission. The advantages of this invention are: improved data interaction efficiency, reduced interaction round trips, and redundant data transmission.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data architecture technology, specifically to a method for dynamic form generation and cross-database adaptation based on metadata-driven approaches. Background Technology

[0002] Existing metadata-driven dynamic form generation and cross-database adaptation suffer from several drawbacks. The flattened metadata model leads to high coupling between business logic, UI, and data logic, making maintenance difficult. Layout generation relies on static rules and lacks intelligent dynamic optimization capabilities based on multi-dimensional context. The data persistence layer uses static ORM mapping, which is strongly bound to the database, making it difficult to adapt to heterogeneous environments and resulting in poor scalability. Validation logic is scattered and uses full-scale computation, leading to poor performance and inability to meet real-time interaction requirements. Furthermore, the complete lack of effective collaborative editing and conflict resolution mechanisms severely restricts the efficiency of multi-user collaboration. These shortcomings collectively result in a rigid system, high costs, and a poor user experience. Summary of the Invention

[0003] To address the aforementioned technical issues, a metadata-driven method for dynamic form generation and cross-database adaptation is provided. This technical solution resolves the problems described above.

[0004] To achieve the above objectives, the technical solution adopted by the present invention is as follows:

[0005] A metadata-driven method for dynamic form generation and cross-database adaptation includes:

[0006] S1. Pre-set several types of raw metadata sets, analyze the semantic dependencies corresponding to the attribute information of the raw metadata, determine the semantic tags, cross-database requirements and execution logic of the raw metadata, and establish the raw metadata attribute graph.

[0007] S2. Based on the original metadata attribute graph and the user roles and device parameters of the call form, establish a dynamic decision model for form layout interaction and generate the optimal form interaction data graph for each user permission on the corresponding device.

[0008] S3. Verify the interaction path between each form in the corresponding device optimal form interaction data diagram of each user permission and perform cross-database mapping and adaptation analysis with the cross-database requirements of the target database type to generate the corresponding device optimal form data adaptation database for each user permission.

[0009] S4. Based on the execution logic in the multi-source heterogeneous data and original metadata attribute graph of real-time user input, compile rules to obtain the logic rule set of multi-source heterogeneous data of real-time user input, mark the incremental propagation path in the corresponding device optimal form interaction data graph of each user permission, and update the corresponding device optimal form data adaptation database of each user permission.

[0010] Preferably, step S1 specifically includes:

[0011] Based on the constraint syntax tree, a constraint parsing function is established to analyze the reference constraint relationship between each field in several types of raw metadata sets, and to construct a set of explicit constraint relationships between fields of several types of raw metadata.

[0012] Each field and word variable in several types of raw metadata sets is selected and concatenated into word vectors of several types of raw metadata. Then, cosine similarity is used to calculate the similarity value between the word vectors of several types of raw metadata.

[0013] Using quartiles, the distribution of similarity values ​​between word vectors of several types of original metadata is statistically analyzed, and the mean of the maximum distribution interval of similarity values ​​between word vectors of several types of original metadata is selected as the word vector association threshold of the original metadata.

[0014] By using the word vector association threshold of the original metadata, the similarity values ​​between word vectors of several types of original metadata are filtered to obtain the implicit semantic association set of fields of several types of original metadata.

[0015] Preferably, step S1 further includes:

[0016] Based on the enterprise data dictionary, the structured entity attributes of each business type are labeled, and a business type entity tag knowledge graph is established.

[0017] Standardize several types of raw metadata;

[0018] Using a fuzzy clustering algorithm, the original metadata of several types is clustered and filtered according to the structured entity attributes of each business type in the business type entity tag knowledge graph to determine the candidate business type entity tag set of several types of original metadata.

[0019] Using a similarity function, the similarity between several types of original metadata and the structured entity attributes of each business type in the candidate business type entity tag set of several types of original metadata is calculated to determine several business type entity tags corresponding to several types of original metadata, as follows: ,

[0020] in, For the original metadata of the i-th type and the i-th e Similarity values ​​between structured entity attributes of each business type For the original metadata of the i-th type and the i-th e Text similarity of structured entity attributes for each business type For the original metadata of the i-th type and the i-th e Structural similarity of structured entity attributes for each business type The text similarity weights of the original metadata The structural similarity weight of the original metadata;

[0021] The method for selecting the maximum similarity of several business type entity tags corresponding to several types of raw metadata and assigning the optimal business type entity tags to the raw metadata of several types is as follows: ,

[0022] in, The optimal business type entity label for the i-th type of raw metadata. This is a set of candidate business type entity tags for several types of raw metadata. This indicates that the original metadata of the i-th type is associated and mapped with the business type entity label.

[0023] Preferably, step S1 further includes:

[0024] Identify the known database types to be crossed;

[0025] Based on the set of explicit field constraints of several types of raw metadata, the explicit field constraints of each raw metadata are decomposed into a set of atomic constraints of several types of raw metadata.

[0026] Based on the base mapping table of the database types to be crossed, the atomic constraint sets of the original metadata of several types are queried, mapped and transformed to obtain the matching constraint rules of the original metadata of several types to be crossed with the databases.

[0027] Based on the known database types to be crossed, and according to the matching constraint rules of the original metadata of several types to be crossed, read and write the original metadata of several types to obtain the known database types to be crossed storage source data of the original metadata of several types.

[0028] Based on the known database types to be crossed for several types of original metadata, the source data is stored, and the matching constraint rules of the databases to be crossed for several types of original metadata are used as mapping conditions to generate dynamic mapping rule functions for each known database type to be crossed.

[0029] Each field in several types of raw metadata sets is taken as the central node, and the business type entity tags corresponding to several types of raw metadata are taken as business entity nodes. The explicit constraint relationship set of the fields of several types of raw metadata is taken as the edge between each field. The implicit semantic association set of the fields of several types of raw metadata is taken as the implicit association between each field. The optimal business type entity tag of several types of raw metadata is taken as the belonging relationship between each field. The dynamic mapping rule function of each known database type to be crossed is taken as the mapping relationship, thus obtaining the raw metadata attribute graph.

[0030] Preferably, step S2 specifically includes:

[0031] Based on the original metadata attribute graph, the attribution relationship between each node is used as the attribution business type entity label. The business type entity label codes of several types of original metadata are obtained, the importance weight of the business type entity label is determined, and the in-degree and out-degree of the dependency of the business type entity label are determined by the edge interaction frequency between each node. The feature data of each node field in the original metadata attribute graph are obtained.

[0032] Based on the user role and device parameters of the call form, read the user role code and device parameter type code of the call form, determine the business type and entity label covered by the user role code of the call form, and the screen space size of the device parameter type code, and obtain the context feature data of user role and device parameters;

[0033] Based on the context feature vectors of user roles and device parameters, the layout priority of entity tags for each business type is determined. Based on the feature vectors of each node field in the original metadata attribute graph, the callable component type of entity tags for each business type is determined, and the optimal layout attribute tag data for each field of user roles and device parameters is obtained.

[0034] The original training set for optimal form interaction is constructed by combining the feature data of each node field in the original metadata attribute graph, the context feature data of user roles and device parameters, and the optimal layout attribute label data of each field of user roles and device parameters.

[0035] Based on random forest, decision trees for different user roles and device parameters are trained using the original training set of optimal form interaction. The original training set of optimal form interaction is used as the root node, the feature data of each node field in the original metadata attribute graph and the context feature data of user role and device parameter are used as branch nodes, and the optimal layout attribute label data of each field of user role and device parameter are used as leaf nodes to build a dynamic decision model for form layout interaction.

[0036] Based on the form layout interaction dynamic decision model, generate the device-optimal form interaction data diagram corresponding to each user permission of each node in the original metadata attribute diagram.

[0037] Preferably, step S3 specifically includes:

[0038] Based on the optimal form interaction data graph of each user's permissions for each device, the interaction paths in the optimal form interaction data graph of each user's permissions for each device are traversed and searched according to the interaction edges between each node in the original metadata attribute graph. The interaction elements in the interaction paths are determined, the optimal form interaction event flow of each user's permissions for each device is obtained, and the directed operation graph of the optimal form interaction of each user's permissions for each device is constructed.

[0039] Based on the device-optimal form interaction directed operation graph corresponding to each user's permissions, according to the interaction event flow in each interaction path, and using the dynamic mapping rule function of each known database type to be crossed as a constraint, and according to the W3C document of the known database type to be crossed, determine the set of rendering data field requirements of the known database type to be crossed corresponding to the interaction event flow in each interaction path under the constraint conditions, and construct it into the device-optimal form interaction directed operation to be crossed database rendering mapping table corresponding to each user's permissions.

[0040] Based on the device-optimal form interaction directed operation mapping table for each user's permissions, a global data dictionary for device-optimal form interaction to be rendered across databases is established.

[0041] Based on the global data dictionary of the optimal form interaction for each user's permissions across databases, filter the data requirements of the optimal form interaction for each user's permissions along the same path as the total requirements of the optimal form interaction for the current user's permissions.

[0042] By taking the data fields of different database interaction requests in the overall optimal form interaction requirements for the current user's permissions as nodes and the directed interaction operations as edges, a greedy algorithm is used to approximate the optimal interaction path for the overall optimal form interaction requirements for the current user's permissions. This yields the cross-database query scheme for the optimal form data for each user's permissions, and determines the database that best suits the optimal form data for each user's permissions.

[0043] Preferably, step S4 specifically includes:

[0044] Based on multi-source heterogeneous data input by users in real time, extract the identifiers of the user's real-time input fields;

[0045] Based on the original metadata attribute graph, the user real-time input field identifier is traversed and searched to obtain the node to which the user real-time input field identifier belongs, determine the interaction path to which the user real-time input field identifier belongs, and determine the appropriate database for the user real-time input multi-source heterogeneous data.

[0046] Based on the adapted database of multi-source heterogeneous data input by users in real time, and according to the dynamic mapping rule function of each known database type to be crossed, the character identifier of multi-source heterogeneous data input by users in real time is parsed into an AST abstract syntax tree;

[0047] Using the original metadata attribute graph, verify whether the variables in the AST abstract syntax tree are valid. If not, return an exception for the multi-source heterogeneous data input by the user in real time. If yes, compile the AST abstract syntax tree into the corresponding adapted database binding function to obtain the logical rule set of the multi-source heterogeneous data input by the user in real time.

[0048] Preferably, step S4 further includes:

[0049] Based on the interaction path of the user's real-time input field identifier, the non-related nodes and edges in the original metadata attribute graph are removed to obtain the user's real-time input field identifier subgraph. The logical rule set of the user's real-time input multi-source heterogeneous data is used as the subgraph edge dependency relationship to generate the optimal form data graph of the user's real-time input multi-source heterogeneous data.

[0050] Based on the in-degree and out-degree of the dependencies of known business type entity labels between nodes in the original metadata attribute graph, the dependency relationships between nodes in the optimal form data graph of real-time multi-source heterogeneous data input by users are marked. Using the Kahn topology sorting algorithm, nodes with initial data changes are marked as dirty nodes. Dependency nodes are recursively sorted and marked in the order of topology sorting to obtain the incremental propagation path in the corresponding device optimal form interaction data graph for each user permission in the original metadata attribute graph.

[0051] By using the incremental propagation path in the device-optimal form interaction data graph corresponding to each user's permissions, the original metadata attribute graph is calibrated to obtain the device-optimal form data adaptation database for each user's permissions.

[0052] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0053] This invention proposes a metadata-driven dynamic form generation and cross-database adaptation scheme. By constructing a global attribute graph that integrates semantics, execution logic, and cross-database mapping, it drives a machine learning model to generate context-aware form layouts. Furthermore, it utilizes graph pattern decomposition and topology sorting to achieve incremental data flow and multi-database adaptive mapping. This fundamentally solves the problem of automatic form generation and consistency maintenance under heterogeneous data sources and dynamic business requirements, realizing end-to-end intelligent adaptation from the user interface to database storage, improving data interaction efficiency, and reducing the number of interaction round trips and redundant data transmission. Attached Figure Description

[0054] Figure 1 This is a flowchart of a metadata-driven dynamic form generation and cross-database adaptation method. Detailed Implementation

[0055] The following description is intended to disclose the invention and enable those skilled in the art to implement it. The preferred embodiments described below are merely examples, and other obvious variations will occur to those skilled in the art.

[0056] Reference Figure 1 As shown, a metadata-driven dynamic form generation and cross-database adaptation method includes:

[0057] S1. Pre-set several types of raw metadata sets, analyze the semantic dependencies corresponding to the attribute information of the raw metadata, determine the semantic tags, cross-database requirements and execution logic of the raw metadata, and establish the raw metadata attribute graph.

[0058] Step S1 specifically includes:

[0059] Based on the constraint syntax tree, a constraint parsing function is established to analyze the reference constraint relationship between each field in several types of raw metadata sets, and to construct a set of explicit constraint relationships between fields of several types of raw metadata.

[0060] As a further development, constraint parsing functions include, but are not limited to: constraint syntax parsing: using regular expression pattern matching to match field references in constraint strings; conditional logic constraints: using an abstract syntax tree (AST) parser to traverse conditional branch nodes; and mathematical formula constraints: using symbol table analysis (such as symbol extraction in SymPy).

[0061] Each field and word variable in several types of raw metadata sets is selected and concatenated into word vectors of several types of raw metadata. Then, cosine similarity is used to calculate the similarity value between the word vectors of several types of raw metadata.

[0062] Using quartiles, the distribution of similarity values ​​between word vectors of several types of original metadata is statistically analyzed, and the mean of the maximum distribution interval of similarity values ​​between word vectors of several types of original metadata is selected as the word vector association threshold of the original metadata.

[0063] By using the word vector association threshold of the original metadata, the similarity values ​​between word vectors of several types of original metadata are filtered to obtain the implicit semantic association set of fields of several types of original metadata.

[0064] Step S1 also includes:

[0065] Based on the enterprise data dictionary, the structured entity attributes of each business type are labeled, and a business type entity tag knowledge graph is established.

[0066] Standardize several types of raw metadata;

[0067] Using a fuzzy clustering algorithm, the original metadata of several types is clustered and filtered according to the structured entity attributes of each business type in the business type entity tag knowledge graph to determine the candidate business type entity tag set of several types of original metadata.

[0068] Using a similarity function, the similarity between several types of original metadata and the structured entity attributes of each business type in the candidate business type entity tag set of several types of original metadata is calculated to determine several business type entity tags corresponding to several types of original metadata, as follows: ,

[0069] in, For the original metadata of the i-th type and the i-th e Similarity values ​​between structured entity attributes of each business type For the original metadata of the i-th type and the i-th e Text similarity of structured entity attributes for each business type For the original metadata of the i-th type and the i-th e Structural similarity of structured entity attributes for each business type The text similarity weights of the original metadata The structural similarity weight of the original metadata;

[0070] As further content, The text similarity weight of the original metadata and The structural similarity weights for initial data are solved using grid search; however, when the similarity function is differentiable and the dataset is large, gradient descent can be used. Let be the similarity value between the original metadata of type i and the structured entity attributes of type e. It represents the degree of overall matching between the metadata object and a standard business term, such as determining whether an animal Sim(animal, cat) belongs to the species "cat" (e). For the original metadata of the i-th type and the i-th e The text similarity of structured entity attributes for each business type indicates that the similarity only considers the name field of the original metadata object. Similarity at the natural language level to the labels (e.labels) of business entity attributes, for example: = "cust_nm" (a database field name), and e.label = customer_name (a standard business term), calculating TextSim(cust_nm, customer_name), the result might be a high score (e.g., 0.8) because "cust" and "customer", "nm" and "name" are similar in text, for... The structural similarity between the original metadata of type i and the structured entity attributes of type e is compared between the original metadata objects. and business entity attributes Its inherent structure and characteristics, for example: : A field of data type NUMBER, which is the primary key and a foreign key referencing the employee table. e: Business term: Employee ID, defined as a 3-digit numeric code uniquely identifying an employee. Even It is `emp_id`, while `e.label` is the employee ID (TextSim might not be high), but their structural features (numeric type, length 3, uniqueness) are highly matched, therefore... It will give a very high score.

[0071] The method for selecting the maximum similarity of several business type entity tags corresponding to several types of raw metadata and assigning the optimal business type entity tags to the raw metadata of several types is as follows: ,

[0072] in, The optimal business type entity label for the i-th type of raw metadata. This is a set of candidate business type entity tags for several types of raw metadata. This indicates that the original metadata of the i-th type is associated and mapped with the business type entity label.

[0073] Step S1 also includes:

[0074] Identify the known database types to be crossed;

[0075] Based on the set of explicit field constraints of several types of raw metadata, the explicit field constraints of each raw metadata are decomposed into a set of atomic constraints of several types of raw metadata.

[0076] Based on the base mapping table of the database types to be crossed, the atomic constraint sets of the original metadata of several types are queried, mapped and transformed to obtain the matching constraint rules of the original metadata of several types to be crossed with the databases.

[0077] Based on the known database types to be crossed, and according to the matching constraint rules of the original metadata of several types to be crossed, read and write the original metadata of several types to obtain the known database types to be crossed storage source data of the original metadata of several types.

[0078] Based on the known database types to be crossed for several types of original metadata, the source data is stored, and the matching constraint rules of the databases to be crossed for several types of original metadata are used as mapping conditions to generate dynamic mapping rule functions for each known database type to be crossed.

[0079] Each field in several types of raw metadata sets is taken as the central node, and the business type entity tags corresponding to several types of raw metadata are taken as business entity nodes. The explicit constraint relationship set of the fields of several types of raw metadata is taken as the edge between each field. The implicit semantic association set of the fields of several types of raw metadata is taken as the implicit association between each field. The optimal business type entity tag of several types of raw metadata is taken as the belonging relationship between each field. The dynamic mapping rule function of each known database type to be crossed is taken as the mapping relationship, thus obtaining the raw metadata attribute graph.

[0080] When using it, please refer to the above:

[0081] As a further development, through multimodal analysis and dynamic compilation, the raw, flat metadata is transformed into an attribute graph knowledge network rich in semantics and adaptation rules. Leveraging a dual dependency discovery mechanism of syntax and semantics, it not only parses explicit syntactic references between fields but also mines deep semantic relationships through word vector similarity, constructing a complete relationship graph far exceeding traditional solutions. Simultaneously, it introduces atomic constraint decomposition and mapping patterns, breaking down complex business constraints into the smallest granularity of atomic rules. By querying a pre-defined mapping table, it dynamically compiles and generates cross-database adaptation functions, achieving a leap from static model mapping to dynamic rule compilation, eliminating dependence on specific ORM frameworks. Furthermore, knowledge graph-driven semantic annotation utilizes existing enterprise data assets to automatically standardize metadata business terminology, ensuring semantic consistency. Its technical features include: improved development efficiency and system flexibility; metadata changes or the addition of new database types do not require modification of business code, only configuration adjustments are needed for automatic adaptation, and the generated form logic is more intelligent and accurate.

[0082] The execution flow of step S1 is exemplified as follows:

[0083] Suppose a company has metadata for customer information forms and needs to adapt it to MySQL and MongoDB.

[0084] Original metadata set M:

[0085] m1: (name: "user_id", type: "int", constraints: "PRIMARY KEY AUTO_INCREMENT")

[0086] m2: (name: "customer_name", type: "varchar", constraints: "NOT NULLLENGTH(255)")

[0087] m3: (name: "client_email", type: "varchar", constraints: "UNIQUE NOTNULL REFERENCEs user_id")

[0088] m4: (name: "annual_income", type: "decimal", constraints: "CHECK(annual_income>0)")

[0089] Step 1: Construct the set of explicit / implicit dependencies

[0090] Explicit dependencies (through resolving constraints):

[0091] E_{dep} = { (m3, references, m1)} (because REFERENCES user_id)

[0092] Implicit dependency (achieved by calculating cosine similarity of word vectors):

[0093] The Sim("customer_name", "client_email") value is very high (both contain customer semantics), let's say 0.82.

[0094] If the set association threshold θ = 0.75, then E_{sem} = { (m2, semanticallyRelated, m3)}

[0095] Step 2: Semantic Tag Annotation

[0096] The knowledge graph contains the entity Customer, whose attributes include identifier, name, and contact.

[0097] Through similarity calculation and clustering:

[0098] The value of m1.name("user_id") is highest with Customer.identifier -> the tag is Customer.identifier;

[0099] m2.name("customer_name") has the highest similarity to Customer.name -> the tag is Customer.name;

[0100] m3.name("client_email") has the highest similarity to Customer.contact -> the tag is Customer.contact;

[0101] Step 3: Generate dynamic mapping rule functions

[0102] Known database types: MySQL, MongoDB

[0103] Atomic constraint decomposition: Taking m2("customer_name") as an example, the constraint "NOT NULL LENGTH(255)"

[0104] Disassembled into:

[0105] Constraint 1: {"type": "varchar"}, Constraint 2: {"not_null": true}, Constraint 3: {"max_length": 255};

[0106] Query the underlying mapping table:

[0107] MySQL mapping table: {"varchar": "VARCHAR(%max_length%)", "not_null:true": "NOT NULL", ...};

[0108] MongoDB mapping table: {"varchar": "string", "not_null:true": {"required":true}, "max_length:%d": {"maxLength": %d}, ...};

[0109] Generate dynamic mapping functions:

[0110] f_m2_to_MySQL = "VARCHAR(255) NOT NULL";

[0111] f_m2_to_MongoDB = { "bsonType": "string", "required": true, "maxLength": 255};

[0112] Step 4: Construct the original metadata attribute graph G

[0113] Vertex V: m1, m2, m3, m4, Customer.identifier, Customer.name,Customer.contact

[0114] Edge E: (m3, dependsOn, m1) (edge), (m2, semanticallyRelated, m3) (latent association), (m1, hasTag, Customer.identifier) ​​(attribution relationship), (m2, hasTag, Customer.name) (attribution relationship), (m3, hasTag, Customer.contact) (attribution relationship), (m2, mapsTo, f_m2_to_MySQL), (m2, mapsTo, f_m2_to_MongoDB) (mapping relationship).

[0115] S2. Based on the original metadata attribute graph and the user roles and device parameters of the call form, establish a dynamic decision model for form layout interaction and generate the optimal form interaction data graph for each user permission on the corresponding device.

[0116] Step S2 specifically includes:

[0117] Based on the original metadata attribute graph, the attribution relationship between each node is used as the attribution business type entity label. The business type entity label codes of several types of original metadata are obtained, the importance weight of the business type entity label is determined, and the in-degree and out-degree of the dependency of the business type entity label are determined by the edge interaction frequency between each node. The feature data of each node field in the original metadata attribute graph are obtained.

[0118] Based on the user role and device parameters of the call form, read the user role code and device parameter type code of the call form, determine the business type and entity label covered by the user role code of the call form, and the screen space size of the device parameter type code, and obtain the context feature data of user role and device parameters;

[0119] Based on the context feature vectors of user roles and device parameters, the layout priority of entity tags for each business type is determined. Based on the feature vectors of each node field in the original metadata attribute graph, the callable component type of entity tags for each business type is determined, and the optimal layout attribute tag data for each field of user roles and device parameters is obtained.

[0120] The original training set for optimal form interaction is constructed by combining the feature data of each node field in the original metadata attribute graph, the context feature data of user roles and device parameters, and the optimal layout attribute label data of each field of user roles and device parameters.

[0121] Based on random forest, decision trees for different user roles and device parameters are trained using the original training set of optimal form interaction. The original training set of optimal form interaction is used as the root node, the feature data of each node field in the original metadata attribute graph and the context feature data of user role and device parameter are used as branch nodes, and the optimal layout attribute label data of each field of user role and device parameter are used as leaf nodes to build a dynamic decision model for form layout interaction.

[0122] Based on the form layout interaction dynamic decision model, generate the device-optimal form interaction data diagram corresponding to each user permission of each node in the original metadata attribute diagram.

[0123] When using it, please refer to the above:

[0124] As a further development, topological features (such as field dependency in-degree and out-degree) and business semantic features (such as entity tag importance) are extracted from the metadata attribute graph and fused with contextual features such as user roles and device parameters to construct a high-dimensional feature vector. Utilizing the random forest ensemble learning algorithm, with field and contextual features as input, the algorithm predicts in real time the optimal component type, layout priority, and space occupied for each field, and automatically assembles them into a complete, context-adaptive form layout interaction graph. This achieves machine learning-driven layout decisions based on graph features and context awareness, replacing traditional responsive layout methods based on manual rules or static templates. Through the random forest model, the system can understand the deep value of fields in the business relationship network and make globally optimal layout arrangements. Its technical features include: highly personalized layouts, generating the most suitable interactive interfaces for different roles and devices, greatly improving user experience and operational efficiency; and strong generalization and adaptability, requiring no code modification for new roles or device types, reducing maintenance costs.

[0125] S3. Verify the interaction path between each form in the corresponding device optimal form interaction data diagram of each user permission and perform cross-database mapping and adaptation analysis with the cross-database requirements of the target database type to generate the corresponding device optimal form data adaptation database for each user permission.

[0126] Step S3 specifically includes:

[0127] Based on the optimal form interaction data graph of each user's permissions for each device, the interaction paths in the optimal form interaction data graph of each user's permissions for each device are traversed and searched according to the interaction edges between each node in the original metadata attribute graph. The interaction elements in the interaction paths are determined, the optimal form interaction event flow of each user's permissions for each device is obtained, and the directed operation graph of the optimal form interaction of each user's permissions for each device is constructed.

[0128] Based on the device-optimal form interaction directed operation graph corresponding to each user's permissions, according to the interaction event flow in each interaction path, and using the dynamic mapping rule function of each known database type to be crossed as a constraint, and according to the W3C document of the known database type to be crossed, determine the set of rendering data field requirements of the known database type to be crossed corresponding to the interaction event flow in each interaction path under the constraint conditions, and construct it into the device-optimal form interaction directed operation to be crossed database rendering mapping table corresponding to each user's permissions.

[0129] Based on the device-optimal form interaction directed operation mapping table for each user's permissions, a global data dictionary for device-optimal form interaction to be rendered across databases is established.

[0130] Based on the global data dictionary of the optimal form interaction for each user's permissions across databases, filter the data requirements of the optimal form interaction for each user's permissions along the same path as the total requirements of the optimal form interaction for the current user's permissions.

[0131] By taking the data fields of different database interaction requests in the overall optimal form interaction requirements for the current user's permissions as nodes and the directed interaction operations as edges, a greedy algorithm is used to approximate the optimal interaction path for the overall optimal form interaction requirements for the current user's permissions. This yields the cross-database query scheme for the optimal form data for each user's permissions, and determines the database that best suits the optimal form data for each user's permissions.

[0132] When using it, please refer to the steps outlined above:

[0133] As a further development, a directed operation graph is constructed by mining user operation sequences, and based on this, the global data requirement set needed to complete the entire business process is derived. Then, a greedy algorithm is used for multi-objective optimization (such as minimizing query counts and latency) to dynamically generate a globally optimal query plan across multiple heterogeneous databases. The technical principle lies in: implementing demand-side driven optimization, shifting the data acquisition strategy from what the database can provide to what the user's operations require, and solving the fundamental problem of multi-source data collaborative access through explicit modeling and optimization of cross-database query paths. This achieves an exceptional performance experience, significantly reducing network round trips and redundant data transmission, and significantly improving form response speed; it also reduces system complexity, completely hiding the underlying complexity of multiple databases from application developers.

[0134] Example scenario: E-commerce platform, user role is buyer, and the form interaction path is: view product details -> add to cart -> checkout.

[0135] Database environment: Product information is in Elasticsearch (ES), inventory data is in Redis, and order data is in MySQL.

[0136] Step 1: Construct an interactive directed operation graph

[0137] Path: [ViewProductDetail] ->[AddToCart] ->[Checkout];

[0138] Step 2: Construct the cross-database rendering mapping table

[0139] The ViewProductDetail event requires retrieving the product_id, name, price, and description from Elasticsearch.

[0140] The AddToCart event requires retrieving product_id and stock_count from Redis to verify inventory.

[0141] The Checkout event requires writing order_id, product_id, quantity, and total_price to MySQL and writing a new stock_count to Redis.

[0142] Step 3: Create a global data dictionary (Buyer role)

[0143] Complete data requirements: {product_id, name, price, description, stock_count, order_id, quantity, total_price}

[0144] Data source:

[0145] ES: {product_id, name, price, description}

[0146] Redis: {product_id, stock_count}

[0147] MySQL: {order_id, product_id, quantity, total_price}

[0148] Step 4: Generate the optimal query solution using a greedy algorithm.

[0149] Initial requirements: {product_id, name, price, description, stock_count} (for the first two steps of interaction)

[0150] Algorithm execution:

[0151] Evaluate the first query:

[0152] Querying Elasticsearch: can cover 4 requirements {product_id, name, price, description} at once, at the cost of 1 query.

[0153] Querying Redis can only cover two requirements: {product_id, stock_count}, at a cost of one query.

[0154] Greedy choice: The best option at present is to query Elasticsearch because it covers the most needs.

[0155] Execute the query in Elasticsearch, and the demand set is updated to: {stock_count}.

[0156] The next query can only select Redis to overwrite {stock_count}.

[0157] The final generated query solution:

[0158] First stop: Retrieve core product information from Elasticsearch.

[0159] Second step: Retrieve the real-time inventory of the product from Redis.

[0160] Execution interaction: The user clicks "Checkout".

[0161] Third step: Create order records in MySQL.

[0162] Fourth step: Update the inventory value in Redis.

[0163] S4. Based on the execution logic in the multi-source heterogeneous data and original metadata attribute graph of real-time user input, compile rules to obtain the logic rule set of multi-source heterogeneous data of real-time user input, mark the incremental propagation path in the corresponding device optimal form interaction data graph of each user permission, and update the corresponding device optimal form data adaptation database of each user permission.

[0164] Step S4 specifically includes:

[0165] Based on multi-source heterogeneous data input by users in real time, extract the identifiers of the user's real-time input fields;

[0166] Based on the original metadata attribute graph, the user real-time input field identifier is traversed and searched to obtain the node to which the user real-time input field identifier belongs, determine the interaction path to which the user real-time input field identifier belongs, and determine the appropriate database for the user real-time input multi-source heterogeneous data.

[0167] Based on the adapted database of multi-source heterogeneous data input by users in real time, and according to the dynamic mapping rule function of each known database type to be crossed, the character identifier of multi-source heterogeneous data input by users in real time is parsed into an AST abstract syntax tree;

[0168] Using the original metadata attribute graph, verify whether the variables in the AST abstract syntax tree are valid. If not, return an error message indicating that the user's real-time input of multi-source heterogeneous data is invalid. If so, compile the AST abstract syntax tree into the corresponding adapted database binding function to obtain the logical rule set of the user's real-time input of multi-source heterogeneous data.

[0169] As a further step, the AST (Abstract Syntax Tree) is compiled into corresponding database binding functions. This needs to be based on the database type and constructed according to the corresponding database syntax (e.g., MySQL, PostgreSQL, SQLite, Oracle, etc.). Different database systems have different SQL syntax and features.

[0170] Step S4 also includes:

[0171] Based on the interaction path of the user's real-time input field identifier, the non-related nodes and edges in the original metadata attribute graph are removed to obtain the user's real-time input field identifier subgraph. The logical rule set of the user's real-time input multi-source heterogeneous data is used as the subgraph edge dependency relationship to generate the optimal form data graph of the user's real-time input multi-source heterogeneous data.

[0172] Based on the in-degree and out-degree of the dependencies of known business type entity labels between nodes in the original metadata attribute graph, the dependency relationships between nodes in the optimal form data graph of real-time multi-source heterogeneous data input by users are marked. Using the Kahn topology sorting algorithm, nodes with initial data changes are marked as dirty nodes. Dependency nodes are recursively sorted and marked in the order of topology sorting to obtain the incremental propagation path in the corresponding device optimal form interaction data graph for each user permission in the original metadata attribute graph.

[0173] By using the incremental propagation path in the device-optimal form interaction data graph corresponding to each user's permissions, the original metadata attribute graph is calibrated to obtain the device-optimal form data adaptation database for each user's permissions.

[0174] When using it, please refer to the steps outlined above:

[0175] As a further development, by compiling user input into a target database-specific executable function in real time and accurately extracting the minimum impact subgraph from the metadata attribute graph, the Kahn algorithm is used for topological sorting and dirty label propagation, thereby precisely pinpointing the scope of data changes and triggering sequential updates. Its technical principles are: implementing context-aware expression compilation and topology-driven impact domain analysis, replacing the cumbersome general rule engine, reducing computational complexity from global O(n) to local O(k). It achieves extreme performance, processing only affected fields with extremely low latency and constant resource consumption; the DAG-based processing order eliminates logical errors, and AST compilation eliminates runtime exceptions; it provides clear observability and data flow paths, greatly reducing the complexity of system debugging and maintenance.

[0176] Example scenario: An order form containing fields: unit price (price), quantity (quantity), and total price (total_price). Where total_price = price * quantity. The user modifies the value of quantity.

[0177] Step 1: Extraction and Compilation

[0178] User input: quantity = 5

[0179] Belonging Node: Locates the quantity field node.

[0180] AST compilation: Assuming the target database is MySQL, the rule for total_price is compiled into an AST, which ultimately generates the binding function: (price, quantity) => price * quantity.

[0181] Step 2: Construct the influence subgraph

[0182] Extract a subgraph from the original property graph that contains quantity, total_price, and the dependOn edges connecting them.

[0183] Subgraph: V = {quantity, total_price}, E = {(quantity, dependsOn, total_price)}

[0184] Step 3: Topological sorting and dirty mark propagation

[0185] Initial state: The quantity has been modified and marked as dirty.

[0186] Execute Kahn's algorithm:

[0187] In the subgraph, the in-degree of quantity is 0, and the in-degree of total_price is 1 (depending on quantity).

[0188] The topological order is: [quantity, total_price].

[0189] Processing the quantity: If it's found to be dirty, it iterates through its outgoing edges, finds the node `total_price` that depends on it, and marks `total_price` as dirty. (Dirty marking pattern)

[0190] Processing total_price: It was found to be dirty and needs to be recalculated.

[0191] The resulting incremental propagation path is: [quantity, total_price].

[0192] Step 4: Recalculate and Update

[0193] The system calls the bound function generated for total_price in step 1: total_price_new = price_current * 5.

[0194] Update the total_price field with the new value.

[0195] Generate database update commands: Based on the S3 mapping, generate two SQL statements:

[0196] UPDATE order_table SET quantity = 5 WHERE ...;

[0197] UPDATE order_table SET total_price =<calculated_value> WHERE ...;

[0198] Result: The system only precisely recalculated the `total_price` field and updated only the two affected columns in the database. The entire process avoided full form validation and calculations for irrelevant fields, resulting in low overall system resource requirements and high operational efficiency.

[0199] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the claimed invention. The scope of protection claimed by the appended claims and their equivalents is defined.

Claims

1. A method for dynamic form generation and cross-database adaptation based on metadata-driven approaches, characterized in that, include: S1. Pre-set several types of raw metadata sets, analyze the semantic dependencies corresponding to the attribute information of the raw metadata, determine the semantic tags, cross-database requirements and execution logic of the raw metadata, and establish the raw metadata attribute graph. S2. Based on the original metadata attribute graph and the user roles and device parameters of the call form, establish a dynamic decision model for form layout interaction and generate the optimal form interaction data graph for each user permission on the corresponding device. S3. Verify the interaction path between each form in the corresponding device optimal form interaction data diagram of each user permission and perform cross-database mapping and adaptation analysis with the cross-database requirements of the target database type to generate the corresponding device optimal form data adaptation database for each user permission. S4. Based on the execution logic in the multi-source heterogeneous data and the original metadata attribute graph of the user's real-time input, the rules are compiled to obtain the logical rule set of the multi-source heterogeneous data of the user's real-time input, the incremental propagation path in the corresponding device optimal form interaction data graph of each user's permission is marked, and the corresponding device optimal form data adaptation database of each user's permission is updated. Specifically, step S3 includes: Based on the optimal form interaction data graph of each user's permissions for each device, the interaction paths in the optimal form interaction data graph of each user's permissions for each device are traversed and searched according to the interaction edges between each node in the original metadata attribute graph. The interaction elements in the interaction paths are determined, the optimal form interaction event flow of each user's permissions for each device is obtained, and the directed operation graph of the optimal form interaction of each user's permissions for each device is constructed. Based on the device-optimal form interaction directed operation graph corresponding to each user's permissions, according to the interaction event flow in each interaction path, and using the dynamic mapping rule function of each known database type to be crossed as a constraint, and according to the W3C document of the known database type to be crossed, determine the set of rendering data field requirements of the known database type to be crossed corresponding to the interaction event flow in each interaction path under the constraint conditions, and construct it into the device-optimal form interaction directed operation to be crossed database rendering mapping table corresponding to each user's permissions. Based on the device-optimal form interaction directed operation mapping table for each user's permissions, a global data dictionary for device-optimal form interaction to be rendered across databases is established. Based on the global data dictionary of the optimal form interaction for each user's permissions across databases, filter the data requirements of the optimal form interaction for each user's permissions along the same path as the total requirements of the optimal form interaction for the current user's permissions. By taking the data fields of different database interaction requests in the overall optimal form interaction requirements for the current user's permissions as nodes and the directed interaction operations as edges, a greedy algorithm is used to approximate the optimal interaction path for the overall optimal form interaction requirements for the current user's permissions. This yields the cross-database query scheme for the optimal form data for each user's permissions, and determines the database that best suits the optimal form data for each user's permissions.

2. The method for dynamic form generation and cross-database adaptation based on metadata-driven approach according to claim 1, characterized in that, Step S1 specifically includes: Based on the constraint syntax tree, a constraint parsing function is established to analyze the reference constraint relationship between each field in several types of raw metadata sets, and to construct a set of explicit constraint relationships between fields of several types of raw metadata. Each field and word variable in several types of raw metadata sets is selected and concatenated into word vectors of several types of raw metadata. Then, cosine similarity is used to calculate the similarity value between the word vectors of several types of raw metadata. Using quartiles, the distribution of similarity values ​​between word vectors of several types of original metadata is statistically analyzed, and the mean of the maximum distribution interval of similarity values ​​between word vectors of several types of original metadata is selected as the word vector association threshold of the original metadata. By using the word vector association threshold of the original metadata, the similarity values ​​between word vectors of several types of original metadata are filtered to obtain the implicit semantic association set of fields of several types of original metadata.

3. The method for dynamic form generation and cross-database adaptation based on metadata-driven approach according to claim 2, characterized in that, Step S1 also includes: Based on the enterprise data dictionary, the structured entity attributes of each business type are labeled, and a business type entity tag knowledge graph is established. Standardize several types of raw metadata; Using a fuzzy clustering algorithm, the original metadata of several types is clustered and filtered according to the structured entity attributes of each business type in the business type entity tag knowledge graph to determine the candidate business type entity tag set of several types of original metadata. Using a similarity function, the similarity between several types of original metadata and the structured entity attributes of each business type in the candidate business type entity tag set of several types of original metadata is calculated to determine several business type entity tags corresponding to several types of original metadata, as follows: , in, For the original metadata of the i-th type and the i-th e Similarity values ​​between structured entity attributes of each business type For the original metadata of the i-th type and the i-th e Text similarity of structured entity attributes for each business type For the original metadata of the i-th type and the i-th e Structural similarity of structured entity attributes for each business type The text similarity weights of the original metadata The structural similarity weight of the original metadata; The method for selecting the maximum similarity of several business type entity tags corresponding to several types of raw metadata and assigning the optimal business type entity tags to the raw metadata of several types is as follows: , in, The optimal business type entity label for the i-th type of raw metadata. This is a set of candidate business type entity tags for several types of raw metadata. This indicates that the original metadata of the i-th type is associated and mapped with the business type entity label.

4. The method for dynamic form generation and cross-database adaptation based on metadata-driven approach according to claim 3, characterized in that, Step S1 also includes: Identify the known database types to be crossed; Based on the set of explicit field constraints of several types of raw metadata, the explicit field constraints of each raw metadata are decomposed into a set of atomic constraints of several types of raw metadata. Based on the base mapping table of the database types to be crossed, the atomic constraint sets of the original metadata of several types are queried, mapped and transformed to obtain the matching constraint rules of the original metadata of several types to be crossed with the databases. Based on the known database types to be crossed, and according to the matching constraint rules of the original metadata of several types to be crossed, read and write the original metadata of several types to obtain the known database types to be crossed storage source data of the original metadata of several types. Based on the known database types to be crossed for several types of original metadata, store source data, use the matching constraint rules of the original metadata to be crossed for several types of databases as mapping conditions, and generate dynamic mapping rule functions for each known database type to be crossed. Each field in several types of raw metadata sets is taken as the central node, and the business type entity tags corresponding to several types of raw metadata are taken as business entity nodes. The explicit constraint relationship set of the fields of several types of raw metadata is taken as the edge between each field. The implicit semantic association set of the fields of several types of raw metadata is taken as the implicit association between each field. The optimal business type entity tag of several types of raw metadata is taken as the belonging relationship between each field. The dynamic mapping rule function of each known database type to be crossed is taken as the mapping relationship, thus obtaining the raw metadata attribute graph.

5. The method for dynamic form generation and cross-database adaptation based on metadata-driven approach according to claim 4, characterized in that, Step S2 specifically includes: Based on the original metadata attribute graph, the attribution relationship between each node is used as the attribution business type entity label. The business type entity label codes of several types of original metadata are obtained, the importance weight of the business type entity label is determined, and the in-degree and out-degree of the dependency of the business type entity label are determined by the edge interaction frequency between each node. The feature data of each node field in the original metadata attribute graph are obtained. Based on the user role and device parameters of the call form, read the user role code and device parameter type code of the call form, determine the business type and entity label covered by the user role code of the call form, and the screen space size of the device parameter type code, and obtain the context feature data of user role and device parameters; Based on the context feature vectors of user roles and device parameters, the layout priority of entity tags for each business type is determined. Based on the feature vectors of each node field in the original metadata attribute graph, the callable component type of entity tags for each business type is determined, and the optimal layout attribute tag data for each field of user roles and device parameters is obtained. The original training set for optimal form interaction is constructed by combining the feature data of each node field in the original metadata attribute graph, the context feature data of user roles and device parameters, and the optimal layout attribute label data of each field of user roles and device parameters. Based on random forest, decision trees for different user roles and device parameters are trained using the original training set of optimal form interaction. The original training set of optimal form interaction is used as the root node, the feature data of each node field in the original metadata attribute graph and the context feature data of user role and device parameter are used as branch nodes, and the optimal layout attribute label data of each field of user role and device parameter are used as leaf nodes to build a dynamic decision model for form layout interaction. Based on the form layout interaction dynamic decision model, generate the device-optimal form interaction data diagram corresponding to each user permission of each node in the original metadata attribute diagram.

6. The method for dynamic form generation and cross-database adaptation based on metadata-driven approach according to claim 5, characterized in that, Step S4 specifically includes: Based on multi-source heterogeneous data input by users in real time, extract the identifiers of the user's real-time input fields; Based on the original metadata attribute graph, the user real-time input field identifier is traversed and searched to obtain the node to which the user real-time input field identifier belongs, determine the interaction path to which the user real-time input field identifier belongs, and determine the appropriate database for the user real-time input multi-source heterogeneous data. Based on the adapted database of multi-source heterogeneous data input by users in real time, and according to the dynamic mapping rule function of each known database type to be crossed, the character identifier of multi-source heterogeneous data input by users in real time is parsed into an AST abstract syntax tree; Using the original metadata attribute graph, verify whether the variables in the AST abstract syntax tree are valid. If not, return an exception for the multi-source heterogeneous data input by the user in real time. If yes, compile the AST abstract syntax tree into the corresponding adapted database binding function to obtain the logical rule set of the multi-source heterogeneous data input by the user in real time.

7. The method for dynamic form generation and cross-database adaptation based on metadata-driven approach according to claim 6, characterized in that, Step S4 also includes: Based on the interaction path of the user's real-time input field identifier, the non-related nodes and edges in the original metadata attribute graph are removed to obtain the user's real-time input field identifier subgraph. The logical rule set of the user's real-time input multi-source heterogeneous data is used as the subgraph edge dependency relationship to generate the optimal form data graph of the user's real-time input multi-source heterogeneous data. Based on the in-degree and out-degree of the dependencies of known business type entity labels between nodes in the original metadata attribute graph, the dependency relationships between nodes in the optimal form data graph of real-time multi-source heterogeneous data input by users are marked. Using the Kahn topology sorting algorithm, nodes with initial data changes are marked as dirty nodes. Dependency nodes are recursively sorted and marked in the order of topology sorting to obtain the incremental propagation path in the corresponding device optimal form interaction data graph for each user permission in the original metadata attribute graph. By using the incremental propagation path in the device-optimal form interaction data graph corresponding to each user's permissions, the original metadata attribute graph is calibrated to obtain the device-optimal form data adaptation database for each user's permissions.

Citation Information

Patent Citations

  • Cross-platform and cross-system configurable data interaction method and system

    CN119884230A

  • Multi-source heterogeneous corpus fusion method and system based on government affair service data

    CN120493159A