Flow chart reasoning method, system and equipment based on page processing logic and medium
By analyzing missing nodes in the flowchart and constructing new nodes using neural network models and user preference data, the problem of missing nodes in the flowchart is solved, enabling automatic reasoning and personalized customization of the flowchart, and improving the accuracy and automation of the flowchart.
Patent Information
- Application Number
- CN202510958137.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-11
- Publication Date
- 2025-11-21
AI Technical Summary
Existing technologies often result in missing nodes or broken connections during flowchart drawing due to user negligence, affecting the integrity of the flowchart and causing development or business execution errors. Furthermore, the limited coverage of traditional rules leads to insufficient accuracy in flowchart reasoning.
By acquiring the target flowchart, analyzing the missing upstream and downstream nodes, using a neural network model to predict semantic information and node types, and combining user preference data to construct new nodes, the flowchart can be automatically completed and customized.
It improves the accuracy and flexibility of flowcharts, reduces manual intervention, and enhances the automation and efficiency of process construction.
Smart Images

Figure CN120996178A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of knowledge reasoning, and in particular to flowchart reasoning methods, systems, devices, and media based on page processing logic. Background Technology
[0002] In software development and business process design, flowcharts are crucial tools for describing system logic. However, during the actual drawing process, nodes are often missing due to user oversight. For example, when drawing an order processing flowchart, a missing "inventory verification" node or a disconnect from downstream nodes can cause the subsequent "shipping" node to become disconnected from its prerequisites. This not only affects the completeness of the flowchart but may also lead to errors in subsequent development or business execution.
[0003] As enterprises' demand for process automation and intelligence continues to grow, flowchart automatic generation technology has evolved from traditional rule-based static methods to more intelligent reasoning and completion methods. Early methods primarily relied on manual rules and knowledge graphs. However, limited by the scope of rule coverage and the constraints of the knowledge base, automatically completed nodes might not align with actual business logic, thus hindering the accuracy of flowchart reasoning. These issues limited the level of intelligence in flowchart reasoning, increased the learning and correction costs for users, and necessitated more automated and intelligent automatic reasoning solutions. Summary of the Invention
[0004] To improve the accuracy of flowchart reasoning, this application provides a flowchart reasoning method, system, device, and medium based on page processing logic.
[0005] Firstly, this application provides a flowchart reasoning method based on page processing logic, employing the following technical solution: Flowchart reasoning methods based on page processing logic include: Obtain the target flowchart constructed by the target user, parse the target flowchart, and determine the upstream and downstream missing nodes; Obtain the first semantic information of the missing upstream node and the second semantic information of the corresponding sibling node, and predict the third semantic information of the next node based on the first semantic information and the second semantic information; Obtain the current node type of the upstream missing node, and determine the target node type of the next node based on the target node type and the third semantic information; Based on the third semantic information and the target node type, determine whether there is a target downstream missing node with consistent semantics and node type. If both are true, then establish a connection between the corresponding upstream missing node and the target downstream missing node. Otherwise, the input preference data of the target user is obtained, and the corresponding text content is determined based on the input preference data and the third semantic information. A new node is constructed based on the text content, and a connection is established between the new node and the corresponding upstream missing node. The above steps are repeated until there are no upstream missing nodes or downstream missing nodes.
[0006] By adopting the above technical solution, the target flowchart constructed by the target user is first obtained, the target flowchart is parsed, and the upstream and downstream missing nodes are determined. Then, the first semantic information of the upstream missing node and the second semantic information of the corresponding sibling node are obtained. Based on the first and second semantic information, the third semantic information of the next node is predicted. Then, the current node type of the upstream missing node is obtained. Based on the target node type and the third semantic information, the target node type of the next node is determined. Then, based on the third semantic information and the target node type, it is determined whether there is a target downstream missing node with the same semantics and node type. If both are true, the connection between the corresponding upstream missing node and the target downstream missing node is established. Otherwise, the method acquires the target user's input preference data, determines the corresponding text content based on the input preference data and third semantic information, constructs a new node based on the text content, establishes a connection between the new node and the corresponding upstream missing node, and repeats the above process until there are no more upstream or downstream missing nodes. The method of this application can intelligently identify and supplement missing nodes in the flowchart by dynamically analyzing the semantic information and node types in the page, realizes automatic reasoning and improvement of the process, and performs personalized customization based on user preferences. This not only improves the automation level of process construction, but also enhances the accuracy and flexibility of the flowchart, thereby improving the intelligence level of page processing logic, helping to reduce manual intervention and improve work efficiency.
[0007] Optionally, the step of parsing the target flowchart to determine the upstream and downstream missing nodes includes: Based on a pre-designed flowchart parsing library, the target flowchart is parsed to obtain the corresponding target graph structure, wherein the target graph structure includes node objects and edge objects; Based on the target graph structure, node traversal is performed. Based on the node type rules, nodes whose outgoing edge list is empty and are not the starting node of the target flowchart are designated as downstream missing nodes, and nodes whose incoming edge list is empty and are not the ending node of the target flowchart are designated as upstream missing nodes.
[0008] By adopting the above technical solution, in order to determine the upstream and downstream missing nodes, the target flowchart is parsed based on a pre-designed flowchart parsing library to obtain the corresponding target graph structure. The target graph structure includes node objects and edge objects. Then, node traversal is performed according to the target graph structure. Based on the node type rules, nodes whose outgoing edge list is empty and are not the starting node of the target flowchart are regarded as downstream missing nodes, and nodes whose incoming edge list is empty and are not the ending node of the target flowchart are regarded as upstream missing nodes.
[0009] Optionally, the step of predicting the third semantic information of the next node based on the first semantic information and the second semantic information includes: Acquire first model training data and divide the first model training data according to a first preset ratio to form a first training set and a first test set, wherein the first model training data includes historical core semantic information and historical supporting semantic information; The hyperparameters of the pre-built neural network model are set according to the grid search algorithm, and the root mean square error (RMSE) and the coefficient of determination (R²) are used as the first evaluation indicators. The pre-built neural network model is trained based on the first training set to obtain a trained neural network model; The trained neural network model is tested according to the first test set, and the error is judged according to the first evaluation index to determine whether the error is within the preset range. If so, the trained neural network model is used as the node semantic prediction model. The first semantic information and the second semantic information are input into the node semantic prediction model to obtain the third semantic information of the next node.
[0010] By adopting the above technical solution, in order to predict the third semantic information of the next node, the first model training data is obtained and divided into a first training set and a first test set according to a first preset ratio. The first model training data includes historical core semantic information and historical support semantic information. Then, the hyperparameters of the pre-constructed neural network model are set according to the grid search algorithm, and the root mean square error (RMSE) and the coefficient of determination (R²) are used as the first evaluation indicators. The pre-constructed neural network model is then trained according to the first training set to obtain a trained neural network model. The trained neural network model is then tested according to the first test set, and the error is judged according to the first evaluation indicator to determine whether it is within the preset range. If so, the trained neural network model is used as the node semantic prediction model. Finally, the first semantic information and the second semantic information are input into the node semantic prediction model to obtain the third semantic information of the next node.
[0011] Optionally, the step of determining the target node type of the next node based on the target node type and the third semantic information includes: Based on a preset node type matching table, a first node type is determined according to the target node type and the third semantic information, wherein the node type matching table includes the mapping relationship between the node types of adjacent nodes; Natural language processing is performed on the third semantic information to obtain corresponding semantic features, wherein the semantic features include verb features, object features, and subject features; Based on the semantic-node type mapping rule, and according to the semantic features, the node type of the next node is assumed, and the topology rule is verified according to the assumption result. If no conflict occurs, the second node type is determined according to the assumption result. The target node type of the next node is determined based on the first node type and the second node type.
[0012] By adopting the above technical solution, in order to determine the target node type of the next node, the first node type is determined based on a preset node type matching table, according to the target node type and third semantic information. The node type matching table includes the mapping relationship between the node types of adjacent nodes. Then, natural language processing is performed on the third semantic information to obtain the corresponding semantic features, which include verb features, object features, and subject features. Then, based on the semantic-node type mapping rule, a node type hypothesis is made for the next node according to the semantic features, and the topology rule is verified according to the hypothesis result. If no conflict occurs, the second node type is determined according to the hypothesis result. Finally, the target node type of the next node is determined according to the first node type and the second node type.
[0013] Optionally, the step of determining the target node type of the next node based on the first node type and the second node type includes: Determine whether the first node type and the second node type are consistent; If so, then the first node type or the second node type will be used as the target node type of the next node; Otherwise, based on the preset node type mapping relationship, the target node type of the next node is determined according to the first node type and the second node type.
[0014] By adopting the above technical solution, in order to determine the target node type of the next node, it is determined whether the first node type and the second node type are consistent. If the first node type and the second node type are consistent, the first node type or the second node type is used as the target node type of the next node. If the first node type and the second node type are inconsistent, the target node type of the next node is determined based on the preset node type mapping relationship and the first node type and the second node type.
[0015] Optionally, the step of determining the target node type of the next node based on the first node type and the second node type includes: The first node type and the second node type are vectorized respectively to obtain a first vector and a second vector; Obtain the weights corresponding to the first node type and the second node type respectively, and perform vector fusion based on the first vector, the second vector and the weights to obtain the node type feature vector; Based on a preset standard feature vector, the node type feature value is determined according to the node type feature vector; The node type feature value is matched in a preset table to obtain the target node type of the next node. The preset table includes node type feature data and node type data, and is used to represent the mapping relationship between the node type feature data and the node type data.
[0016] By adopting the above technical solution, in order to determine the target node type of the next node, the first node type and the second node type are vectorized respectively to obtain the first vector and the second vector. Then, the weights corresponding to the first node type and the second node type are obtained, and vector fusion is performed according to the first vector, the second vector and the weights to obtain the node type feature vector. Then, based on the preset standard feature vector, the node type feature value is determined according to the node type feature vector. Then, the node type feature value is matched in a preset table to obtain the target node type of the next node. The preset table includes node type feature data and node type data, and the preset table is used to represent the mapping relationship between the node type feature data and the node type data.
[0017] Optionally, the step of determining the corresponding text content based on the input preference data and the third semantic information includes: Acquire the second model training data and divide the second model training data according to the second preset ratio to form a second training set and a second test set. The second model training data includes historical input preference data, historical semantic information and historical text information. The hyperparameters of the pre-built Transformer model are set according to the particle swarm optimization algorithm, and the second root mean square error (RMSE) and the second coefficient of determination (R²) are used as the second evaluation index. The pre-built Transformer model is trained based on the second training set to obtain a trained Transformer model. The trained Transformer model is tested according to the second test set, and the error is judged according to the second evaluation index to see if they are all within the preset range. If so, the trained Transformer model is used as the text content generation model. The input preference data and the third semantic information are input into the text content generation model to obtain the corresponding text content.
[0018] By adopting the above technical solution, in order to determine the corresponding text content, second model training data is obtained and divided according to a second preset ratio to form a second training set and a second test set. The second model training data includes historical input preference data, historical semantic information, and historical text information. Then, the hyperparameters of the pre-built Transformer model are set according to the particle swarm optimization algorithm, and the second root mean square error (RMSE) and the second coefficient of determination (R²) are used as the second evaluation index. The pre-built Transformer model is then trained according to the second training set to obtain a trained Transformer model. The trained Transformer model is then tested according to the second test set, and the error is judged according to the second evaluation index to determine whether the error is within the preset range. If the error is within the preset range, the trained Transformer model is used as the text content generation model. Finally, the input preference data and the third semantic information are input into the text content generation model to obtain the corresponding text content.
[0019] Secondly, this application also provides a flowchart reasoning system based on page processing logic, which adopts the following technical solution: A flowchart reasoning system based on page processing logic includes: The node determination module is used to obtain the target flowchart constructed by the target user, parse the target flowchart, and determine the upstream missing nodes and downstream missing nodes; The semantic processing module is used to obtain the first semantic information of the missing upstream node and the second semantic information of the corresponding sibling node, and predict the third semantic information of the next node based on the first semantic information and the second semantic information. The node type determination module is used to obtain the current node type of the upstream missing node and determine the target node type of the next node based on the target node type and the third semantic information. The node construction and connection module is used to determine whether there is a target downstream missing node with the same semantics and node type based on the third semantic information and the target node type. If both exist, a connection is established between the corresponding upstream missing node and the target downstream missing node. Otherwise, the input preference data of the target user is obtained, and the corresponding text content is determined based on the input preference data and the third semantic information. A new node is constructed based on the text content, and a connection is established between the new node and the corresponding upstream missing node.
[0020] Thirdly, this application also provides a computer device, which adopts the following technical solution: A computer device includes a memory and a processor, the memory storing a computer program executable on the processor, the processor executing the computer program to implement the method described in the first aspect.
[0021] Fourthly, this application also provides a computer-readable storage medium, which adopts the following technical solution: A computer-readable storage medium storing a computer program capable of being loaded by a processor and executing the method described in the first aspect.
[0022] In summary, this application includes at least the following beneficial technical effects: First, the target flowchart constructed by the target user is obtained; the target flowchart is parsed to determine the upstream missing node and the downstream missing node; then, the first semantic information of the upstream missing node and the second semantic information of the corresponding sibling node are obtained; the third semantic information of the next node is predicted based on the first and second semantic information; then, the current node type of the upstream missing node is obtained; the target node type of the next node is determined based on the target node type and the third semantic information; then, based on the third semantic information and the target node type, it is determined whether there is a target downstream missing node with consistent semantics and node type; if both are true, a connection is established between the corresponding upstream missing node and the target downstream missing node. Otherwise, the method acquires the target user's input preference data, determines the corresponding text content based on the input preference data and third semantic information, constructs a new node based on the text content, establishes a connection between the new node and the corresponding upstream missing node, and repeats the above process until there are no more upstream or downstream missing nodes. The method of this application can intelligently identify and supplement missing nodes in the flowchart by dynamically analyzing the semantic information and node types in the page, realizes automatic reasoning and improvement of the process, and performs personalized customization based on user preferences. This not only improves the automation level of process construction, but also enhances the accuracy and flexibility of the flowchart, thereby improving the intelligence level of page processing logic, helping to reduce manual intervention and improve work efficiency. Attached Figure Description
[0023] Figure 1 This is a schematic diagram of the overall process of an embodiment of this application.
[0024] Figure 2 This is a schematic diagram of the system structure of this application.
[0025] Figure 3 This is a structural block diagram of the computer device described in this application. Detailed Implementation
[0026] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0027] This application discloses a flowchart reasoning method based on page processing logic.
[0028] Reference Figure 1 A flowchart reasoning method based on page processing logic includes: Step S11: Obtain the target flowchart constructed by the target user, parse the target flowchart, and determine the missing upstream and downstream nodes.
[0029] It is understood that in this application, an upstream missing node is a node in which an upstream node is missing, and a downstream missing node is a node in which a downstream node is missing.
[0030] Step S12: Obtain the first semantic information of the missing upstream node and the second semantic information of the corresponding sibling node, and predict the third semantic information of the next node based on the first and second semantic information.
[0031] It should be noted that in step S12, by integrating the first semantic information (such as contextual features, latent patterns, or associated data) of the missing upstream node with the second semantic information (such as parallel structure, similar attributes, or co-occurrence relationship) of the sibling node, the third semantic information of the next node can be predicted based on semantic relevance and contextual dependence, ensuring that it is consistent with the overall semantic logic and conforms to the expected semantic flow.
[0032] Step S13: Obtain the current node type of the upstream missing node, and determine the target node type of the next node based on the target node type and the third semantic information.
[0033] It should be noted that the type of subsequent nodes can be inferred from the preceding nodes. There are two types of inference: one is the execution path, which includes judgment, looping, and traversal; the other is data transfer, where a conversion node is automatically added when there is a type mismatch between the previous and next nodes. In this application, node types include event source nodes, action nodes, logic control nodes, and data processing nodes. Event source nodes represent the interaction trigger point, i.e., the starting point of the process, and include the trigger event type, source component ID, and event parameter structure. Action nodes represent the specific operation to be performed (such as CallAPI), and include the action type and configuration parameters. Logic control nodes include conditional branches, loops, and parallelism. Data processing nodes include variable operations and expression calculations.
[0034] Step S14: Based on the third semantic information and the target node type, determine whether there is a target downstream missing node with consistent semantics and node type. If both are true, establish a connection between the corresponding upstream missing node and the target downstream missing node.
[0035] Step S15: Otherwise, obtain the target user's input preference data, determine the corresponding text content based on the input preference data and the third semantic information, construct a new node based on the text content, establish a connection between the new node and the corresponding upstream missing node, and repeat steps S11 to S15 until there are no upstream or downstream missing nodes.
[0036] It should be noted that in steps S14 and S15, a connection is established between two nodes, that is, an edge is established between the two nodes. In this application, the edge includes control flow edges and data flow edges. Control flow edges are used to define the execution order and dependencies of the nodes (usually pointing from the "output port" of one node to the "input port" of the next node), and may have condition labels (true, false, loop item). Data flow edges are used to define how data is passed between nodes (such as passing event parameters to action inputs and passing action outputs to condition judgments), and explicitly or implicitly binding source ports and target ports.
[0037] In the above implementation, the target flowchart constructed by the target user is first obtained, the target flowchart is parsed, and the upstream missing node and the downstream missing node are determined. Then, the first semantic information of the upstream missing node and the second semantic information of the corresponding sibling node are obtained. The third semantic information of the next node is predicted based on the first semantic information and the second semantic information. Then, the current node type of the upstream missing node is obtained. The target node type of the next node is determined based on the target node type and the third semantic information. Then, based on the third semantic information and the target node type, it is determined whether there is a target downstream missing node with the same semantics and node type. If both are true, the connection between the corresponding upstream missing node and the target downstream missing node is established. Otherwise, the method acquires the target user's input preference data, determines the corresponding text content based on the input preference data and third semantic information, constructs a new node based on the text content, establishes a connection between the new node and the corresponding upstream missing node, and repeats the above process until there are no more upstream or downstream missing nodes. The method of this application can intelligently identify and supplement missing nodes in the flowchart by dynamically analyzing the semantic information and node types in the page, realizes automatic reasoning and improvement of the process, and performs personalized customization based on user preferences. This not only improves the automation level of process construction, but also enhances the accuracy and flexibility of the flowchart, thereby improving the intelligence level of page processing logic, helping to reduce manual intervention and improve work efficiency.
[0038] As a further implementation of the method, the steps of parsing the target flowchart to determine the upstream and downstream missing nodes include: Step S21: Based on the pre-designed flowchart parsing library, the target flowchart is parsed to obtain the corresponding target graph structure, wherein the target graph structure includes node objects and edge objects.
[0039] Step S22: Perform node traversal according to the target graph structure. Based on the node type rules, nodes whose outgoing edge list is empty and are not the starting node of the target flowchart are designated as downstream missing nodes, and nodes whose incoming edge list is empty and are not the ending node of the target flowchart are designated as upstream missing nodes.
[0040] In the above implementation, in order to determine the upstream and downstream missing nodes, the target flowchart is parsed based on a pre-designed flowchart parsing library to obtain the corresponding target graph structure. The target graph structure includes node objects and edge objects. Then, node traversal is performed according to the target graph structure. Based on the node type rules, nodes whose outgoing edge list is empty and are not the starting node of the target flowchart are regarded as downstream missing nodes, and nodes whose incoming edge list is empty and are not the ending node of the target flowchart are regarded as upstream missing nodes.
[0041] As a further implementation of the method, the step of predicting the third semantic information of the next node based on the first semantic information and the second semantic information includes: Step S31: Obtain the first model training data and divide the first model training data according to the first preset ratio to form a first training set and a first test set. The first model training data includes historical core semantic information and historical supporting semantic information.
[0042] It should be noted that the first preset ratio can be 7:3 or 8:2.
[0043] Step S32: Set the hyperparameters of the pre-built neural network model according to the grid search algorithm, and use the root mean square error (RMSE) and the coefficient of determination (R²) as the first evaluation index.
[0044] It should be noted that grid search is a hyperparameter optimization method used to systematically search for the optimal hyperparameters within a given range of parameter combinations to improve the performance of machine learning models. Its core idea is to exhaustively search for all possible combinations of hyperparameters, evaluate the performance of each set of parameters through cross-validation, and finally select the hyperparameter configuration that best performs the model.
[0045] Step S33: Train the pre-built neural network model according to the first training set to obtain the trained neural network model.
[0046] Step S34: Test the trained neural network model according to the first test set, and determine whether the errors are all within the preset range according to the first evaluation index. If so, use the trained neural network model as the node semantic prediction model.
[0047] Step S35: Input the first semantic information and the second semantic information into the node semantic prediction model to obtain the third semantic information of the next node.
[0048] In the above implementation, in order to predict the third semantic information of the next node, first model training data is obtained and divided into a first training set and a first test set according to a first preset ratio. The first model training data includes historical core semantic information and historical support semantic information. Then, the hyperparameters of the pre-built neural network model are set according to the grid search algorithm, and the root mean square error (RMSE) and the coefficient of determination (R²) are used as the first evaluation indicators. The pre-built neural network model is then trained according to the first training set to obtain a trained neural network model. The trained neural network model is then tested according to the first test set, and the error is judged according to the first evaluation indicator to determine whether the error is within the preset range. If so, the trained neural network model is used as the node semantic prediction model. Finally, the first semantic information and the second semantic information are input into the node semantic prediction model to obtain the third semantic information of the next node.
[0049] As a further implementation of the method, the step of determining the target node type of the next node based on the target node type and third semantic information includes: Step S41: Based on a preset node type matching table, determine the first node type according to the target node type and third semantic information, wherein the node type matching table includes the mapping relationship between the node types of adjacent nodes.
[0050] Step S42: Perform natural language processing on the third semantic information to obtain the corresponding semantic features, which include verb features, object features and subject features.
[0051] Step S43: Based on the semantic-node type mapping rule, make a node type assumption for the next node according to the semantic features, and perform topology rule verification based on the assumption result. If no conflict occurs, determine the second node type based on the assumption result.
[0052] Step S44: Determine the target node type of the next node based on the first node type and the second node type.
[0053] In the above implementation, in order to determine the target node type of the next node, a first node type is determined based on a preset node type matching table, according to the target node type and third semantic information. The node type matching table includes the mapping relationship between the node types of adjacent nodes. Then, natural language processing is performed on the third semantic information to obtain the corresponding semantic features, which include verb features, object features, and subject features. Then, based on the semantic-node type mapping rule, a node type hypothesis is made for the next node according to the semantic features, and the topology rule is verified according to the hypothesis result. If no conflict occurs, the second node type is determined according to the hypothesis result. Finally, the target node type of the next node is determined according to the first node type and the second node type.
[0054] As a further implementation of the method, the step of determining the target node type of the next node based on the first node type and the second node type includes: Step S51: Determine whether the type of the first node and the type of the second node are the same.
[0055] Step S52: If so, then the first node type or the second node type is used as the target node type of the next node.
[0056] Step S53: Otherwise, based on the preset node type mapping relationship, determine the target node type of the next node according to the first node type and the second node type.
[0057] In the above implementation, in order to determine the target node type of the next node, it is determined whether the first node type and the second node type are consistent. If the first node type and the second node type are consistent, the first node type or the second node type is used as the target node type of the next node. If the first node type and the second node type are inconsistent, the target node type of the next node is determined based on the preset node type mapping relationship and the first node type and the second node type.
[0058] As a further implementation of the method, the step of determining the target node type of the next node based on the first node type and the second node type includes: Step S61: Vectorize the first node type and the second node type respectively to obtain the first vector and the second vector.
[0059] Step S62: Obtain the weights corresponding to the first node type and the second node type respectively, and perform vector fusion based on the first vector, the second vector and the weights to obtain the node type feature vector.
[0060] Step S63: Based on the preset standard feature vector, determine the node type feature value according to the node type feature vector.
[0061] Step S64: Match the node type feature values in a preset table to obtain the target node type of the next node. The preset table includes node type feature data and node type data, and is used to represent the mapping relationship between node type feature data and node type data.
[0062] In the above implementation, in order to determine the target node type of the next node, the first node type and the second node type are vectorized respectively to obtain a first vector and a second vector. Then, the weights corresponding to the first node type and the second node type are obtained, and vector fusion is performed according to the first vector, the second vector and the weights to obtain a node type feature vector. Then, based on a preset standard feature vector, the node type feature value is determined according to the node type feature vector. Then, the node type feature value is matched in a preset table to obtain the target node type of the next node. The preset table includes node type feature data and node type data, and the preset table is used to represent the mapping relationship between the node type feature data and the node type data.
[0063] As a further implementation of the method, the step of determining the corresponding text content based on input preference data and third semantic information includes: Step S71: Obtain the second model training data and divide the second model training data according to the second preset ratio to form the second training set and the second test set. The second model training data includes historical input preference data, historical semantic information and historical text information.
[0064] Step S72: Set the hyperparameters of the pre-built Transformer model according to the particle swarm optimization algorithm, and use the second root mean square error (RMSE) and the second coefficient of determination (R²) as the second evaluation index.
[0065] It should be noted that Particle Swarm Optimization (PSO) is an optimization method based on swarm intelligence, simulating the cooperative foraging behavior of flocks of birds or schools of fish. Its core idea is to find the optimal solution in the solution space through information sharing among individuals (particles). The Transformer model is a text processing architecture that breaks through the limitations of traditional models through a global attention mechanism, achieving deep semantic understanding and efficient parallel generation. It can simultaneously capture the complex relationships between words in the entire text, accurately analyze sentiment, logical relationships and implicit intentions, and support the rapid processing of large-scale text.
[0066] Step S73: Train the pre-built Transformer model according to the second training set to obtain the trained Transformer model.
[0067] Step S74: Test the trained Transformer model according to the second test set, and determine whether the errors are all within the preset range according to the second evaluation index. If so, use the trained Transformer model as the text content generation model.
[0068] Step S75: Input the input preference data and third semantic information into the text content generation model to obtain the corresponding text content.
[0069] In the above implementation, in order to determine the corresponding text content, second model training data is obtained and divided according to a second preset ratio to form a second training set and a second test set. The second model training data includes historical input preference data, historical semantic information, and historical text information. Then, the hyperparameters of the pre-built Transformer model are set according to the particle swarm optimization algorithm, and the second root mean square error (RMSE) and the second coefficient of determination (R²) are used as the second evaluation index. The pre-built Transformer model is then trained according to the second training set to obtain a trained Transformer model. The trained Transformer model is then tested according to the second test set, and the error is judged according to the second evaluation index to determine whether the error is within a preset range. If the error is within the preset range, the trained Transformer model is used as the text content generation model. Finally, the input preference data and the third semantic information are input into the text content generation model to obtain the corresponding text content.
[0070] This application also discloses a flowchart reasoning system based on page processing logic.
[0071] refer to Figure 2 A flowchart reasoning system based on page processing logic, including: The node determination module is used to obtain the target flowchart constructed by the target user, parse the target flowchart, and determine the upstream and downstream missing nodes; The semantic processing module is used to obtain the first semantic information of the missing upstream node and the second semantic information of the corresponding sibling node, and predict the third semantic information of the next node based on the first and second semantic information. The node type determination module is used to obtain the current node type of the missing upstream node and determine the target node type of the next node based on the target node type and third semantic information. The node construction and connection module is used to determine whether there is a target downstream missing node with the same semantics and node type based on the third semantic information and the target node type. If both exist, a connection is established between the corresponding upstream missing node and the target downstream missing node. Otherwise, the input preference data of the target user is obtained, and the corresponding text content is determined based on the input preference data and the third semantic information. A new node is constructed based on the text content, and a connection is established between the new node and the corresponding upstream missing node.
[0072] The flowchart reasoning system based on page processing logic of the present invention can implement any of the flowchart reasoning methods based on page processing logic, and the specific working process of the flowchart reasoning system based on page processing logic of the present invention can refer to the corresponding process in the flowchart reasoning method based on page processing logic described above.
[0073] This application also discloses a computer device.
[0074] refer to Figure 3 A computer device includes a memory and a processor, wherein the memory stores a computer program that can run on the processor, and the processor executes the computer program to implement any of the above-described flowchart reasoning methods based on page processing logic.
[0075] This application also discloses a computer-readable storage medium.
[0076] A computer-readable storage medium storing a computer program capable of being loaded by a processor and executing any of the above-described flowchart reasoning methods based on page processing logic.
[0077] The computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in connection with an instruction execution system, apparatus, or device; the program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0078] The above are all preferred embodiments of this application and are not intended to limit the scope of protection of this application. Any feature disclosed in this specification (including the abstract and drawings) may be replaced by other equivalent or similar features unless specifically stated otherwise. That is, unless specifically stated otherwise, each feature is only one example of a series of equivalent or similar features.
Claims
1. A flowchart reasoning method based on page processing logic, characterized in that, include: Obtain the target flowchart constructed by the target user, parse the target flowchart, and determine the upstream and downstream missing nodes; Obtain the first semantic information of the missing upstream node and the second semantic information of the corresponding sibling node, and predict the third semantic information of the next node based on the first semantic information and the second semantic information; Obtain the current node type of the upstream missing node, and determine the target node type of the next node based on the target node type and the third semantic information; Based on the third semantic information and the target node type, determine whether there is a target downstream missing node with consistent semantics and node type. If both are true, then establish a connection between the corresponding upstream missing node and the target downstream missing node. Otherwise, the input preference data of the target user is obtained, and the corresponding text content is determined based on the input preference data and the third semantic information. A new node is constructed based on the text content, and a connection is established between the new node and the corresponding upstream missing node. The above steps are repeated until there are no upstream missing nodes or downstream missing nodes.
2. The flowchart reasoning method based on page processing logic according to claim 1, characterized in that, The step of parsing the target flowchart to determine the upstream and downstream missing nodes includes: Based on a pre-designed flowchart parsing library, the target flowchart is parsed to obtain the corresponding target graph structure, wherein the target graph structure includes node objects and edge objects; Based on the target graph structure, node traversal is performed. Based on the node type rules, nodes whose outgoing edge list is empty and are not the starting node of the target flowchart are designated as downstream missing nodes, and nodes whose incoming edge list is empty and are not the ending node of the target flowchart are designated as upstream missing nodes.
3. The flowchart reasoning method based on page processing logic according to claim 1, characterized in that, The step of predicting the third semantic information of the next node based on the first semantic information and the second semantic information includes: Acquire first model training data and divide the first model training data according to a first preset ratio to form a first training set and a first test set, wherein the first model training data includes historical core semantic information and historical supporting semantic information; The hyperparameters of the pre-built neural network model are set according to the grid search algorithm, and the root mean square error (RMSE) and the coefficient of determination (R²) are used as the first evaluation indicators. The pre-built neural network model is trained based on the first training set to obtain a trained neural network model; The trained neural network model is tested according to the first test set, and the error is judged according to the first evaluation index to determine whether the error is within the preset range. If so, the trained neural network model is used as the node semantic prediction model. The first semantic information and the second semantic information are input into the node semantic prediction model to obtain the third semantic information of the next node.
4. The flowchart reasoning method based on page processing logic according to claim 1, characterized in that, The step of determining the target node type of the next node based on the target node type and the third semantic information includes: Based on a preset node type matching table, a first node type is determined according to the target node type and the third semantic information, wherein the node type matching table includes the mapping relationship between the node types of adjacent nodes; Natural language processing is performed on the third semantic information to obtain corresponding semantic features, wherein the semantic features include verb features, object features, and subject features; Based on the semantic-node type mapping rule, and according to the semantic features, the node type of the next node is assumed, and the topology rule is verified according to the assumption result. If no conflict occurs, the second node type is determined according to the assumption result. The target node type of the next node is determined based on the first node type and the second node type.
5. The flowchart reasoning method based on page processing logic according to claim 4, characterized in that, The step of determining the target node type of the next node based on the first node type and the second node type includes: Determine whether the first node type and the second node type are consistent; If so, then the first node type or the second node type will be used as the target node type of the next node; Otherwise, based on the preset node type mapping relationship, the target node type of the next node is determined according to the first node type and the second node type.
6. The flowchart reasoning method based on page processing logic according to claim 4, characterized in that, The step of determining the target node type of the next node based on the first node type and the second node type includes: The first node type and the second node type are vectorized respectively to obtain a first vector and a second vector; Obtain the weights corresponding to the first node type and the second node type respectively, and perform vector fusion based on the first vector, the second vector and the weights to obtain the node type feature vector; Based on a preset standard feature vector, the node type feature value is determined according to the node type feature vector; The node type feature value is matched in a preset table to obtain the target node type of the next node. The preset table includes node type feature data and node type data, and is used to represent the mapping relationship between the node type feature data and the node type data.
7. The flowchart reasoning method based on page processing logic according to claim 1, characterized in that, The step of determining the corresponding text content based on the input preference data and the third semantic information includes: Acquire the second model training data and divide the second model training data according to the second preset ratio to form a second training set and a second test set. The second model training data includes historical input preference data, historical semantic information and historical text information. The hyperparameters of the pre-built Transformer model are set according to the particle swarm optimization algorithm, and the second root mean square error (RMSE) and the second coefficient of determination (R²) are used as the second evaluation index. The pre-built Transformer model is trained based on the second training set to obtain a trained Transformer model. The trained Transformer model is tested according to the second test set, and the error is judged according to the second evaluation index to see if they are all within the preset range. If so, the trained Transformer model is used as the text content generation model. The input preference data and the third semantic information are input into the text content generation model to obtain the corresponding text content.
8. A flowchart reasoning system based on page processing logic, characterized in that, include: The node determination module is used to obtain the target flowchart constructed by the target user, parse the target flowchart, and determine the upstream missing nodes and downstream missing nodes; The semantic processing module is used to obtain the first semantic information of the missing upstream node and the second semantic information of the corresponding sibling node, and predict the third semantic information of the next node based on the first semantic information and the second semantic information. The node type determination module is used to obtain the current node type of the upstream missing node and determine the target node type of the next node based on the target node type and the third semantic information. The node construction and connection module is used to determine whether there is a target downstream missing node with the same semantics and node type based on the third semantic information and the target node type. If both are true, a connection is established between the corresponding upstream missing node and the target downstream missing node. Otherwise, the input preference data of the target user is obtained, and the corresponding text content is determined based on the input preference data and the third semantic information. A new node is constructed based on the text content, and a connection is established between the new node and the corresponding upstream missing node.
9. A computer device, characterized in that, The method includes a memory and a processor, wherein the memory stores a computer program that can run on the processor, and the processor executes the computer program to implement the method of any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer program is stored that can be loaded by a processor and execute the method of any one of claims 1 to 7.