Test rule generation method, device and equipment
By preprocessing the original test rules and building transaction topology graphs, and using two-layer graph convolution neural network to generate new test rules, it solves the problem that testers need a lot of time to update the test rules after moving down the core system, and achieves efficient and accurate test rules generation.
Patent Information
- Application Number
- CN202411742637.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-03-18
AI Technical Summary
After the core system is moved down, testers need to invest a lot of time to sort out, update and design new test cases again on the test rules written during the previous downward transfer. This part of the work is cumbersome and difficult to replace, and the changes in testers may lead to deviations in understanding the original transactions and new requirements, affecting the testing efficiency and adding new functions risks.
By preprocessing the original test rules, obtain the set of test rules corresponding to the transaction, and build a transaction topology diagram. Based on the transaction topology graph, a two-layer graph convolution neural network is used to learn transaction graph features and generate new test rules.
It realizes automated updates and generation of test rules, improves testing efficiency, reduces labor costs, and ensures the accuracy and comprehensiveness of test cases.
Smart Images

Figure CN119645864A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a test rule generation method, device and equipment. Background Art
[0002] Software testing runs through the entire software development life cycle, and plays a vital role in the process of moving distributed core systems downward. As the core systems tend to run stably after moving downward, more focus will be placed on optimizing and transforming existing scenarios and functions in the future. The optimization of new requirements requires testers to invest a lot of time to re-sort and update the test rule points written in the previous downward process and design new test cases based on them. This part of the work is tedious and difficult to replace. If the change of testers leads to deviations in the understanding of the original transaction and new requirements, it may affect the test efficiency and increase the risk of new functions. Therefore, how to generate test rules more efficiently is a technical problem that needs to be solved urgently. Summary of the invention
[0003] In view of this, embodiments of the present application provide a test rule generation method, apparatus, and device to more efficiently generate test rules.
[0004] To solve the above problems, the technical solutions provided in the embodiments of the present application are as follows:
[0005] A test rule generation method, the method comprising:
[0006] Preprocessing the original test rules to obtain a test rule set corresponding to the transaction, wherein the test rule set includes a rule input, a rule attribute set, and a result set, and the rule attribute set corresponds to the result set in a one-to-one manner;
[0007] Constructing a transaction topology graph according to a set of test rules corresponding to the transaction;
[0008] Based on the transaction topology graph, obtaining an embedded feature representation matrix of graph nodes in the transaction topology graph;
[0009] Inputting the embedding feature representation matrix into a two-layer graph convolutional neural network to obtain a transaction graph representation;
[0010] New test rules are generated based on the use of the transaction graph features.
[0011] In a possible implementation, obtaining an embedded feature representation matrix of graph nodes in the transaction topology graph based on the transaction topology graph includes:
[0012] Based on the transaction topology graph, using a gated unit recurrent neural network, an input representation matrix, rule attribute set features, and result set features are obtained; the input representation matrix includes an input embedding representation vector;
[0013] Generating an input personalized information representation vector according to the rule attribute set characteristics and the result set characteristics;
[0014] The input embedding representation vector is fused with the input personalized information representation vector to obtain the embedding representation of the graph node;
[0015] The embedded representations of each graph node are combined into an embedded feature representation matrix of the graph node.
[0016] In a possible implementation, inputting the embedding feature representation matrix into a two-layer graph convolutional neural network to obtain a transaction graph representation includes:
[0017] The adjacency matrix of the embedded feature representation matrix is discarded according to the discard rate, and the edges in the adjacency matrix are normalized to obtain a standardized adjacency matrix;
[0018] Inputting the standardized adjacency matrix and the embedded feature representation matrix into a first-layer graph convolutional neural network to obtain a first-layer graph representation;
[0019] Using an update matrix to update the adjacency matrix to obtain an updated adjacency matrix;
[0020] The updated adjacency matrix is discarded according to the discard rate, and the edges in the updated adjacency matrix are normalized to obtain a standardized updated adjacency matrix;
[0021] Inputting the standardized updated adjacency matrix and the first-layer graph representation into a second-layer graph convolutional neural network to obtain a second-layer graph representation;
[0022] The second-layer graph representation is pooled to obtain a transaction graph representation.
[0023] In a possible implementation, the method further includes:
[0024] Calculating a Euclidean distance between node representations of two connected nodes according to the adjacency matrix, the node representations being from the first layer of graph representation;
[0025] Inputting the Euclidean distance into a convolutional neural network layer to obtain a representation matrix of potential relationship types of edges, wherein the representation matrix of potential relationship types of edges includes representation vectors of all potential types;
[0026] Calculate the average of the representation vectors of all potential types as the confidence weight of the edge;
[0027] The confidence weights of all edges are combined into a confidence matrix, and the confidence matrix is determined as the update matrix.
[0028] In a possible implementation, the method further includes:
[0029] Establishing a probability matrix based on the confidence matrix and the first layer graph representation;
[0030] According to the probability matrix, the confidence matrix is adjusted with the goal of minimizing the divergence value.
[0031] In a possible implementation, the method further includes:
[0032] A loss value is calculated according to the new test rule and the actual test rule, and the two-layer graph convolutional neural network is trained using the loss value.
[0033] In a possible implementation, the method further includes:
[0034] Preprocessing the demand document to obtain a demand document set corresponding to each transaction, wherein the demand document set includes a modified rule input, a modified rule attribute set, and a modified result set, wherein the modified rule attribute set corresponds to the modified result set in a one-to-one manner;
[0035] A new transaction topology graph is constructed according to the set of requirement documents.
[0036] A test rule generating device, the device comprising:
[0037] A preprocessing unit, used to preprocess the original test rules to obtain a test rule set corresponding to the transaction, wherein the test rule set includes a rule input, a rule attribute set and a result set, and the rule attribute set corresponds to the result set in a one-to-one manner;
[0038] A construction unit, configured to construct a transaction topology map according to a test rule set corresponding to the transaction;
[0039] A graph node representation unit, used to obtain an embedded feature representation matrix of graph nodes in the transaction topology graph based on the transaction topology graph;
[0040] A graph representation learning unit, used for inputting the embedding feature representation matrix into a two-layer graph convolutional neural network to obtain a transaction graph representation;
[0041] A generating unit is used to generate new test rules according to the transaction graph features.
[0042] A test rule generating device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the test rule generating method as described in any one of the above items is implemented.
[0043] A computer-readable storage medium stores instructions, and when the instructions are executed on a terminal device, the terminal device executes the test rule generation method as described in any one of the above items.
[0044] It can be seen that the embodiments of the present application have the following beneficial effects:
[0045] The embodiment of the present application preprocesses the original test rules to obtain the test rule set corresponding to the transaction, which includes rule input, rule attribute set and result set, and the rule attribute set corresponds to the result set one by one; construct a transaction topology graph according to the test rule set corresponding to the transaction; obtain the embedded feature representation matrix of the graph nodes in the transaction topology graph based on the transaction topology graph; input the embedded feature representation matrix into a two-layer graph convolutional neural network to obtain a transaction graph representation; generate new test rules based on the transaction graph features. Automatically generate or update test rules to improve test efficiency and reduce labor costs, while ensuring the accuracy and comprehensiveness of subsequent test cases written based on test rules. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 A schematic diagram of an exemplary application scenario provided for an embodiment of the present application;
[0047] Figure 2 A flowchart of a test rule generation method provided in an embodiment of the present application;
[0048] Figure 3 A schematic diagram of a transaction topology diagram in an embodiment of the present application;
[0049] Figure 4 A schematic diagram of a test rule generating device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0050] In order to make the above-mentioned purposes, features and advantages of the embodiments of the present application more obvious and easy to understand, the embodiments of the present application are further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0051] In order to facilitate the understanding and explanation of the technical solutions provided by the embodiments of the present application, the technical terms that may appear in the embodiments of the present application will be explained below.
[0052] Natural Language Processing (NLP) is an interdisciplinary subject in the fields of computer science, artificial intelligence and linguistics. It mainly studies how to enable computers to understand, process, generate and simulate human language, so as to achieve the ability to have natural conversations with humans. At the same time, it is hoped that machines can have human thinking and creativity. As one of the main tasks of natural language processing, text generation tasks (NLG) can be divided into the following items: machine translation (when an English text is input, the corresponding Chinese translation will be given through the translation software. The number of words in the two texts is not one-to-one, and there is both understanding and generation), question-answering system (understanding the user's expression and generating reasonable replies), text summarization (given a document, generating a summary of the document's topic content), story generation, poem generation, etc. With the development of deep learning technology, neural networks and other machine learning methods have made important progress in the field of natural language processing. Future development directions include deeper semantic understanding, better dialogue systems, more extensive cross-language processing and more powerful transfer learning technology.
[0053] Jieba Chinese word segmentation tool: word segmentation is the basis of text processing in natural language processing tasks. Chinese structure is relatively complex, and there is no obvious separation mark between words. Word segmentation is to reassemble sentences composed of character sequences into a set of words according to certain rules. Chinese word segmentation refers to dividing the Chinese character sequence in a sentence into a set of words for machine processing. For example, after word segmentation, the word set obtained for "2022 Winter Games in a certain city" is "
[2022] , [City], [Winter], [Sports Games]". Jieba Chinese word segmentation tool is a widely used word segmenter with good word segmentation effect. It is based on the prefix dictionary dict. New words that have not been registered cannot be segmented in the application. The dictionary can be modified and added to ensure a higher accuracy. One word in the dictionary occupies one line, and each line is divided into three parts: word, word frequency (optional), and part of speech (optional).
[0054] Gated unit (recurrent) neural network: In a text sequence, the previous and next words are not independent but are related to each other. In order to learn the context-dependent relationship in the text, the neural network needs to have short-term memory to link the previous and next elements in the sequence together to mine the overall semantic information of the sequence. Therefore, recurrent neural network RNN has a wide range of applications in the field of natural language processing. In RNN, for each time t, for the input data x t , the update formula of the new hidden state is:
[0055] h t =tanh(W h h t-1 +W x x t )
[0056] where h t-1 is the hidden state at time t-1, which can be regarded as the storage and memory of the information before time t in the sequence. h and W x Update matrix for hidden state parameters in recurrent neural network RNN. Sharing between each moment in the RNN structure reduces the magnitude of model learning parameters to a certain extent. At the same time, by fusing the information before the current moment with the information at the current moment, the global dependency information of the sequence can be mined. However, it is precisely because of its ability to process serialized data that it brings the problem of gradient vanishing or gradient explosion, which makes the model unable to model long-distance dependencies. The introduction of gated unit (recurrent) neural network (GRU) can effectively deal with the above problems. The GRU model solves the huge amount of computation brought by the gated device, combines the memory cell and the hidden state into one, and turns the gate into an update gate z t and reset gate r t , thereby reducing the computational time complexity of the model. The update gate is used to merge the input gate and the forget gate, according to the hidden state h at time t-1. t-1 and the input information x at the current time t t , determines the degree of retention of historical storage information and current input information; the reset gate is based on h t-1 and x t Used to determine how much historical information needs to be discarded:
[0057] z t =σ(W z x t +U z h t-1 )
[0058] r t =σ(W r x t +U r h t-1 )
[0059] Then use the update gate z t and reset gate r t Calculate the hidden state h at the current moment t :
[0060]
[0061] Convolutional Neural Network: Convolutional Neural Network (CNN) is commonly used in image-related tasks in the field of deep learning, aiming to simulate the process of human eye recognition of images. The structure of convolutional neural network includes input layer, convolution layer, pooling layer, fully connected layer and output layer. The lower hidden layer of the overall structure is composed of alternating convolution layer and pooling layer, which are also the core modules for feature extraction of input data. In the convolution layer, convolution kernel is used to extract local perceptual features of input data. If the input data is an image, the convolution kernel works like a resizable window, extracting image features by moving in each dimension of the image, and realizing the diversity of feature extraction by using multiple convolution kernels. In the pooling layer, if the importance of local perceptual features extracted by the convolution layer is different, the maximum pooling operation is usually used to screen and select the most significant features; when the importance of the extracted local features is not a necessary consideration, the average pooling operation MeanPooling can be used to average the features. After completing feature extraction in the low hidden layer, the high-level structure uses a fully connected layer to nonlinearly fuse the local perception features extracted by the low hidden layer to obtain information from a global perspective, and finally completes the classification through SoftMax as the output layer.
[0062] Graph Convolutional Neural Network: With the further development of deep learning, researchers are no longer limited to the extraction and use of the features of a single or multiple objects, but are beginning to pay more attention to the learning of the topological structure formed by the connections between objects. Graph Convolutional Neural Network (GCN) came into being. Its advantages in information extraction and fusion representation have made it applied to many fields. For a graph G = <V, E>, V represents a node set with n nodes, and each node v i The characteristic is represented as h i , we can get the feature matrix H∈R of n nodes n×d , where d is the node representation dimension. E is the node relationship set, i.e., the edge set, which can be obtained through the adjacency matrix A∈R n×n To represent the relationship between nodes. For the multi-layer graph convolutional network structure, it can be regarded as a structure that transmits information through the node representation matrix and the node relationship matrix:
[0063]
[0064] Among them, H l-1 ∈R n×d The node representation matrix corresponding to the l-1th layer of the graph convolutional neural network structure, Indicates adding a self-loop The node relationship matrix after normalization is also called the adjacency matrix. Self-loop means that in the adjacency matrix A, if αij =1, add α ij =1 to indicate that there is an edge between node i and node j. W represents the degree of the i-th node. l-1 ∈R d×d represents the learning parameters updated with training, and σ(·) is the activation function. Although the multi-layer graph convolution structure realizes the aggregation and transmission of information to form a more comprehensive structured representation, its complex structure and huge number of parameters also bring certain difficulties to model training, such as overfitting. In order to alleviate the problem of overfitting, in each round of training of the multi-layer graph convolution structure model, a certain number of edges in the graph structure are randomly removed, while achieving the randomness and diversification of the input data of each layer of the structure. Let the number of edges in the graph structure adjacency matrix A be N, and remove a certain number p in each round of training. dr N edges, where p dr Indicates the edge culling rate.
[0065] KL divergence (Kullback Leibler Divergence): Also known as relative entropy in information theory, it is used to measure the difference between two distributions. It is also widely used in machine learning because of its clear physical meaning, that is, to measure the similarity of two functions. The true probability distribution of the discrete or continuous random variable X is represented as P, and the fitted distribution is represented as Q. The KL divergence of the two distributions is calculated according to the following formula:
[0066]
[0067] Several conclusions can be drawn from the analysis of the KL divergence results. First, a KL divergence value of 0 indicates that the two calculated probability distributions are exactly the same. Second, the larger the KL divergence value, the greater the difference between the two probability distributions, and the smaller the value, the smaller the difference. In this method, the model learns the difference between the posterior distribution of the edge confidence weight calculated and the Gaussian distribution fitted by the weight distribution, and minimizes the KL divergence value as the training loss to guide the model to adjust the calculation of the confidence weight.
[0068] In order to facilitate understanding and explanation of the technical solution provided by the embodiments of the present application, the background technology of the embodiments of the present application will be described below.
[0069] As the core systems tend to run stably after being moved down, each system will focus more on optimizing and transforming existing scenarios and functions in the future. The optimization of new requirements requires testers to invest a lot of time to re-sort and update the test rule points written in the previous downward process and design new test cases based on this. On the one hand, the cost of case design and output will increase accordingly. On the other hand, manual rule updates may miss the correlation or conflict between the old and new rules, which will affect the test efficiency and increase the risk of new functions to a certain extent. After the systems are moved down, the existing test rules can be stored in the rule base platform as a test asset accumulation. Therefore, it is crucial to more conveniently, efficiently and comprehensively implement the update of old rules and the generation of new rules based on the rule base.
[0070] After each system is moved down, the existing test rules can be stored in the rule base platform as test asset accumulation. Therefore, it is crucial to update the old rules and generate new rules more conveniently, efficiently and comprehensively based on the rule base and new requirements. Entering the information age, natural language processing (NLP) has shown its advantages in many scenarios and applications. The embodiment of this application considers automatically updating and generating test rules to improve test efficiency and reduce labor costs, while ensuring the accuracy and comprehensiveness of test cases written based on test rules. As a type of text generation task, test rule generation has the following pain points in the context of existing research:
[0071] Chinese text processing is difficult, so progress in NLP tasks is slower than in other fields. Unlike English text, where words are separated by spaces for easy word recognition and segmentation, Chinese text has different semantics when the sentences are segmented, making it difficult for machines to accurately recognize and understand.
[0072] The data sets and text pre-training models used by existing large domestic and foreign models such as ChatGPT are mostly built for English text, and the models may not meet industry compliance requirements and are difficult to reuse directly.
[0073] As a higher level of abstraction of test cases, test rules are more concise and need to include many elements in accordance with the asset storage specifications of the rule base platform. As the core system becomes stable, the input of new requirements is more about optimizing and transforming current transactions. It is difficult for computers to accurately understand and extract new rules through simple learning without missing the potential and reliable correlation between the new rules and the original transaction rules.
[0074] Under the existing technical background, tasks such as English question-answering systems and text summarization have developed rapidly and achieved certain results. For example, the seq2seq serialization supervised learning model uses a deep neural network to map an input sequence to an output sequence. The characteristic of the serialization model is that it weakens the topological structure between inputs and only focuses on a single input content. The advantage of this type of model is that it can process variable-length sequences, but it is affected by the quality and diversity of the training data set and does not pay attention to the correlation between inputs. The generated content is mostly repetitive and independent. Obviously, this is not suitable for test rule generation. Testers naturally hope that their test rules are more comprehensive and diverse.
[0075] Based on this, in order to achieve the purpose of computer learning diversified data to automatically update and generate associated and comprehensive Chinese test rules, the embodiments of the present application provide a test rule generation method, device and equipment, which innovatively constructs a transaction-level graph topology structure for the test rules stored in the rule base platform according to the system-transaction dimension, uses the elements in the transaction rules as graph structure elements, and applies the confidence graph convolutional neural network to learn the embedded representation and structured representation of the transaction graph structure, and mines the potential correlation between transaction rules. At the same time, the confidence module solves the unreliability problem of constructing the topological structure and the importance of measuring the correlation between rules to the transaction results.
[0076] In order to facilitate understanding of the test rule generation method provided in the embodiment of the present application, Figure 1 See the example scenario shown in the figure. Figure 1 As shown, this figure is a schematic diagram of an exemplary application scenario provided in an embodiment of the present application.
[0077] The embodiment of the present application provides a test rule generation method based on a confidence graph convolutional neural network, which is applied to two scenarios of stable operation after the core system is moved down: one scenario is the automatic update of old rules when there is no optimization and transformation, and the other scenario is the automatic update and generation of new test rules when optimizing and transforming existing scenarios and functions, thereby improving test efficiency and reducing labor costs, while ensuring the accuracy and comprehensiveness of test cases written based on test rules. The rules in the rule base platform are pre-processed and pre-trained according to the system-transaction dimension and the new transformation requirement documents respectively, and then modeled: the transaction test rules of a certain transaction under the system are constructed according to the transaction code identifier. The graph convolutional neural network is used to learn the graph structure and embedded representation. At the same time, the relationship (edge) between the rules in the graph is measured by confidence. The degree of correlation and reliability, after multiple iterations of learning and parameter optimization, the potential diverse test rules for the current transaction are automatically updated. When the system has a new optimization and transformation, the new requirement document is input into the graph structure, the graph topology is updated, and the structure, representation and confidence are also updated and learned. Multiple iterations and parameter optimization are used to automatically generate new transaction test rules.
[0078] In an embodiment of the present application, the updating and generation of automated test rules are implemented based on a confidence graph neural network. While using external evaluation indicators such as BLEU, ROUGE and other optimization models, the correlation between rules is measured by constructing the confidence of the relationship between different inputs in the rules. The degree of correlation is used as an edge weight to guide the training of the graph neural network, thereby generating more accurate and comprehensive test rules.
[0079] In the embodiment of the present application, the data sources are the test rules divided by the rule base platform according to the system transaction level and a small number of new transformation requirement documents. A rule contains the system / module name, transaction name, transaction code, rule sequence number, business rule, input and output, test coverage, designer and other contents; the new transformation requirement document contains input, input transformation content, and transformation results.
[0080] In view of the different elements contained in the Chinese test rule text, data cleaning is first performed in the preprocessing stage to remove stop words, punctuation marks, etc., and then the Jieba word segmentation tool is used to segment and tag the test rules. The segmented corpus will be sent to the ERNIE2.0 pre-training model for Chinese word embedding and pre-training.
[0081] The transaction level graph topology is constructed by using the different elements contained in the rules and the transaction code as the unique identifier of the transaction. The rule sequence number identifies the graph node, the business rule is the condition describing the input, and is the attribute set of the graph node. The test coverage item is the result set describing the compliance and noncompliance of the business rule, and is the result set of the graph node. The attribute set and the result set correspond one to one. The input, attribute set and result set are used as the node content of the graph. Different inputs are connected by undirected edges to represent the correlation between the inputs.
[0082] Construct a confidence graph convolutional neural network to learn the transaction topology graph, which includes a graph representation learning module and a relationship confidence module. The graph representation learning module learns the embedded representation and structured representation of the transaction topology graph structure through a graph convolutional neural network (GCN), aiming to explore the potential correlation between transaction rules. The relationship confidence module solves the unreliability problem caused by connecting different inputs with undirected edges when constructing the transaction graph, that is, not all inputs are associated in actual transactions, and the association is not equally important to the transaction results.
[0083] After multiple iterations of model training, the current transaction rules can be dynamically updated without any new optimization or transformation. The newly transformed requirement document is input into the bidirectional recurrent neural network (bi-GRU) to encode the pre-trained requirement text, and the Adam optimizer is used to tune and learn document-level and sentence-level semantic information and features to achieve automated test rule generation.
[0084] Those skilled in the art will understand that Figure 1 The schematic diagram of the framework shown is only an example in which the embodiments of the present application can be implemented. The scope of application of the embodiments of the present application is not limited by any aspect of the framework.
[0085] To facilitate the understanding of the embodiments of the present application, a method for generating test rules provided by the embodiments of the present application will be described below with reference to the accompanying drawings.
[0086] See Figure 2 As shown, this figure is a flowchart of a method for generating test rules provided by the embodiments of the present application. As Figure 2 shown, the method may include S201 - S205:
[0087] S201: Preprocess the original test rules to obtain a set of test rules corresponding to the transactions. The set of test rules includes rule inputs, a set of rule attributes, and a set of results. The set of rule attributes corresponds one-to-one with the set of results.
[0088] Similarly, in a possible implementation, it may further include:
[0089] Preprocess the requirement document to obtain a set of requirement documents corresponding to each transaction. The set of requirement documents includes modified rule inputs, a set of modified rule attributes, and a set of modified results. The set of modified rule attributes corresponds one-to-one with the set of modified results.
[0090] In the data preprocessing stage, according to the modeling requirements, data cleaning is performed on the original test rules divided by system - transaction in the rule library platform and the requirement documents for new optimization and transformation of the current transaction, aiming to reduce the complexity of processing text, improve the algorithm efficiency, and even avoid the model results being affected by dirty data and affecting the accuracy of generating rules. It mainly includes removing text stopwords and processing repeated words, default values, etc. In NLP research, stopwords mainly refer to words that frequently appear in the text but usually do not have much meaning, such as common function words, empty words, punctuation marks, prepositions, pronouns, conjunctions, auxiliary verbs, etc. For example, "de", "he", "le" in Chinese text. For the new requirement documents, they also need to be separately divided according to the elements required for generating rules, namely transaction name, transaction code, input content, transformation points, etc., to facilitate the subsequent update of the transaction topology structure. The test rule text and the new transformation requirement documents after data cleaning will be tokenized and part-of-speech tagged through the Jieba tokenization tool. In Chinese, the smallest unit is a character, but the smallest unit with semantics is a word. Tokenization facilitates subsequent learning and understanding of Chinese text through the word set and learning the semantic relationships between different words.
[0091] Computers cannot process text directly but can process numbers. Therefore, the original test rules after word segmentation and the corpus of the newly added requirement documents will be sent to the ERNIE2.0 pre-training model for Chinese word embedding and pre-training. Its purpose is to convert abstract Chinese words into numerical form and map them to a high-dimensional mathematical space through linear transformation. It is difficult to find the correlation between two words or phrases in low dimensions, but the model can mine the semantic correlation of different words by learning the similarities between numbers of different dimensions in high-dimensional mathematical space. For example, a word or phrase can be mapped to a 128-dimensional vector in high-dimensional mathematical space. After mining the correlation, it can be realized from word to word, and from word to sentence. The test rule set for a single transaction after word embedding and training This set contains the rule input Rule attribute set and its corresponding result set The attributes in the rule attribute set correspond to the results in the result set one by one, which can be expressed as a two-tuple The new transformation requirement document for this transaction is set as a collection in Represents the input of the transformation, the attribute set for the transformation input and its corresponding result set
[0092] S202: Construct a transaction topology map according to the test rule set corresponding to the transaction.
[0093] There may be different degrees of correlation between different test rules in a transaction. These correlations may work together to obtain transaction results or they may conflict with each other. The purpose of constructing a transaction topology structure is to integrate the test rules of the transaction and explore the explicit or potential correlations between the test rules, so as to make the writing of transaction test rules more comprehensive and the transaction logic more reliable. The rule input, rule attribute set and result set in the test rules are used as the node content of the transaction topology structure, and the graph nodes are identified according to the test rule sequence number. For example, you can construct Figure 2 The topological structure shown. Figure 2 The rule input "A+B" indicates that the test rule needs to input two fields A and B, such as the financial entity code and loan contract number in the loan transaction; "D->E" means that the test rule also needs to input two fields D or E, but D must be entered first to enter E. The rule numbers are connected with undirected edges according to the direct relationship between the rule input contents, thus obtaining Figure 2 The topological structure on the right side. The non-hierarchical nature of the topological structure is only used to more clearly show the association. The dotted lines in the figure represent possible potential associations, which will be learned by the model later.
[0094] Define the above topological structure, P = {a 1,a 2 ,...,a n ; G P} is the test rule sequence corresponding to the pre-order traversal of the transaction graph, a i Represents a graph node, corresponding to the rule number in the test rule, and n is the number of test rules for a single transaction. P The structure represented as a transaction topology graph, i.e. Figure 2 As shown. P =<V P ,E P >V P G P The node set in V P ={a 1 ,a 2 ,...,a n}; E P ={e ij |i,j=1,2,...,n} is an edge set, that is, in the above-mentioned mapping process, the direct relationship of the input content according to the rule is connected with undirected edges. i and a j If the input content is directly related to i and a j There is a line between E P The edge e ij In addition, the adjacency matrix (edge matrix) of an undirected topological graph can be expressed as A P ∈R n×n And A P The initial value of is:
[0095]
[0096] Similarly, in a possible implementation, a new transaction topology graph may be constructed based on the set of requirement documents.
[0097] When a new optimization and transformation requirement document is obtained, the new requirement document is numbered continuously according to the old rules, and the transaction topology diagram is updated according to the direct relationship between the new requirement document input and the current rules.
[0098] S203: Based on the transaction topology graph, an embedding feature representation matrix of graph nodes in the transaction topology graph is obtained.
[0099] According to the transaction topology structure constructed above, the representation of the graph node consists of three parts: input, input attribute set and result set. The input of multiple rules may be the same, and the content of their test rules belongs to the input attribute set. The result set corresponds to the test coverage item. For example, the input of a transaction is date, and its business rules include: date field is 8 digits, date field is not 8 digits, date field is all numbers, etc. The test coverage items are field is 8 digits as expected, field is not 8 digits and error xxx, field is all numbers as expected, etc. It can be seen that the attribute set result set corresponds one to one. The embedded feature representation matrix of the graph node (i.e., the graph node representation) can be further obtained by the gated unit (recurrent) neural network.
[0100] In a possible implementation, the specific implementation of obtaining the embedded feature representation matrix of the graph nodes in the transaction topology graph based on the transaction topology graph in S203 includes:
[0101] A1: Based on the transaction topology graph, the gated unit recurrent neural network is used to obtain the input representation matrix, rule attribute set features, and result set features; the input representation matrix includes the input embedding representation vector.
[0102] A2: Generate a personalized information representation vector of the input based on the characteristics of the rule attribute set and the result set.
[0103] A3: The input embedding representation vector is fused with the input personalized information representation vector to obtain the embedding representation of the graph node.
[0104] A4: The embedded representations of each graph node are combined into an embedded feature representation matrix of the graph node.
[0105] For preprocessed and trained input According to the rule number Each rule input A gated unit (recurrent) neural network (GRU) is used to learn the semantic relationship of the text at the word level and sentence level, and the input representation matrix of all inputs of a single transaction is obtained as follows: i * ' represents the input text vector after the gated unit (recurrent) neural network learns the text semantic relationship. The new optimization and transformation requirements document is also processed in the above manner.
[0106] The attribute set and result set corresponding to each input need to be processed one by one. For example, the set of rule attributes that have been preprocessed and trained and its corresponding result set Can be expressed as and result set characteristics Each rule attribute and result is passed through a gated unit (recurrent) neural network (GRU) to learn the semantic relationship of the text at the word level and sentence level, and an input rule attribute set and result set are obtained as the rule attribute set feature P' = {p′ 1 ,p' 2 ,...,p' m} and the result set feature Q' = {q' 1 ,q' 2 ,...,q' m In order to associate the rule attribute set features with the result set features to form features that are exclusive to the rule input, a “personalized information” vector is used to represent them, where W p ∈R d×d and W q ∈R d×d To learn the matrix, follow the model training to learn the degree of causal connection between individual attributes and results:
[0107]
[0108] Among them, W p and W q is the transformation matrix, and the obtained input personalized information embedding representation sequence is Integrate all personalized information to obtain a personalized information representation vector that inputs all test rules:
[0109]
[0110] Among them, U F ∈R 1×d and W F ∈R m×d The conversion matrix converts the personalized information embedding representation sequence into a high-dimensional vector space. At the same time, in order to solve the problem that different inputs may have different numbers of <attribute, result> pairs, that is, the value of m is uncertain, the dimension is adjusted through the conversion matrix to avoid the subsequent training design of variable-dimensional vectors to increase the training complexity. * 'Fusing with the input personalized information representation vector, the embedded representation of the graph node is obtained as:
[0111] f i =i * 'W i +f'W f
[0112] Where W i ∈R d×d and W f ∈R d×d To learn the matrix, follow the model training to learn the relationship between the input embedding representation and the personalized information vector. Thus, the topology graph G of a single transaction is obtained.P The embedding feature representation matrix is R P =[f 1 ,f 2 ,...,f n ]∈R n×d .
[0113] S204: Input the embedded feature representation matrix into a two-layer graph convolutional neural network to obtain a transaction graph representation.
[0114] In a possible implementation, S204: inputting the embedding feature representation matrix into a two-layer graph convolutional neural network to obtain a transaction graph representation may include:
[0115] B1: The adjacency matrix of the embedded feature representation matrix is discarded according to the discard rate, and normalized to obtain a standardized adjacency matrix.
[0116] B2: Input the standardized adjacency matrix and the embedded feature representation matrix into the first layer of graph convolutional neural network to obtain the first layer of graph representation.
[0117] B3: Use the update matrix to update the adjacency matrix to obtain the updated adjacency matrix.
[0118] B4: discard the edges in the updated adjacency matrix according to the discard rate, and standardize the updated adjacency matrix to obtain a standardized updated adjacency matrix.
[0119] B5: Input the standardized updated adjacency matrix and the first-layer graph representation into the second-layer graph convolutional neural network to obtain the second-layer graph representation.
[0120] B6: Pool the second-layer graph representation to obtain the transaction graph representation.
[0121] In this embodiment of the present application, a two-layer graph convolutional neural network (GCN) is used to learn the embedded feature representation matrix R of the transaction topology graph obtained in S203 P First, the embedding feature representation matrix R that does not enter the graph convolutional network layer P The adjacency matrix (edge matrix) of is expressed as The edges in the adjacency matrix are discarded according to the discard rate p to alleviate the overfitting phenomenon that may occur during training. After discarding, it can be expressed as After removing it, add the self-loop to get Then normalize to get the normalized adjacency matrix:
[0122]
[0123] After standardization is completed, in the first layer of graph convolutional network, the information of nodes in the transaction topology graph structure is initially aggregated and the "default" graph representation is obtained. Here, "default" means that the values of edge weights in the undirected graph structure are all 1, that is, the associations between the rules are the same. The first layer of "default" graph representation is learned as the first layer of graph representation:
[0124]
[0125] in h i represents the "default" representation of the i-th node in the transaction graph structure, represents the learning parameters updated with training, is the “default” graph representation learning bias term, and σ(·) is the activation function.
[0126] In actual applications, the correlation between multiple test rules in a transaction is not the same and the impact on the entire transaction is also different. Therefore, it is not comprehensive to use the "default" edge weight learning in the first layer of the graph convolutional network. It is necessary to re-measure the relationship between the rules (edge weights), that is, calculate the confidence. This part will be explained in detail in the subsequent embodiments. Here, the calculated confidence matrix is directly used as the update matrix of the edge weight, expressed as w P . This update matrix is used to update the initial adjacency matrix That is, the updated adjacency matrix is obtained The updated adjacency matrix Similarly, a certain number of edges are discarded according to the discard rate p, self-loops are added and normalized to obtain the standardized updated adjacency matrix Representing the first layer And the normalized updated adjacency matrix The second layer of graph convolutional neural network is sent to learn reliable transaction graph representations with different degrees of rule association (with confidence), and the second layer of graph representation is obtained:
[0127]
[0128] Finally, the average pooling method is used to learn the transaction graph representation with confidence:
[0129]
[0130] In a possible implementation, the method may further include:
[0131] C1: Calculate the Euclidean distance between the node representations of two connected nodes according to the adjacency matrix, where the node representations come from the first layer of graph representation.
[0132] C2: Input the Euclidean distance into the convolutional neural network layer to obtain the representation matrix of the potential relationship type of the edge. The representation matrix of the potential relationship type of the edge includes the representation vectors of all potential types.
[0133] C3: Calculate the average of the representation vectors of all potential types as the confidence weight of the edge.
[0134] C4: The confidence weights of all edges are combined into a confidence matrix, and the confidence matrix is determined as the update matrix.
[0135] In the embodiment of the present application, the correlation and contribution of the relationship between the rules in the transaction graph structure will be reconsidered, and the calculated confidence matrix will be used to update the "default" edge weights to measure the reliability and importance of the relationship between the rules, thus achieving quantification and computability of reliability. The learning of process relationship confidence is located between the two layers of graph convolutional network layers of graph representation learning, that is, the output of the "default" graph representation learning, the first layer of graph representation H 1 P As the input of the relationship confidence learning, the output is the confidence matrix w used in the above embodiment. P Relation confidence learning includes two parts: confidence calculation and confidence consistency information calculation.
[0136] First, the confidence calculation is performed. For the input According to the adjacency matrix Compute the Euclidean distance between two node representations:
[0137]
[0138] Among them, h i and h j are the “default” representation vectors of transaction graph nodes learned by the first layer of graph convolutional neural network, and h i and h j There is a line in the adjacency matrix The edge in , that is, there is a direct relationship between the rules represented by these two nodes. ik and h jk Indicates h i and h jRepresents each component of the vector in dimension d. In practical applications, there are various types of such association relationships. For example, the inputs of two rules 1 will affect the inputs of rule 2, and the inputs of rule 1 do not exist if the inputs of rule 2 exist. A type parameter Φ is set for the potential type of such a relationship. In order to learn the characteristics of different potential types, the Euclidean distances of each node calculated above are sequentially sent to a CNN convolutional neural network layer to further learn the local features of the distance vector itself and normalize the distance feature vector to map it to the interval [0,1]. Finally, the local features are fused through the fully connected layer and the fused features are mapped to different potential types:
[0139]
[0140] in, is the type learning matrix, which is adjusted as the model is trained. is the type bias term, σ is the activation function, Indicates The representation matrix of all potential relationship types represented by the edge between node i and node j in the transaction topology graph is The confidence weight of the edge to be calculated is the average value of all potential type representations of the edge. The confidence weights of all edges are calculated in the same way as above to obtain the confidence matrix (all edges):
[0141]
[0142] N represents the number of transaction graph edges in the adjacency matrix, and Φ represents the number of potential types of relationships represented by the edges.
[0143] In a possible implementation, the method may further include:
[0144] D1: Construct a probability matrix from the confidence matrix and the first layer graph representation.
[0145] D2: According to the probability matrix, adjust the confidence matrix with the goal of minimizing the divergence value.
[0146] In the above confidence calculation process, the potential type type Φ is set to reflect the diversity of (edge) relationships between rules. The types of relationships between different rules may be different, that is, the training data is uncertain. Therefore, it is necessary to standardize the confidence weight matrix through confidence consistency calculation to reduce the impact of complex calculations caused by training uncertainty. Confidence calculation is regarded as a probability model For the “default” graph representation learning (first-layer graph representation), the probability model is based on the confidence matrix w P For each potential relationship type Calculate a probability. The confidence weight distribution is continuously updated with model training, and depends on the overall model training update. It is used as the posterior distribution based on model training and updated using the logSoftmax function:
[0147]
[0148] If the confidence calculation is regarded as a prediction task for the potential type of the edge, the potential type has no corresponding label and cannot be predicted by taking the expected value of the posterior distribution of the confidence weight. Therefore, it is necessary to find a fitting distribution for the confidence weight so that the KL divergence between this distribution and the posterior distribution of the confidence weight is minimized. The parameters of the probability model are initialized using Gaussian distribution and each type of potential relationship is modeled separately based on the results of the Gaussian process in the optimization model. The mean and variance in the Gaussian distribution are given by The calculation results are:
[0149]
[0150] Among them, W mean and W vαr ∈R d×d are the model training parameter matrices, b mean and b var ∈R d The log function is a bias term, and its purpose is to make the variance value smoother. The distribution of the potential relationship can be obtained by Gaussian fitting distribution as follows:
[0151]
[0152] Finally, the KL divergence is used to calculate the difference between the posterior distribution of confidence and the Gaussian fitting distribution to reflect the consistency trade-off. The model normalizes the confidence weight by minimizing the KL divergence value:
[0153] L KL =KL(p(x|H P )||q(x|H P ))
[0154] S205: Generate new test rules based on the transaction graph features.
[0155] Transaction Graph Representation H P Use the fully connected layer and Softmax function to update and generate new business rules:
[0156]
[0157] In a possible implementation, the method may further include:
[0158] The loss value is calculated according to the new test rules and the actual test rules, and the loss value is used to train the two-layer graph convolutional neural network.
[0159] In order to verify the semantic correctness of the newly generated rules, in addition to selecting external evaluation indicators Perplexity, BLEURT and ROUGE to measure the fluency of the generated new test cases, the model is pre-trained to compare the semantic consistency of the model with a small number of business rules. A small number of business rule texts are converted into text embedding vectors using the TF-IDF algorithm, and then calculated in sequence according to the following cosine similarity formula. Finally, the model with a semantic similarity computer result greater than or equal to 95% is saved:
[0160]
[0161] In the pre-training stage, the model's generation loss is calculated by generating regular text vectors The cross entropy of the distribution of and the distribution of the real small number of business rule text vectors y:
[0162]
[0163] During the model training process, the final loss optimization is the above and the training generated loss and confidence consistency loss L KL The weighted sum of KL It is the weight value of different losses selected by hyperparameter adjustment, which measures the degree to which the two consistency losses participate in model training and helps the three losses achieve the best trade-off. The model is trained by minimizing these two types of losses through multiple iterations:
[0164]
[0165] The embodiment of the present application provides a test rule generation method based on a confidence graph convolutional neural network, which is applied to two scenarios of stable operation after the core system is moved down: one scenario is the automatic update of old rules when there is no optimization and transformation, and the other scenario is the automatic update and generation of new test rules when optimizing and transforming existing scenarios and functions, thereby improving test efficiency and reducing labor costs, while ensuring the accuracy and comprehensiveness of test cases written based on test rules. The rules in the rule base platform are pre-processed and pre-trained according to the system-transaction dimension and the new transformation requirement documents respectively, and then modeled: the transaction test rules of a certain transaction under the system are constructed according to the transaction code identifier. The graph convolutional neural network is used to learn the graph structure and embedded representation. At the same time, the relationship (edge) between the rules in the graph is measured by confidence. The degree of correlation and reliability, after multiple iterations of learning and parameter optimization, the potential diverse test rules for the current transaction are automatically updated. When the system has a new optimization and transformation, the new requirement document is input into the graph structure, the graph topology is updated, and the structure, representation and confidence are also updated and learned. Multiple iterations and parameter optimization are used to automatically generate new transaction test rules. It aims to improve testing efficiency, reduce labor costs, and ensure the accuracy and comprehensiveness of subsequent test cases written based on test rules.
[0166] Based on a test rule generating method provided by the above method embodiment, an embodiment of the present application further provides a test rule generating device, which will be described below in conjunction with the accompanying drawings.
[0167] See also Figure 4 As shown in FIG. 1 , this figure is a schematic diagram of the structure of a test rule generation device provided in an embodiment of the present application. Figure 4 As shown, the test rule generating device includes:
[0168] A preprocessing unit 401 is used to preprocess the original test rule to obtain a test rule set corresponding to the transaction, wherein the test rule set includes a rule input, a rule attribute set and a result set, and the rule attribute set corresponds to the result set in a one-to-one manner;
[0169] A construction unit 402, configured to construct a transaction topology map according to a test rule set corresponding to the transaction;
[0170] A graph node representation unit 403, configured to obtain an embedded feature representation matrix of graph nodes in the transaction topology graph based on the transaction topology graph;
[0171] A graph representation learning unit 404, configured to input the embedding feature representation matrix into a two-layer graph convolutional neural network to obtain a transaction graph representation;
[0172] The generating unit 405 is used to generate new test rules according to the transaction graph features.
[0173] In a possible implementation, the graph node representation unit is specifically used to:
[0174] Based on the transaction topology graph, using a gated unit recurrent neural network, an input representation matrix, rule attribute set features, and result set features are obtained; the input representation matrix includes an input embedding representation vector;
[0175] Generating an input personalized information representation vector according to the rule attribute set characteristics and the result set characteristics;
[0176] The input embedding representation vector is fused with the input personalized information representation vector to obtain the embedding representation of the graph node;
[0177] The embedded representations of each graph node are combined into an embedded feature representation matrix of the graph node.
[0178] In a possible implementation, the graph representation learning unit is specifically used to:
[0179] The adjacency matrix of the embedded feature representation matrix is discarded according to the discard rate, and the edges in the adjacency matrix are normalized to obtain a standardized adjacency matrix;
[0180] Inputting the standardized adjacency matrix and the embedded feature representation matrix into a first-layer graph convolutional neural network to obtain a first-layer graph representation;
[0181] Using an update matrix to update the adjacency matrix to obtain an updated adjacency matrix;
[0182] The updated adjacency matrix is discarded according to the discard rate, and the edges in the updated adjacency matrix are normalized to obtain a standardized updated adjacency matrix;
[0183] Inputting the standardized updated adjacency matrix and the first layer graph representation into a second layer graph convolutional neural network to obtain a second layer graph representation;
[0184] The second-layer graph representation is pooled to obtain a transaction graph representation.
[0185] In a possible implementation manner, the device further includes:
[0186] A relationship confidence learning unit is used to calculate the Euclidean distance between the node representations of two connected nodes according to the adjacency matrix, wherein the node representation comes from the first layer of graph representation; input the Euclidean distance into the convolutional neural network layer to obtain a representation matrix of the potential relationship type of the edge, wherein the representation matrix of the potential relationship type of the edge includes representation vectors of all potential types; calculate the average value of the representation vectors of all potential types as the confidence weight of the edge; form a confidence matrix with the confidence weights of all edges, and determine the confidence matrix as the update matrix.
[0187] In a possible implementation manner, the device further includes:
[0188] An adjustment unit is used to establish a probability matrix based on the confidence matrix and the first layer graph representation; and adjust the confidence matrix according to the probability matrix with the goal of minimizing the divergence value.
[0189] In a possible implementation manner, the device further includes:
[0190] A training unit is used to calculate a loss value according to the new test rule and the actual test rule, and use the loss value to train the two-layer graph convolutional neural network.
[0191] In one possible implementation,
[0192] The preprocessing unit is further used to preprocess the demand document to obtain a demand document set corresponding to each transaction, wherein the demand document set includes a modified rule input, a modified rule attribute set, and a modified result set, and the modified rule attribute set corresponds to the modified result set in a one-to-one manner;
[0193] The construction unit is further used to construct a new transaction topology diagram according to the demand document set.
[0194] In addition, an embodiment of the present application also provides a test rule generation device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the test rule generation method as described in any one of the above items is implemented.
[0195] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores instructions, and when the instructions are executed on a terminal device, the terminal device executes any of the test rule generation methods described above.
[0196] An embodiment of the present application further provides a computer program product, including computer program instructions. When the computer program instructions are executed on a computer, the computer executes any of the test rule generation methods described above.
[0197] The embodiment of the present application preprocesses the original test rules to obtain the test rule set corresponding to the transaction, which includes rule input, rule attribute set and result set, and the rule attribute set corresponds to the result set one by one; construct a transaction topology graph according to the test rule set corresponding to the transaction; obtain the embedded feature representation matrix of the graph nodes in the transaction topology graph based on the transaction topology graph; input the embedded feature representation matrix into a two-layer graph convolutional neural network to obtain a transaction graph representation; generate new test rules based on the transaction graph features. Automatically generate or update test rules to improve test efficiency and reduce labor costs, while ensuring the accuracy and comprehensiveness of subsequent test cases written based on test rules.
[0198] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the various embodiments can be referred to each other. For the system or device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.
[0199] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0200] It should also be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0201] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0202] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A test rule generation method, characterized in that: The method comprises: Preprocessing the original test rules to obtain a test rule set corresponding to the transaction, wherein the test rule set includes a rule input, a rule attribute set, and a result set, and the rule attribute set corresponds to the result set in a one-to-one manner; Constructing a transaction topology graph according to a set of test rules corresponding to the transaction; Based on the transaction topology graph, obtaining an embedded feature representation matrix of graph nodes in the transaction topology graph; Inputting the embedding feature representation matrix into a two-layer graph convolutional neural network to obtain a transaction graph representation; New test rules are generated based on the use of the transaction graph features.
2. The method according to claim 1, characterized in that The step of obtaining an embedded feature representation matrix of graph nodes in the transaction topology graph based on the transaction topology graph includes: Based on the transaction topology graph, using a gated unit recurrent neural network, an input representation matrix, rule attribute set features, and result set features are obtained; the input representation matrix includes an input embedding representation vector; Generating an input personalized information representation vector according to the rule attribute set characteristics and the result set characteristics; The input embedding representation vector is fused with the input personalized information representation vector to obtain the embedding representation of the graph node; The embedded representations of each graph node are combined into an embedded feature representation matrix of the graph node.
3. The method according to claim 1, characterized in that The step of inputting the embedding feature representation matrix into a two-layer graph convolutional neural network to obtain a transaction graph representation includes: The adjacency matrix of the embedded feature representation matrix is discarded according to the discard rate, and the edges in the adjacency matrix are normalized to obtain a standardized adjacency matrix; Inputting the standardized adjacency matrix and the embedded feature representation matrix into a first-layer graph convolutional neural network to obtain a first-layer graph representation; Using an update matrix to update the adjacency matrix to obtain an updated adjacency matrix; The updated adjacency matrix is discarded according to the discard rate, and the edges in the updated adjacency matrix are normalized to obtain a standardized updated adjacency matrix; Inputting the standardized updated adjacency matrix and the first layer graph representation into a second layer graph convolutional neural network to obtain a second layer graph representation; The second-layer graph representation is pooled to obtain a transaction graph representation.
4. The method according to claim 3, characterized in that The method further comprises: Calculating a Euclidean distance between node representations of two connected nodes according to the adjacency matrix, the node representations being from the first layer of graph representation; Inputting the Euclidean distance into a convolutional neural network layer to obtain a representation matrix of potential relationship types of edges, wherein the representation matrix of potential relationship types of edges includes representation vectors of all potential types; Calculate the average of the representation vectors of all potential types as the confidence weight of the edge; The confidence weights of all edges are combined into a confidence matrix, and the confidence matrix is determined as the update matrix.
5. The method according to claim 4, characterized in that The method further comprises: Establishing a probability matrix based on the confidence matrix and the first layer graph representation; According to the probability matrix, the confidence matrix is adjusted with the goal of minimizing the divergence value.
6. The method according to claim 1, characterized in that The method further comprises: A loss value is calculated according to the new test rule and the actual test rule, and the two-layer graph convolutional neural network is trained using the loss value.
7. The method according to claim 1, characterized in that The method further comprises: Preprocessing the demand document to obtain a demand document set corresponding to each transaction, wherein the demand document set includes a modified rule input, a modified rule attribute set, and a modified result set, wherein the modified rule attribute set corresponds to the modified result set in a one-to-one manner; A new transaction topology graph is constructed according to the set of requirement documents.
8. A test rule generating device, characterized in that: The device comprises: A preprocessing unit, used to preprocess the original test rules to obtain a test rule set corresponding to the transaction, wherein the test rule set includes a rule input, a rule attribute set and a result set, and the rule attribute set corresponds to the result set in a one-to-one manner; A construction unit, configured to construct a transaction topology map according to a test rule set corresponding to the transaction; A graph node representation unit, used to obtain an embedded feature representation matrix of graph nodes in the transaction topology graph based on the transaction topology graph; A graph representation learning unit, used for inputting the embedding feature representation matrix into a two-layer graph convolutional neural network to obtain a transaction graph representation; A generating unit is used to generate new test rules according to the transaction graph features.
9. A test rule generating device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the test rule generating method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed on a terminal device, the terminal device executes the test rule generating method according to any one of claims 1 to 7.