Method, system, medium and device for synthesizing abnormal RPA workflow data
Through the combined graph neural network of structural VAE and temporal VAE, new samples fitted with the original RPA workflow data structure and time distribution are generated, solving the problem of ignoring structural information in the existing technology and improving the performance of the anomaly detection model.
Patent Information
- Application Number
- CN202410986144.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-23
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2044-07-23
AI Technical Summary
The existing RPA workflow data enhancement technology ignores the structural information of the workflow, resulting in the new data generated cannot accurately outline the characteristic information and patterns of the RPA workflow, and cannot effectively improve the performance of the abnormality detection model.
Using structural VAE and time VAE combined with graph neural network, by obtaining the execution trajectory and node information of the abnormal RPA workflow, it is converted into RPA graph data, and the structural features and time feature matrix are obtained to generate the same time distribution fit as the original data structure. New sample.
The generated synthetic anomaly RPA workflow data can learn data distribution and patterns more comprehensively, improve the performance of downstream anomaly detection models, and enhance the ability to identify abnormal data.
Smart Images

Figure CN118521275B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of software engineering, and more specifically, to a method, system, medium and device for synthesizing abnormal RPA workflow data. Background Art
[0002] Robotic Process Automation (PA) is a modern digital tool and technology designed to automate and simplify routine business processes and tasks, reducing the need for human intervention. RPA systems use virtual software robots to mimic human actions such as mouse clicks, keyboard input, and data processing on computers to perform various tasks such as data entry, document processing, information extraction, etc. RPA is a powerful technology that can be used to automate tasks, improve efficiency, reduce costs, and increase accuracy, allowing employees to focus more on creative and strategic work.
[0003] When executing automated tasks, the RPA system generates a large number of workflow paths, recording various execution paths and events for auditing, debugging, and performance analysis when necessary. Combined with deep learning technology, these workflow data can be used for anomaly detection in the RPA system. Unsupervised anomaly detection lacks knowledge of abnormal data, and its performance and accuracy are not guaranteed; while supervised anomaly detection lacks high-quality annotated data sets. The reasons are: on the one hand, manually analyzing and annotating the collected data not only has high labor costs, but is also prone to annotation errors; on the other hand, RPA system anomalies are relatively rare, and normal data accounts for a large proportion. The ratio of normal samples to abnormal samples in the data set is seriously unbalanced, which is not conducive to the training of anomaly detection models.
[0004] Therefore, it is very important to synthesize abnormal RPA workflow data. It helps the performance of RPA system anomaly detection tasks by synthesizing reconstructed abnormal RPA workflow data with the same nodes and paths as the original abnormal RPA workflow and the node execution time distribution fitting the original data distribution. However, the existing data enhancement technology only considers the execution time value and ignores the structural information of the RPA workflow. The generated new data not only cannot accurately outline the characteristic information of the RPA workflow for the downstream anomaly detection task, but also does not fully learn the data distribution and pattern, and loses structural information such as topological order, which is quite different from the original data and does not help the downstream anomaly detection task. Summary of the invention
[0005] The purpose of the present invention is to provide a method, system, medium and device for synthesizing abnormal RPA workflow data, which can generate new samples with the same structure as the original abnormal RPA workflow data and fit the original data distribution in time, thereby improving the performance of the downstream anomaly detection model.
[0006] The present invention provides a method for synthesizing abnormal RPA workflow data, comprising the following steps: S1: acquiring an execution trajectory of an abnormal RPA workflow and execution information of each node on the trajectory, and obtaining abnormal RPA workflow data according to the execution trajectory of the abnormal RPA workflow and the execution information of each node on the trajectory; S2: converting the abnormal RPA workflow data into RPA graph data, and obtaining an adjacency matrix and a structural feature matrix according to the RPA graph data; using a structural VAE encoder to obtain a structural feature expression; S3: using a temporal VAE according to the RPA graph data, the structural feature expression and the adjacency matrix, to obtain synthesized abnormal RPA workflow data.
[0007] Furthermore, step S1 of the above-mentioned method for synthesizing abnormal RPA workflow data includes the following steps: S11: obtaining the logs of all task nodes of the RPA system, obtaining the logs of the abnormal RPA workflow based on the logs of all task nodes, obtaining the task nodes and execution time of the abnormal RPA workflow based on the logs of the abnormal RPA workflow, and obtaining the execution trajectory of the abnormal RPA workflow and the execution information of each node on the trajectory based on the task nodes and execution time of the abnormal RPA workflow; the execution information includes the status and response code of each node; S12: uniformly parsing and organizing the execution trajectory of the abnormal RPA workflow and the execution information of each node on the trajectory to obtain abnormal RPA workflow data; the abnormal RPA workflow data includes node information, parent node information and execution time.
[0008] Furthermore, step S2 of the above-mentioned method for synthesizing abnormal RPA workflow data includes the following steps: S21: converting the abnormal RPA workflow data into RPA graph data, and obtaining an adjacency matrix and a structural feature matrix based on the RPA graph data; S22: obtaining a structural VAE encoder and a structural VAE decoder, the structural VAE encoder including a graph neural network and a pooling layer, and the structural VAE decoder including a graph neural network, a fully connected layer and an inner product; using the adjacency matrix, the structural feature matrix and the structural VAE decoder, the structural VAE encoder is trained to obtain a trained structural VAE encoder; S23: according to the adjacency matrix and the structural feature matrix, using the trained structural VAE encoder, a structural feature expression is obtained.
[0009] Furthermore, step S3 of the method for synthesizing abnormal RPA workflow data includes the following steps: S31: obtaining a request time feature matrix according to the RPA graph data; S32: constructing a loss function, such as the formula:
[0010]
[0011]
[0012]
[0013]
[0014] Where L is the loss function; It is the negative value ratio of the reconstructed data, controls the negative value ratio, and constrains the generated negative values; is the reconstruction loss; ELBO is the variational lower bound; x is the original input data, is the generated reconstructed data, represent The proportion of negative values in the equation; α and β are both parameters. α and β are set to a specific value so that a smaller penalty is given when the negative value ratio is 0 or very small, and a larger penalty is given when it is greater than 0; For a given hour The expected value of It represents the posterior distribution of z produced by the encoder, The decoder generates The distribution of is the KL divergence, which measures the difference between two probability distributions; Φ and θ are model parameters, z represents the latent space variable, and p(z) is the prior distribution of z;
[0015] S33: Train the temporal VAE using the loss function, the structural feature expression, the request time feature matrix and the adjacency matrix to obtain a trained temporal VAE; the temporal VAE includes a temporal VAE encoder and a temporal VAE decoder, the temporal VAE encoder includes a graph neural network and a pooling layer, and the temporal VAE decoder includes a graph neural network and a scheduling layer;
[0016] S34: According to the adjacency matrix and the request time feature matrix, the time VAE encoder of the trained time VAE is used to obtain the time feature expression; the structural feature expression is embedded into the time feature expression, and the trained time VAE is used to obtain the synthetic abnormal RPA workflow data.
[0017] The present invention also provides a system, comprising the following modules:
[0018] The data acquisition module is configured to: obtain the execution trajectory of the abnormal RPA workflow and the execution information of each node on the trajectory, and obtain the abnormal RPA workflow data based on the execution trajectory of the abnormal RPA workflow and the execution information of each node on the trajectory; the structural feature module is configured to: convert the abnormal RPA workflow data into RPA graph data, and obtain the adjacency matrix and the structural feature matrix based on the RPA graph data; use the structural VAE encoder to obtain the structural feature expression; the data reconstruction module is configured to: use the time VAE based on the RPA graph data, the structural feature expression and the adjacency matrix to obtain the synthetic abnormal RPA workflow data.
[0019] Furthermore, the data acquisition module of the above system is specifically configured as follows: obtaining the logs of all task nodes of the RPA system, obtaining the logs of the abnormal RPA workflow based on the logs of all task nodes, obtaining the task nodes and execution time of the abnormal RPA workflow based on the logs of the abnormal RPA workflow, and obtaining the execution trajectory of the abnormal RPA workflow and the execution information of each node on the trajectory based on the task nodes and execution time of the abnormal RPA workflow; the execution information includes the status and response code of each node; the execution trajectory of the abnormal RPA workflow and the execution information of each node on the trajectory are uniformly parsed and sorted to obtain the abnormal RPA workflow data; the abnormal RPA workflow data includes node information, parent node information and execution time.
[0020] Furthermore, the structural feature module of the above system is specifically configured as follows: converting abnormal RPA workflow data into RPA graph data, and obtaining an adjacency matrix and a structural feature matrix based on the RPA graph data; obtaining a structural VAE encoder and a structural VAE decoder, the structural VAE encoder including a graph neural network and a pooling layer, and the structural VAE decoder including a graph neural network, a fully connected layer and an inner product; using the adjacency matrix, the structural feature matrix and the structural VAE decoder to train the structural VAE encoder to obtain a trained structural VAE encoder; according to the adjacency matrix and the structural feature matrix, using the trained structural VAE encoder, obtain the structural feature expression.
[0021] Furthermore, the data reconstruction module of the above system is specifically configured as follows:
[0022] According to the RPA graph data, the request time feature matrix is obtained; the loss function is constructed, such as the formula:
[0023]
[0024]
[0025]
[0026]
[0027] Where L is the loss function; It is the negative value ratio of the reconstructed data, controls the negative value ratio, and constrains the generated negative values; is the reconstruction loss; ELBO is the variational lower bound; x is the original input data, is the generated reconstructed data, represent The proportion of negative values in the equation; α and β are both parameters. α and β are set to a specific value so that a smaller penalty is given when the negative value ratio is 0 or very small, and a larger penalty is given when it is greater than 0; For a given hour The expected value of It represents the posterior distribution of z produced by the encoder, The decoder generates The distribution of is the KL divergence, which measures the difference between two probability distributions; Φ and θ are model parameters, z represents the latent space variable, and p(z) is the prior distribution of z; the time VAE is trained using the loss function, structural feature expression, request time feature matrix and adjacency matrix to obtain the trained time VAE; the time VAE includes a time VAE encoder and a time VAE decoder, the time VAE encoder includes a graph neural network and a pooling layer, and the time VAE decoder includes a graph neural network and a scheduling layer; according to the adjacency matrix and the request time feature matrix, the time VAE encoder of the trained time VAE is used to obtain the time feature expression; the structural feature expression is embedded in the time feature expression, and the trained time VAE is used to obtain synthetic abnormal RPA workflow data.
[0028] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the above-mentioned method for synthesizing abnormal RPA workflow data when the computer program is executed by a processor.
[0029] The present invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned method for synthesizing abnormal RPA workflow data when executing the program.
[0030] The method, system, medium and device for synthesizing abnormal RPA workflow data provided by the present invention have the following beneficial effects:
[0031] The present invention uses a variational auto encoder (VAE) as the model skeleton, and combines graph neural networks and variational Bayesian methods to learn the overall distribution of abnormal RPA workflows in time and structure. Specifically, the abnormal RPA workflow data is obtained by uniformly parsing and organizing the abnormal RPA workflow trajectory and the status, response code and other information of each node on the trajectory; the data of the abnormal RPA workflow is encoded and message propagated based on the graph neural network to obtain the structural feature expression and request time feature expression at the graph level; based on the obtained structural feature expression, the structural feature information of the workflow graph is learned through the pre-trained structural VAE; the structural feature expression is embedded in the time feature expression, and the request time distribution of each node in the workflow is learned based on the Bayesian network; sampling is performed based on the request time distribution, and after negative value and distribution verification, new samples with the same structure as the original abnormal RPA workflow data and time fitting the original data distribution are generated. Therefore, the method, system, medium and device for synthesizing abnormal RPA workflow data provided by the present invention can generate any amount of data; the generated data conforms to the real logic, that is, there is no negative delay, there is no parent service delay less than the child service, and there is no call that is not in the original data; the training data formed by merging the generated data with the original data can improve the performance of the model using the original data as training data, which is helpful for downstream anomaly detection tasks. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] The present invention will be further described below with reference to the accompanying drawings and embodiments, in which:
[0033] Figure 1 is a flow chart of a method for synthesizing abnormal RPA workflow data provided by the present invention;
[0034] Figure 2 It is a schematic diagram of the framework of the VAE provided by the present invention;
[0035] Figure 3 It is a schematic diagram of the message transmission mechanism of the graph neural network provided by the present invention;
[0036] Figure 4 It is a schematic diagram of the framework of the time VAE provided by the present invention;
[0037] Figure 5 It is a schematic diagram of the performance results of the model method provided by the present invention after 100 rounds of training on three data sets;
[0038] Figure 6 It is a structural block diagram of the computer device provided by the present invention. DETAILED DESCRIPTION
[0039] In order to have a clearer understanding of the technical features, purposes and effects of the present invention, specific embodiments of the present invention are now described in detail with reference to the accompanying drawings.
[0040] Figure 1 A schematic diagram of synthesizing abnormal RPA workflow data in this embodiment is shown. In this embodiment, the method for synthesizing abnormal RPA workflow data includes the following steps:
[0041] S1: Obtain the execution track of the abnormal RPA workflow and the execution information of each node on the track, and obtain the abnormal RPA workflow data according to the execution track of the abnormal RPA workflow and the execution information of each node on the track;
[0042] Specifically, step S1 of the method for synthesizing abnormal RPA workflow data includes the following steps: S11: obtaining logs of all task nodes of the RPA system, obtaining logs of abnormal RPA workflows according to the logs of all task nodes, obtaining task nodes and execution time of abnormal RPA workflows according to the logs of abnormal RPA workflows, and obtaining execution tracks of abnormal RPA workflows and execution information of each node on the tracks according to the task nodes and execution time of abnormal RPA workflows; the execution information includes the status and response code of each node; S12: uniformly parsing and arranging the execution tracks of abnormal RPA workflows and the execution information of each node on the tracks to obtain abnormal RPA workflow data; the abnormal RPA workflow data includes node information, parent node information and execution time;
[0043] S2: Convert the abnormal RPA workflow data into RPA graph data, obtain the adjacency matrix and structural feature matrix based on the RPA graph data, and use the structural VAE encoder to obtain the structural feature expression;
[0044] Specifically, step S2 of the method for synthesizing abnormal RPA workflow data includes the following steps: S21: converting the abnormal RPA workflow data into RPA graph data, and obtaining an adjacency matrix and a structural feature matrix according to the RPA graph data; S22: obtaining a structural VAE encoder and a structural VAE decoder, the structural VAE encoder including a graph neural network and a pooling layer, and the structural VAE decoder including a graph neural network, a fully connected layer and an inner product; using the adjacency matrix, the structural feature matrix and the structural VAE decoder, the structural VAE encoder is trained to obtain a trained structural VAE encoder; S23: according to the adjacency matrix and the structural feature matrix, the trained structural VAE encoder is used to obtain a structural feature expression;
[0045] S3: Based on the RPA graph data, structural feature expression and adjacency matrix, the temporal VAE is used to obtain synthetic abnormal RPA workflow data;
[0046] Specifically, step S3 of the method for synthesizing abnormal RPA workflow data includes the following steps: S31: obtaining a request time feature matrix according to RPA graph data; S32: constructing a loss function, such as formula:
[0047]
[0048]
[0049]
[0050]
[0051] Where L is the loss function; It is the negative value ratio of the reconstructed data, controls the negative value ratio, and constrains the generated negative values; is the reconstruction loss; ELBO is the variational lower bound; x is the original input data, is the generated reconstructed data, represent The proportion of negative values in the equation; α and β are both parameters. α and β are set to a specific value so that a smaller penalty is given when the negative value ratio is 0 or very small, and a larger penalty is given when it is greater than 0; For a given hour The expected value of It represents the posterior distribution of z produced by the encoder, The decoder generates The distribution of is the KL divergence, which measures the difference between two probability distributions; Φ and θ are model parameters, z represents the latent space variable, and p(z) is the prior distribution of z;
[0052] S33: Train the temporal VAE using the loss function, the structural feature expression, the request time feature matrix and the adjacency matrix to obtain a trained temporal VAE; the temporal VAE includes a temporal VAE encoder and a temporal VAE decoder, the temporal VAE encoder includes a graph neural network and a pooling layer, and the temporal VAE decoder includes a graph neural network and a scheduling layer;
[0053] S34: According to the adjacency matrix and the request time feature matrix, the time VAE encoder of the trained time VAE is used to obtain the time feature expression; the structural feature expression is embedded into the time feature expression, and the trained time VAE is used to obtain the synthetic abnormal RPA workflow data.
[0054] This embodiment provides a system, including the following modules:
[0055] A data acquisition module is configured to: acquire the execution track of the abnormal RPA workflow and the execution information of each node on the track, and obtain the abnormal RPA workflow data according to the execution track of the abnormal RPA workflow and the execution information of each node on the track;
[0056] Specifically, the data acquisition module of the above system is specifically configured as follows:
[0057] Obtain the logs of all task nodes of the RPA system, obtain the logs of abnormal RPA workflows based on the logs of all task nodes, obtain the task nodes and execution time of abnormal RPA workflows based on the logs of abnormal RPA workflows, and obtain the execution track of abnormal RPA workflows and the execution information of each node on the track based on the task nodes and execution time of abnormal RPA workflows; the execution information includes the status and response code of each node; the execution track of abnormal RPA workflows and the execution information of each node on the track are uniformly parsed and sorted to obtain abnormal RPA workflow data; the abnormal RPA workflow data includes node information, parent node information and execution time;
[0058] The structural feature module is configured to: convert abnormal RPA workflow data into RPA graph data, obtain an adjacency matrix and a structural feature matrix based on the RPA graph data; and obtain a structural feature expression using a structural VAE encoder;
[0059] Specifically, the structural feature module of the above system is specifically configured as follows: converting abnormal RPA workflow data into RPA graph data, and obtaining an adjacency matrix and a structural feature matrix according to the RPA graph data; obtaining a structural VAE encoder and a structural VAE decoder, wherein the structural VAE encoder includes a graph neural network and a pooling layer, and the structural VAE decoder includes a graph neural network, a fully connected layer, and an inner product; using the adjacency matrix, the structural feature matrix, and the structural VAE decoder, the structural VAE encoder is trained to obtain a trained structural VAE encoder; according to the adjacency matrix and the structural feature matrix, the trained structural VAE encoder is used to obtain a structural feature expression;
[0060] The data reconstruction module is configured to: obtain synthetic abnormal RPA workflow data using temporal VAE based on RPA graph data, structural feature expressions, and adjacency matrix;
[0061] Specifically, the data reconstruction module of the above system is specifically configured as follows: according to the RPA graph data, a request time feature matrix is obtained; and a loss function is constructed, such as the formula:
[0062]
[0063]
[0064]
[0065]
[0066] Where L is the loss function; It is the negative value ratio of the reconstructed data, controls the negative value ratio, and constrains the generated negative values; is the reconstruction loss; ELBO is the variational lower bound; x is the original input data, is the generated reconstructed data, represent The proportion of negative values in the equation; α and β are both parameters. α and β are set to a specific value so that a smaller penalty is given when the negative value ratio is 0 or very small, and a larger penalty is given when it is greater than 0; For a given hour The expected value of It represents the posterior distribution of z produced by the encoder, The decoder generates The distribution of is the KL divergence, which measures the difference between two probability distributions; Φ and θ are model parameters, z represents the latent space variable, and p(z) is the prior distribution of z; the time VAE is trained using the loss function, structural feature expression, request time feature matrix and adjacency matrix to obtain the trained time VAE; the time VAE includes a time VAE encoder and a time VAE decoder, the time VAE encoder includes a graph neural network and a pooling layer, and the time VAE decoder includes a graph neural network and a scheduling layer; according to the adjacency matrix and the request time feature matrix, the time VAE encoder of the trained time VAE is used to obtain the time feature expression; the structural feature expression is embedded in the time feature expression, and the trained time VAE is used to obtain synthetic abnormal RPA workflow data.
[0067] In some embodiments, the above-mentioned method for synthesizing abnormal RPA workflow data can also be implemented in the following manner.
[0068] In this embodiment, the method for synthesizing RPA abnormal workflow data includes the following steps:
[0069] S1: Obtain the abnormal RPA workflow trajectory and the execution information of each node on the trajectory, and parse and organize them into abnormal RPA workflow data. Each piece of data represents the execution status of a node in an abnormal workflow. The data consists of node information, parent node information, and operation execution time.
[0070] S2: Convert the abnormal RPA workflow data into graph data according to the call path to obtain the adjacency matrix and feature matrix. Based on the graph neural network, encode and propagate the data of the abnormal RPA workflow to obtain the structural feature expression and time feature expression at the graph level. Among them, the feature matrix of the pre-trained structural VAE is the structural feature matrix, which generates the structural feature expression of the abnormal RPA workflow, and the feature matrix of the time VAE is the execution time feature matrix, which generates the execution time feature expression of the abnormal RPA workflow.
[0071] S3: embed the structural feature expression into the temporal feature expression, and learn the request time distribution of each node in the workflow based on the Bayesian network; the Bayesian network updates the knowledge of the request time distribution of each node by continuously observing the data value;
[0072] S4: Sampling is performed based on the request time distribution. After negative value verification and distribution verification, the former verifies whether the sampled value is negative, and the latter verifies whether the generated value conforms to the request time distribution of the node. After two rounds of verification, the trained model can generate reconstructed data with the same structure and similar time as the original abnormal RPA workflow data.
[0073] Specifically, step S1 includes: S1.1: Collecting the execution trajectories of all abnormal RPA workflows in the system. Each workflow has different task nodes and execution order. The logs of all task nodes constitute the logs of abnormal RPA workflows. By analyzing the execution time of different task nodes through logs, the execution trajectory of abnormal RPA workflows can be obtained; S1.2: Abnormal RPA workflow data is a kind of monitoring data that records node information, parent node information and execution time. It has a tree structure and is used to view the execution status of abnormal RPA workflows. The introduction of deep learning technology can use abnormal RPA workflow data to detect anomalies in the system. For supervised anomaly detection models, obtaining enough abnormal RPA workflow data is beneficial to the performance of the model;
[0074] Specifically, step S2 includes: S2.1: converting abnormal RPA workflow data into graph data according to the call path to obtain the adjacency matrix and feature matrix; specifically, taking each task in the workflow data as a node, and drawing the upstream and downstream relationship of task execution into a graph as a directed edge, and obtaining the adjacency matrix of the graph, the adjacency matrix represents the connection relationship between nodes, if the downstream node of task A is B, then the value of row A and column B in the matrix is 1, otherwise it is 0; at the same time, constructing a feature matrix, and the value of the dimension in the matrix is the feature value of the node; S2.2: Based on the graph neural network, according to the RPA graph data obtained in step S2.1, construct a structural feature matrix, that is, the matrix value is the type value corresponding to the task, and inputs it into the structural VAE. The framework of the structural VAE is as follows Figure 2, encodes and propagates the data of abnormal RPA workflows to generate structural feature expressions that carry structural information; the message passing mechanism of graph neural networks is as follows Figure 3 As shown in the figure, each node receives the feature information of its neighbor nodes in each iteration and updates its own feature representation. This information exchange and update process can be iterated multiple times to achieve the aggregation and propagation of global information.
[0075] Specifically, step S3 includes: S3.1: Similar to step S2.2, the RPA graph data is used to construct a request time feature matrix, that is, the matrix value is the request time X corresponding to the task, and is input into the time VAE. The framework of the time VAE is as follows: Figure 4 , encode and propagate the data of abnormal RPA workflows, generate the second (time) structural feature expression Z2 at the graph level, and embed the obtained first structural feature expression Z into the time feature expression Z2; after the structural VAE is trained, the generated structural feature expression only plays an encoding role in the time VAE, does not participate in the gradient calculation of the time VAE, and is spliced with the time feature expression of the time VAE to generate reconstructed data; S3.2: Based on the Bayesian network, the model learns the request time distribution of each node in the workflow; the variational Bayesian network is a technology for approximate Bayesian inference, which provides a framework for effectively approximating complex posterior distributions; the posterior distribution of the variational Bayesian method is expressed as follows, where express Figure 3 The potential intermediate variables generated by the model, x represents the workflow data, p(z|x) represents the distribution probability of the potential intermediate variables generated after observing the workflow data, p(x|z) represents the distribution probability of the reconstructed data sampled from the potential intermediate variables, and p(z) and p(x) represent the distribution probabilities of x and z in the absence of observations, that is, in the initial state:
[0076]
[0077] The variational Bayesian method transforms the original Bayesian inference problem into an optimization problem, aiming to find an approximate distribution that is as close as possible to the true posterior distribution. To achieve this, the variational Bayesian method usually uses a parameterized distribution family (such as Gaussian distribution, Dirichlet distribution, etc.) to represent the approximate distribution, and adjusts the parameters of these distributions through optimization methods to maximize the similarity with the true posterior distribution; this optimization method uses the Kullback-Leibler divergence, q represents the process from the original RPA data x to the potential intermediate variable z, p represents the process of generating RPA data x from the potential intermediate variable z, q(z) and p(z) represent the distribution of z in the initial state of the q and p processes respectively, both of which belong to the prior distribution, p(z|x) represents the distribution of z of the p process after observing the original RPA data x, and p(x|z) represents the reconstructed RPA data of the p process after observing the latent variable z. distributed:
[0078]
[0079] Specifically, step S4 includes: sampling based on the request time distribution, and undergoing negative value verification and distribution verification. The former verifies whether the sampled value is negative, and the latter verifies whether the generated value conforms to the request time distribution of the node. After two rounds of verification, the trained model can generate reconstructed data with the same structure and similar time as the original abnormal RPA workflow data: S4.1: Sampling based on the request time distribution, randomly sampling in the request time distribution of each task node formed by the time VAE, keeping the original abnormal RPA workflow node and node execution path unchanged, and using the sampled value as the request time of the task node to generate new abnormal RPA workflow data; S4.2: The sampled value is subjected to negative value verification to prevent the model from generating negative request time; construct a loss function:
[0080]
[0081] in, x is the original input data, is the generated reconstructed data, is the reconstruction loss, is the negative value ratio of the reconstructed data, Control the proportion of negative values and constrain the generated negative values:
[0082]
[0083] in represent The proportion of negative values in the equation; α and β are both parameters. α and β are set to a specific value so that a smaller penalty is given when the negative value ratio is 0 or very small, and a larger penalty is given when it is greater than 0;
[0084] In addition, the sampled negative values are mapped to positive values with the same probability in the distribution and symmetric about the mean in the distribution image;
[0085] Another part of negative value validation is MSE (Mean Squared Error), which is a commonly used loss function. When the number of model samples is n, there is:
[0086]
[0087] The squares of the differences between the two are summed and the average is calculated. If the generated data deviates significantly from the original data, a larger penalty will be imposed.
[0088] S4.3: The sampled values are verified for distribution to verify whether the generated values conform to the request time distribution of the node. The ELBO formula is added to the loss function:
[0089]
[0090] Φ and θ are model parameters, x represents the input data, represents the reconstructed data, z represents the latent space variable, and p(z) is the prior distribution of z; It represents the posterior distribution of z produced by the encoder, The decoder generates The distribution of For a given hour The expected value of is the KL divergence, which measures the difference between two probability distributions;
[0091] After negative value verification and distribution verification, the model can better learn the distribution of abnormal RPA workflow execution time, generate abnormal RPA workflow data that is consistent with the original data nodes, node execution paths, and node execution time that fits the original data distribution, which is conducive to improving the performance of the anomaly detection model based on abnormal RPA workflow data.
[0092] In this embodiment, the method for synthesizing RPA abnormal workflow data mainly includes the following steps:
[0093] The background obtains the abnormal RPA workflow trajectory and the execution information of each node on the trajectory, and uniformly parses and organizes them into abnormal RPA workflow data; the row attributes of each data include node information, parent node information and operation execution time; to control the size of the data set, the collected data is evenly divided into three data sets; the execution time size of the tasks in the original data set varies greatly, so the data needs to be standardized. This is because: different tasks perform different functions. Even in the normal execution state, simple tasks may only take 1 millisecond, and complex tasks may sometimes take hundreds or thousands of milliseconds. When an abnormality occurs, the execution time range of the tasks is expanded, and the size gap between them also increases accordingly; when the data values differ greatly, it may cause the problem of gradient disappearance or explosion, so the data needs to be standardized; for the original data x Calculate the mean μ and standard deviation σ, and use the following formula to standardize each data x The linear transformation is x’ , so that it follows a standard normal distribution:
[0094]
[0095] After standardization, the data graph needs to be structured: group the data by id, use each task as a node, and draw a graph structure with directed edges from the parent task to the child task to obtain the adjacency matrix and feature matrix of the workflow graph;
[0096] In order to train the deep reinforcement learning model, this embodiment divides the collected data into a training set and a validation set in a ratio of 7:3; Figure 5 The performance results of the model method after 100 rounds of training on three datasets are shown. It can be seen that the ELBO value gradually decreases to a stable and smaller value, which shows that the model in the method is gradually learning the distribution of the original data during step-by-step training, and finally reaches a certain level of mastery, and finally generates data similar to the original data;
[0097] At the same time, in order to verify the impact of the method on the performance of the downstream anomaly detection model, the data generated by the method is merged with the original data set to form new training data and input into the same anomaly detection model for verification; there are four possible predictions of the data by the model: True Positive (TP) when the actual data is abnormal and predicted to be abnormal, False Positive (FP) when the actual data is normal and predicted to be abnormal, False Negative (FN) when the actual data is abnormal and predicted to be normal, and True Negative (TN) when the actual data is normal and predicted to be normal. The F1-score indicator is used to measure the performance of the model, which consists of the following two formulas:
[0098]
[0099] Take the harmonic mean of the two:
[0100]
[0101] As can be seen from Table 1, the original data set has an unbalanced ratio of normal samples to abnormal samples, and the downstream anomaly detection model lacks cognition of abnormal samples, so the F1-score is low and the model performance needs to be improved; the data set generated by this method is conducive to the downstream anomaly model's cognition of abnormal samples, thus improving the performance of the downstream anomaly detection model;
[0102] Table 1: The impact of whether to use the method on the F1-score of the anomaly detection model
[0103]
[0104] This embodiment provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the method for synthesizing abnormal RPA workflow data are implemented. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), a flash memory, a hard disk drive (HDD), or a solid-state drive (SSD), etc.; the storage medium may also include a combination of the above-mentioned types of memory.
[0105] This embodiment provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the steps of the method for synthesizing abnormal RPA workflow data are implemented.
[0106] like Figure 6As shown, the computer device may include: at least one processor 121, such as a CPU (Central Processing Unit), at least one communication interface 123, a memory 124, and at least one communication bus 122. Among them, the communication bus 122 is used to realize the connection and communication between these components. Among them, the communication interface 123 may include a display screen (Display), a keyboard (Keyboard), and the optional communication interface 123 may also include a standard wired interface and a wireless interface. The memory 124 may be a high-speed RAM memory (Random Access Memory, volatile random access memory), or a non-volatile memory (non-volatile memory), such as at least one disk memory. The memory 124 may also be at least one storage device located away from the aforementioned processor 121. Among them, the memory 124 stores an application program, and the processor 121 calls the program code stored in the memory 124 to perform any of the above method steps. Among them, the communication bus 122 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The communication bus 122 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6Only one line is used to represent it, but it does not mean that there is only one bus or one type of bus. Among them, the memory 124 may include a volatile memory (English: volatile memory), such as a random access memory (English: random-access memory, abbreviated: RAM); the memory may also include a non-volatile memory (English: non-volatile memory), such as a flash memory (English: flash memory), a hard disk drive (English: hard disk drive, abbreviated: HDD) or a solid-state drive (English: solid-state drive, abbreviated: SSD); the memory 124 may also include a combination of the above-mentioned types of memory. Among them, the processor 121 may be a central processing unit (English: central processing unit, abbreviated: CPU), a network processor (English: network processor, abbreviated: NP) or a combination of CPU and NP. Among them, the processor 121 may further include a hardware chip. The above-mentioned hardware chip may be an application-specific integrated circuit (English: application-specific integrated circuit, abbreviated: ASIC), a programmable logic device (English: programmable logic device, abbreviated: PLD) or a combination thereof. The PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof. Optionally, the memory 124 is also used to store program instructions. The processor 121 may call program instructions to implement the method for synthesizing abnormal RPA workflow data in this embodiment.
[0107] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation modes, which are merely illustrative rather than restrictive. Under the guidance of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the present invention and the claims, all of which are within the protection of the present invention.
Claims
1. A method for synthesizing abnormal RPA workflow data, characterized in that: The following steps are involved: S1: Obtain the execution track of the abnormal RPA workflow and the execution information of each node on the track, and obtain the abnormal RPA workflow data according to the execution track of the abnormal RPA workflow and the execution information of each node on the track; S2: converting the abnormal RPA workflow data into RPA graph data, obtaining an adjacency matrix and a structural feature matrix according to the RPA graph data; and obtaining a structural feature expression using a structural VAE encoder; The specific steps include: S21: converting the abnormal RPA workflow data into RPA graph data, and obtaining an adjacency matrix and a structural feature matrix according to the RPA graph data; S22: Obtain a structural VAE encoder and a structural VAE decoder, wherein the structural VAE encoder includes a graph neural network and a pooling layer, and the structural VAE decoder includes a graph neural network, a fully connected layer, and an inner product; train the structural VAE encoder using the adjacency matrix, the structural feature matrix, and the structural VAE decoder to obtain a trained structural VAE encoder; S23: Obtaining a structural feature expression using a trained structural VAE encoder according to the adjacency matrix and the structural feature matrix; S3: According to the RPA graph data, structural feature expression and adjacency matrix, using the temporal VAE, obtain synthetic abnormal RPA workflow data; specifically comprising the following steps: S31: Obtaining a request time feature matrix according to the RPA graph data; S32: Construct the loss function, such as formula: Where L is the loss function; It is the negative value ratio of the reconstructed data, controls the negative value ratio, and constrains the generated negative values; is the reconstruction loss; ELBO is the variational lower bound; x is the original input data, is the generated reconstructed data, represent The proportion of negative values in the equation; α and β are both parameters. α and β are set to a specific value so that a smaller penalty is given when the negative value ratio is 0 or very small, and a larger penalty is given when it is greater than 0; For a given hour The expected value of It represents the posterior distribution of z produced by the encoder, The decoder generates The distribution of is the KL divergence, which measures the difference between two probability distributions; Φ and θ are model parameters, z represents the latent space variable, and p(z) is the prior distribution of z; S33: Using the loss function, the structural feature expression, the request time feature matrix and the adjacency matrix, the temporal VAE is trained to obtain a trained temporal VAE; the temporal VAE includes a temporal VAE encoder and a temporal VAE decoder, the temporal VAE encoder includes a graph neural network and a pooling layer, and the temporal VAE decoder includes a graph neural network and a scheduling layer; S34: According to the adjacency matrix and the request time feature matrix, the time VAE encoder of the trained time VAE is used to obtain the time feature expression; the structural feature expression is embedded into the time feature expression, and the trained time VAE is used to obtain the synthetic abnormal RPA workflow data.
2. The method for synthesizing abnormal RPA workflow data according to claim 1, characterized in that: Step S1 includes the following steps: S11: Obtain logs of all task nodes of the RPA system, obtain logs of abnormal RPA workflows according to the logs of all task nodes, obtain task nodes and execution time of the abnormal RPA workflows according to the logs of the abnormal RPA workflows, and obtain execution tracks of the abnormal RPA workflows and execution information of each node on the tracks according to the task nodes and execution time of the abnormal RPA workflows; the execution information includes the status and response code of each node; S12: uniformly analyzing and organizing the execution track of the abnormal RPA workflow and the execution information of each node on the track to obtain abnormal RPA workflow data; the abnormal RPA workflow data includes node information, parent node information and execution time.
3. A system, characterized in that: Includes the following modules: A data acquisition module is configured to: acquire an execution track of the abnormal RPA workflow and execution information of each node on the track, and obtain abnormal RPA workflow data according to the execution track of the abnormal RPA workflow and the execution information of each node on the track; The structural feature module is configured to: convert the abnormal RPA workflow data into RPA graph data, obtain an adjacency matrix and a structural feature matrix according to the RPA graph data; and obtain a structural feature expression using a structural VAE encoder; the structural feature module is specifically configured as follows: Converting the abnormal RPA workflow data into RPA graph data, and obtaining an adjacency matrix and a structural feature matrix according to the RPA graph data; Obtain a structural VAE encoder and a structural VAE decoder, wherein the structural VAE encoder includes a graph neural network and a pooling layer, and the structural VAE decoder includes a graph neural network, a fully connected layer, and an inner product; train the structural VAE encoder using the adjacency matrix, the structural feature matrix, and the structural VAE decoder to obtain a trained structural VAE encoder; According to the adjacency matrix and the structural feature matrix, using the trained structural VAE encoder, obtain the structural feature expression; The data reconstruction module is configured to obtain synthetic abnormal RPA workflow data using time VAE according to the RPA graph data, structural feature expression and adjacency matrix; the data reconstruction module is specifically configured as follows: According to the RPA graph data, a request time feature matrix is obtained; Construct the loss function as follows: Where L is the loss function; It is the negative value ratio of the reconstructed data, controls the negative value ratio, and constrains the generated negative values; is the reconstruction loss; ELBO is the variational lower bound; x is the original input data, is the generated reconstructed data, represent The proportion of negative values in the equation; α and β are both parameters. α and β are set to a specific value so that a smaller penalty is given when the negative value ratio is 0 or very small, and a larger penalty is given when it is greater than 0; For a given hour The expected value of It represents the posterior distribution of z produced by the encoder, The decoder generates The distribution of is the KL divergence, which measures the difference between two probability distributions; Φ and θ are model parameters, z represents the latent space variable, and p(z) is the prior distribution of z; The time VAE is trained using the loss function, the structural feature expression, the request time feature matrix and the adjacency matrix to obtain a trained time VAE; the time VAE includes a time VAE encoder and a time VAE decoder, the time VAE encoder includes a graph neural network and a pooling layer, and the time VAE decoder includes a graph neural network and a scheduling layer; According to the adjacency matrix and the request time feature matrix, the time VAE encoder of the trained time VAE is used to obtain the time feature expression; the structural feature expression is embedded into the time feature expression, and the trained time VAE is used to obtain the synthetic abnormal RPA workflow data.
4. The system according to claim 3, characterized in that The data acquisition module is specifically configured as follows: Obtain logs of all task nodes of the RPA system, obtain logs of abnormal RPA workflows according to the logs of all task nodes, obtain task nodes and execution time of abnormal RPA workflows according to the logs of abnormal RPA workflows, and obtain execution tracks of abnormal RPA workflows and execution information of each node on the tracks according to the task nodes and execution time of abnormal RPA workflows; the execution information includes the status and response code of each node; The execution track of the abnormal RPA workflow and the execution information of each node on the track are uniformly parsed and sorted to obtain abnormal RPA workflow data; the abnormal RPA workflow data includes node information, parent node information and execution time.
5. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for synthesizing abnormal RPA workflow data as claimed in any one of claims 1 to 2 are implemented.
6. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the method for synthesizing abnormal RPA workflow data as described in any one of claims 1-2 are implemented.
Citation Information
Patent Citations
Alignment-based multi-dimensional RPA process similarity calculation method
CN116227907A
Combined application method and device of RPA equipment, equipment and medium
CN116308191A
Subjective question scoring method and system based on ALBERT model and RPA technology
CN117540727A
RPA-based server state monitoring method and system
CN118484356A
Automated system and method for detection and remediation of anomalies in robotic process automation environment
US20230039566A1
