A rule component recommendation method based on Bayesian network and neural network
By combining Bayesian networks with neural networks, we build component knowledge graphs and make intelligent recommendations, solving the duplication and usability issues of low-code platforms in rule construction, improving development efficiency and error rates, and promoting the application of low-code technology in enterprises.
Patent Information
- Application Number
- CN202510958822.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-11
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2045-07-11
AI Technical Summary
Low-code platforms lack intelligent reuse mechanisms when processing highly repetitive business rules, resulting in low development efficiency. Non-technical users are prone to errors in rule construction, and modular development has poor flexibility and is difficult to adapt to complex scenarios and dynamic data.
A rule-based component recommendation method based on Bayesian networks and neural networks is adopted. By analyzing historical rule data to build a component knowledge graph, a frequency analysis algorithm is used to mine association rules. The Bayesian network and neural network are combined for component recommendation, and the recommendation results are integrated to provide intelligent component selection.
It improves the intelligence level of rule component construction, reduces error rates, optimizes development efficiency, provides more efficient business process and rule management tools, and promotes the application of low-code technology in enterprise digital transformation.
Smart Images

Figure CN120447889B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a rule component recommendation method based on Bayesian networks and neural networks. Background Art
[0002] In recent years, with the acceleration of enterprise digital transformation, low-code technology, as a rapid application development tool, has become a key driver for optimizing business processes and rules management. Business and process rules within an enterprise are often complex and dynamically changing. Traditional development methods, due to their long development cycles and high costs, struggle to quickly respond to these changes, leading to a disconnect between business needs and technical implementation. Low-code technology, through its visual development interface, pre-built modules, and configurable logic, provides enterprises with a flexible and efficient solution, enabling them to quickly build, adapt, and deploy applications to better adapt to the dynamic changes in business and process rules. Low-code platforms, with their drag-and-drop interface, pre-built templates, and configurable logic, not only lower the development barrier, allowing non-technical personnel to directly participate in application development, but also provide professional developers with efficient scalability, achieving a deep integration of business and technology.
[0003] However, despite the significant advantages of low-code technology in rule building and process management, practical applications still face several challenges: 1. Lack of intelligent recommendation mechanisms: Existing low-code platforms lack intelligent reuse mechanisms for highly repetitive business rules. This forces developers to repeatedly build rules for the same or similar scenarios, resulting in low development efficiency. 2. Limited support for rule building: For non-technical practitioners, the platforms lack clear rule component prompts and intelligent recommendation features. This can easily lead to incorrect component selection and improper logic configuration, increasing the risk of build failures and errors. 3. Modular development issues: Mainstream low-code platforms use pre-set keyword tags (such as "validation" and "user permissions") to retrieve components, but this struggles to address semantic generalization and contextual relevance requirements. Static rule-based recommendation methods rely on manually defined matching logic, are unable to adapt to complex scenarios and dynamic data, and lack flexibility. These issues not only limit the widespread adoption of low-code technology but also reduce its practicality in complex business scenarios. Summary of the Invention
[0004] In view of this, the present invention provides a rule component recommendation method based on Bayesian network and neural network, which is used to at least solve the problem of low intelligence of low-code technology in the existing technology.
[0005] In order to achieve the above object, the present invention adopts the following technical solutions:
[0006] A rule component recommendation method based on Bayesian network and neural network includes the following steps:
[0007] S1. Historical rule data splitting: Analyze historical rule data and split each piece of historical rule data into historical component sequences, storing them in a component sequence database. Extract the unidirectional connections between components in each historical component sequence to construct a component knowledge graph. Use the SFP Tree frequency analysis algorithm to obtain frequent item sets from the historical sequence components. Then, mine association rules for these frequent item sets and obtain the corresponding confidence levels of the association rules.
[0008] S2. Bayesian network construction:
[0009] S21. Dynamically select relevant components and unidirectional connections between components from the component knowledge graph based on the context information of the component to be recommended, to form a directed acyclic graph as a Bayesian subnetwork;
[0010] S22. Based on the relationships between nodes in the Bayesian subnetwork, obtain each child node with a parent node, and obtain a conditional probability table for each child node. A Noisy-OR model is used based on the confidence of the association rule obtained in S1 to obtain a conditional probability table for each child node. A Bayesian network is constructed based on the conditional probability table and the Bayesian subnetwork.
[0011] S23. Calculate the recommendation probability of the component to be recommended based on the Bayesian formula and the conditional probability table, and push it according to the size of the recommendation probability;
[0012] S3. Neural Network Training and Construction: Expand the training dataset through data augmentation and use a recurrent neural network based on LSTM units as the overall framework;
[0013] S4. Fusion of recommendation results: Bayesian network algorithm and neural network algorithm are used to obtain recommendation results respectively, and the recommendation results of Bayesian network and neural network are fused based on the frequency of recommendation algorithms corresponding to the recommendation results adopted by users.
[0014] Preferably, the specific content of S1 includes:
[0015] S11. By using a parser to parse the historical rule data in the form of an XML file into an abstract syntax tree;
[0016] S12. truncate the abstract syntax tree at the process control node and extract the historical component sequence;
[0017] S13. Save the obtained historical component sequence in the component sequence database in the form of a component ID list.
[0018] Preferably, obtaining the specific content of the component knowledge graph includes:
[0019] Taking the component as the entity E in the component knowledge graph and the unidirectional connection relationship between components as the relationship R, the component relationships are extracted in sequence from the historical component sequence mined from S1 to form the component knowledge graph.
[0020] Preferably, the frequency analysis algorithm SFP Tree is used to obtain frequent item sets from the historical sequence components, and association rules are mined for the frequent item sets. The specific contents of the corresponding confidence of the association rules include:
[0021] (1) Initialize the component sequence database, in which the historical component sequence is formatted as an ID list, where a historical component sequence is recorded as a transaction , where I is Any component in , denoted as item, initializes the minimum confidence and minimum support;
[0022] (2) Generate the header table: traverse the component sequence database, obtain the number of occurrences of each component, and obtain the support of each component. Delete the infrequent items and retain the frequent items based on the minimum support, obtain the header chain of each frequent item component, and construct the generated header table.
[0023] (3) Generate SFP Tree and create the header chain of the header table: traverse the component sequence database again, add the frequent items retained in each transaction to the SFP-Tree according to the sequence relationship in the current transaction, the root node is null, the first sequence is directly hung on the root of the tree, and the count of each node is 1; then hang the next sequence, if the same node is found in the tree, start hanging from the same node, and add 1 to the count of the corresponding node until all sequences are mounted;
[0024] (4) Associate the lowest node with other identical nodes in the tree, and finally associate all nodes with the header chain of the header table to obtain the final SFP-Tree;
[0025] (5) Traverse the SFP Tree to generate conditional pattern base, candidate item set, and frequent item set:
[0026] Starting from the last item in the item header table, the conditional pattern base of each item is obtained in sequence, that is, the set of paths containing the item. Then, the conditional pattern base is traversed to obtain the sequence items, and the following judgments are made during the process:
[0027] ① If the candidate item set contains the same item as the current sequence item, proceed to the next step. If not, add a new object to the set to save the item set composed of the sequence item and the support of the current sequence;
[0028] ② If there is a candidate item set containing the same item, add the support count of the item set to the support count of the current sequence item, and then further determine whether there is a sequence consistent with the sequence item in the current candidate item set. If so, add the support count of the item to the support count of the current sequence item; if not, add a new item and save the current sequence item and its support count;
[0029] ③ Delete the candidate item set. If the support count of the candidate item set is greater than or equal to the minimum support, it will be retained;
[0030] (6) Mining association rules for frequent item sets and obtaining the corresponding confidence of the association rules; the confidence calculation method of the association rules is:
[0031] ;
[0032] Where, Represents an item or item set, which is an ordered sequence; express Sequence support count of ; represents frequent items, express Before When it appears Support count of ; express and Appear at the same time, and Before The confidence level of occurrence, i.e. probability.
[0033] Preferably, the specific method of using the Noisy-OR model to obtain the conditional probability table of each child node is:
[0034] Let any child node be , its parent node set is recorded as , and set The parent node of There are no dependencies between:
[0035] ;
[0036] ;
[0037] Where, refer to The nth parent node of Represents the node set with state 1 in the parent node set. If the current node does not appear, its node state is recorded as 0, and if it appears, it is recorded as 1. ; is the prior probability, which is approximated by the statistical marginal probability; the marginal probability is the ratio of the support count to the total number of transaction sets, then:
[0038] ;
[0039] According to the confidence of the association rule in the current Bayesian subgraph, the probability that the state of its child node is 1 when the state of any parent node is 1 as the preceding item is obtained, which is recorded as ,according to The probability calculated by the Noisy-OR model is used to obtain the corresponding conditional probability under each node state, and the conditional probability table is obtained.
[0040] Preferably, the specific content of S3 includes:
[0041] S31. Constructing a training data format: The position of the component to be recommended is marked by a MASK, and the context information of the component to be recommended is inserted before and after the MASK mark to form a training component sequence as training data;
[0042] S32. Split the component sequence obtained through rule-based historical big data mining into subsequences, add a MASK marker to each position of each subsequence, obtain the input data of the training data corresponding to each subsequence according to the training data format, and annotate the input data with a label;
[0043] S33. Input the input data and corresponding labels into the neural network model for training to obtain a trained RNN model.
[0044] Preferably, the specific content of S32 includes:
[0045] Split a component sequence into multiple subsequences, where a subsequence is composed of any two or more components in the component sequence;
[0046] The number of subsequences is as follows:
[0047] ;
[0048] Where, is the number of components in the sequence, is the number of subsequences.
[0049] Preferably, the neural network model in S33 includes: an embedding layer, an encoding layer, a decoding layer, a fully connected layer, and an output layer;
[0050] The embedding layer is used to convert high-order sparse identifiers into low-dimensional dense vector identifiers, capturing the similarity and structural information between data through dense vector identifiers; it is also used to extract the essential features of the data;
[0051] Both the encoding layer and the decoding layer are RNNs composed of LSTM units;
[0052] The decoding layer is used to: capture long-term dependencies in the input sequence and provide meaningful context for subsequent decoding or classification tasks; selectively retain and update information; generate a context vector, which stores key information of the entire input sequence and serves as the input state or direct input of the subsequent decoder; process edge length input and accept input sequences of arbitrary length;
[0053] The decoding layer is used to generate the next element in the target sequence by recursively processing each time step: at each time step, the decoder first receives the target sequence element generated in the previous time step, combines the current context vector and the probability distribution of the next target sequence element predicted by the fully connected layer output, and updates the internal state, including the hidden state and cell state, to prepare for the next time step;
[0054] The output layer uses the softmax operation to take the components with probabilities greater than the preset probability threshold as outputs, and outputs them through the output layer to give the recommendation results.
[0055] Preferably, the specific content of S4 includes:
[0056] S41. Obtain user recommendation requirements and obtain recommendation results using the Bayesian network recommendation algorithm and the neural network recommendation algorithm respectively;
[0057] S42. Collect the frequency of the recommendation algorithms corresponding to the recommendation results adopted by the user, obtain the weights between the Bayesian network recommendation algorithm and the neural network recommendation algorithm and the total number of components of all recommendation results based on the frequency, and adjust the number of recommendation results of the recommendation algorithm based on the weights.
[0058] Preferably, the specific content of S42 includes:
[0059] If the total number of components of all recommended results is , the results recommended by the Bayesian network recommendation algorithm are adopted with a frequency of , the results recommended by the neural network are adopted with a frequency of ,but:
[0060] ;
[0061] ;
[0062] in, Indicates the maximum number of recommended components of the Bayesian network recommendation algorithm; Indicates the maximum number of recommended components of the adjusted neural network recommendation algorithm.
[0063] It can be seen from the above technical solutions that, compared with the prior art, the present invention discloses a rule component recommendation method based on Bayesian networks and neural networks, which has the following beneficial effects:
[0064] The present invention proposes a rule component recommendation method based on neural networks and Bayesian networks, providing a more intelligent solution for low-code technology. By analyzing user historical usage data, combining the learning ability of neural networks and the probabilistic reasoning of Bayesian networks, this method can provide users with intelligent recommendations during the rule component construction process, helping enterprises and non-technical practitioners to quickly select suitable rule components, optimize the construction process, reduce the error rate, and thus significantly improve development efficiency. The present invention not only solves the problems of repeatability and ease of use of low-code platforms in rule construction, but also provides enterprises with more efficient and intelligent tool support in business process and rule management, further promoting the in-depth application of low-code technology in enterprise digital transformation. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0066] Figure 1 A schematic diagram of a flow chart of a rule component recommendation method based on Bayesian network and neural network provided by the present invention;
[0067] Figure 2 A schematic diagram of a behavior rule historical big data mining and component sequence splitting provided by an embodiment of the present invention;
[0068] Figure 3 A schematic diagram of a component triple provided in an embodiment of the present invention;
[0069] Figure 4 A component knowledge graph provided for an embodiment of the present invention;
[0070] Figure 5 The extracted component knowledge graph provided by the embodiment of the present invention;
[0071] Figure 6 A schematic diagram of a context component in a component knowledge graph provided by an embodiment of the present invention;
[0072] Figure 7 A Bayesian network subgraph provided by an embodiment of the present invention;
[0073] Figure 8 Schematic diagram of the SFP Tree construction process provided by an embodiment of the present invention;
[0074] Figure 9 A schematic diagram of the process of constructing a header chain according to an embodiment of the present invention;
[0075] Figure 10 A schematic diagram of the Noisy-OR parent-child node model provided by an embodiment of the present invention;
[0076] Figure 11 A schematic diagram of a Bayesian network downward recommendation provided by an embodiment of the present invention;
[0077] Figure 12 A schematic diagram of splitting a component sequence into subsequences according to an embodiment of the present invention;
[0078] Figure 13 A schematic diagram of subsequence 5 provided in an embodiment of the present invention;
[0079] Figure 14 A schematic diagram of constructing training data provided by an embodiment of the present invention;
[0080] Figure 15 Schematic diagram of the LSTM-based RNN model structure provided in an embodiment of the present invention;
[0081] Figure 16 This is a schematic diagram of determining the next recommendation sequence based on user usage frequency provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0082] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0083] The present invention provides a rule component recommendation method based on Bayesian network and neural network, such as Figure 1 As shown, the following steps are included:
[0084] S1. Historical rule data splitting: Analyze historical rule data and split each piece of historical rule data into historical component sequences, storing them in a component sequence database. Extract the unidirectional connections between components in each historical component sequence to construct a component knowledge graph. Use the SFP Tree frequency analysis algorithm to obtain frequent item sets from the historical sequence components. Then, mine association rules for these frequent item sets and obtain the corresponding confidence levels of the association rules.
[0085] S2. Bayesian network construction:
[0086] S21. Dynamically select relevant components and unidirectional connections between components from the component knowledge graph based on the context information of the component to be recommended, to form a directed acyclic graph as a Bayesian subnetwork;
[0087] S22. Based on the relationships between nodes in the Bayesian subnetwork, obtain each child node with a parent node, and obtain a conditional probability table for each child node. A Noisy-OR model is used based on the confidence of the association rule obtained in S1 to obtain a conditional probability table for each child node. A Bayesian network is constructed based on the conditional probability table and the Bayesian subnetwork.
[0088] S23. Calculate the recommendation probability of the component to be recommended based on the Bayesian formula and the conditional probability table, and push it according to the size of the recommendation probability;
[0089] S3. Neural Network Training and Construction: Expand the training dataset through data augmentation and use a recurrent neural network based on LSTM units as the overall framework;
[0090] S4. Fusion of recommendation results: Bayesian network algorithm and neural network algorithm are used to obtain recommendation results respectively, and the recommendation results of Bayesian network and neural network are fused based on the frequency of recommendation algorithms corresponding to the recommendation results adopted by users.
[0091] It should be noted that:
[0092] In this embodiment, in S23 , the recommendations are sorted in descending order according to their recommendation probabilities and then pushed.
[0093] In order to further implement the above technical solutions, the specific contents of S1 include:
[0094] S11. By using a parser to parse the historical rule data in the form of an XML file into an abstract syntax tree;
[0095] S12. truncate the abstract syntax tree at the process control node and extract the historical component sequence;
[0096] S13. Save the obtained historical component sequence in the component sequence database in the form of a component ID list.
[0097] It should be noted that:
[0098] Historical behavioral rule data contains valuable information about the relationships between components. Currently, the vast majority of established behavioral rules are underutilized. Therefore, to implement component recommendation functionality based on historical big data, this paper first conducts a detailed analysis of the behavioral rule data.
[0099] Behavioral rule data is stored in the system as XML files. Its structure is a tree consisting of multiple nested nodes, including start and end nodes, components representing various actions, and flow control components (if, while, and do). This paper uses an XML parser to parse the XML file into an operational object called an abstract syntax tree. This object is then truncated at the flow control nodes to extract a sequence of behavioral rule components of appropriate length. These component sequences are stored in a database as lists of component IDs, forming a component knowledge graph composed of component associations. The mined historical big data, namely component sequence data, prepares the ground for constructing the SFP Tree for component frequency analysis.
[0100] The following example illustrates how to mine component sequences from behavioral rules. Represents a component, represents the i-th component, for example Represents the component with ID 1. Then the flow chart behavior rule is as follows Figure 2 As shown in , it consists of components, judgment nodes, and loop nodes. Starting from the start node, analyze one by one, stop when encountering a control node, and build a component sequence; then continue from the control node to build the next component sequence. Sequence, due to encounter Judge the node, so the sequence is built. The two branches of construct new sequences respectively. And so on, until the end node position, the component sequence construction is completed. The component sequence after splitting is as follows Figure 2 As shown, there are 8 component sequences in total.
[0101] To further implement the above technical solution, the specific content of obtaining the component knowledge graph includes:
[0102] Taking the component as the entity E in the component knowledge graph and the unidirectional connection relationship between components as the relationship R, the component relationships are extracted in sequence from the historical component sequence mined from S1 to form the component knowledge graph.
[0103] It should be noted that:
[0104] The mined component sequence is prepared for component sequence frequency analysis. In this paper, the component sequence is called transaction For example, a component sequence is a transaction , ; All sequences constitute a transaction set and are stored in the transaction database D.
[0105] Based on the component sequence obtained after mining the historical big data of behavioral rules, the knowledge graph of components can be constructed by extracting the one-way connection relationship between components. Components are entities in the knowledge graph. , the unidirectional connection relationship between components is . Relation triples is a simple relationship such as Figure 3 As shown;
[0106] From the mined component sequence, component relationships are extracted in sequence and a knowledge graph is constructed as follows: Figure 4 shown.
[0107] In this embodiment, a part of the component knowledge graph extracted from the rule set, such as Figure 5 As shown in the figure, if the entire component knowledge graph is used to construct a Bayesian network, the network structure will be very large, and the conditional probability calculation formula will become very complicated and time-consuming. Therefore, to solve this problem, the present invention adopts the method of dynamically extracting the relevant components from the component knowledge graph according to the context information of the recommended component when recommending to construct a Bayesian sub-network, such as Figure 6 shown.
[0108] After extracting the relevant components, a directed acyclic graph as shown below is constructed as a Bayesian network subgraph, such as Figure 7 shown.
[0109] To further implement the above technical solution, we use the frequency analysis algorithm SFP Tree to obtain frequent item sets from historical sequence components, mine association rules for frequent item sets, and obtain the corresponding confidence of the association rules. The specific contents include:
[0110] (1) Initialize the component sequence database, in which the historical component sequence is formatted as an ID list, where a historical component sequence is recorded as a transaction , where I is Any component in , denoted as item, initializes the minimum confidence and minimum support;
[0111] (2) Generate the header table: traverse the component sequence database, obtain the number of occurrences of each component, and obtain the support of each component. Delete the infrequent items and retain the frequent items based on the minimum support, obtain the header chain of each frequent item component, and construct the generated header table.
[0112] (3) Generate SFP Tree and create the header chain of the header table: traverse the component sequence database again, add the frequent items retained in each transaction to the SFP-Tree according to the sequence relationship in the current transaction, the root node is null, the first sequence is directly hung on the root of the tree, and the count of each node is 1; then hang the next sequence, if the same node is found in the tree, start hanging from the same node, and add 1 to the count of the corresponding node until all sequences are mounted;
[0113] (4) Associate the lowest node with other identical nodes in the tree, and finally associate all nodes with the header chain of the header table to obtain the final SFP-Tree;
[0114] (5) Traverse the SFP Tree to generate conditional pattern base, candidate item set, and frequent item set:
[0115] Starting from the last item in the item header table, the conditional pattern base of each item is obtained in sequence, that is, the set of paths containing the item. Then, the conditional pattern base is traversed to obtain the sequence items, and the following judgments are made during the process:
[0116] ① If the candidate item set contains the same item as the current sequence item, proceed to the next step. If not, add a new object to the set to save the item set composed of the sequence item and the support of the current sequence;
[0117] ② If there is a candidate item set containing the same item, add the support count of the item set to the support count of the current sequence item, and then further determine whether there is a sequence consistent with the sequence item in the current candidate item set. If so, add the support count of the item to the support count of the current sequence item; if not, add a new item and save the current sequence item and its support count;
[0118] ③ Delete the candidate item set. If the support count of the candidate item set is greater than or equal to the minimum support, it will be retained;
[0119] (6) Mining association rules for frequent item sets and obtaining the corresponding confidence of the association rules; the confidence calculation method of the association rules is:
[0120] ;
[0121] Where, Represents an item or item set, which is an ordered sequence; express Sequence support count of ; represents frequent items, express Before When it appears Support count of ; express and Appear at the same time, and Before The confidence level of occurrence, i.e. probability.
[0122] It should be noted that:
[0123] SFP Tree effectively reduces the number of transactions by converting the transaction set into a tree structure, where each node represents an item (component); each path represents a transaction (a component sequence). The number of operations is reduced to improve the efficiency of the algorithm. By traversing and analyzing the SFP Tree, frequent item sets and their corresponding confidence levels are efficiently mined from the sequence set (transaction set) to construct the conditional probability table.
[0124] In this embodiment, the component sequence database is initialized in step (1), as shown in Table 1:
[0125] Table 1 Initialize transaction database
[0126] ;
[0127] In step (3), the items whose support count in each transaction is greater than the minimum support are added to the SFP-Tree strictly according to the sequence relationship in the current transaction. Figure 8 After constructing the SFP Tree, associate the lowest node with the same nodes in the tree, and finally associate all nodes with the header chain of the header table to complete the construction of the header chain and create the header table. The header table is as follows: Figure 9 shown.
[0128] Before mining association rules, it is necessary to prune the candidate item set, retaining only frequent items for association rule mining; then, the confidence degree is calculated using the confidence degree formula based on different sequences in the frequent item set to obtain the association rules. The following principles should be followed when mining association rules:
[0129] ① The mined frequent item sets are stored in the form of objects, including frequent items, support counts, sequence patterns between frequent items and corresponding support counts. Therefore, when obtaining association rules, all frequent items with a length greater than 1 should be traversed to obtain all the sequence patterns therein, and then the confidence between each sequence should be calculated using confidence formula 1.
[0130] ② Since the rule construction process is step-by-step, with one link added each time, the present invention does not consider association rules in the form of "1 to 1", "many to 1", "1 to many", and "many to many" when mining association rules.
[0131] ③ Since the association rules mined by this algorithm are based on the sequence pattern of the training transaction set, the preceding and following items of the rule follow the order in which the items appear in the transaction set, that is, the sequential relationship between the components. This algorithm considers that the probability of a sequence that does not appear in the training transaction set is extremely low, that is, there is no corresponding component sequence, and such a sequence will not be mined.
[0132] In order to further implement the above technical solution, the specific method of using the Noisy-OR model to obtain the conditional probability table of each child node is as follows:
[0133] Let any child node be , its parent node set is recorded as , and set The parent node There are no dependencies between:
[0134] ;
[0135] ;
[0136] Where, refer to The nth parent node of Represents the node set with state 1 in the parent node set. If the current node does not appear, its node state is recorded as 0, and if it appears, it is recorded as 1. ; is the prior probability, which is approximated by the statistical marginal probability; the marginal probability is the ratio of the support count to the total number of transaction sets, then:
[0137] ;
[0138] According to the confidence of the association rule in the current Bayesian subgraph, the probability that the state of its child node is 1 when the state of any parent node is 1 as the preceding item is obtained, which is recorded as ,according to The probability calculated by the Noisy-OR model is used to obtain the corresponding conditional probability under each node state, and the conditional probability table is obtained.
[0139] It should be noted that:
[0140] Because the computation of the conditional probability table (see the next section) in a Bayesian network grows exponentially as the number of nodes increases, it is necessary to employ some assumptions to reasonably simplify the Bayesian network. This paper employs the Noisy-OR model, which is described in detail below.
[0141] For a node , its parent node If there is an association relationship between parent nodes, then The calculation of will be very complicated. Among them, the permutations and combinations of parent node states "0" and "1" are As the number of parent nodes increases, the number of conditional probability table calculations will increase exponentially.
[0142] In order to simplify the calculation, the Noisy-OR model is introduced. The basic conditions of the Noisy-OR model are: The parent node of There is no dependency between Figure 10 shown.
[0143] Then we can get the following relational expression:
[0144] ;
[0145] The same logic applies , as follows:
[0146] ;
[0147] in , refer to No. parent nodes.
[0148] Refers to the parent node set The set of nodes whose status is "1".
[0149] For example:
[0150] ;
[0151] And so on.
[0152] However, there is a loophole in the formula. When the current parent node status is "0", the child node will not appear, so it will be set to 0 by default, that is:
[0153] ;
[0154] However, in reality, when all parent nodes have not occurred, the node may still appear, and it is not constrained by the parent nodes. This probability is called leakage probability. Therefore, we introduce the prior probability:
[0155] ;
[0156] ;
[0157] Using the Noisy-OR model for parameter learning, we can get The probability table for each node is constructed, and prior probabilities are introduced to further improve the conditional probability table (CPT). This solves the problem of large parameter requirements during parameter learning when parent nodes have conditional independence. The number of parameters is reduced from exponential growth to linear growth, significantly reducing parameter dependency. The association rules mined by SFP Growth can be better combined with Bayesian networks to construct a Bayesian network model based on the Noisy-OR model for component recommendation model construction and reasoning.
[0158] The conditional probability table is the basis for the Bayesian network to calculate the probability of the recommended component. It is known that the confidence of the association rules obtained by the data mining SFP Tree algorithm is This confidence level represents the conditional probability of some relevant edges in the current Bayesian network subgraph; its meaning is When it appears as the preceding item, The probability of occurrence is ; Equivalent to the conditional probability expressed as follows . Confidence of multiple parent nodes Equivalent to conditional probability .
[0159] like Figure 7 The Bayesian network shown in the figure analyzes the relationship between the nodes in the graph and finds the confidence of the association rules, which can produce the following results:
[0160] ;
[0161] The edge probability of each node is derived from the statistical probability of each item, that is, the ratio of the support count to the total number of transactions.
[0162] ;
[0163] However, some numerical calculations in the conditional probability table are difficult, so the Noisy-OR model is needed to simplify the calculations. The Bayesian network based on the Noisy_OR model (hereinafter referred to as Noisy-OR_BN) follows the following relationship: The parent node is ; The parent node is ; The parent node is ; The parent node is ; The parent node is The corresponding conditional probabilities are 、 、 、 、 There are five conditional probability tables required. The specific value of each conditional probability can be obtained according to the Noisy-OR model, as shown in Table 2-6 below:
[0164] Table 2 :
[0165] ;
[0166] Table 3 :
[0167] ;
[0168] Table 4 :
[0169] ;
[0170] Table 5 :
[0171] ;
[0172] Table 6 :
[0173] ;
[0174] This embodiment provides a probabilistic process for finding the recommended component during downward reasoning. The node status has only two options: "0" and "1", and "0" indicates that the node does not appear, while "1" indicates that it appears. The inner shadow represents the node status of "1", and the no shadow represents the status of "0". The bottom shadow represents the node status of "pending", and the outer shadow represents the status of "pending". Figure 11 shown.
[0175] According to the Bayesian formula, we can get and The probability value of is calculated as follows:
[0176] ;
[0177] After checking the table, we can get Value:
[0178] ;
[0179] The expansion of is as follows:
[0180] ;
[0181] After checking the table, we can get Value:
[0182] ;
[0183] Finally, the two values are compared and sorted by probability before being recommended to the user.
[0184] To further implement the above technical solutions, the specific contents of S3 include:
[0185] S31. Constructing a training data format: The position of the component to be recommended is marked by a MASK, and the context information of the component to be recommended is inserted before and after the MASK mark to form a training component sequence as training data;
[0186] S32. Split the component sequence obtained through rule-based historical big data mining into subsequences, add a MASK marker to each position of each subsequence, obtain the input data of the training data corresponding to each subsequence according to the training data format, and annotate the input data with a label;
[0187] S33. Input the input data and corresponding labels into the neural network model for training to obtain a trained RNN model.
[0188] It should be noted that:
[0189] The LSTM-based RNN neural network used in this paper is a deep learning neural network that requires a large amount of labeled data to train the model before it can perform optimal inference. Therefore, an important step in this method is the definition and acquisition of training data.
[0190] The following formula is used as an example to construct the training data format:
[0191] ;
[0192] In the above formula, the input data from the training data is on the left side of the arrow. The component sequence is ordered from left to right. The mask in the middle position is a special placeholder that identifies the position of the component to be recommended. I1, I2, I3, and I4 refer to component context information. I1 and I2 are upstream of the mask and therefore belong to the upstream components, while I3 and I4 are downstream of the mask and therefore belong to the downstream components. Each component is identified by a component ID. In summary, the input data from the training data is on the right side of the arrow in the above formula. The label data, i.e., the recommended component at the input data mask, is on the right side of the arrow.
[0193] In order to further implement the above technical solution, the specific contents of S32 include:
[0194] Split a component sequence into multiple subsequences, where a subsequence is composed of any two or more components in the component sequence;
[0195] The number of subsequences is as follows:
[0196] ;
[0197] Where, is the number of components in the sequence, is the number of subsequences, <8.
[0198] It should be noted that:
[0199] The following example illustrates the process of splitting subsequences:
[0200] The process of splitting a component sequence I1 → I2 → I3 → I4 into multiple subsequences is as follows: the splitting is performed according to the order. Note that since a single component does not constitute a sequence, this invention excludes sequences of single components. After splitting, we obtain three component sequences containing two elements, a two-element component sequence, and the component sequence itself, for a total of six subsequences. Following this scheme, subsequences of any length can be split.
[0201] The number of subsequences will increase with Get bigger and bigger, here the present invention cuts off to =8 to ensure computational efficiency. The subsequence splitting results are as follows: Figure 12 shown.
[0202] After obtaining the subsequence, you only need to add a mask to each position of the subsequence to obtain the input data of the training data. The components masked by the mask are the label data, and a complete training data can be obtained. Figure 13 The subsequence with sequence number 5 is I1→I2→I3.
[0203] A mask layer can be added at each position to form the following multiple training data, such as Figure 14 shown.
[0204] In order to further implement the above technical solution, the neural network model in S33 includes: an embedding layer, an encoding layer, a decoding layer, a fully connected layer, and an output layer;
[0205] The embedding layer is used to convert high-order sparse identifiers into low-dimensional dense vector identifiers, capturing the similarity and structural information between data through dense vector identifiers; it is also used to extract the essential features of the data;
[0206] Both the encoding layer and the decoding layer are RNNs composed of LSTM units;
[0207] The decoding layer is used to: capture long-term dependencies in the input sequence and provide meaningful context for subsequent decoding or classification tasks; selectively retain and update information; generate a context vector, which stores key information of the entire input sequence and serves as the input state or direct input of the subsequent decoder; process edge length input and accept input sequences of arbitrary length;
[0208] The decoding layer is used to generate the next element in the target sequence by recursively processing each time step: at each time step, the decoder first receives the target sequence element generated in the previous time step, combines the current context vector and the probability distribution of the next target sequence element predicted by the fully connected layer output, and updates the internal state, including the hidden state and cell state, to prepare for the next time step;
[0209] The output layer uses the softmax operation to take the components with probabilities greater than the preset probability threshold as outputs, and outputs them through the output layer to give the recommendation results.
[0210] It should be noted that:
[0211] The main function of the embedding layer is to convert high-order sparse representations (such as one-hot encoding) into low-dimensional dense vector representations. These vectors can capture the similarity and structural information between data. Moreover, the embedding layer can extract the essential characteristics of the data, so it can help the model better generalize to unseen data. For example, when recommending a component sequence that has never appeared before to the user, the model can also make reasonable predictions based on the known information.
[0212] The encoding layer consists of an RNN composed of LSTM units. Its main functions are: 1. Capturing long-term dependencies in the input sequence and providing meaningful context for subsequent decoding or classification tasks. 2. Selectively retaining and updating information: The LSTM's forget gate determines which information should be discarded, while the input gate controls the addition of new information. This mechanism allows the LSTM unit to dynamically adjust its internal state, known as the cell state, based on the current input. This enables the LSTM to selectively retain important information and continuously update its memory as new data arrives. 3. Generating context: The LSTM encoding layer is responsible for converting the input sequence into a fixed-length vector, often called a "context vector" or "thought vector." This vector stores key information about the entire input sequence and serves as the input state or direct input for the subsequent decoder. 4. Handling input lengths: Because LSTM is a form of recurrent neural network, it can accept input sequences of arbitrary length. This is particularly advantageous for processing data structures with long edges. The LSTM encoding layer processes each element of the input sequence one by one, gradually building an understanding of the entire sequence.
[0213] The decoding layer is also an LSTM-based RNN that generates the next element in the target sequence by recursively processing each time step. At each time step, the decoder first receives the target sequence element generated by the previous time step (for the first time step, usually a special symbol <sos>), then it will combine the current context vector to output the predicted probability distribution of the next target sequence element (here the fully connected layer is used, and the fully connected layer is the dictionary table of components), and finally update the internal state (hidden state and cell state) to prepare for the next time step. Finally, the softmax operation is used to output the components with probabilities greater than the preset probability threshold, and output them through the output layer to give the recommended components. The results of the neural network are as follows Figure 15 shown.
[0214] The recommendation list based on the neural network is the output of the fully connected layer. softmax After processing and converting into probability, the output probability value is ranked first N Components are recommended. The input is {i1,i2,i3,i4,MASK}, which is fed into the neural network to infer the possible components at the MASK. The final inference results are sorted by probability into {i1,i2,i3,i4,i5}.
[0215] In order to further implement the above technical solutions, the specific contents of S4 include:
[0216] S41. Obtain user recommendation requirements and obtain recommendation results using the Bayesian network recommendation algorithm and the neural network recommendation algorithm respectively;
[0217] S42. Collect the frequency of the recommendation algorithms corresponding to the recommendation results adopted by the user, obtain the weights between the Bayesian network recommendation algorithm and the neural network recommendation algorithm and the total number of components of all recommendation results based on the frequency, and adjust the number of recommendation results of the recommendation algorithm based on the weights.
[0218] Preferably, the specific content of S42 includes:
[0219] If the total number of components of all recommended results is , the results recommended by the Bayesian network recommendation algorithm are adopted with a frequency of , the results recommended by the neural network are adopted with a frequency of ,but:
[0220] ;
[0221] ;
[0222] in, Indicates the maximum number of recommended components of the Bayesian network recommendation algorithm; Indicates the maximum number of recommended components of the adjusted neural network recommendation algorithm.
[0223] It should be noted that:
[0224] Although the mechanisms of Bayesian networks and neural networks are different, their output forms are the same: a list of recommended components and the corresponding probability of each component. For a class of indicators with the same attributes, the present invention can consider using a weighted approach to fuse the two. However, weighted methods require expert knowledge to adjust the weights and manual intervention to modify the weight parameters, which sacrifices simplicity. Therefore, the present invention needs to consider additional fusion methods and technologies that are more in line with user habits and simpler.
[0225] This invention implicitly collects user decision information to determine the weights of the two recommendation algorithms. This user decision information refers to the algorithm used each time a user uses the recommendation function. As users continue to use the function, the usage frequency of each algorithm is counted. Based on this usage frequency, the weights are updated for subsequent recommendations. This automated, dynamic recommendation method provides more accurate recommendations based on user habits.
[0226] like Figure 16 As shown in the figure, the gradient horizontal bars represent the usage frequency of the corresponding algorithms, and the rightmost bar represents the number of recommended component sequences. In the figure above, the Bayesian network recommendation results are used more frequently, so it recommends more component sequences; while the neural network recommendation results are used less frequently, so it recommends a smaller list of components.
[0227] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present application, and should all be included in the scope of protection of the present application.< / sos>
Claims
1. A rule component recommendation method based on Bayesian network and neural network, characterized in that: The following steps are involved: S1. Historical rule data splitting: Analyze historical rule data and split each piece of historical rule data into historical component sequences, storing them in a component sequence database. Extract the unidirectional connections between components in each historical component sequence to construct a component knowledge graph. Use the SFP Tree frequency analysis algorithm to obtain frequent item sets from the historical sequence components. Then, mine association rules for these frequent item sets and obtain the corresponding confidence levels of the association rules. S2. Bayesian network construction: S21. Dynamically select relevant components and unidirectional connections between components from the component knowledge graph based on the context information of the component to be recommended, to form a directed acyclic graph as a Bayesian subnetwork; S22. Based on the relationships between nodes in the Bayesian subnetwork, obtain each child node with a parent node, and obtain a conditional probability table for each child node. The conditional probability table for each child node is obtained using the Noisy-OR model based on the confidence level of the association rule obtained in S1. A Bayesian network is constructed based on the conditional probability table and the Bayesian subnetwork. The specific method for obtaining the conditional probability table for each child node using the Noisy-OR model is as follows: Let any child node be , its parent node set is recorded as , and set The parent node of There are no dependencies between: ; ; Where, refer to The nth parent node of Represents the node set with state 1 in the parent node set. If the current node does not appear, its node state is recorded as 0, and if it appears, it is recorded as 1. ; is the prior probability, which is approximated by the statistical marginal probability; the marginal probability is the ratio of the support count to the total number of transaction sets, then: ; According to the confidence of the association rule in the current Bayesian subgraph, the probability that the state of its child node is 1 when the state of any parent node is 1 as the preceding item is obtained, which is recorded as ,according to The probability calculated by the Noisy-OR model is used to obtain the corresponding conditional probability of each node state, and the conditional probability table is obtained; S23. Calculate the recommendation probability of the component to be recommended based on the Bayesian formula and the conditional probability table, and push it according to the size of the recommendation probability; S3. Neural Network Training and Construction: Expand the training dataset through data augmentation and use a recurrent neural network based on LSTM units as the overall framework; S4. Fusion of recommendation results: Bayesian network algorithm and neural network algorithm are used to obtain recommendation results respectively, and the recommendation results of Bayesian network and neural network are fused based on the frequency of recommendation algorithms corresponding to the recommendation results adopted by users.
2. The rule component recommendation method based on Bayesian network and neural network according to claim 1, characterized in that: The specific contents of S1 include: S11. By using a parser to parse the historical rule data in the form of an XML file into an abstract syntax tree; S12. truncate the abstract syntax tree at the process control node and extract the historical component sequence; S13. Save the obtained historical component sequence in the component sequence database in the form of a component ID list.
3. The rule component recommendation method based on Bayesian network and neural network according to claim 1, characterized in that: The specific contents of obtaining the component knowledge graph include: Taking the component as the entity E in the component knowledge graph and the unidirectional connection relationship between components as the relationship R, the component relationships are extracted in sequence from the historical component sequence mined from S1 to form the component knowledge graph.
4. The rule component recommendation method based on Bayesian network and neural network according to claim 1, characterized in that: Use the frequency analysis algorithm SFP Tree to obtain frequent item sets from historical sequence components, mine association rules for frequent item sets, and obtain the corresponding confidence of the association rules. The specific contents include: (1) Initialize the component sequence database, in which the historical component sequence is formatted as an ID list, where a historical component sequence is recorded as a transaction , where I is Any component in , denoted as item, initializes the minimum confidence and minimum support; (2) Generate the header table: traverse the component sequence database, obtain the number of occurrences of each component, and obtain the support of each component. Delete the infrequent items and retain the frequent items based on the minimum support, obtain the header chain of each frequent item component, and construct the generated header table. (3) Generate SFP Tree and create the header chain of the header table: traverse the component sequence database again, add the frequent items retained in each transaction to the SFP-Tree according to the sequence relationship in the current transaction, the root node is null, the first sequence is directly hung on the root of the tree, and the count of each node is 1; then hang the next sequence, if the same node is found in the tree, start hanging from the same node, and add 1 to the count of the corresponding node until all sequences are mounted; (4) Associate the lowest node with other identical nodes in the tree, and finally associate all nodes with the header chain of the header table to obtain the final SFP-Tree; (5) Traverse the SFP Tree to generate conditional pattern base, candidate item set, and frequent item set: Starting from the last item in the item header table, the conditional pattern base of each item is obtained in sequence, that is, the set of paths containing the item. Then, the conditional pattern base is traversed to obtain the sequence items, and the following judgments are made during the process: ① If the candidate item set contains the same item as the current sequence item, proceed to the next step. If not, add a new object to the set to save the item set composed of the sequence item and the support of the current sequence; ② If there is a candidate item set containing the same item, add the support count of the item set to the support count of the current sequence item, and then further determine whether there is a sequence consistent with the sequence item in the current candidate item set. If so, add the support count of the item to the support count of the current sequence item; if not, add a new item and save the current sequence item and its support count; ③ Delete the candidate item set. If the support count of the candidate item set is greater than or equal to the minimum support, it will be retained; (6) Mining association rules for frequent item sets and obtaining the corresponding confidence of the association rules; the confidence calculation method of the association rules is: ; Where, Represents an item or item set, which is an ordered sequence; express Sequence support count of ; represents frequent items, express Before When it appears Support count of ; express and Appear at the same time, and Before The confidence level of occurrence, i.e. probability.
5. The rule component recommendation method based on Bayesian network and neural network according to claim 1, characterized in that: The specific contents of S3 include: S31. Constructing a training data format: The position of the component to be recommended is marked by a MASK, and the context information of the component to be recommended is inserted before and after the MASK mark to form a training component sequence as training data; S32. Split the component sequence obtained through rule-based historical big data mining into subsequences, add a MASK marker to each position of each subsequence, obtain the input data of the training data corresponding to each subsequence according to the training data format, and annotate the input data with a label; S33. Input the input data and corresponding labels into the neural network model for training to obtain a trained RNN model.
6. The rule component recommendation method based on Bayesian network and neural network according to claim 5, characterized in that: The specific contents of S32 include: Split a component sequence into multiple subsequences, where a subsequence is composed of any two or more components in the component sequence; The number of subsequences is as follows: ; Where, is the number of components in the sequence, is the number of subsequences.
7. The rule component recommendation method based on Bayesian network and neural network according to claim 1, characterized in that: The neural network model in S33 includes: embedding layer, encoding layer, decoding layer, fully connected layer and output layer; The embedding layer is used to convert high-order sparse identifiers into low-dimensional dense vector identifiers, capturing the similarity and structural information between data through dense vector identifiers; it is also used to extract the essential features of the data; Both the encoding layer and the decoding layer are RNNs composed of LSTM units; The decoding layer is used to: capture long-term dependencies in the input sequence and provide meaningful context for subsequent decoding or classification tasks; selectively retain and update information; generate a context vector, which stores key information of the entire input sequence and serves as the input state or direct input of the subsequent decoder; process edge length input and accept input sequences of arbitrary length; The decoding layer generates the next element in the target sequence by recursively processing each time step: at each time step, the decoder first receives the target sequence element generated in the previous time step, combines the current context vector and the probability distribution of the next target sequence element predicted by the fully connected layer output, and updates the internal state, including the hidden state and cell state, to prepare for the next time step; The output layer uses the softmax operation to take the components with probabilities greater than the preset probability threshold as outputs, and outputs them through the output layer to give the recommendation results.
8. The rule component recommendation method based on Bayesian network and neural network according to claim 1, characterized in that: The specific contents of S4 include: S41. Obtain user recommendation requirements and obtain recommendation results using the Bayesian network recommendation algorithm and the neural network recommendation algorithm respectively; S42. Collect the frequency of the recommendation algorithms corresponding to the recommendation results adopted by the user, obtain the weights between the Bayesian network recommendation algorithm and the neural network recommendation algorithm and the total number of components of all recommendation results based on the frequency, and adjust the number of recommendation results of the recommendation algorithm based on the weights.
9. The rule component recommendation method based on Bayesian network and neural network according to claim 1, characterized in that: The specific contents of S42 include: If the total number of components of all recommended results is , the results recommended by the Bayesian network recommendation algorithm are adopted with a frequency of , the results recommended by the neural network are adopted with a frequency of ,but: ; in, Indicates the maximum number of recommended components of the Bayesian network recommendation algorithm; Indicates the maximum number of recommended components of the adjusted neural network recommendation algorithm.
Citation Information
Patent Citations
Recommendation technology based on correlation rules and Bayesian network integration
CN107103000A
Knowledge graph reasoning systems using self-supervised reinforcement learning and methods thereof
US20240249154A1