An automatic testing method, device, equipment and storage medium for a cloud computing scenario
By extracting and processing operation sequences from the cloud server system log, and using the LSTM model and similarity to supplement operation vectors, the problem of insufficient test accuracy in cloud computing tests is solved, and higher test accuracy is achieved.
Patent Information
- Application Number
- CN202211240017.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-11
- Publication Date
- 2025-05-27
- Estimated Expiration
- 2042-10-11
AI Technical Summary
In the field of cloud computing testing, the subjectivity of testers in the prior art makes it difficult to maximize the real operation of simulated users, and the test accuracy is insufficient.
By obtaining the cloud server system log, extracting the operation sequence and converting it into an initial vector set, these vectors are processed using the LSTM model, supplementing the operation vector based on the similarity, and finally performing scene tests based on the supplemented vector set.
It improves the test accuracy of automatic testing in cloud computing scenarios, making the supplemented operation sequence closer to the user's real operations.
Smart Images

Figure CN115495377B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of cloud computing testing, and particularly relates to an automatic testing method, device, equipment and storage medium for cloud computing scenarios. Background Art
[0002] Cloud computing is a type of distributed computing, which means that through the network "cloud", huge data computing programs are decomposed into countless small programs, and then these small programs are processed and analyzed by a system composed of multiple servers, and the results are returned to users.
[0003] Cloud computing testing is software testing using cloud computing technology, which means that resources in the cloud platform need to be used. Its resources are any hardware, software and infrastructure required for testing. Through the cloud computing environment, an organization can conduct software testing as an easily scalable on-demand service. In the past few decades, traditional software testing has led to high costs for simulating multiple user activities. Most applications run on a client / server architecture, and data is tightly coupled with the applications in the client / server architecture. In the current field of cloud computing testing, testers usually implement interface automation testing using scripting languages, or conduct divergent manual testing based on their own experience.
[0004] In the above solutions, whether it is interface automation testing or divergent manual testing, there is subjectivity of testers, and it is difficult to maximize the simulation of real user operations. Summary of the Invention
[0005] The present application provides an automatic testing method, device, equipment and storage medium for cloud computing scenarios, which improves the testing accuracy of automatic testing for cloud computing scenarios. The technical solution is as follows.
[0006] On the one hand, an automatic testing method for cloud computing scenarios is provided. The method includes:
[0007] Obtain the system log of the cloud server; the system log of the cloud server contains each operation sequence; each operation sequence contains at least two cloud computing operations;
[0008] For each operation sequence, vectorize each cloud computing operation in the operation sequence to obtain an initial vector set corresponding to the operation sequence;
[0009] Input the initial vector set into a target LSTM model for processing to obtain a complete vector set corresponding to the operation sequence;
[0010] Select at least one vector of cloud computing operations based on the similarity between the complete vector set and the vectors of various cloud computing operations in the cloud server system log to supplement the complete vector set;
[0011] According to the supplemented complete vector set, select cloud computing operations in sequence for scenario testing.
[0012] In another aspect, an automatic testing device for cloud computing scenarios is provided. The device includes:
[0013] A log acquisition module for acquiring the cloud server system log; the cloud server system log contains various operation sequences; each operation sequence contains at least two cloud computing operations;
[0014] An initial vector acquisition module for, for each operation sequence, representing each cloud computing operation in the operation sequence as a vector to obtain an initial vector set corresponding to the operation sequence;
[0015] A complete vector acquisition module for inputting the initial vector set into a target LSTM model for processing to obtain a complete vector set corresponding to the operation sequence;
[0016] A vector supplement module for selecting at least one vector of cloud computing operations to supplement the complete vector set based on the similarity between the complete vector set and the vectors of various cloud computing operations in the cloud server system log;
[0017] A scenario testing module for, according to the supplemented complete vector set, selecting cloud computing operations in sequence for scenario testing.
[0018] In a possible implementation manner, the vector supplement module is further configured to:
[0019] Execute at least one supplement process until the number of vectors in the supplemented complete vector set meets a specified condition. The supplement process includes:
[0020] Calculate the similarity between the complete vector set and the vectors of each cloud computing operation in the cloud server system log, and supplement the complete vector set with the cloud computing operation with the highest similarity to obtain a first candidate vector set;
[0021] Input the candidate vector set into the target LSTM model for processing to obtain a second candidate vector set;
[0022] Based on the similarity between the second candidate vector set and the vectors of each cloud computing operation in the cloud server system log, select at least one vector of a cloud computing operation to supplement the second candidate vector set, and determine the supplemented second candidate vector as the supplemented complete vector set.
[0023] In a possible implementation, the vector supplement module is further configured to:
[0024] Execute at least one supplement process until the number of vectors in the supplemented complete vector set meets the specified condition. The supplement process includes:
[0025] Calculate the similarity between the complete vector set and the vectors of each cloud computing operation in the cloud server system log, and supplement the complete vector set with the cloud computing operation having the highest similarity to obtain a first candidate vector set;
[0026] Input the candidate vector set into the target LSTM model for processing to obtain a second candidate vector set;
[0027] Based on the similarity between the second candidate vector set and the vectors of each cloud computing operation in the cloud server system log, select at least one vector of a cloud computing operation to supplement the second candidate vector set, and determine the supplemented second candidate vector as the supplemented complete vector set.
[0028] In a possible implementation, the complete vector acquisition module is further configured to:
[0029] Process the target vector in the initial vector set through the forget gate in the target LSTM model to obtain a forget amount;
[0030] Process the target vector through the input gate in the target LSTM model to obtain an output ratio;
[0031] Process the target vector through the tanh unit in the target LSTM model to obtain vector information;
[0032] Update the memory cell in the target LSTM model through the forget amount, output ratio, and vector information;
[0033] Based on the updated memory cell, obtain the output vector corresponding to the target vector;
[0034] Perform weighted processing on the output vectors corresponding to each target vector through attention weights and behavior weights to obtain the complete vector set corresponding to the operation sequence.
[0035] In a possible implementation, the complete vector acquisition module is further configured to:
[0036] Calculate a transfer ratio based on the previous hidden state of the target LSTM model and the target vector; the previous hidden state is the hidden state corresponding to the previous vector of the target vector by the target LSTM model;
[0037] Determine the hidden state corresponding to the target vector based on the transfer ratio and the updated memory cell, and determine the hidden state corresponding to the target vector as the output vector corresponding to the target vector.
[0038] In a possible implementation, the complete vector acquisition module is further configured to
[0039] Determine new information according to the output ratio and the vector information;
[0040] Determine the product of the amount of information and the amount of forgetting in the memory cell as the original information;
[0041] Determine the sum of the new information and the original information as the new memory cell to complete the update of the memory cell in the target LSTM model.
[0042] In a possible implementation, the device further includes an attention weight acquisition module, configured to:
[0043] Concatenate each vector in the complete vector set corresponding to the operation sequence into a complete vector matrix;
[0044] Process the complete vector matrix through an attention mechanism to obtain the attention weights corresponding to each vector in the complete vector set.
[0045] In a possible implementation, the behavior weight acquisition module is further configured to:
[0046] Count the number of times the operations corresponding to each vector in the complete vector set appear in the cloud server system log;
[0047] Determine the behavior weights corresponding to each vector in the complete vector set based on the number of times the operations corresponding to each vector in each complete vector set appear in the cloud server system log.
[0048] In another aspect, a computer device is provided, where the computer device includes a processor and a memory, and at least one instruction is stored in the memory, and the at least one instruction is loaded and executed by the processor to implement the automatic test method for the above cloud computing scenario.
[0049] In another aspect, a computer-readable storage medium is provided. At least one instruction is stored in the storage medium, and the at least one instruction is loaded and executed by a processor to implement the automatic test method for the cloud computing scenario described above.
[0050] In yet another aspect, a computer program product or a computer program is provided. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the automatic test method for the cloud computing scenario described above.
[0051] The technical solution provided by this application may include the following beneficial effects:
[0052] During the automatic test of the cloud computing scenario, the computer device first obtains the system log of the cloud server, extracts each operation sequence from the system log of the cloud server, and converts each operation sequence into a corresponding initial vector set. The computer device then processes the initial vector set through the target LSTM model to obtain a complete vector set. At this time, similarity calculation is performed between the complete vector set and the vectors of various cloud computing operations in the cloud server system log, and the cloud computing operations with high similarity are used to supplement the complete vector set. The computer device then performs a scenario test on the cloud server through the cloud computing operations corresponding to the supplemented complete vector set. In the above solution, first, the operation sequences in the actual operation process of the user are read from the system log of the cloud server, and then through vector processing of the operation sequences, the cloud computing operations closest to the operation sequences are obtained to supplement the operation sequences, so that the supplemented operation sequences are closest to the user's actual operations, thereby improving the test accuracy of the automatic test of the cloud computing scenario. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] In order to more clearly illustrate the specific embodiments of the present application or the technical solutions in the prior art, the following will briefly introduce the drawings required for the description of the specific embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0054] Figure 1 is a schematic structural diagram of a cloud computing test system shown according to an exemplary embodiment.
[0055] Figure 2 is a method flowchart of an automatic test method for a cloud computing scenario shown according to an exemplary embodiment.
[0056] Figure 3 It is a flowchart of a method for automatically testing a cloud computing scenario shown according to an exemplary embodiment.
[0057] Figure 4 It shows a system framework diagram for operating test of a cloud computing scenario involved in an embodiment of the present application.
[0058] Figure 5 It shows an automatic test device for a cloud computing scenario involved in an embodiment of the present application.
[0059] Figure 6 It is a schematic diagram of a computer device provided according to an exemplary embodiment of the present application. Detailed implementation manners
[0060] Next, the technical solutions of the present application will be clearly and completely described in conjunction with the accompanying drawings. Obviously, the described embodiments are some but not all of the embodiments of the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present application without creative efforts shall fall within the protection scope of the present application.
[0061] It should be understood that the "indication" mentioned in the embodiments of the present application can be direct indication, indirect indication, or indication of an associated relationship. For example, A indicates B, which can mean that A directly indicates B. For example, B can be obtained through A; it can also mean that A indirectly indicates B. For example, A indicates C and B can be obtained through C; it can also mean that there is an associated relationship between A and B.
[0062] In the description of the embodiments of the present application, the term "corresponding" can indicate a direct or indirect corresponding relationship between two parties, or can indicate an associated relationship between two parties, or can also be relationships such as indication and being indicated, configuration and being configured.
[0063] In the embodiments of the present application, "predefinition" can be implemented by pre-saving corresponding codes, tables, or other means that can be used to indicate relevant information in a device (for example, including a terminal device and a network device). The present application does not limit its specific implementation manner.
[0064] Before describing each embodiment shown in the present application, several concepts related to the present application will be introduced first.
[0065] 1) Recurrent Neural Network (RNN)
[0066] The Recurrent Neural Network (RNN) is a type of recursive neural network that takes sequence data as input, performs recursion in the evolution direction of the sequence, and all nodes (recurrent units) are connected in a chain.
[0067] The research on recurrent neural networks began in the 1980s and 1990s and developed into one of the deep learning algorithms in the early 21st century. Among them, the Bidirectional RNN (Bi-RNN) and the Long Short-Term Memory networks (LSTM) are common recurrent neural networks.
[0068] Recurrent neural networks have memory, parameter sharing, and Turing completeness, so they have certain advantages in learning the nonlinear features of sequences. Recurrent neural networks are applied in natural language processing (NLP), such as speech recognition, language modeling, machine translation, etc., and are also used in various time series forecasts. Recurrent neural networks constructed by introducing convolutional neural networks (CNNs) can handle computer vision problems containing sequence inputs.
[0069] Figure 1 It is a schematic structural diagram of a cloud computing test system shown according to an exemplary embodiment. The system includes a cloud server 110.
[0070] Optionally, a cloud computing application for performing cloud computing can be loaded in the cloud server 110. When the cloud computing application receives an instruction sent by a user, it can execute an operation corresponding to the instruction and generate a corresponding cloud server system log to record the operation executed according to the instruction sent by the user.
[0071] Optionally, a test application for performing cloud computing tests is also loaded in the cloud server. When the test application receives a cloud computing operation, it can test the cloud computing operation and generate a corresponding test result.
[0072] Optionally, the cloud server 110 can read the cloud server system log, generate a test sequence for the corresponding cloud computing operation according to the instruction corresponding to the cloud computing operation recorded in the cloud server system log, and send it to the test application for cloud computing tests.
[0073] Optionally, the cloud computing test system further includes a test instruction generation device 120, which can be implemented by a certain computer device in the cloud server. An LSTM model is loaded in the test instruction generation device. The test instruction generation device 120 can read the cloud server system log in the cloud server 110, and through the LSTM model, perform feature learning on the cloud computing operations in the cloud server system log, so as to judge, through the LSTM model, the cloud computing operation most relevant to each cloud computing operation sequence in the cloud server system log, so as to augment each cloud computing operation sequence in the cloud server system log, thereby constituting a new cloud computing operation sequence (that is, generating an operation instruction for cloud computing testing).
[0074] Optionally, the cloud server can be a cloud server that provides basic computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.
[0075] Optionally, the cloud server 110 and the test instruction generation device 120 can be connected through a communication network. Optionally, the communication network can be a wired network or a wireless network.
[0076] Optionally, the above-mentioned wireless network or wired network uses standard communication technologies and / or protocols. The network is usually the Internet, but can also be any other network, including but not limited to any combination of local area networks, metropolitan area networks, wide area networks, mobile, limited or wireless networks, private networks or virtual private networks. In some embodiments, technologies and / or formats including Hypertext Markup Language, Extensible Markup Language, etc. are used to represent the data exchanged through the network. In addition, conventional encryption technologies such as Secure Sockets Layer, Transport Layer Security, Virtual Private Network, Internet Protocol Security, etc. can be used to encrypt all or some of the links. In other embodiments, customized and / or dedicated data communication technologies can also be used to replace or supplement the above data communication technologies.
[0077] Figure 2 is a method flowchart of an automatic test method for a cloud computing scenario shown according to an exemplary embodiment. This method is executed by a computer device, and the computer device can be the cloud server 110 as Figure 1 shown, and this method includes:
[0078] Step 201, obtain the cloud server system log.
[0079] In the embodiment of the present application, the cloud server system log contains each operation sequence; each of these operation sequences contains at least two cloud computing operations.
[0080] In a cloud server, when an operation instruction sent by a user is received, the cloud server will execute the corresponding cloud computing operation according to the operation instruction, and record the execution of the cloud computing operation and the time when the cloud computing operation is executed for storage in the cloud server system log.
[0081] Therefore, when an instruction for testing a cloud computing scenario needs to be generated, a computer device can first read the cloud server system log, and according to the time axis in the cloud server system log, split the cloud computing operations saved in the cloud server system log into each operation sequence, and each operation sequence includes at least two cloud computing operations.
[0082] Step 202, for each such operation sequence, perform vector representation on each cloud computing operation in the operation sequence to obtain an initial vector set corresponding to the operation sequence.
[0083] After obtaining each operation sequence, the computer device processes each operation sequence. First, perform vector representation on each operation sequence. For example, randomly convert various cloud computing operations included in the cloud server system log into vectors. At this time, since each cloud computing operation in each operation sequence can be converted into a corresponding vector, for each operation sequence, the set composed of the vectors of the cloud computing operations in the operation sequence is the initial vector set.
[0084] Optionally, the arrangement order of the initial vector set corresponds to the execution time sequence of the cloud computing operations in the operation sequence.
[0085] Step 203, input the initial vector set into a target LSTM model for processing to obtain a complete vector set corresponding to the operation sequence.
[0086] After obtaining the initial vector set corresponding to the operation sequence, it can be processed by inputting the initial vector set into a target LSTM model, that is, input the vectors corresponding to each cloud operation sequence in the initial vector set into the target LSTM model in turn, so that the target LSTM model can achieve unsupervised training.
[0087] At this time, the target LSTM model transforms each vector corresponding to each cloud operation sequence in the initial vector set one by one to convert the initial vector set into a complete vector set corresponding to the operation sequence.
[0088] At this time, when the vectors in the complete vector set are compared with the vectors in the initial vector set, each vector in the complete vector set incorporates the features of the vectors before it, so that the vectors in the complete vector set take into account the operation time sequence features in the actual cloud operation process.
[0089] Step 204: Based on the similarity between the complete vector set and the vectors of various cloud computing operations in the system log of the cloud server, select at least one vector of a cloud computing operation to supplement the complete vector set.
[0090] After obtaining the complete vector set, the number of vectors corresponding to the cloud computing operations included in the complete vector set may be insufficient to complete the test of the cloud computing scenario. Therefore, at this time, the computer device can select one by one from various cloud computing operations in the system log of the cloud server, compare the vector corresponding to the cloud computing operation with the complete vector set, and supplement the complete vector set with the vector having the highest similarity, so that the number of cloud computing operations corresponding to the supplemented complete vector set meets the requirements for testing the cloud computing scenario.
[0091] Step 305: According to the supplemented complete vector set, sequentially select cloud computing operations for scenario testing.
[0092] At this time, according to each vector in the supplemented complete vector set, the cloud computing operation corresponding to each vector can be determined. When sequentially selecting cloud computing operations to perform scenario testing in the order of vector arrangement, the cloud computing scenario testing can be made closer to the actual operations of users, thereby improving the accuracy of the operation testing of the cloud computing scenario.
[0093] In summary, in the process of automatic testing of a cloud computing scenario, the computer device first obtains the system log of the cloud server, extracts each operation sequence from the system log of the cloud server, and converts each operation sequence into a corresponding initial vector set. The computer device then processes the initial vector set through a target LSTM model to obtain a complete vector set. At this time, the similarity between the complete vector set and the vectors of various cloud computing operations in the system log of the cloud server is calculated, and the cloud computing operation with high similarity is used to supplement the complete vector set. The computer device then performs scenario testing on the cloud server through the cloud computing operations corresponding to the supplemented complete vector set. In the above solution, first, the operation sequence in the actual operation process of the user is read from the system log of the cloud server, and then through vector processing of the operation sequence, the cloud computing operation closest to the operation sequence is obtained to supplement the operation sequence, so that the supplemented operation sequence is closest to the real operation of the user, thereby improving the test accuracy of the automatic testing of the cloud computing scenario.
[0094] Figure 3 is a flowchart of a method for automatically testing a cloud computing scenario according to an exemplary embodiment. The method is executed by a computer device, and the computer device may be a cloud server 110 as shown in Figure 1 shown, and the method includes:
[0095] Step 301: Obtain the system log of the cloud server.
[0096] In the embodiment of the present application, the system log of the cloud server contains various operation sequences; each of these operation sequences contains at least two cloud computing operations.
[0097] Let V = {v 1 , v 2 ,... v i ,..., v m} represent the total set of all cloud computing-related operations filtered out in the cloud server system, where v i represents the operation with index number i, and m represents the total number of operations. Let S = {s 1 , s 2 ,... s i ... s q} represent the total set of all cloud computing operation sequences, where s i represents the i-th operation sequence, and q represents the total number of operation sequences. An operation sequence s i consists of multiple operations, and these operations are sorted according to the timestamp as an operation sequence: where represents that the user performs the t-th operation in the operation sequence s i .
[0098] Step 302: For each of these operation sequences, represent each cloud computing operation in the operation sequence as a vector to obtain the initial vector set corresponding to the operation sequence.
[0099] That is, the computer device can perform random initialization vector representation on the current operation sequence s i . The embedding vector of each operation in the current operation sequence s i can be obtained, denoted as e t , representing the embedding vector of the t-th operation in the operation sequence s i . At this time, the current operation sequence is represented as s i = {e 1 , e 2 ,... e t ... e n}.
[0100] After obtaining the current operation sequence representation (i.e., the initial vector set), the current operation sequence representation {e 1 , e 2 ,... e t ... e n} is input into the LSTM in sequential form, and finally the representation matrix H of the new operation vector is learned.
[0101] Step 303: Process the target vector in the initial vector set through the forget gate in the target LSTM model to obtain the forgetting amount.
[0102] First, the computer device performs an LSTM forget gate operation on the target vector (any vector) in the initial vector set. The forget gate of the LSTM takes the previous hidden state h t-1 and the current input layer, that is, the embedding vector e of the t-th operation in the current operation sequence s i (which is the target vector) through a sigmoid function to determine the proportion of forgetting the memory information stored in the cell c t (that is, the target vector) through a sigmoid function to determine the proportion of forgetting the memory information stored in the cell c t-1 to obtain the output f of the forget gate t (that is, the forgetting amount). f t represents the probability of forgetting the previous cell state. It is expressed by the formula: f t =σ f (W f [h t-1 , e t +b f ). Among them, W f represents the parameter matrix, and b f represents the bias vector.
[0103] Step 304: Process the target vector through the input gate in the target LSTM model to obtain the output proportion.
[0104] Secondly, the computer device performs an output gate operation of the LSTM model on the target vector in the initial vector set. The input gate of the LSTM has a sigmoid unit to determine the output proportion i of the input information t :
[0105] i t =σ i (W i [h t-1 , e t +b i )
[0106] Among them, W i represents the parameter matrix, and b i represents the bias vector.
[0107] Step 305: Process the target vector through the tanh unit in the target LSTM model to obtain vector information.
[0108] The computer device can obtain the new information through the tanh unit as (that is, the vector information):
[0109]
[0110] Among them, W c represents the parameter matrix, and b c represents the bias vector.
[0111] Step 306: Update the memory cells in the target LSTM model based on the forgetting amount, output ratio, and vector information.
[0112] In a possible implementation, determine the new information based on the output ratio and the vector information;
[0113] Determine the original information as the product of the amount of information in the memory cell and the forgetting amount;
[0114] Determine the sum of the new information and the original information as the new memory cell to complete the update of the memory cells in the target LSTM model.
[0115] The computer device can update the memory cells. This step is to update the memory cell c based on the forgetting amount and new information obtained from the previous forget gate and input gate t :
[0116]
[0117] Step 307: Obtain the output vector corresponding to the target vector based on the updated memory cells.
[0118] In a possible implementation, calculate the transfer ratio based on the previous hidden state of the target LSTM model and the target vector; the previous hidden state is the hidden state corresponding to the previous vector of the target vector by the target LSTM model;
[0119] Determine the hidden state corresponding to the target vector based on the transfer ratio and the updated memory cells, and determine the hidden state corresponding to the target vector as the output vector corresponding to the target vector.
[0120] That is to say, after the computer device updates the memory cells, it controls how much information (i.e., the output vector) needs to be passed to the next state h through the output gate t :
[0121] o t =σ o (W o [h t-1 , e t +b o )
[0122] h t =ot ·tanh(c t )
[0123] Among them, W o represents the parameter matrix, and b o represents the bias vector.
[0124] Step 308: Weight the output vectors corresponding to each target vector through the attention weights and the behavior weights to obtain the complete vector set corresponding to this operation sequence.
[0125] The attention weights with different operations trained through the attention mechanism Then assign the behavior weights defined innovatively to each operation vector Accumulate and multiply to obtain the overall vector representation H of the current operation sequence S .
[0126] That is, accumulate to obtain the final complete vector representation H of the operation sequence S :
[0127]
[0128] In a possible implementation, splice the vectors in the complete vector set corresponding to this operation sequence into a complete vector matrix;
[0129] Process this complete vector matrix through the attention mechanism to obtain the attention weights corresponding to each vector in this complete vector set.
[0130] For the complete operation sequence s i It is necessary to generate, through the attention mechanism, different attention weights for each operation in the current operation sequence
[0131]
[0132] Among them, and represent the parameter matrix.
[0133] In a possible implementation, count the number of times the operations corresponding to each vector in this complete vector set appear in the cloud server system log;
[0134] Based on the number of times the operations corresponding to each vector in this complete vector set appear in the cloud server system log, determine the behavior weights corresponding to each vector in this complete vector set.
[0135] Assign new-defined behavior weights to each operation vector By calculating the operation sequence s iThe occurrence frequency of the current operation in the operation sequence s i All the operation frequency values in are used as the behavior weights The role is to assign high weight values to the operations with higher user operation frequencies, which have greater influence. In this way, on the basis of the attention weights trained through the black box deep learning, artificially assigning behavior weights will make the complete operation sequence vector representation more accurate and closer to the real scenario. The formula is as follows:
[0136]
[0137] Among them, p(·) represents the total number of times the current operation h has occurred in the total set S of cloud computing operation sequences i The total number of occurrences.
[0138] Step 309, based on the similarity between the complete vector set and the vectors of various cloud computing operations in the cloud server system log, select at least one vector of cloud computing operations to supplement the complete vector set.
[0139] In a possible implementation, calculate the quantity difference between the number of vectors in the complete vector set and the target quantity;
[0140] Calculate the similarity between the complete vector set and the vectors of each cloud computing operation in the cloud server system log, and supplement the complete vector set with the vectors of the cloud computing operations with the highest similarity and the number of quantity differences.
[0141] That is to say, when supplementing the complete vector set, the similarity between multiple vectors of cloud computing operations and the complete vector set can be calculated simultaneously, and the number of vectors that need to be supplemented to the complete vector set (that is, the quantity difference) can be determined. The computer device sorts each cloud computing operation according to the similarity and selects the vectors corresponding to the number of quantity differences to supplement into the complete vector set.
[0142] In a possible implementation, perform at least one supplement process until the number of vectors in the supplemented complete vector set meets the specified conditions. The supplement process includes:
[0143] Calculate the similarity between the complete vector set and the vectors of each cloud computing operation in the cloud server system log, and supplement the complete vector set with the cloud computing operation with the highest similarity to obtain the first candidate vector set;
[0144] Input the candidate vector set into the target LSTM model for processing to obtain the second candidate vector set;
[0145] Based on the similarity between the second candidate vector set and the vectors of each cloud computing operation in the cloud server system log, at least one vector of a cloud computing operation is selected to supplement the second candidate vector set, and the supplemented second candidate vector is determined as the supplemented complete vector set.
[0146] That is to say, the computer device represents the complete operation sequence vector H of the currently learned operation sequence s with the candidate operation e i to perform cosine similarity matching, and calculate the similarity score score. The formula is as follows: The candidate operation with the highest similarity score score is included in the scenario test operation set.
[0147] Then, the candidate operation with the highest score obtained is used as the next item, i.e., the n+1 item, of the operation sequence, and steps 303 to 308 are repeated for x (set according to the test requirements) rounds.
[0148] Step 310: According to the supplemented complete vector set, cloud computing operations are sequentially selected for scenario testing.
[0149] Please refer to Figure 4 , which shows a system framework diagram of a cloud computing scenario operation test involved in an embodiment of the present application. In the embodiment of the present application, through the following example, the system logic of the cloud computing scenario operation test as Figure 4 shown is described:
[0150] S1: Data preparation stage.
[0151] S1-1: Obtain the cloud server system log, filter out all cloud computing-related operations in the system, and establish an index table (removing duplicates) according to the operations. The example is as shown in Table 1 below:
[0152] Index number Operation name 1 Virtual machine creation 2 Virtual machine disk addition 3 Virtual machine shutdown 4 Virtual machine restart 6 Virtual machine deletion 7 Virtual machine disk expansion 8 Virtual machine list
[0153] Table 1
[0154] S1-2: Randomly select a continuous operation sequence in chronological order. Assume that the current operation sequence is s 1 ={operation 8 (e 8 ), operation 1 (e 1 ), operation 2 (e 2 )}, which means that in the operation sequence S1, the user performed the operations of 'virtual machine list, virtual machine creation, virtual machine adding disk' in chronological order.
[0155] S2: Randomly initialize the vector representation of the current operation sequence s 1 . In this case, the dimension is 2D, and the current operation sequence s 1The embedding vectors of each operation in
[0156] S3: Substitute the embedding vector representation of the current operation obtained in step S2 into the algorithm in sequential form, and finally learn to obtain the representation matrix of the new operation vector.
[0157] S4: Different attention weights for operations trained through the attention mechanism Then assign an innovative defined behavior weight to each operation vector Accumulate and multiply to obtain the overall vector representation H of the current operation sequence S 。
[0158] S4-1: For the complete operation sequence s 1 It is necessary to generate different attention weights for each operation in the current operation sequence through the attention mechanism
[0159] S4-2: Assume that the total number of times the "virtual machine list" operation appears in the cloud computing operation sequence is p(h 1 ) = 8, the total number of times the "virtual machine creation" operation appears in the cloud computing operation sequence is p(h 2 ) = 9, and the total number of times the "virtual machine add disk" operation appears in the cloud computing operation sequence is p(h 3 ) = 3. Substituting into the formula gives
[0160] S4-3: Then accumulate to obtain the final complete operation sequence vector representation
[0161] S5: Calculate the cosine similarity between the complete operation sequence vector representation H of the currently learned operation sequence S and the candidate operation. Assume that the embedding vector of candidate operation 6 "virtual machine disk expansion" is Calculate the similarity score Assume that the embedding vector of candidate operation 7 "virtual machine disk expansion" is Calculate the similarity score The candidate operation 7 "virtual machine disk expansion" with the highest score will be included in the scenario test operation set.
[0162] S6: Take the candidate operation with the highest score obtained in S5 as the next item, i.e., the n+1 item, of the operation sequence.
[0163] S7: In this example, it is assumed that when the operations in the scenario test operation set reach 1 round threshold, the algorithm ends. If the threshold is greater than 1, repeat steps S3 to S5.
[0164] S8: Take out the operations in the operation set, namely virtual machine list, virtual machine creation, virtual machine disk addition, and virtual machine disk expansion, and conduct scenario tests in sequence.
[0165] In summary, during the automatic testing process of the cloud computing scenario, the computer device first obtains the system log of the cloud server, extracts each operation sequence from the system log of the cloud server, and converts each operation sequence into a corresponding initial vector set. Then, the computer device processes the initial vector set through the target LSTM model to obtain a complete vector set. At this time, the similarity between the complete vector set and the vectors of various cloud computing operations in the cloud server system log is calculated, and the cloud computing operations with high similarity are used to supplement the complete vector set. The computer device then conducts scenario tests on the cloud server through the cloud computing operations corresponding to the supplemented complete vector set. In the above solution, first obtain the operation sequence in the actual operation process of the user read from the system log of the cloud server, and then through vector processing of the operation sequence, obtain the cloud computing operation closest to the operation sequence to supplement the operation sequence, so that the supplemented operation sequence is closest to the user's real operation, thereby improving the test accuracy of the automatic test of the cloud computing scenario.
[0166] Please refer to Figure 5 , which shows an automatic test device for a cloud computing scenario according to an embodiment of the present application. The device includes:
[0167] A log acquisition module 501 for acquiring the system log of the cloud server; the system log of the cloud server contains each operation sequence; each operation sequence contains at least two cloud computing operations;
[0168] An initial vector acquisition module 502 for representing each cloud computing operation in the operation sequence as a vector for each operation sequence to obtain an initial vector set corresponding to the operation sequence;
[0169] A complete vector acquisition module 503 for processing the initial vector set by inputting it into the target LSTM model to obtain a complete vector set corresponding to the operation sequence;
[0170] A vector supplement module 504 for selecting at least one vector of a cloud computing operation to supplement the complete vector set based on the similarity between the complete vector set and the vectors of various cloud computing operations in the cloud server system log;
[0171] A scenario test module 505 for sequentially selecting cloud computing operations for scenario tests according to the supplemented complete vector set.
[0172] In a possible implementation, the vector supplementation module is further configured to:
[0173] Execute at least one supplementation process until the number of vectors in the supplemented complete vector set meets the specified condition. The supplementation process includes:
[0174] Calculate the similarity between the complete vector set and the vectors of each cloud computing operation in the cloud server system log, and supplement the complete vector set with the cloud computing operation having the highest similarity to obtain a first candidate vector set;
[0175] Input the candidate vector set into the target LSTM model for processing to obtain a second candidate vector set;
[0176] Based on the similarity between the second candidate vector set and the vectors of each cloud computing operation in the cloud server system log, select the vectors of at least one cloud computing operation to supplement the second candidate vector set, and determine the supplemented second candidate vector as the supplemented complete vector set.
[0177] In a possible implementation, the vector supplementation module is further configured to:
[0178] Execute at least one supplementation process until the number of vectors in the supplemented complete vector set meets the specified condition. The supplementation process includes:
[0179] Calculate the similarity between the complete vector set and the vectors of each cloud computing operation in the cloud server system log, and supplement the complete vector set with the cloud computing operation having the highest similarity to obtain a first candidate vector set;
[0180] Input the candidate vector set into the target LSTM model for processing to obtain a second candidate vector set;
[0181] Based on the similarity between the second candidate vector set and the vectors of each cloud computing operation in the cloud server system log, select the vectors of at least one cloud computing operation to supplement the second candidate vector set, and determine the supplemented second candidate vector as the supplemented complete vector set.
[0182] In a possible implementation, the complete vector acquisition module is further configured to:
[0183] Process the target vector in the initial vector set through the forget gate in the target LSTM model to obtain a forgetting amount;
[0184] Process the target vector through the input gate in the target LSTM model to obtain an output ratio;
[0185] Process the target vector through the tanh unit in the target LSTM model to obtain vector information;
[0186] Update the memory cell in the target LSTM model based on the forgetting amount, output ratio, and vector information;
[0187] Based on the updated memory cell, obtain the output vector corresponding to the target vector;
[0188] Perform weighted processing on the output vectors corresponding to each target vector through the attention weight and behavior weight to obtain the complete vector set corresponding to the operation sequence.
[0189] In a possible implementation manner, the complete vector acquisition module is further configured to:
[0190] Calculate the transfer ratio based on the previous hidden state of the target LSTM model and the target vector; the previous hidden state is the hidden state corresponding to the previous vector of the target vector by the target LSTM model;
[0191] Determine the hidden state corresponding to the target vector based on the transfer ratio and the updated memory cell, and determine the hidden state corresponding to the target vector as the output vector corresponding to the target vector.
[0192] In a possible implementation manner, the complete vector acquisition module is further configured to
[0193] Determine the new information according to the output ratio and the vector information;
[0194] Determine the product of the amount of information in the memory cell and the forgetting amount as the original information;
[0195] Determine the sum of the new information and the original information as the new memory cell to complete the update of the memory cell in the target LSTM model.
[0196] In a possible implementation manner, the device further includes an attention weight acquisition module, configured to:
[0197] Concatenate each vector in the complete vector set corresponding to the operation sequence into a complete vector matrix;
[0198] Process the complete vector matrix through the attention mechanism to obtain the attention weights corresponding to each vector in the complete vector set.
[0199] In a possible implementation manner, the behavior weight acquisition module is further configured to:
[0200] Count the number of times the operations corresponding to each vector in the complete vector set appear in the system log of the cloud server;
[0201] Based on the number of times the operations corresponding to each vector in each of the complete vector sets appear in the system log of the cloud server, determine the behavior weights corresponding to each vector in the complete vector set.
[0202] In summary, during the automatic testing process in the cloud computing scenario, the computer device first obtains the system log of the cloud server, extracts each operation sequence from the system log of the cloud server, and converts each operation sequence into a corresponding initial vector set. Then, the computer device processes the initial vector set through the target LSTM model to obtain a complete vector set. At this time, the similarity between the complete vector set and the vectors of various cloud computing operations in the cloud server system log is calculated, and the cloud computing operations with high similarity are used to supplement the complete vector set. The computer device then performs scenario testing on the cloud server through the cloud computing operations corresponding to the supplemented complete vector set. In the above solution, first obtain the operation sequence in the actual operation process of the user read from the system log of the cloud server, and then through vector processing of the operation sequence, obtain the cloud computing operation closest to the operation sequence to supplement the operation sequence, so that the supplemented operation sequence is closest to the user's real operation, thereby improving the test accuracy of the automatic testing of the cloud computing scenario.
[0203] Please refer to Figure 6 , which is a schematic diagram of a computer device provided according to an exemplary embodiment of the present application. The computer device includes a memory and a processor. The memory is used to store a computer program. When the computer program is executed by the processor, the above method is implemented.
[0204] Among them, the processor may be a central processing unit (CPU). The processor may also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. chips, or a combination of the above types of chips.
[0205] As a non-transitory computer-readable storage medium, the memory can be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as program instructions / modules corresponding to the methods in the embodiments of the present invention. By running the non-transitory software programs, instructions, and modules stored in the memory, the processor can execute various functional applications and data processing of the processor, that is, implement the methods in the above method embodiments.
[0206] The memory may include a program storage area and a data storage area. Among them, the program storage area can store an operating system and application programs required for at least one function; the data storage area can store data created by the processor and the like. In addition, the memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state storage devices. In some embodiments, the memory may optionally include a memory remotely set relative to the processor, and these remote memories can be connected to the processor through a network. Examples of the above networks include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0207] In an exemplary embodiment, a computer-readable storage medium is also provided, which is used to store at least one computer program, and the at least one computer program is loaded and executed by a processor to implement all or part of the steps in the above method. For example, the computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a compact disc read-only memory (CD-ROM), a magnetic tape, a floppy disk, and an optical data storage device, etc.
[0208] In an exemplary embodiment, a computer program product or a computer program is also provided. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the above Figure 2 or Figure 3 all or part of the steps of the method shown in any of the embodiments.
[0209] Other embodiments of the present application will be readily apparent to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present application, which follow the general principles of the present application and include known common general knowledge or conventional technical means in the technical field not disclosed in the present application. The specification and examples are only regarded as exemplary, and the true scope and spirit of the present application are pointed out by the following claims.
[0210] It should be understood that the present application is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present application is only limited by the appended claims.
Claims
1. An automatic testing method for cloud computing scenarios, characterized in that, the method includes: Obtain the system log of the cloud server; the system log of the cloud server contains each operation sequence; each operation sequence contains at least two cloud computing operations; For each operation sequence, vectorize each cloud computing operation in the operation sequence to obtain an initial vector set corresponding to the operation sequence; For the target vector in the initial vector set, process it through the forget gate in the target LSTM model to obtain the forgetting amount; Process the target vector through the input gate in the target LSTM model to obtain the output ratio; Process the target vector through the tanh unit in the target LSTM model to obtain vector information; Update the memory cell in the target LSTM model through the forgetting amount, output ratio, and vector information; Based on the updated memory cell, obtain the output vector corresponding to the target vector; Perform weighted processing on the output vectors corresponding to each target vector through attention weights and behavior weights to obtain a complete vector set corresponding to the operation sequence; Execute at least one supplementation process until the number of vectors in the supplemented complete vector set meets the specified conditions. The supplementation process includes: Calculate the similarity between the complete vector set and the vectors of each cloud computing operation in the system log of the cloud server, and supplement the complete vector set with the cloud computing operation with the highest similarity to obtain a first candidate vector set; Input the candidate vector set into the target LSTM model for processing to obtain a second candidate vector set; Based on the similarity between the second candidate vector set and the vectors of each cloud computing operation in the system log of the cloud server, select at least one vector of a cloud computing operation to supplement the second candidate vector set, and determine the supplemented second candidate vector set as the supplemented complete vector set; According to the supplemented complete vector set, sequentially select cloud computing operations for scenario testing.
2. The method according to claim 1, characterized in that, the updating of the memory cell in the target LSTM model through the forgetting amount, output ratio, and vector information includes: Determine the new information according to the output ratio and the vector information; Determine the product of the amount of information in the memory cell and the forgetting amount as the original information; Determine the sum of the new information and the original information as the new memory cell to complete the updating of the memory cell in the target LSTM model.
3. The method according to claim 1, characterized in that, the obtaining of the output vector corresponding to the target vector based on the updated memory cell includes: Calculate the transfer ratio based on the previous hidden state of the target LSTM model and the target vector; the previous hidden state is the hidden state corresponding to the previous vector of the target vector by the target LSTM model; Based on the transfer ratio and the updated memory cells, determine the hidden state corresponding to the target vector, and determine the hidden state corresponding to the target vector as the output vector corresponding to the target vector.
4. The method according to claim 1, wherein, before obtaining the complete vector set corresponding to the operation sequence by weighting the output vectors corresponding to each target vector through the attention weight and the behavior weight, the method further includes: Concatenate each vector in the complete vector set corresponding to the operation sequence into a complete vector matrix; Process the complete vector matrix through an attention mechanism to obtain the attention weights corresponding to each vector in the complete vector set.
5. The method according to claim 1, wherein, before obtaining the complete vector set corresponding to the operation sequence by weighting the output vectors corresponding to each target vector through the attention weight and the behavior weight, the method further includes: Count the number of times the operations corresponding to each vector in the complete vector set appear in the cloud server system log; Based on the number of times the operations corresponding to each vector in each complete vector set appear in the cloud server system log, determine the behavior weights corresponding to each vector in the complete vector set.
6. An automatic test device for a cloud computing scenario, wherein, the device includes: A log acquisition module for acquiring the cloud server system log; the cloud server system log contains each operation sequence; each operation sequence contains at least two cloud computing operations; An initial vector acquisition module for, for each operation sequence, performing vector representation on each cloud computing operation in the operation sequence to obtain an initial vector set corresponding to the operation sequence; A complete vector acquisition module for, for the target vector in the initial vector set, processing it through the forget gate in the target LSTM model to obtain a forgetting amount; processing the target vector through the input gate in the target LSTM model to obtain an output ratio; processing the target vector through the tanh unit in the target LSTM model to obtain vector information; updating the memory cells in the target LSTM model through the forgetting amount, the output ratio, and the vector information; obtaining the output vector corresponding to the target vector based on the updated memory cells; obtaining the complete vector set corresponding to the operation sequence by weighting the output vectors corresponding to each target vector through the attention weight and the behavior weight; A vector supplement module, configured to perform at least one supplement process until the number of vectors in the supplemented complete vector set meets a specified condition. The supplement process includes: calculating the similarity between the complete vector set and the vectors of each cloud computing operation in the cloud server system log, and supplementing the complete vector set with the cloud computing operation having the highest similarity to obtain a first candidate vector set; inputting the candidate vector set into the target LSTM model for processing to obtain a second candidate vector set; based on the similarity between the second candidate vector set and the vectors of each cloud computing operation in the cloud server system log, selecting at least one vector of a cloud computing operation to supplement the second candidate vector set, and determining the supplemented second candidate vector set as the supplemented complete vector set; A scenario testing module, configured to sequentially select cloud computing operations for scenario testing according to the supplemented complete vector set.
7. A computer device, characterized in that, the computer device includes a processor and a memory, and at least one instruction is stored in the memory. The at least one instruction is loaded and executed by the processor to implement the automatic testing method for cloud computing scenarios as described in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, at least one instruction is stored in the storage medium. The at least one instruction is loaded and executed by a processor to implement the automatic testing method for cloud computing scenarios as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Abnormal state detection method and system, storage medium, program and server
CN111552609A
Log exception detection method based on component perception
CN111949480A