Operation resource evaluation method, device and product based on cloud resource life cycle
By using cloud resource lifecycle-based methods in software testing and using genetic algorithms to generate optimal operating use cases, the problems of low efficiency and poor accuracy of software resource evaluation in the existing technology are solved, and efficient and accurate resource evaluation is achieved.
Patent Information
- Application Number
- CN202410887566.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-03
- Publication Date
- 2024-12-31
- Estimated Expiration
- 2044-07-03
AI Technical Summary
The existing technology is inefficient, workload and poor accuracy in software operation resource evaluation. Due to the work experience and professional capabilities of testers, the software's resource evaluation in the cloud environment is inaccurate.
Using a cloud resource life cycle method, by obtaining the test path and operation parameters of the target software, building the initial operation use case population, and using the improved genetic algorithm to find the best operation use case, and running it in a specified cloud environment to obtain Resource occupancy data, conduct resource evaluation.
It improves the efficiency and accuracy of software operation resource evaluation, reduces manual participation, avoids problems due to experience and ability limitations, and is suitable for large-scale software testing.
Smart Images

Figure CN118820096B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of software testing technology, and specifically relates to a method, device and product for evaluating operation resources based on the cloud resource life cycle. Background Art
[0002] The stability of software operation is receiving more and more attention and concern from people. At present, one of the important ways to improve the stability of software operation is to conduct a large number of operation tests before the software goes online to obtain the necessary resources required for its operation, so as to allocate sufficient operation resources to the software according to the test results, thereby ensuring the stable operation of the software.
[0003] At the same time, with the rapid development of large-scale cloud services, software has gradually migrated from local to cloud deployment. Cloud deployment allows enterprises to flexibly expand or reduce computing resources as needed to meet business needs (such as servers, storage, and bandwidth, etc.). It has the advantages of high availability and recoverability, strong flexibility, high security, low cost, and easy management and maintenance. Therefore, cloud deployment is widely used by enterprises.
[0004] At present, the running resource evaluation of software in cloud environment mostly generates running test cases first, and then runs the cases in the specified cloud environment; finally, the corresponding running resource evaluation results are obtained by recording the relevant parameters when the software is running in the cloud environment; among them, the traditional technology is mainly based on the results of software functional requirement analysis, and manually writes test content and forms test cases according to test case design methods such as equivalence class division, boundary value analysis, and guessing error method. It has the following shortcomings: low efficiency, large workload, and is easily limited by the work experience and professional ability of testers, which will cause the quality of generated test cases to be uneven and the accuracy of test cases to be low. This will lead to poor accuracy of subsequent running resource evaluation; based on this, how to provide an efficient and accurate running resource evaluation method has become an urgent problem to be solved. Summary of the invention
[0005] The purpose of the present invention is to provide a method, device and product for evaluating operation resources based on the cloud resource life cycle, so as to solve the problems of low efficiency, heavy workload and poor evaluation accuracy existing in the prior art.
[0006] In order to achieve the above object, the present invention adopts the following technical solutions:
[0007] In a first aspect, a method for evaluating operating resources based on a cloud resource lifecycle is provided, comprising:
[0008] Acquire a test path and operating parameters corresponding to the target software, wherein the operating parameters include the total number of input parameters of the target software;
[0009] Based on the operation parameters, construct a number of initial operation use cases, and use the number of initial operation use cases to form an initial operation use case population, wherein the dimension of any initial operation use case is n, data of each dimension is used to characterize an input parameter of the target software, and n represents the total number of the input parameters;
[0010] According to the test path corresponding to the target software, construct an operation fitness function of the target software, wherein the function value of the operation fitness function is used to characterize the coverage of the test path when the target software runs any initial operation case, and the smaller the function value, the greater the coverage;
[0011] Using the operation fitness function and the improved genetic algorithm, a number of initial operation cases in the initial operation case population are optimized to obtain the optimal operation case of the target software after the optimization process;
[0012] In a specified cloud environment, controlling the target software to run the optimal operation case, and obtaining resource occupancy data of the system in the specified cloud environment during the operation, wherein the resource occupancy data includes CPU occupancy rate and memory occupancy rate;
[0013] The resource occupancy data is used as a result of evaluating the running resources of the target software in the specified cloud environment.
[0014] Based on the above disclosed content, the present invention first obtains the operating parameters and test path of the target software, and then, based on the operating parameters, constructs several initial operating use cases, and uses the test path to construct an operating fitness function; wherein, the operating fitness function is used to characterize the coverage of the test path when the target software runs any initial operating use case, and the smaller the function value, the greater the coverage, and the greater the coverage, the greater the coverage, when the use case is run, the greater the coverage of the statements in the software source code, and the more code is executed; thus, this embodiment is based on this fitness function and uses an improved genetic algorithm to optimize the aforementioned several initial operating use cases, so as to obtain the optimal operating use case of the target software; then, in the specified cloud environment, the target software is controlled to run the optimal operating use case; finally, the resource occupancy data of the system in the specified cloud environment is recorded during its operation, and the operating resource evaluation result of the target software in the specified cloud environment can be obtained.
[0015] Through the above design, the present invention uses the running parameters of the software to generate several initial running test cases, and combines the test path of the software to construct a fitness function for characterizing the coverage of the test path by the software running test cases; then, based on the fitness function, and using the improved genetic algorithm, the optimal test case of the software is generated; finally, the running resource evaluation of the software can be carried out based on this; thus, compared with the traditional technology, the present invention is not only efficient and less workload, but also not limited by the work experience and professional ability of the personnel, therefore, the quality of the running case generation is guaranteed, thereby greatly improving the accuracy of the software running resource evaluation; therefore, the present invention is very suitable for large-scale application and promotion in the field of software testing.
[0016] In a possible design, the operation fitness function and the improved genetic algorithm are used to optimize several initial operation cases, including:
[0017] Initialize the number of iterations s to 1, obtain the updated weight at the s-th iteration, and calculate the learning factor at the s-th iteration based on the updated weight at the s-th iteration;
[0018] Using the updated weight and learning factor at the s-th iteration, the search position and search speed of each initial running case in the initial running case population at the s-th iteration are calculated, so as to obtain each initial running case at the s-th iteration after the calculation is completed;
[0019] Based on the operation fitness function, the fitness of each initial operation case at the s-th iteration is calculated, and based on each fitness, the optimal solution at the s-th iteration is determined, wherein the optimal solution at the s-th iteration is the initial operation case corresponding to the maximum fitness among the fitness of all initial operation cases at the s-th iteration;
[0020] Using the optimal solution at the sth iteration, the historical global optimal solution is updated to obtain the first global optimal solution, wherein the historical global optimal solution is the initial operation case corresponding to the maximum fitness among all fitness in all iterations before the sth iteration;
[0021] Determining whether the first global optimal solution is a local extreme value;
[0022] If yes, then update the first global optimal solution to obtain a second global optimal solution;
[0023] Filtering a target operation case from all initial operation cases at the s-th iteration, and updating the search speed of the target operation case based on the second global optimal solution, so as to update the search position of the target operation case by using the updated search speed, so as to obtain an updated target operation case after the search position is updated;
[0024] In all initial running cases of the s-th iteration, the target running case is replaced with the updated target running case, and after the replacement is completed, the initial running case population of the s-th iteration is obtained;
[0025] Recalculate the fitness of each initial running case in the initial running case population at the sth iteration, and determine whether the optimization process reaches the iteration stop condition based on the recalculated fitness;
[0026] If not, the initial running case population is updated to the initial running case population at the sth iteration, s is incremented by 1, and the updated weights at the sth iteration are re-obtained until the optimization process reaches the iteration stop condition. The first global optimal solution that meets the iteration stop condition is used as the optimal running case of the target software, and the first global optimal solution that meets the iteration stop condition is obtained based on the recalculated fitness levels.
[0027] In a possible design, obtaining the updated weights at the sth iteration includes:
[0028] Obtaining iteration parameters, wherein the iteration parameters include a maximum update weight, a minimum update weight, and a maximum number of iterations;
[0029] Based on the iteration parameter and according to the following formula (1), the update weight at the s-th iteration is calculated;
[0030]
[0031] In the above formula (1), w s is the updated weight at the sth iteration, w min represents the minimum update weight, w max represents the maximum update weight, and S represents the maximum number of iterations;
[0032] Correspondingly, based on the updated weights at the sth iteration, the learning factor at the sth iteration is calculated, which includes:
[0033] According to the following formula (2), the first learning factor at the sth iteration is calculated;
[0034]
[0035] In the above formula (2), η1 represents the first learning factor, and α, β, and δ all represent constants;
[0036] Obtaining a standard value of a learning factor, and calculating a second learning factor based on the standard value of the learning factor and the first learning factor;
[0037] The first learning factor and the second learning factor are used to form the learning factor at the s-th iteration.
[0038] In one possible design, updating the first global optimal solution to obtain a second global optimal solution includes:
[0039] Obtaining an update step size, and initializing the number of updates t to 1, and calculating the update parameters for the tth update based on the first global optimal solution;
[0040] Using the update parameter and the update step size, and according to the following formula (3), calculate the first global optimal solution after the t-th update;
[0041] Z t =Z t-1 +λ r(t) (3)
[0042] In the above formula (3), Z t represents the first global optimal solution after the tth update, Z t-1 represents the first global optimal solution after the t-1th update, λ represents the update step size, r(t) represents the update parameter at the tth update, where when t is 1, Z t-1 is the first global optimal solution;
[0043] Based on the first global optimal solution after the t-th update and the first global optimal solution after the t-1-th update, determine whether the update iteration stop condition is met;
[0044] If not, the first global optimal solution is replaced by the first global optimal solution after the tth update, and t is incremented by 1, and the update parameters for the tth update are recalculated based on the first global optimal solution until the update iteration stop condition is met. The updated first global optimal solution that meets the update iteration stop condition is used as the second global optimal solution.
[0045] In a possible design, a target running case is screened out from all initial running cases at the s-th iteration, and a search speed of the target running case is updated based on the second global optimal solution, including:
[0046] From all the initial operation cases at the s-th iteration, select an initial operation case whose distance from a specified operation case is less than or equal to a preset threshold as a target operation case, wherein the specified operation case is the initial operation case corresponding to the second global optimal solution;
[0047] Obtaining the worst historical search position of the target running case, wherein the worst historical search position is the search position corresponding to the minimum fitness of the target running case during the first to s-th iterations;
[0048] Based on the historical worst search position, the search speed of the target running case is updated to obtain an updated search speed of the target running case.
[0049] In a possible design, based on the historical worst search position, updating the search speed of the target running case to obtain the updated search speed of the target running case includes:
[0050] Randomly select an initial running case from the population of initial running cases and use it as the initial worst running case;
[0051] Using the historical worst search position and the search position of the initial worst running case, and according to the following formula (4), the search speed of the target running case is updated;
[0052]
[0053] In the above formula (4), v′ k represents the updated search speed of the target running case in the kth dimension, w s is the updated weight at the sth iteration, Indicates the search position of the target running case in the kth dimension at the sth iteration, x′ k represents the search position on the kth dimension in the worst historical search position, represents the search position of the initial worst running case in the kth dimension, represents the search speed of the target running case in the kth dimension at the sth iteration, where η3, η4 represent the third learning factor and the fourth learning factor, and μ3, μ4 are random numbers.
[0054] In a possible design, constructing an operation fitness function of the target software according to the test path corresponding to the target software includes:
[0055] Based on the test path and any initial running case, construct a path deviation function and a branch distance function;
[0056] The operation fitness function is obtained by using the path deviation function and the branch distance function.
[0057] In a second aspect, a cloud resource lifecycle-based operation resource evaluation device is provided, comprising:
[0058] An acquisition unit, configured to acquire a test path and operating parameters corresponding to the target software, wherein the operating parameters include the total number of input parameters of the target software;
[0059] A population construction unit, configured to construct a plurality of initial operation use cases based on the operation parameters, and use the plurality of initial operation use cases to form an initial operation use case population, wherein the dimension of any initial operation use case is n, data of each dimension is used to characterize an input parameter of the target software, and n represents the total number of the input parameters;
[0060] A function construction unit, used to construct an operation fitness function of the target software according to the test path corresponding to the target software, wherein the function value of the operation fitness function is used to characterize the coverage of the test path when the target software runs any initial operation case, and the smaller the function value, the greater the coverage;
[0061] An optimization unit, used to perform optimization processing on a number of initial operation cases in the initial operation case population by using the operation fitness function and the improved genetic algorithm, so as to obtain the optimal operation case of the target software after the optimization processing;
[0062] A testing unit, used to control the target software to run the optimal running case in a specified cloud environment, and to obtain resource occupancy data of the system in the specified cloud environment during the running process, wherein the resource occupancy data includes CPU occupancy rate and memory occupancy rate;
[0063] The testing unit is further configured to use the resource occupancy data as a result of evaluating the running resources of the target software in the specified cloud environment.
[0064] In a third aspect, another operation resource assessment device based on the cloud resource life cycle is provided. Taking the device as an electronic device as an example, the device includes a memory, a processor and a transceiver which are communicatively connected in sequence, wherein the memory is used to store computer programs, the transceiver is used to send and receive messages, and the processor is used to read the computer program to execute the operation resource assessment method based on the cloud resource life cycle as in the first aspect or any possible design in the first aspect.
[0065] In a fourth aspect, a storage medium is provided, on which instructions are stored. When the instructions are executed on a computer, the operating resource assessment method based on the cloud resource life cycle as in the first aspect or any possible design of the first aspect is executed.
[0066] In a fifth aspect, a computer program product comprising instructions is provided, which, when executed on a computer, causes the computer to execute the cloud resource lifecycle-based operating resource assessment method as described in the first aspect or any possible design of the first aspect.
[0067] Beneficial effects:
[0068] (1) The present invention utilizes the running parameters of the software to generate a number of initial running test cases, and combines the test path of the software to construct a fitness function for characterizing the coverage of the test path by the software running test cases; then, based on the fitness function, and utilizing the improved genetic algorithm, the optimal test case of the software is generated; finally, based on this, the running resource evaluation of the software can be performed; thus, compared with the traditional technology, the present invention is not only efficient and less labor-intensive, but also not limited by the work experience and professional ability of personnel, thus ensuring the quality of the running case generation, thereby greatly improving the accuracy of the software running resource evaluation; therefore, the present invention is very suitable for large-scale application and promotion in the field of software testing. BRIEF DESCRIPTION OF THE DRAWINGS
[0069] Figure 1 A schematic diagram of the steps of a method for evaluating cloud resource lifecycle-based operation resources provided by an embodiment of the present invention;
[0070] Figure 2 A schematic diagram of the structure of an operating resource evaluation device based on a cloud resource life cycle provided by an embodiment of the present invention;
[0071] Figure 3 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0072] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the present invention will be briefly introduced below in combination with the drawings and the description of the embodiments or the prior art. Obviously, the following description of the structure of the drawings is only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. It should be noted that the description of these embodiments is used to help understand the present invention, but does not constitute a limitation of the present invention.
[0073] It should be understood that although the terms first, second, etc. may be used herein to describe various units, these units should not be limited by these terms. These terms are only used to distinguish one unit from another unit. For example, a first unit can be referred to as a second unit, and similarly, a second unit can be referred to as a first unit without departing from the scope of the exemplary embodiments of the present invention.
[0074] It should be understood that the term "and / or" that may appear in this article is merely a description of the association relationship between associated objects, indicating that three relationships may exist. For example, A and / or B can represent three situations: A exists alone, B exists alone, and A and B exist at the same time. The term " / and" that may appear in this article describes another type of association object relationship, indicating that two relationships may exist. For example, A / and B can represent two situations: A exists alone, and A and B exist alone. In addition, the character " / " that may appear in this article generally indicates that the previous and next associated objects are in an "or" relationship.
[0075] Example:
[0076] See also Figure 1 As shown, the operation resource evaluation method based on the cloud resource life cycle provided in this embodiment uses the input parameters of the software to generate several initial operation use cases, and combines the test path of the software to construct a fitness function for characterizing the coverage of the software operation test case on the test path; then, based on the fitness function, and using the improved genetic algorithm, the aforementioned several initial operation use cases are optimized, so as to obtain the optimal test case of the software; finally, the operation resource evaluation of the software can be performed based on the optimal test case; thus, compared with the traditional technology, the method does not require human participation, is not only efficient and less labor-intensive, but also is not limited to the influence of personnel work experience and professional ability, therefore, the quality of the operation use case generation is guaranteed, thereby greatly improving the accuracy of the software operation resource evaluation; among them, for example, the method can be but not limited to running on the cloud server side, it can be understood that the aforementioned execution subject does not constitute a limitation on the embodiments of the present application, and accordingly, the operation steps of the method can be but not limited to the following steps S1 to S6.
[0077] S1. Obtain the test path and running parameters corresponding to the target software, wherein the running parameters include the total number of input parameters of the target software; in this embodiment, the total number of output parameters of the software can be pre-stored in the cloud server and can be read when used; at the same time, the test path of the target software can be obtained by, but not limited to, the following methods: (1) Based on the target software, generate a control flow graph of the target software (a control flow graph is a graphical method for describing the control flow of a program, in which a circle in the graph represents a node, and a node represents one or more branchless statements, and an arrow line in the graph represents the control flow); (2) Based on the control flow graph, calculate the cyclomatic complexity of the target software (a software metric that provides a quantitative scale for program complexity and can provide program (a) determining the number of independent paths in the basic set of sequences and the upper limit of the number of test cases that ensure that all statements are executed at least once; (b) determining the number of independent paths based on the cyclic complexity and the control flow graph; and (c) determining the test path based on the independent paths. In this embodiment, the number of independent paths is greater than 1. Therefore, in this embodiment, the longest path length is selected from the independent paths as the test path. Thus, the longer the path length, the more statements are executed, the greater the coverage of the software code, and the higher the execution complexity. Based on this, the most complex path is used as the test path, which can test the resources occupied by the software when it is fully running to the greatest extent. In addition, the above method is the basic path test method of software, which is a commonly used method for software testing, and its principle will not be repeated.
[0078] After obtaining the operating parameters and test path of the target software, several initial operating cases and operating fitness functions can be generated, so that the aforementioned initial operating cases can be optimized based on the fitness function to obtain the optimal operating case of the target software; optionally, the generation process of the initial operating case can be but is not limited to as shown in the following step S2.
[0079] S2. Based on the operation parameters, construct a number of initial operation use cases, and use the initial operation use cases to form an initial operation use case population, wherein the dimension of any initial operation use case is n, and the data of each dimension is used to characterize an input parameter of the target software, and n represents the total number of the input parameters; in this embodiment, it has been explained above that the operation parameter is the number of output parameters of the target software, therefore, it is equivalent to generating a number of representative input data, and an initial operation use case is used as an input data; based on this, an initial operation use case is equivalent to an n-dimensional vector, and the element of each dimension in the vector represents an input parameter.
[0080] After generating a number of initial operation cases, an operation fitness function can be constructed based on the test path so as to perform case optimization processing based on it; wherein, the construction process of the operation fitness function can be but is not limited to as shown in the following step S3.
[0081] S3. According to the test path corresponding to the target software, construct an operation fitness function of the target software, wherein the function value of the operation fitness function is used to characterize the coverage of the test path when the target software runs any initial operation case, and the smaller the function value, the greater the coverage; in specific applications, for example, but not limited to, first constructing a path deviation function and a branch distance function based on the test path and any initial operation case; then, using the path deviation function and the branch distance function to derive the operation fitness function.
[0082] Specifically, the path deviation function refers to: when the target software runs any of the aforementioned initial running use cases, the running path it passes through deviates from the branch of the test path, that is, the number of nodes that are not matched between the path corresponding to any of the aforementioned initial running use cases and the test path; in layman's terms, it is to obtain the intersection of the nodes in the aforementioned two paths; then, obtain the number of nodes in the node intersection; finally, use the total number of nodes in the test path minus the number of nodes in the node intersection to obtain the path deviation degree.
[0083] At the same time, the branch distance function is used to describe the degree to which the target software approaches the branch conditions of each conditional statement in the test path when executing any of the aforementioned initial running cases; for example, if a conditional statement in the test path is: ifg≥10, then the test goal is to allow the true branch of the statement to be executed; and when the software uses any of the aforementioned initial running cases as input to execute the conditional statement, the value obtained is g′; based on this, the branch distance function of the conditional statement is:
[0084]
[0085] Among them, this embodiment can obtain the branch distance function corresponding to the remaining conditional statements in the test path by constructing a branch distance function table; then, the sum of the branch distance functions corresponding to each conditional statement is obtained and standardized to obtain the branch distance function of the test path.
[0086] The branch distance function table may be, but is not limited to, the table shown in Table 1 below.
[0087] Table 1 is a branch distance function table.
[0088] Branch Conditions g≥g′ g>g′ g=g′ g≠g′ Branch distance (true) 0 0 0 0 Branch distance (false) |gg′| |gg′|+0.1 |gg′| 1
[0089] In this way, based on the aforementioned Table 1, the branch distance function corresponding to different conditional statements in the test path (i.e., the nodes belonging to the conditional statements) can be constructed; then, the sum of the branch distance functions corresponding to each conditional statement is obtained, and standardized, to obtain the branch distance function of the test path; finally, the branch distance function of the test path is added to the aforementioned path deviation function to obtain the running fitness function.
[0090] In this embodiment, the running fitness function may be, but is not limited to, the following formula (5).
[0091]
[0092] In the above formula (5), F(X) represents the running fitness function, P(X) represents the path deviation function when the target software executes any initial running case X, and f m (X) represents the branch distance function of the mth conditional statement when the target software executes any initial running case X, and M represents the total number of conditional statements in the test path.
[0093] Thus, through the above explanation, a fitness function for characterizing the coverage of the test path by the software running test case can be constructed; and from formula (5), it can be seen that the smaller the branch distance function and the path deviation function values are, the smaller the value of the running fitness function is, and the smaller the path deviation function value is, the more nodes covered by any initial running case on the test path are; similarly, the smaller the branch distance function is, the more the true branch of the conditional statement in the test path is executed (when the true branch is executed, the corresponding branch distance function takes a value of 0); therefore, this embodiment is based on the running fitness function to optimize several initial running cases, so as to obtain the optimal running case that maximizes the node coverage in the test path and executes the most conditional statements of the true branch; optionally, the optimization process of the initial running case can be but is not limited to the following step S4.
[0094] S4. Utilize the operation fitness function and the improved genetic algorithm to optimize several initial operation cases in the initial operation case population, so as to obtain the optimal operation case of the target software after the optimization process; in specific applications, this embodiment introduces update weights and learning factors related to the update weights to update the search speed and position of each initial operation case; at the same time, a secondary search and update process are also provided to avoid falling into a local optimal solution; in this way, the search accuracy of the algorithm can be improved; among them, for example, the following steps S40 to S49 can be used to optimize and obtain the optimal operation case.
[0095] S41. Initialize the number of iterations s to 1, obtain the update weight at the s-th iteration, and calculate the learning factor at the s-th iteration based on the update weight at the s-th iteration; in the specific implementation, for example, but not limited to, first obtain the iteration parameters (in this embodiment, the iteration parameters include the maximum update weight, the minimum update weight and the maximum number of iterations); then, based on the iteration parameters, calculate the update weight at the s-th iteration.
[0096] Optionally, for example, but not limited to, the following formula (1) may be used to calculate the update weight at the s-th iteration.
[0097]
[0098] In the above formula (1), w s is the updated weight at the sth iteration, w min represents the minimum update weight, w max Represents the maximum update weight, S represents the maximum number of iterations; in this embodiment, the minimum update weight is 0.4 and the maximum update weight is 0.9; of course, the values of the aforementioned parameters can be specifically set according to actual use and are not limited to the aforementioned examples.
[0099] In this way, based on the aforementioned formula (1), the updated weight at the s-th iteration can be calculated; then, based on this, the learning factor at the s-th iteration can be calculated; optionally, the calculation process of the learning factor at the s-th iteration can be but is not limited to the following steps S41a to S41c.
[0100] S41a. Calculate the first learning factor at the sth iteration according to the following formula (2).
[0101]
[0102] In the above formula (2), η1 represents the first learning factor, and α, β, and δ all represent constants. In this embodiment, α, β, and δ may be, but are not limited to, 0.45, 0.9, and 0.45, respectively. Of course, the values of α, β, and δ may also be specifically set according to actual use, and are not limited to the above examples.
[0103] After the first learning factor is calculated, the second learning factor may be calculated using the first learning factor, and the process may be but is not limited to the process shown in the following step S41b.
[0104] S41b. Obtain a standard value of the learning factor, and calculate a second learning factor based on the standard value of the learning factor and the first learning factor. In this embodiment, the second learning factor can be obtained by subtracting the first learning factor from the standard value of the learning factor, but is not limited to, and the standard value of the learning factor can be, but is not limited to, 2.
[0105] After the second learning factor is calculated, it can be combined with the first learning factor to obtain the learning factor for the sth iteration, and the process can be but is not limited to the following step S41c.
[0106] S41c. Use the first learning factor and the second learning factor to form the learning factor for the s-th iteration.
[0107] In this way, through the aforementioned steps S41a~S41c, the update weights and learning factors at the sth iteration can be calculated; then, based on this, the search position and search speed of each initial running use case at the sth iteration can be calculated, so that the fitness can be calculated based on the search position of each initial running use case subsequently; wherein, the calculation process of the search position and speed can be but is not limited to as shown in the following step S42.
[0108] S42. Utilize the updated weights and learning factors at the s-th iteration to calculate the search position and search speed of each initial running case in the population of initial running cases at the s-th iteration, so as to obtain each initial running case at the s-th iteration after the calculation is completed; in the specific implementation, it has been explained above that each initial running case is actually an n-dimensional vector, and the n-dimensional vector serves as the initial search position of each initial running case (that is, the search position is a vector, and each element in the vector corresponds to an input parameter respectively), and at the same time, an initial search speed is assigned to each initial running case (the vector dimension is the same as the dimension of the search position); then, the search position and speed of each initial running case are updated in combination with the updated weights and learning factors at the s-th iteration mentioned above.
[0109] For any initial running case, the search speed at the sth iteration may be calculated by, for example but not limited to, using the following formula (6).
[0110]
[0111] In the above formula (6), represents the search speed of the bth dimension at the sth iteration of any of the aforementioned initial run cases, represents the search speed of the bth dimension of any of the aforementioned initial running cases at the s-1th iteration (i.e., the search speed of any of the aforementioned initial running cases at the s-1th iteration corresponds to the bth element in the vector), η1, η2 represent the first learning factor and the second learning factor respectively, rand1, rand2 both represent random numbers between [0,1], p b represents the b-th element in the individual historical optimal search position of any of the initial running cases (i.e., the b-th element in the search position corresponding to the maximum fitness of any of the initial running cases during the 1st to sth iterations), p b ′ represents the element of the bth dimension in the historical optimal position of the population in the population of initial running cases (i.e., the search position corresponding to the initial running case with the largest fitness among all the initial running cases during the 1st to sth iterations); represents the element of the bth dimension in the search position of any of the initial running cases at the s-1th iteration; where b = 1, 2, ..., n, and when s is 1, Then it is the element of the bth dimension in the initial search speed of any initial running case; similarly, when s is 1, the initial search position of each initial running case can be used to calculate the corresponding fitness, and the initial search position of the initial running case corresponding to the maximum fitness is taken as the historical optimal position of the population; of course, when s is 1, is the element of the bth dimension in the initial search position of any of the aforementioned initial run use cases.
[0112] Thus, based on the aforementioned formula (6), the search speed in each dimension of any of the aforementioned initial running cases at the s-th iteration can be calculated; and then, the search speed in each dimension can be used to form its search speed at the s-th iteration.
[0113] Further, examples may include but are not limited to using To obtain the search position of the bth dimension of any of the above initial running cases at the sth iteration Right now:
[0114] Therefore, based on the aforementioned formula (6), the update of the search speed and position of each initial running case at the sth iteration can be completed, thereby obtaining each initial running case at the sth iteration; then, the fitness of each initial running case at the sth iteration can be calculated based on the aforementioned running fitness function, so as to determine whether the optimization process can be continued based on the fitness; wherein, the fitness calculation process can be but is not limited to as shown in the following step S43.
[0115] S43. Based on the operation fitness function, the fitness of each initial operation case at the s-th iteration is calculated, and based on each fitness, the optimal solution at the s-th iteration is determined, wherein the optimal solution at the s-th iteration is the initial operation case corresponding to the maximum fitness among the fitness of all initial operation cases at the s-th iteration; in this embodiment, the target software is made to execute each initial operation case at the s-th iteration, and then, based on the aforementioned formula (5), the corresponding fitness is calculated; finally, the initial operation case with the maximum fitness at the s-th iteration is taken as the aforementioned optimal solution.
[0116] After obtaining the optimal solution at the s-th iteration, the historical global optimal solution may be updated, and the process may be, but is not limited to, as shown in the following step S44.
[0117] S44. Use the optimal solution at the s-th iteration to update the historical global optimal solution to obtain the first global optimal solution, wherein the historical global optimal solution is the initial operation case corresponding to the maximum fitness among all fitness in all iterations before the s-th iteration; in this embodiment, the historical global optimal solution is the initial operation case corresponding to the maximum fitness of each initial operation case in the initial operation case population from the first to the s-th iteration; at the same time, if the optimal solution at the s-th iteration is greater than the historical global optimal solution, the historical global optimal solution is updated to the optimal solution at the s-th iteration, thereby obtaining the first global optimal solution; otherwise, no update is performed, and the historical global optimal solution is directly used as the first global optimal solution.
[0118] After completing the update of the historical global optimal solution, it can be determined whether it has fallen into a local optimum, so that after falling into the local optimum, individual adjustments can be made to escape from the local optimum; wherein, the local optimum determination process can be but is not limited to as shown in the following step S45.
[0119] S45. Determine whether the first global optimal solution is a local extreme value. In this embodiment, if the first global optimal solution does not change for u consecutive times (u can be but is not limited to being set to 3 times), it is determined that the population is trapped in a local optimum. At this time, it is necessary to update the first global optimal solution to get out of the local optimum. The update process of the first global optimal solution can be but is not limited to the following step S46.
[0120] S46. If yes, then the first global optimal solution is updated to obtain a second global optimal solution. In this embodiment, if the first global optimal solution is not a local extreme value, then it is directly determined whether the fitness of the first global optimal solution is less than the fitness threshold, or whether s has reached the maximum number of iterations. If yes, then the first global optimal solution is directly used as the optimal running case of the target software. Otherwise, each initial running case in the initial running case population is updated to each initial running case at the sth iteration. Then s is incremented by 1, and the update weight at the sth iteration is re-obtained (i.e., returns to step S41). At the same time, when u is less than 3, it is also directly determined whether the fitness of the first global optimal solution is less than the fitness threshold, or whether s has reached the maximum number of iterations. Then, the same steps as above are executed. The process is the same as the operating steps when the first global optimal solution is not a local extreme value, and will not be repeated here.
[0121] Further, when the first global optimal solution is a local extreme value, the first global optimal solution may be updated by, for example but not limited to, using the following steps S46a to S46d.
[0122] S46a. Obtain the update step size, and initialize the number of updates t to 1, and calculate the update parameters for the tth update based on the first global optimal solution; in this embodiment, the aforementioned first global optimal solution is essentially the historical optimal individual of the population during the iteration process; and the search position corresponding to the first global optimal solution is an n-dimensional vector, then, a parameter function can be constructed for the first global optimal solution, and then, the partial derivative of the parameter function in the n-dimension of the first global optimal solution is obtained; then, each partial derivative is used to form a vector as a gradient vector; finally, the norm of the gradient vector is used as the aforementioned update parameter.
[0123] Optionally, the example parameter function can be but is not limited to: the branch distance function of the test path when the target software executes the first global optimal solution; that is, each node of the conditional statement of the test path corresponds to a branch distance function, and each branch distance function corresponds to the first global optimal solution (that is, corresponding to n-dimensional input data); and the branch distance functions of all conditional statements are superimposed and standardized, which can be used as the branch distance function of the test path, and its function form is the same as the expression after P(X) in formula (5), which will not be repeated here.
[0124] As described above, finding the partial derivative of the parameter function is equivalent to finding the gradient direction of the function. Based on this, this embodiment uses a gradient descent method to update the first global optimal solution, thereby making it deviate from the local optimum.
[0125] After obtaining the update parameters at the t-th update, the first global optimal solution can be updated based on the update parameters, and the process can be but is not limited to the following step S46b.
[0126] S46b. Using the update parameters and the update step size, and according to the following formula (3), calculate the first global optimal solution after the t-th update.
[0127] Z t =Z t-1 +λ r(t) (3)
[0128] In the above formula (3), Z t represents the first global optimal solution after the tth update, Z t-1 represents the first global optimal solution after the t-1th update, λ represents the update step size, r(t) represents the update parameter at the tth update, where when t is 1, Z t-1 is the first global optimal solution; in this embodiment, the update step size can be specifically set according to actual use and is not specifically limited here; at the same time, updating the first global optimal solution is essentially updating the search position corresponding to the first global optimal solution.
[0129] After obtaining the global optimal solution after the t-th update based on the above formula (3), it can be determined whether the update process can be terminated. The process can be but is not limited to the following step S46c.
[0130] S46c. Based on the first global optimal solution after the t-th update and the first global optimal solution after the t-1-th update, determine whether the update iteration stop condition is satisfied; in this embodiment, for example, but not limited to, when the first global optimal solution after the t-th update no longer changes, it is determined that the update iteration stop condition is satisfied; or when the error between the first global optimal solutions after the t-th update and the t-1-th update is less than a preset value, it is determined that the update iteration stop condition is satisfied; wherein the error between the two may be the mean of the errors of the elements in each dimension of the n-dimensional elements.
[0131] In this embodiment, if the update iteration stop condition is not met, then it is necessary to update the first global optimal solution to the first global optimal solution after the tth update; then, recalculate the update parameters, and re-execute the aforementioned steps S46a to S46c until the update iteration stop condition is met to obtain the second global optimal solution; wherein, the cyclic update process can be but is not limited to as shown in the following step S46d.
[0132] S46d. If not, then the first global optimal solution is replaced by the first global optimal solution after the t-th update, and t is incremented by 1, and the update parameters for the t-th update are recalculated based on the first global optimal solution until the update iteration stop condition is met. The first global optimal solution after the update that meets the update iteration stop condition is used as the second global optimal solution.
[0133] In this way, through the aforementioned steps S46a to S46d, the gradient descent method can be used to make the first global optimal solution that is trapped in the local extreme value escape from the local optimum, thereby avoiding it from causing incorrect guidance to the remaining initial running use cases in the next iteration process; at the same time, after completing the escape from the local optimum, this embodiment also provides a secondary search speed update process, and its process can be but is not limited to as shown in the following step S47.
[0134] S47. Filter out the target operation case from all the initial operation cases at the sth iteration, and update the search speed of the target operation case based on the second global optimal solution, so as to update the search position of the target operation case using the updated search speed, so as to obtain the updated target operation case after the search position is updated.
[0135] In this embodiment, the updated search speed can be obtained by, for example but not limited to, using the following steps S47a to S47c.
[0136] S47a. From all the initial running use cases at the sth iteration, the initial running use cases whose distance to the designated running use cases is less than or equal to a preset threshold are screened out as target running use cases, wherein the designated running use cases are the initial running use cases corresponding to the second global optimal solution; in this embodiment, the search position vector of each initial running use case can be calculated, and the distance between the search position vector of the initial running use case corresponding to the second global optimal solution can be calculated, and then the initial running use cases whose distance is less than or equal to the preset threshold are screened out as target running use cases.
[0137] After obtaining the target running case, the historical worst search position of the target running case can be obtained so that the corresponding search speed can be updated based on the historical worst search position; wherein, the process of obtaining the historical worst search position can be but is not limited to as shown in the following step S47b.
[0138] S47b. Obtain the historical worst search position of the target operation case, wherein the historical worst search position is the search position corresponding to the minimum fitness of the target operation case during the first to s-th iterations; in this embodiment, assuming that there are three target operation cases, the historical worst search position of each target operation case is obtained respectively; then, based on the historical worst search position of each target operation case, the update of each search speed can be completed, and the process can be but not limited to as shown in the following step S47c.
[0139] S47c. Based on the historical worst search position, the search speed of the target running case is updated to obtain the updated search speed of the target running case; in specific applications, for example, but not limited to, an initial running case is first randomly selected from the initial running case population and used as the initial worst running case; then, the search speed of the target running case is updated using the historical worst search position and the search position of the initial worst running case.
[0140] Optionally, the following formula (4) may be used to obtain the updated search speed of the target running case.
[0141]
[0142] In the above formula (4), v′ k represents the updated search speed of the target running case in the kth dimension, w s is the updated weight at the sth iteration, represents the search position of the target running case in the kth dimension at the sth iteration (i.e., the kth element in the vector corresponding to the search position), x′ k represents the search position on the kth dimension in the worst historical search position, represents the search position of the initial worst running case in the kth dimension, represents the search speed of the target running case in the kth dimension at the sth iteration, where η3, η4 represent the third learning factor and the fourth learning factor, and μ3, μ4 are both random numbers; of course, the value range of μ3, μ4 is also [0, 1], and k = 1, 2, ..., n.
[0143] Therefore, through the aforementioned steps S47a to S47c, the search speed of each target running use case can be updated, and then, the search position can be updated based on the updated search speed (that is, the update formula can be found in the aforementioned step S42), and the principle will not be repeated here.
[0144] After completing the update of the search position of each target operation case, the updated target operation case can be used to replace the original target operation case, and the process can be but not limited to as shown in the following step S48.
[0145] S48. In all initial running cases of the sth iteration, the target running case is replaced with the updated target running case, and after the replacement is completed, the initial running case population of the sth iteration is obtained.
[0146] After completing the replacement of the target running case based on the aforementioned step S48, the initial running case population at the sth iteration can be obtained; at this time, it is necessary to recalculate the fitness of each initial running case in the initial running case population at the sth iteration, and based on this, determine whether the optimization process can be terminated; wherein the determination process can be but is not limited to as shown in the following step S48.
[0147] S48. Recalculate the fitness of each initial running case in the population of initial running cases at the sth iteration, and determine whether the optimization process reaches the iteration stop condition based on the recalculated fitnesses; in this embodiment, the initial running case corresponding to the largest fitness is still screened out, and then, determine whether the initial running case corresponding to the largest fitness is the same as the historical global optimal solution; if not, update the historical global optimal solution to obtain the first global optimal solution (if they are the same, use the historical global optimal solution as the first global optimal solution); at this time, determine whether the fitness of the first global optimal solution is less than the fitness threshold, or whether s reaches the maximum number of iterations; if any of the above conditions is met, use the first global optimal solution as the optimal running case; otherwise, it is necessary to perform optimization again, that is, enter the next optimization process, and continue to loop until the iteration stop condition is met; wherein, the cyclic optimization process can be but is not limited to the following step S49.
[0148] S49. If not, then add 1 to s and re-obtain the updated weight at the sth iteration until the optimization process reaches the iteration stop condition. The first global optimal solution that meets the iteration stop condition will be used as the optimal running case of the target software, and the first global optimal solution that meets the iteration stop condition is obtained based on the recalculated fitness levels.
[0149] Therefore, through the aforementioned steps S41 to S49 and their sub-steps, the running fitness function and the improved genetic algorithm can be used to find the optimal running case of the target software; then, based on the optimal running case, the resources required for the running of the target software can be evaluated, and the process can be but not limited to as shown in the following steps S5 and S6.
[0150] S5. In the specified cloud environment, control the target software to run the optimal operation use case, and during the operation, obtain the resource occupancy data of the system in the specified cloud environment, wherein the resource occupancy data includes CPU occupancy and memory occupancy; in this embodiment, the resource occupancy data may also include bandwidth, etc., and the aforementioned resource occupancy data is directly obtained through the operation log of the system in the cloud environment.
[0151] After obtaining the resource occupancy data corresponding to the optimal operation use case of the target software in the cloud environment, it can be used as the operation resource evaluation result of the target software in the specified cloud environment. The process can be but is not limited to the following step S6.
[0152] S6. Use the resource occupancy data as the operating resource evaluation result of the target software in the specified cloud environment. Thus, based on the aforementioned steps, the operating resource evaluation result of the target software in the specified cloud environment can be obtained. Then, according to the evaluation result, sufficient operating resources can be allocated to the target software in the cloud environment, thereby ensuring the stable operation of the target software.
[0153] Thus, through the operation resource evaluation method based on the cloud resource life cycle described in detail in the aforementioned steps S1 to S6, the present invention utilizes the input parameters of the software to generate a number of initial operation use cases, and combines the test path of the software to construct a fitness function for characterizing the coverage of the test path by the software operation test case; then, based on the fitness function, and using the improved genetic algorithm, the aforementioned several initial operation use cases are optimized to obtain the optimal test case of the software; finally, the operation resource evaluation of the software can be performed based on the optimal test case; thus, compared with the traditional technology, the present invention does not require human participation, is not only highly efficient and less labor-intensive, but is also not limited by the work experience and professional ability of personnel, and therefore, ensures the quality of the generation of the operation use cases, thereby greatly improving the accuracy of the software operation resource evaluation.
[0154] like Figure 2 As shown, the second aspect of this embodiment provides a hardware device for implementing the operation resource evaluation method based on the cloud resource life cycle described in the first aspect of the embodiment, including:
[0155] The acquisition unit is used to acquire the test path and operation parameters corresponding to the target software, wherein the operation parameters include the total number of input parameters of the target software.
[0156] A population construction unit is used to construct a number of initial operation use cases based on the operation parameters, and use the several initial operation use cases to form an initial operation use case population, wherein the dimension of any initial operation use case is n, and the data of each dimension is used to characterize an input parameter of the target software, and n represents the total number of the input parameters.
[0157] A function construction unit is used to construct an operation fitness function of the target software according to the test path corresponding to the target software, wherein the function value of the operation fitness function is used to characterize the coverage of the test path when the target software runs any initial operation use case, and the smaller the function value, the greater the coverage.
[0158] The optimization unit is used to use the operation fitness function and the improved genetic algorithm to perform optimization processing on several initial operation cases in the initial operation case population, so as to obtain the optimal operation case of the target software after the optimization processing.
[0159] The test unit is used to control the target software to run the optimal operation case in the specified cloud environment, and during the operation, obtain the resource occupancy data of the system in the specified cloud environment, wherein the resource occupancy data includes CPU occupancy and memory occupancy.
[0160] The testing unit is further configured to use the resource occupancy data as a result of evaluating the running resources of the target software in the specified cloud environment.
[0161] The working process, working details and technical effects of the device provided in this embodiment can be found in the first aspect of the embodiment and will not be described in detail here.
[0162] like Figure 3 As shown, the third aspect of this embodiment provides another operation resource assessment device based on the cloud resource life cycle. Taking the device as an electronic device as an example, it includes: a memory, a processor and a transceiver that are communicatively connected in sequence, wherein the memory is used to store computer programs, the transceiver is used to send and receive messages, and the processor is used to read the computer program to execute the operation resource assessment method based on the cloud resource life cycle as described in the first aspect of the embodiment.
[0163] For example, the memory may include, but is not limited to, random access memory (RAM), read only memory (ROM), flash memory, first input first output (FIFO) and / or first in last out (FILO), etc. Specifically, the processor may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). At the same time, the processor may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state.
[0164] In some embodiments, the processor may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. For example, the processor may not be limited to a microprocessor of the STM32F105 series, a reduced instruction set computer (RISC) microprocessor, an X86 architecture processor, or a processor with an integrated embedded neural network processing unit (NPU); the transceiver may be, but is not limited to, a wireless fidelity (WIFI) wireless transceiver, a Bluetooth wireless transceiver, a general packet radio service technology (General Packet Radio Service, GPRS) wireless transceiver, a ZigBee protocol (a low-power local area network protocol based on the IEEE802.15.4 standard, ZigBee) wireless transceiver, a 3G transceiver, a 4G transceiver and / or a 5G transceiver, etc. In addition, the device may also include, but is not limited to, a power module, a display screen, and other necessary components.
[0165] The working process, working details and technical effects of the electronic device provided in this embodiment can be found in the first aspect of the embodiment and will not be described in detail here.
[0166] The fourth aspect of this embodiment provides a storage medium that stores instructions for the operation resource assessment method based on the cloud resource life cycle described in the first aspect of the embodiment, that is, the storage medium stores instructions, and when the instructions are executed on a computer, the operation resource assessment method based on the cloud resource life cycle described in the first aspect of the embodiment is executed.
[0167] The storage medium refers to a carrier for storing data, which may include but is not limited to a floppy disk, a CD, a hard disk, a flash memory, a USB flash drive and / or a memory stick, and the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
[0168] The working process, working details and technical effects of the storage medium provided in this embodiment can be found in the first aspect of the embodiment and will not be described in detail here.
[0169] A fifth aspect of this embodiment provides a computer program product comprising instructions, which, when executed on a computer, causes the computer to execute the operation resource assessment method based on the cloud resource lifecycle as described in the first aspect of the embodiment, wherein the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
[0170] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for evaluating operating resources based on the cloud resource life cycle, characterized in that: include: Acquire a test path and operating parameters corresponding to the target software, wherein the operating parameters include the total number of input parameters of the target software; Based on the operation parameters, construct a number of initial operation use cases, and use the number of initial operation use cases to form an initial operation use case population, wherein the dimension of any initial operation use case is n, data of each dimension is used to characterize an input parameter of the target software, and n represents the total number of the input parameters; According to the test path corresponding to the target software, construct an operation fitness function of the target software, wherein the function value of the operation fitness function is used to characterize the coverage of the test path when the target software runs any initial operation case, and the smaller the function value, the greater the coverage; Using the operation fitness function and the improved genetic algorithm, a number of initial operation cases in the initial operation case population are optimized to obtain the optimal operation case of the target software after the optimization process; In a specified cloud environment, controlling the target software to run the optimal operation case, and obtaining resource occupancy data of the system in the specified cloud environment during the operation, wherein the resource occupancy data includes CPU occupancy rate and memory occupancy rate; Using the resource occupancy data as a result of evaluating the running resources of the target software in the specified cloud environment; Using the operational fitness function and the improved genetic algorithm, several initial operational use cases are optimized, including: Initialize the number of iterations s to 1, obtain the updated weight at the s-th iteration, and calculate the learning factor at the s-th iteration based on the updated weight at the s-th iteration; Using the updated weight and learning factor at the s-th iteration, the search position and search speed of each initial running case in the initial running case population at the s-th iteration are calculated, so as to obtain each initial running case at the s-th iteration after the calculation is completed; Based on the operation fitness function, the fitness of each initial operation case at the s-th iteration is calculated, and based on each fitness, the optimal solution at the s-th iteration is determined, wherein the optimal solution at the s-th iteration is the initial operation case corresponding to the maximum fitness among the fitness of all initial operation cases at the s-th iteration; Using the optimal solution at the sth iteration, the historical global optimal solution is updated to obtain the first global optimal solution, wherein the historical global optimal solution is the initial operation case corresponding to the maximum fitness among all fitnesses in all iterations before the sth iteration; Determining whether the first global optimal solution is a local extreme value; If yes, then update the first global optimal solution to obtain a second global optimal solution; Filtering a target operation case from all initial operation cases at the s-th iteration, and updating the search speed of the target operation case based on the second global optimal solution, so as to update the search position of the target operation case by using the updated search speed, so as to obtain an updated target operation case after the search position is updated; In all initial running cases of the s-th iteration, the target running case is replaced with the updated target running case, and after the replacement is completed, the initial running case population of the s-th iteration is obtained; Recalculate the fitness of each initial running case in the initial running case population at the sth iteration, and determine whether the optimization process reaches the iteration stop condition based on the recalculated fitness; If not, the initial running case population is updated to the initial running case population at the sth iteration, s is incremented by 1, and the updated weights at the sth iteration are re-obtained until the optimization process reaches the iteration stop condition. The first global optimal solution that meets the iteration stop condition is used as the optimal running case of the target software, and the first global optimal solution that meets the iteration stop condition is obtained based on the recalculated fitness levels.
2. The method according to claim 1, characterized in that Get the updated weights at the sth iteration, including: Obtaining iteration parameters, wherein the iteration parameters include a maximum update weight, a minimum update weight, and a maximum number of iterations; Based on the iteration parameter and according to the following formula (1), the update weight at the s-th iteration is calculated; (1) In the above formula (1), is the updated weight at the sth iteration, represents the minimum update weight, represents the maximum update weight, Indicates the maximum number of iterations; Correspondingly, based on the updated weights at the sth iteration, the learning factor at the sth iteration is calculated, which includes: According to the following formula (2), the first learning factor at the sth iteration is calculated; (2) In the above formula (2), represents the first learning factor, All represent constants; Obtaining a standard value of a learning factor, and calculating a second learning factor based on the standard value of the learning factor and the first learning factor; The first learning factor and the second learning factor are used to form the learning factor at the s-th iteration.
3. The method according to claim 1, characterized in that Updating the first global optimal solution to obtain a second global optimal solution includes: Obtaining an update step size, and initializing the number of updates t to 1, and calculating the update parameters for the tth update based on the first global optimal solution; Using the update parameter and the update step size, and according to the following formula (3), calculate the first global optimal solution after the t-th update; (3) In the above formula (3), represents the first global optimal solution after the tth update, represents the first global optimal solution after the t-1th update, represents the update step size, represents the update parameter at the tth update, where when t is 1, is the first global optimal solution; Based on the first global optimal solution after the t-th update and the first global optimal solution after the t-1-th update, determine whether the update iteration stop condition is met; If not, the first global optimal solution is replaced by the first global optimal solution after the tth update, and t is incremented by 1, and the update parameters for the tth update are recalculated based on the first global optimal solution until the update iteration stop condition is met. The updated first global optimal solution that meets the update iteration stop condition is used as the second global optimal solution.
4. The method according to claim 1, characterized in that: Filtering out a target running case from all the initial running cases at the s-th iteration, and updating the search speed of the target running case based on the second global optimal solution, including: From all the initial operation cases at the s-th iteration, select an initial operation case whose distance from a specified operation case is less than or equal to a preset threshold as a target operation case, wherein the specified operation case is the initial operation case corresponding to the second global optimal solution; Obtaining the worst historical search position of the target running case, wherein the worst historical search position is the search position corresponding to the minimum fitness of the target running case during the first to s-th iterations; Based on the historical worst search position, the search speed of the target running case is updated to obtain an updated search speed of the target running case.
5. The method according to claim 4, characterized in that Based on the historical worst search position, updating the search speed of the target running case to obtain the updated search speed of the target running case includes: Randomly select an initial running case from the population of initial running cases and use it as the initial worst running case; Using the historical worst search position and the search position of the initial worst running case, and according to the following formula (4), the search speed of the target running case is updated; (4) In the above formula (4), represents the updated search speed of the target running case on the kth dimension, is the updated weight at the sth iteration, Indicates the search position of the target running case in the kth dimension at the sth iteration, represents the search position on the kth dimension in the worst historical search position, represents the search position of the initial worst running case in the kth dimension, represents the search speed of the target running case in the kth dimension at the sth iteration, where represents the third learning factor and the fourth learning factor, and All are random numbers.
6. The method according to claim 1, characterized in that According to the test path corresponding to the target software, constructing the operation fitness function of the target software, including: Based on the test path and any initial running case, construct a path deviation function and a branch distance function; The operation fitness function is obtained by using the path deviation function and the branch distance function.
7. An operating resource evaluation device based on cloud resource lifecycle, used to execute the operating resource evaluation method based on cloud resource lifecycle according to any one of claims 1 to 6, characterized in that: include: An acquisition unit, configured to acquire a test path and operating parameters corresponding to the target software, wherein the operating parameters include the total number of input parameters of the target software; A population construction unit, configured to construct a plurality of initial operation use cases based on the operation parameters, and use the plurality of initial operation use cases to form an initial operation use case population, wherein the dimension of any initial operation use case is n, data of each dimension is used to characterize an input parameter of the target software, and n represents the total number of the input parameters; A function construction unit, used to construct an operation fitness function of the target software according to the test path corresponding to the target software, wherein the function value of the operation fitness function is used to characterize the coverage of the test path when the target software runs any initial operation case, and the smaller the function value, the greater the coverage; An optimization unit, used to perform optimization processing on a number of initial operation cases in the initial operation case population by using the operation fitness function and the improved genetic algorithm, so as to obtain the optimal operation case of the target software after the optimization processing; A testing unit, used to control the target software to run the optimal running case in a specified cloud environment, and to obtain resource occupancy data of the system in the specified cloud environment during the running process, wherein the resource occupancy data includes CPU occupancy rate and memory occupancy rate; The testing unit is further configured to use the resource occupancy data as a result of evaluating the running resources of the target software in the specified cloud environment.
8. A cloud resource life cycle-based operating resource evaluation device, characterized in that: include: A memory, a processor and a transceiver that are sequentially communicatively connected, wherein the memory is used to store a computer program, the transceiver is used to send and receive messages, and the processor is used to read the computer program to execute the operation resource assessment method based on the cloud resource life cycle as described in any one of claims 1 to 6.
9. A computer program product comprising instructions, characterized in that When the instructions are executed on a computer, the computer is caused to execute the operating resource evaluation method based on the cloud resource life cycle as described in any one of claims 1 to 6.
