Dynamic form generation and cross-database adaptation method based on metadata driving

By building metadata property graphs and machine learning models, the high coupling and scalability problems in dynamic form generation and cross-database adaptation are solved, intelligent form generation and cross-database adaptation are realized, and data interaction efficiency and system flexibility are improved.

CN120743967AActive Publication Date: 2025-10-03NANJING LAICHEN TECH CO LTD +1

Patent Information

Application Number
CN202511254477.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-04
Publication Date
2025-10-03
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 and UI, difficulty in maintenance, lack of multi-dimensional contextual intelligent optimization capabilities, poor scalability of the data persistence layer, low validation logic performance, and lack of collaborative editing and conflict intent preservation mechanisms, resulting in system rigidity and high costs.

Method used

By constructing the original metadata property graph, generating dynamic form layout based on semantic tags and user roles, performing cross-database mapping adaptation, and using machine learning models to achieve incremental data flow and multi-database adaptation, data interaction is optimized by combining graph pattern decomposition and topological sorting.

Benefits of technology

It realizes full-link intelligent adaptation from user interface to database, improves data interaction efficiency, reduces the number of interactive round trips and redundant data transmission, and reduces system complexity and maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120743967A_ABST
    Figure CN120743967A_ABST
Patent Text Reader

Abstract

The invention discloses a dynamic form generation and cross-database adaptation method based on metadata driving, and belongs to the technical field of data architectures. The method comprises the steps that an original metadata attribute graph is established; on the basis of the original metadata attribute graph and user roles and equipment parameters for calling the forms, generating an optimal equipment form interaction data graph corresponding to each user permission; verifying an interaction path between the forms and a cross-database demand of a target database type to carry out cross-database mapping adaptation analysis, and generating an optimal form data adaptation database of the corresponding equipment of each user permission; and performing rule compiling based on multi-source heterogeneous data input by a user in real time and execution logic in the original metadata attribute graph, marking an incremental propagation path in the optimal form interaction data graph of the corresponding equipment of each user permission, and updating the optimal form data adaptation database of the corresponding equipment of each user permission. The method has the advantages that the data interaction efficiency is improved, and the interaction round-trip times and redundant data transmission are reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data architecture, and specifically to a metadata-driven dynamic form generation and cross-database adaptation method. Background Art

[0002] Existing metadata-driven dynamic form generation and cross-database adaptation, due to the flattened metadata model, results in a tight coupling between business, 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 tightly bound to the database, making it difficult to adapt to heterogeneous environments and exhibiting poor scalability. Validation logic is decentralized and relies on full computation, resulting in poor performance that cannot meet the needs of real-time interaction. Furthermore, there is a complete lack of effective collaborative editing and conflict intent preservation mechanisms, severely restricting the efficiency of multi-user collaboration. These flaws collectively lead to a rigid system, high costs, and a poor user experience. Summary of the Invention

[0003] In order to solve the above technical problems, a metadata-driven dynamic form generation and cross-database adaptation method is provided. This technical solution solves the above problems.

[0004] In order to achieve the above objects, the technical solution adopted by the present invention is: A metadata-driven dynamic form generation and cross-database adaptation method includes: S1. Preset 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 role and device parameters of the calling form, a dynamic decision model for form layout interaction is established to generate the optimal form interaction data graph for each device corresponding to each user permission; S3. Verify the interaction paths between the various forms in the optimal form interaction data diagram corresponding to each user's permissions and the cross-database requirements of the target database type, perform cross-database mapping adaptation analysis, and generate the optimal form data adaptation database corresponding to each user's permissions; S4. Compile rules based on the execution logic in the real-time user input multi-source heterogeneous data and the original metadata attribute graph to obtain a set of logical rules for the real-time user input multi-source heterogeneous data, mark the incremental propagation path in the optimal form interaction data graph of the corresponding device for each user permission, and update the optimal form data adaptation database for the corresponding device for each user permission.

[0005] Preferably, it is characterized in that step S1 specifically includes: Based on the parsing constraint syntax tree, a constraint parsing function is established to analyze the reference constraint relationship between each field in several types of original metadata sets, and to form a set of explicit constraint relationships between fields of several types of original metadata; Filter each field and word variable in several types of original metadata sets, concatenate them into word vectors of several types of original metadata, and use cosine similarity to calculate the similarity values ​​between the word vectors of several types of original metadata; Using quartiles, we statistically analyze the distribution of similarity values ​​between word vectors of several types of original metadata, and select the mean of the maximum distribution interval of similarity values ​​between word vectors of several types of original metadata as the word vector association threshold of the original metadata. The word vector association threshold of the original metadata is used to filter the similarity values ​​between the word vectors of several types of original metadata to obtain the field implicit semantic association sets of several types of original metadata.

[0006] Preferably, it is characterized in that step S1 further includes: Based on the enterprise data dictionary, mark the structured entity attributes of each business type and build a business type entity label knowledge graph; Standardize several types of raw metadata; Using a fuzzy clustering algorithm, cluster and screen several types of raw metadata according to each business type structured entity attribute in the business type entity tag knowledge graph to determine a set of candidate business type entity tags for the several types of raw metadata; Using a similarity function, calculate the similarity between the original metadata of several types and each business type structured entity attribute in the candidate business type entity tag set of the original metadata of several types, and determine the business type entity tags corresponding to the original metadata of several types, in the following manner: , in, The original metadata of the i-th type and the e The similarity value between the attributes of the structured entities of business types, The original metadata of the i-th type and the e The text similarity of the structured entity attributes of each business type, The original metadata of the i-th type and the e The structural similarity of the structured entity attributes of each business type, is the text similarity weight of the original metadata, is the structural similarity weight of the original metadata; Filter the maximum similarity of several business type entity labels corresponding to several types of original metadata, and assign the optimal business type entity label to several types of original metadata in the following way: , in, is the optimal business type entity label for the original metadata of type i, is a set of candidate business type entity labels for several types of original metadata, Indicates that the original metadata of the i-th type is associated with the business type entity label.

[0007] Preferably, it is characterized in that step S1 further includes: Determine the known database types to be crossed; Based on the explicit constraint relationship sets of several types of original metadata fields, each explicit constraint relationship of the original metadata fields is split into atomic constraint sets of several types of original metadata fields; Perform query mapping conversion on the atomic constraint sets of several types of original metadata according to the basic mapping table of the database type to be crossed, and obtain matching constraint rules for the several types of original metadata to be crossed; Based on the known database types to be crossed, according to the matching constraint rules of the original metadata to be crossed, the original metadata of the types are read and written to obtain the known storage source data of the original metadata of the types to be crossed. According to the known database types to be crossed of several types of original metadata, the source data is stored, and the matching constraint rules of the several types of original metadata to be crossed are used as mapping conditions to generate dynamic mapping rule functions for each known database type to be crossed.

[0008] Each field in several types of original metadata sets is taken as the central node, several business type entity labels corresponding to several types of original metadata are taken as business entity nodes, the explicit constraint relationship set of several types of original metadata fields is taken as the edge between each field, the implicit semantic association set of several types of original metadata fields is taken as the implicit association between each field, the optimal business type entity label of several types of original metadata is taken as the attribution relationship between each field, and the dynamic mapping rule function of each known cross-database type is taken as the mapping relationship to obtain the original metadata attribute graph.

[0009] Preferably, it is 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 encoding of several types of original metadata is obtained. The importance weight of the business type entity label is determined. The dependency in-degree and dependency out-degree of the business type entity label are determined based on the edge interaction frequency between each node. The feature data of each node field in the original metadata attribute graph is obtained. Based on the user role and device parameters of the calling form, the user role code and the device parameter type code of the calling form are read, the business type and entity label covered by the user role code of the calling form, and the screen space size of the device parameter type code are determined, and the user role and device parameter context feature data are obtained; Based on the user role and device parameter context feature vectors, the layout priority of each business type entity tag is determined. Based on the feature vectors of each node field in the original metadata attribute graph, the callable component type of each business type entity tag is determined to obtain the optimal layout attribute label data for each field of the user role and device parameter. The optimal form interaction original training set 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 forests, we use the optimal form interaction original training set to train decision trees for different user roles and device parameters. This optimal form interaction original training set serves as the root node, the feature data of each node field in the original metadata attribute graph and the contextual feature data of user roles and device parameters serve as branches, and the optimal layout attribute label data for each field of user roles and device parameters serves as leaf nodes. This constructs a dynamic decision model for form layout interaction. According to the form layout interaction dynamic decision model, the optimal form interaction data graph corresponding to each user permission of each node in the original metadata attribute graph is generated.

[0010] Preferably, it is characterized in that step S3 specifically includes: Based on the optimal form interaction data graph for each user's permissions, a search is performed along the interaction edges between each node in the original metadata attribute graph to filter out the interaction paths in the optimal form interaction data graph for each user's permissions. The interaction elements in the interaction paths are then determined to obtain the optimal form interaction event flow for each user's permissions. This results in a directed operation graph for the optimal form interaction for each user's permissions. Based on the optimal form interaction directed operation graph for each device with each user permission, according to the interaction event flow in each interaction path, using the dynamic mapping rule function of each known database type to be crossed as a constraint, and according to the W3C documentation of the known database type to be crossed, determine the set of rendering data field requirements for the known database type to be crossed corresponding to the interaction event flow in each interaction path under the constraints. This is then constructed into a mapping table for the optimal form interaction directed operation to be rendered across databases for each device with each user permission. Based on the mapping table of the optimal form interaction of each user's corresponding device to be rendered across databases, a global data dictionary of the optimal form interaction of each user's corresponding device to be rendered across databases is established; Based on the global data dictionary of the cross-database optimal form interaction corresponding to each user's authority, the data requirements of the optimal form interaction with the same path form corresponding to each user's authority are filtered as the total requirements of the optimal form interaction corresponding to the current user's authority; Taking the data fields of different database interaction requests in the total optimal form interaction demand of the device corresponding to the current user permissions as nodes and the interactive directed operations as edges, the greedy algorithm is used to approximate the optimal interaction path of the total optimal form interaction demand of the device corresponding to the current user permissions, and the optimal form data cross-database query solution for the device corresponding to each user permission is obtained, and the optimal form data adaptation database for the device corresponding to each user permission is determined.

[0011] Preferably, it is characterized in that step S4 specifically includes: Extract user input field identifiers based on real-time user input of multi-source heterogeneous data; According to the original metadata attribute graph, a traversal search is performed for the user's real-time input field identifier to obtain the belonging node of the user's real-time input field identifier, determine the belonging interaction path of the user's real-time input field identifier, and determine the adaptation database for the user's real-time input multi-source heterogeneous data; According to the adaptive database of multi-source heterogeneous data input by users in real time, the character identifiers of the multi-source heterogeneous data input by users in real time are parsed into AST abstract syntax trees according to the dynamic mapping rule functions of each known cross-database type; Use the original metadata attribute graph to verify whether the variables in the AST abstract syntax tree are legal. If not, return the exception of the user's real-time input of multi-source heterogeneous data. If so, compile the AST abstract syntax tree into the corresponding adaptation database binding function to obtain the logical rule set of the user's real-time input of multi-source heterogeneous data.

[0012] Preferably, step S4 further includes: Based on the attributed interaction path of the user's real-time input field identifier, the irrelevant 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 of multi-source heterogeneous data is used as the subgraph edge dependency to generate the optimal form data graph of the user's real-time input of multi-source heterogeneous data. Based on the dependency in-degree and dependency out-degree 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 for users to input multi-source heterogeneous data in real time are marked. Using the Kahn topological sorting algorithm, the initial data change nodes are marked as dirty nodes. The dependent nodes are recursively marked in order of topological sorting to obtain the incremental propagation path in the optimal form interaction data graph for each user permission in the original metadata attribute graph. The original metadata attribute graph is calibrated using the incremental propagation path in the optimal form interaction data graph of the corresponding device for each user permission, and the optimal form data adaptation database of the corresponding device for each user permission is obtained.

[0013] Compared with the prior art, the present invention has the following beneficial effects: The present invention proposes a metadata-driven dynamic form generation and cross-database adaptation solution. By constructing a global attribute graph that integrates semantics, execution logic and cross-database mapping, it drives the machine learning model to generate context-aware form layouts, and uses graph pattern decomposition and topological sorting to achieve incremental data flow and multi-database adaptive mapping. It fundamentally solves the problems of automatic form generation and consistency maintenance under heterogeneous data sources and dynamic business needs, realizes full-link intelligent adaptation from user interface to database storage, improves data interaction efficiency, and reduces the number of interaction round trips and redundant data transmission. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] Figure 1 This is a flowchart of a metadata-driven dynamic form generation and cross-database adaptation method. DETAILED DESCRIPTION

[0015] The following description is intended to disclose the present invention so that those skilled in the art can implement the present invention. The preferred embodiments described below are only examples, and those skilled in the art may conceive of other obvious variations.

[0016] Reference Figure 1 As shown, a metadata-driven dynamic form generation and cross-database adaptation method includes: S1. Preset 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; Step S1 specifically includes: Based on the parsing constraint syntax tree, a constraint parsing function is established to analyze the reference constraint relationship between each field in several types of original metadata sets, and to form a set of explicit constraint relationships between fields of several types of original metadata; As further content, constraint parsing functions include but are not limited to: constraint syntax parsing: using regular expression pattern matching to constrain field references in strings; conditional logic constraints: using the abstract syntax tree (AST) parser to traverse conditional branch nodes; mathematical formula constraints: using symbol table analysis (such as SymPy's symbol extraction); Filter each field and word variable in several types of original metadata sets, concatenate them into word vectors of several types of original metadata, and use cosine similarity to calculate the similarity values ​​between the word vectors of several types of original metadata; Using quartiles, we statistically analyze the distribution of similarity values ​​between word vectors of several types of original metadata, and select the mean of the maximum distribution interval of similarity values ​​between word vectors of several types of original metadata as the word vector association threshold of the original metadata. The word vector association threshold of the original metadata is used to filter the similarity values ​​between the word vectors of several types of original metadata to obtain the field implicit semantic association sets of several types of original metadata.

[0017] Step S1 further includes: Based on the enterprise data dictionary, mark the structured entity attributes of each business type and build a business type entity label knowledge graph; Standardize several types of raw metadata; Using a fuzzy clustering algorithm, cluster and screen several types of raw metadata according to each business type structured entity attribute in the business type entity tag knowledge graph to determine a set of candidate business type entity tags for the several types of raw metadata; Using a similarity function, calculate the similarity between the original metadata of several types and each business type structured entity attribute in the candidate business type entity tag set of the original metadata of several types, and determine the business type entity tags corresponding to the original metadata of several types, in the following manner: , in, The original metadata of the i-th type and the e The similarity value between the attributes of the structured entities of business types, The original metadata of the i-th type and the e The text similarity of the structured entity attributes of each business type, The original metadata of the i-th type and the e The structural similarity of the structured entity attributes of each business type, is the text similarity weight of the original metadata, is the structural similarity weight of the original metadata; As a further addition, is the text similarity weight of the original metadata and The structural similarity weight of the initial metadata is solved based on grid search. However, when the similarity function is differentiable and the data set is large, the gradient descent method can be used to solve it. is the similarity value between the original metadata of the i-th type and the structured entity attribute of the e-th business type. It represents the overall matching degree between the metadata object and a standard business term, for example, judging whether an animal Sim (animal, cat) belongs to the species "cat" (e); The original metadata of the i-th type and the e The text similarity of the structured entity attributes of a business type, which means that the similarity only focuses on the name field of the original metadata object Similarity to the labels (e.label) of business entity attributes at the natural language level, for example: = "cust_nm" (a database field name), and e.label = customer_name (a standard business term), calculate TextSim(cust_nm,customer_name), the result may be a high score (such as 0.8), because cust and customer, nm and name are similar in text. It is the structural similarity between the original metadata of the i-th type and the structured entity attributes of the e-th business type. It compares the original metadata objects. and business entity attributes The inherent structure and characteristics of : A field with data type NUMBER, which is the primary key and the foreign key references the employee table. e: Business term is employee number, which is defined as a 3-digit code that uniquely identifies an employee. Even if is emp_id, and e.label is the employee ID (TextSim may not be high), but their structural characteristics (numeric type, length 3, uniqueness) are highly matched, so Will give a very high score.

[0018] Filter the maximum similarity of several business type entity labels corresponding to several types of original metadata, and assign the optimal business type entity label to several types of original metadata in the following way: , in, is the optimal business type entity label for the original metadata of type i, is a set of candidate business type entity labels for several types of original metadata, Indicates that the original metadata of the i-th type is associated with the business type entity label.

[0019] Step S1 further includes: Determine the known database types to be crossed; Based on the explicit constraint relationship sets of several types of original metadata fields, each explicit constraint relationship of the original metadata fields is split into atomic constraint sets of several types of original metadata fields; Perform query mapping conversion on the atomic constraint sets of several types of original metadata according to the basic mapping table of the database type to be crossed, and obtain matching constraint rules for the several types of original metadata to be crossed; Based on the known database types to be crossed, according to the matching constraint rules of the original metadata to be crossed, the original metadata of the types are read and written to obtain the known storage source data of the original metadata of the types to be crossed. According to the known database types to be crossed of several types of original metadata, the source data is stored, and the matching constraint rules of the several types of original metadata to be crossed are used as mapping conditions to generate dynamic mapping rule functions for each known database type to be crossed.

[0020] Each field in several types of original metadata sets is taken as the central node, several business type entity labels corresponding to several types of original metadata are taken as business entity nodes, the explicit constraint relationship set of several types of original metadata fields is taken as the edge between each field, the implicit semantic association set of several types of original metadata fields is taken as the implicit association between each field, the optimal business type entity label of several types of original metadata is taken as the attribution relationship between each field, and the dynamic mapping rule function of each known cross-database type is taken as the mapping relationship to obtain the original metadata attribute graph.

[0021] When using, combine the above: As a further development, through multimodal analysis and dynamic compilation, the original, flat metadata is transformed into a property graph knowledge network rich in semantics and adaptation rules. It is conducive to the dual grammatical and semantic dependency discovery mechanism, which not only parses explicit grammatical references between fields, but also mines deep semantic associations through word vector similarity, constructing a complete relationship graph that far exceeds traditional solutions. At the same time, it introduces an atomic constraint decomposition and mapping mode, which breaks down complex business constraints into atomic rules of the smallest granularity, and dynamically compiles and generates cross-library adaptation functions by querying preset mapping tables, realizing the transition from static model mapping to dynamic rule compilation, and getting rid of the dependence on a specific ORM framework. In addition, the knowledge graph-driven semantic annotation utilizes the company's existing data assets to achieve automatic standardization of metadata business terms and ensure semantic consistency. Its technical features are: improved development efficiency and system flexibility, metadata changes or new database types do not require modification of business code, only configuration adjustments are required for automatic adaptation, and the generated form logic is more intelligent and accurate.

[0022] The execution process of step S1 is exemplary: Suppose a company has metadata for customer information forms and needs to adapt to MySQL and MongoDB.

[0023] Original metadata set M: m1: (name: "user_id", type: "int", constraints: "PRIMARY KEY AUTO_INCREMENT") m2: (name: "customer_name", type: "varchar", constraints: "NOT NULLLENGTH(255)") m3: (name: "client_email", type: "varchar", constraints: "UNIQUE NOTNULL REFERENCEs user_id") m4: (name: "annual_income", type: "decimal", constraints: "CHECK(annual_income>0)") Step 1: Build explicit / implicit dependency sets Explicit dependencies (by resolving constraints): E_{dep} = { (m3, references, m1)} (because REFERENCES user_id) Implicit dependencies (by calculating word vector cosine similarity): The Sim("customer_name", "client_email") value is very high (both contain customer semantics), assuming it is 0.82.

[0024] If the set association threshold θ = 0.75, then E_{sem} = { (m2, semanticallyRelated,m3)} Step 2: Semantic labeling There is an entity Customer in the knowledge graph, whose attributes include identifier, name, and contact.

[0025] By similarity calculation and clustering: m1.name ("user_id") has the highest similarity with Customer.identifier -> the label is Customer.identifier; m2.name ("customer_name") is most similar to Customer.name -> the label is Customer.name; m3.name ("client_email") has the highest similarity with Customer.contact -> the label is Customer.contact; Step 3: Generate dynamic mapping rule function Known database types: MySQL, MongoDB Atomic constraint decomposition: Taking m2 ("customer_name") as an example, the constraint "NOT NULL LENGTH(255)" Disassembled into: Constraint 1: {"type": "varchar"}, Constraint 2: {"not_null": true}, Constraint 3: {"max_length": 255}; Query the basic mapping table: MySQL mapping table: {"varchar": "VARCHAR(%max_length%)", "not_null:true": "NOT NULL", ...}; MongoDB mapping table: {"varchar": "string", "not_null:true": {"required":true}, "max_length:%d": {"maxLength": %d}, ...}; Generate a dynamic mapping function: f_m2_to_MySQL = "VARCHAR(255) NOT NULL"; f_m2_to_MongoDB = { "bsonType": "string", "required": true, "maxLength": 255}; Step 4: Construct the original metadata attribute graph G Vertex V: m1, m2, m3, m4, Customer.identifier, Customer.name,Customer.contact Edge E: (m3, dependsOn, m1) (edge), (m2, semanticallyRelated, m3) (implicit 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).

[0026] S2. Based on the original metadata attribute graph and the user role and device parameters of the calling form, a dynamic decision model for form layout interaction is established to generate the optimal form interaction data graph for each device corresponding to each user permission; 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 encoding of several types of original metadata is obtained. The importance weight of the business type entity label is determined. The dependency in-degree and dependency out-degree of the business type entity label are determined based on the edge interaction frequency between each node. The feature data of each node field in the original metadata attribute graph is obtained. Based on the user role and device parameters of the calling form, the user role code and the device parameter type code of the calling form are read, the business type and entity label covered by the user role code of the calling form, and the screen space size of the device parameter type code are determined, and the user role and device parameter context feature data are obtained; Based on the user role and device parameter context feature vectors, the layout priority of each business type entity tag is determined. Based on the feature vectors of each node field in the original metadata attribute graph, the callable component type of each business type entity tag is determined to obtain the optimal layout attribute label data for each field of the user role and device parameter. The optimal form interaction original training set 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 forests, we use the optimal form interaction original training set to train decision trees for different user roles and device parameters. This optimal form interaction original training set serves as the root node, the feature data of each node field in the original metadata attribute graph and the contextual feature data of user roles and device parameters serve as branches, and the optimal layout attribute label data for each field of user roles and device parameters serves as leaf nodes. This constructs a dynamic decision model for form layout interaction. According to the form layout interaction dynamic decision model, the optimal form interaction data graph corresponding to each user permission of each node in the original metadata attribute graph is generated.

[0027] When using, combine the above: Furthermore, by extracting topological features (such as field dependency in-degree and out-degree) and business semantic features (such as entity tag importance) from the metadata attribute graph and fusing them with contextual features such as user roles and device parameters, a high-dimensional feature vector is constructed. Using a random forest ensemble learning algorithm, the algorithm uses field and contextual features as input to predict the optimal component type, layout priority, space occupied, and other properties for each field in real time. This algorithm then automatically assembles a complete, context-adaptive form layout interaction graph. This machine-learning-driven layout decision-making, driven by graph features and contextual awareness, replaces traditional responsive layout approaches based on manual rules or static templates. Using the random forest model, the system understands the deep value of fields within the business network and determines the globally optimal layout arrangement. Its technical features include: highly personalized layouts, generating optimally tailored interfaces for different roles and devices, significantly improving user experience and operational efficiency; and strong generalization and adaptability, eliminating the need for code modifications to accommodate new roles or device types, reducing maintenance costs.

[0028] S3. Verify the interaction paths between the various forms in the optimal form interaction data diagram corresponding to each user's permissions and the cross-database requirements of the target database type, perform cross-database mapping adaptation analysis, and generate the optimal form data adaptation database corresponding to each user's permissions; Step S3 specifically includes: Based on the optimal form interaction data graph for each user's permissions, a search is performed along the interaction edges between each node in the original metadata attribute graph to filter out the interaction paths in the optimal form interaction data graph for each user's permissions. The interaction elements in the interaction paths are then determined to obtain the optimal form interaction event flow for each user's permissions. This results in a directed operation graph for the optimal form interaction for each user's permissions. Based on the optimal form interaction directed operation graph for each device with each user permission, according to the interaction event flow in each interaction path, using the dynamic mapping rule function of each known database type to be crossed as a constraint, and according to the W3C documentation of the known database type to be crossed, determine the set of rendering data field requirements for the known database type to be crossed corresponding to the interaction event flow in each interaction path under the constraints. This is then constructed into a mapping table for the optimal form interaction directed operation to be rendered across databases for each device with each user permission. Based on the mapping table of the optimal form interaction of each user's corresponding device to be rendered across databases, a global data dictionary of the optimal form interaction of each user's corresponding device to be rendered across databases is established; Based on the global data dictionary of the cross-database optimal form interaction corresponding to each user's authority, the data requirements of the optimal form interaction with the same path form corresponding to each user's authority are filtered as the total requirements of the optimal form interaction corresponding to the current user's authority; Taking the data fields of different database interaction requests in the total optimal form interaction demand of the device corresponding to the current user permissions as nodes and the interactive directed operations as edges, the greedy algorithm is used to approximate the optimal interaction path of the total optimal form interaction demand of the device corresponding to the current user permissions, and the optimal form data cross-database query solution for the device corresponding to each user permission is obtained, and the optimal form data adaptation database for the device corresponding to each user permission is determined.

[0029] When using, combine the above steps: As a further step, a directed operation graph is constructed by mining user operation sequences, and based on this, the global data requirement set required to complete the entire business process is derived. A greedy algorithm is then used to perform multi-objective optimization (such as minimizing the number of queries and latency) to dynamically generate a globally optimal query plan across multiple heterogeneous databases. The technical principle behind this approach is that it implements demand-side driven data acquisition, shifting the data acquisition strategy from what the database can provide to what the user requires. By explicitly modeling and optimizing cross-database query paths, it solves the fundamental challenge of collaborative access to multi-source data. This delivers an ultimate 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 complexity of the underlying multiple databases from application developers.

[0030] Example: Scenario: E-commerce platform, the user role is a buyer, and the form interaction path is: view product details -> add to shopping cart -> checkout and place order.

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

[0032] Step 1: Build an interactive directed operation graph Path: [ViewProductDetail] ->[AddToCart] ->[Checkout]; Step 2: Build the mapping table to be rendered across databases ViewProductDetail event: needs to obtain product_id, name, price, description from ES.

[0033] AddToCart event: Need to get product_id, stock_count from Redis to verify inventory.

[0034] Checkout event: needs to write order_id, product_id, quantity, total_price to MySQL, and write the new stock_count to Redis.

[0035] Step 3: Create a global data dictionary (Buyer role) Full set of data requirements: {product_id, name, price, description, stock_count, order_id, quantity, total_price} Data Source: ES: {product_id, name, price, description} Redis: {product_id, stock_count} MySQL: {order_id, product_id, quantity, total_price} Step 4: Greedy algorithm generates the optimal query solution Initial requirements: {product_id, name, price, description, stock_count} (for the first two steps of interaction) Algorithm execution: Evaluate the first query: Query ES: It can cover four requirements of {product_id, name, price, description} at one time, with the cost of one query.

[0036] Query Redis: Only two requirements {product_id, stock_count} can be covered, and the cost is one query.

[0037] Greedy selection: The current best option is to query ES because it covers the most requirements.

[0038] Execute the ES query and the requirement set is updated to: {stock_count}.

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

[0040] The resulting query plan is: First stop: Get core product information from Elasticsearch.

[0041] Second stop: Get the real-time inventory of the product from Redis.

[0042] Perform interaction: User clicks Checkout.

[0043] Third stop: Create order records in MySQL.

[0044] Fourth stop: Update the inventory value in Redis.

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

[0046] Step S4 specifically includes: Extract user input field identifiers based on real-time user input of multi-source heterogeneous data; According to the original metadata attribute graph, a traversal search is performed for the user's real-time input field identifier to obtain the belonging node of the user's real-time input field identifier, determine the belonging interaction path of the user's real-time input field identifier, and determine the adaptation database for the user's real-time input multi-source heterogeneous data; According to the adaptive database of multi-source heterogeneous data input by users in real time, the character identifiers of the multi-source heterogeneous data input by users in real time are parsed into AST abstract syntax trees according to the dynamic mapping rule functions of each known cross-database type; Use the original metadata attribute graph to verify whether the variables in the AST abstract syntax tree are legal. If not, return an exception for the user's real-time input of multi-source heterogeneous data. If so, compile the AST abstract syntax tree into the corresponding adaptation database binding function to obtain the logical rule set for the user's real-time input of multi-source heterogeneous data; As a further step, compiling the AST into a database-adaptive binding function requires building a function based on the database type and using the corresponding database syntax, such as MySQL, PostgreSQL, SQLite, Oracle, etc. Different database systems have different SQL syntax and features.

[0047] Step S4 further includes: Based on the attributed interaction path of the user's real-time input field identifier, the irrelevant 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 of multi-source heterogeneous data is used as the subgraph edge dependency to generate the optimal form data graph of the user's real-time input of multi-source heterogeneous data. Based on the dependency in-degree and dependency out-degree 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 for users to input multi-source heterogeneous data in real time are marked. Using the Kahn topological sorting algorithm, the initial data change nodes are marked as dirty nodes. The dependent nodes are recursively marked in order of topological sorting to obtain the incremental propagation path in the optimal form interaction data graph for each user permission in the original metadata attribute graph. The original metadata attribute graph is calibrated using the incremental propagation path in the optimal form interaction data graph of the corresponding device for each user permission, and the optimal form data adaptation database of the corresponding device for each user permission is obtained.

[0048] When using, combine the above steps: As a further development, by compiling user input into executable functions specific to the target database in real time, and accurately extracting the minimum impact subgraph in the metadata property graph, the Kahn algorithm is used for topological sorting and dirty mark propagation, thereby accurately locking the scope of data changes and triggering linkage updates in an orderly manner. Its technical principles are: implementing context-aware expression compilation and topology-driven impact domain analysis, replacing the bulky general rule engine, and reducing the computational complexity from global O(n) to local O(k). It achieves extreme performance, only processing 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.

[0049] Example: Scenario: An order form contains the fields: price, quantity, and total price. Total price = price * quantity. The user modifies the quantity value.

[0050] Step 1: Extract and compile User input: quantity = 5 Belonging node: locate the quantity field node.

[0051] AST compilation: Assuming the target database is MySQL, the rule of total_price is compiled into AST, and the final binding function is generated: (price, quantity) => price * quantity.

[0052] Step 2: Construct the influence subgraph Extract a small subgraph from the original attribute graph containing quantity, total_price, and the dependsOn edges connecting them.

[0053] Subgraph: V = {quantity, total_price}, E = {(quantity, dependsOn, total_price)} Step 3: Topological sorting and dirty mark propagation Initial state: quantity is modified and marked as dirty.

[0054] Execute Kahn's algorithm: In the subgraph, the in-degree of quantity is 0, and the in-degree of total_price is 1 (depends on quantity).

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

[0056] Processing quantity: Found it is dirty, so traverse its outgoing edges, find its dependent node total_price, and mark total_price as dirty. (Dirty marking mode) Processing total_price: found it to be dirty, needs to be recalculated.

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

[0058] Step 4: Recalculate and update The system calls the bound function generated for total_price in step 1: total_price_new = price_current * 5.

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

[0060] Generate database update instructions: Generate two SQL statements based on the S3 mapping: UPDATE order_table SET quantity = 5 WHERE ...; UPDATE order_table SET total_price =<calculated_value> WHERE ...; Result: The system accurately recalculates only the total_price field and updates only the two affected columns in the database. No full form validation or calculation of irrelevant fields is performed during this process, resulting in low resource requirements and high operational efficiency.

[0061] The above shows and describes 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 above embodiments and descriptions merely illustrate the principles of the present invention. Various changes and modifications may be made to the present invention without departing from the spirit and scope of the present invention. Such changes and modifications are intended to fall within the scope of the present invention. The scope of protection claimed by the present invention is defined by the appended claims and their equivalents.

Claims

1. A metadata-driven dynamic form generation and cross-database adaptation method, characterized in that: include: S1. Preset 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 role and device parameters of the calling form, a dynamic decision model for form layout interaction is established to generate the optimal form interaction data graph for each device corresponding to each user permission; S3. Verify the interaction paths between the various forms in the optimal form interaction data diagram corresponding to each user's permissions and the cross-database requirements of the target database type, perform cross-database mapping adaptation analysis, and generate the optimal form data adaptation database corresponding to each user's permissions; S4. Compile rules based on the execution logic in the real-time user input multi-source heterogeneous data and the original metadata attribute graph to obtain a set of logical rules for the real-time user input multi-source heterogeneous data, mark the incremental propagation path in the optimal form interaction data graph of the corresponding device for each user permission, and update the optimal form data adaptation database for the corresponding device for each user permission.

2. A metadata-driven dynamic form generation and cross-database adaptation method according to claim 1, characterized in that: Step S1 specifically includes: Based on the parsing constraint syntax tree, a constraint parsing function is established to analyze the reference constraint relationship between each field in several types of original metadata sets, and to form a set of explicit constraint relationships between fields of several types of original metadata; Filter each field and word variable in several types of original metadata sets, concatenate them into word vectors of several types of original metadata, and use cosine similarity to calculate the similarity values ​​between the word vectors of several types of original metadata; Using quartiles, we statistically analyze the distribution of similarity values ​​between word vectors of several types of original metadata, and select the mean of the maximum distribution interval of similarity values ​​between word vectors of several types of original metadata as the word vector association threshold of the original metadata. The word vector association threshold of the original metadata is used to filter the similarity values ​​between the word vectors of several types of original metadata to obtain the field implicit semantic association sets of several types of original metadata.

3. The metadata-driven dynamic form generation and cross-database adaptation method according to claim 2, characterized in that: Step S1 further includes: Based on the enterprise data dictionary, mark the structured entity attributes of each business type and build a business type entity label knowledge graph; Standardize several types of raw metadata; Using a fuzzy clustering algorithm, cluster and screen several types of raw metadata according to each business type structured entity attribute in the business type entity tag knowledge graph to determine a set of candidate business type entity tags for the several types of raw metadata; Using a similarity function, calculate the similarity between the original metadata of several types and each business type structured entity attribute in the candidate business type entity tag set of the original metadata of several types, and determine the business type entity tags corresponding to the original metadata of several types, in the following manner: , in, The original metadata of the i-th type and the e The similarity value between the attributes of the structured entities of business types, The original metadata of the i-th type and the e The text similarity of the structured entity attributes of each business type, The original metadata of the i-th type and the e The structural similarity of the structured entity attributes of each business type, is the text similarity weight of the original metadata, is the structural similarity weight of the original metadata; Filter the maximum similarity of several business type entity labels corresponding to several types of original metadata, and assign the optimal business type entity label to several types of original metadata in the following way: , in, is the optimal business type entity label for the original metadata of type i, is a set of candidate business type entity labels for several types of original metadata, Indicates that the original metadata of the i-th type is associated with the business type entity label.

4. The metadata-driven dynamic form generation and cross-database adaptation method according to claim 3, characterized in that: Step S1 further includes: Determine the known database types to be crossed; Based on the explicit constraint relationship sets of several types of original metadata fields, each explicit constraint relationship of the original metadata fields is split into atomic constraint sets of several types of original metadata fields; Perform query mapping conversion on the atomic constraint sets of several types of original metadata according to the basic mapping table of the database type to be crossed, and obtain matching constraint rules for the several types of original metadata to be crossed; Based on the known database types to be crossed, according to the matching constraint rules of the original metadata to be crossed, the original metadata of the types are read and written to obtain the known storage source data of the original metadata of the types to be crossed. According to 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 several types of original metadata to be crossed are used as mapping conditions to generate dynamic mapping rule functions for each known database type to be crossed; Each field in several types of original metadata sets is taken as the central node, several business type entity labels corresponding to several types of original metadata are taken as business entity nodes, the explicit constraint relationship set of several types of original metadata fields is taken as the edge between each field, the implicit semantic association set of several types of original metadata fields is taken as the implicit association between each field, the optimal business type entity label of several types of original metadata is taken as the attribution relationship between each field, and the dynamic mapping rule function of each known cross-database type is taken as the mapping relationship to obtain the original metadata attribute graph.

5. The metadata-driven dynamic form generation and cross-database adaptation method 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 encoding of several types of original metadata is obtained. The importance weight of the business type entity label is determined. The dependency in-degree and dependency out-degree of the business type entity label are determined based on the edge interaction frequency between each node. The feature data of each node field in the original metadata attribute graph is obtained. Based on the user role and device parameters of the calling form, the user role code and the device parameter type code of the calling form are read, the business type and entity label covered by the user role code of the calling form, and the screen space size of the device parameter type code are determined, and the user role and device parameter context feature data are obtained; Based on the user role and device parameter context feature vectors, the layout priority of each business type entity tag is determined. Based on the feature vectors of each node field in the original metadata attribute graph, the callable component type of each business type entity tag is determined to obtain the optimal layout attribute label data for each field of the user role and device parameter. The optimal form interaction original training set 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 forests, we use the optimal form interaction original training set to train decision trees for different user roles and device parameters. This optimal form interaction original training set serves as the root node, the feature data of each node field in the original metadata attribute graph and the contextual feature data of user roles and device parameters serve as branches, and the optimal layout attribute label data for each field of user roles and device parameters serves as leaf nodes. This constructs a dynamic decision model for form layout interaction. According to the form layout interaction dynamic decision model, the optimal form interaction data graph corresponding to each user permission of each node in the original metadata attribute graph is generated.

6. The metadata-driven dynamic form generation and cross-database adaptation method according to claim 5, characterized in that: Step S3 specifically includes: Based on the optimal form interaction data graph for each user's permissions, a search is performed along the interaction edges between each node in the original metadata attribute graph to filter out the interaction paths in the optimal form interaction data graph for each user's permissions. The interaction elements in the interaction paths are then determined to obtain the optimal form interaction event flow for each user's permissions. This results in a directed operation graph for the optimal form interaction for each user's permissions. Based on the optimal form interaction directed operation graph for each device with each user permission, according to the interaction event flow in each interaction path, using the dynamic mapping rule function of each known database type to be crossed as a constraint, and according to the W3C documentation of the known database type to be crossed, determine the set of rendering data field requirements for the known database type to be crossed corresponding to the interaction event flow in each interaction path under the constraints. This is then constructed into a mapping table for the optimal form interaction directed operation to be rendered across databases for each device with each user permission. Based on the mapping table of the optimal form interaction of each user's corresponding device to be rendered across databases, a global data dictionary of the optimal form interaction of each user's corresponding device to be rendered across databases is established; Based on the global data dictionary of the cross-database optimal form interaction corresponding to each user's authority, the data requirements of the optimal form interaction with the same path form corresponding to each user's authority are filtered as the total requirements of the optimal form interaction corresponding to the current user's authority; Taking the data fields of different database interaction requests in the total optimal form interaction demand of the device corresponding to the current user permissions as nodes and the interactive directed operations as edges, the greedy algorithm is used to approximate the optimal interaction path of the total optimal form interaction demand of the device corresponding to the current user permissions, and the optimal form data cross-database query solution for the device corresponding to each user permission is obtained, and the optimal form data adaptation database for the device corresponding to each user permission is determined.

7. The metadata-driven dynamic form generation and cross-database adaptation method according to claim 6, characterized in that: Step S4 specifically includes: Extract user input field identifiers based on real-time user input of multi-source heterogeneous data; According to the original metadata attribute graph, a traversal search is performed for the user's real-time input field identifier to obtain the belonging node of the user's real-time input field identifier, determine the belonging interaction path of the user's real-time input field identifier, and determine the adaptation database for the user's real-time input multi-source heterogeneous data; According to the adaptive database of multi-source heterogeneous data input by users in real time, the character identifiers of the multi-source heterogeneous data input by users in real time are parsed into AST abstract syntax trees according to the dynamic mapping rule functions of each known cross-database type; Use the original metadata attribute graph to verify whether the variables in the AST abstract syntax tree are legal. If not, return the exception of the user's real-time input of multi-source heterogeneous data. If so, compile the AST abstract syntax tree into the corresponding adaptation database binding function to obtain the logical rule set of the user's real-time input of multi-source heterogeneous data.

8. The metadata-driven dynamic form generation and cross-database adaptation method according to claim 7, characterized in that: Step S4 further includes: Based on the attributed interaction path of the user's real-time input field identifier, the irrelevant 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 of multi-source heterogeneous data is used as the subgraph edge dependency to generate the optimal form data graph of the user's real-time input of multi-source heterogeneous data. Based on the dependency in-degree and dependency out-degree 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 for users to input multi-source heterogeneous data in real time are marked. Using the Kahn topological sorting algorithm, the initial data change nodes are marked as dirty nodes. The dependent nodes are recursively marked in order of topological sorting to obtain the incremental propagation path in the optimal form interaction data graph for each user permission in the original metadata attribute graph. The original metadata attribute graph is calibrated using the incremental propagation path in the optimal form interaction data graph of the corresponding device for each user permission, and the optimal form data adaptation database of the corresponding device for each user permission is obtained.

Citation Information

Patent Citations

  • Unified authentication / authorization method and equipment across multi-source heterogeneous storage system and storage medium

    CN114706857A

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

    CN119884230A

  • Pandas-based cross-database query method, system and device and medium

    CN120086274A

  • LLM-based cross-system heterogeneous metadata intelligent acquisition method and system

    CN120408157A

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

    CN120493159A

Cited By

  • Extensible form element resource extraction method, system and device and medium

    CN121092172A

  • Extensible tree structure dynamic modeling method and system for steel quality standard

    CN121388026A

  • Regional power dispatching optimization method and system driven by dynamic power consumption data

    CN121906643A