Methods, apparatus, electronic devices and storage media for extracting related scenes
By constructing directed connected graphs and pressure transmission graphs, the system automatically extracts performance test related scenarios, solving the problems of missing and lagging results caused by manual verification and achieving accurate performance test scenario extraction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- INDUSTRIAL AND COMMERCIAL BANK OF CHINA
- Filing Date
- 2022-07-22
- Publication Date
- 2026-07-03
AI Technical Summary
In existing technologies, the serial verification of performance testing scenarios mainly relies on manual verification, which has deficiencies and lags, and lacks effective automated tools.
By acquiring node information based on preset logging points, a directed connected graph is constructed and a pressure transmission graph is generated. Target links are extracted using node execution and performance information to form a set of related scenarios.
It enables automated and rapid extraction of performance test-related scenarios, avoiding the lag and bias of manual sorting, and ensuring the completeness and accuracy of test scenarios.
Smart Images

Figure CN115129609B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of financial technology, and more specifically, to a method, apparatus, electronic device, and storage medium for extracting related scenarios. Background Technology
[0002] With the digital transformation of enterprises, software systems are becoming increasingly complex, significantly enhancing the importance of performance testing in software testing. Performance testing primarily focuses on core and high-frequency transactions within the software system, with primary testing targets often related to the changes made in the current version. However, changes in requirements not only put pressure on the currently modified system functions but may also create cascading pressure on previously unaffected functions. Therefore, performance testing focused solely on a single point has significant scenario omissions. Typically, performance testing requires combining multiple test points, that is, connecting performance test scenarios. Currently, the verification of connecting multiple test points mainly relies on the experience of testers for manual verification, lacking effective tool support.
[0003] In related technologies, although test plans and test cases are accumulated as a reference for sequential verification, the compilation of test plans mostly requires manual sorting, which can easily lead to the omission of relevant scenarios requiring performance testing and also has a certain lag. Therefore, there is an urgent need for a fast-responding and automatically organized method for extracting relevant performance testing scenarios to reduce manual sorting and provide test plans for sequential verification of performance tests.
[0004] There is currently no effective solution to the above problems. Summary of the Invention
[0005] This invention provides a method, apparatus, electronic device, and storage medium for extracting associated scenarios, in order to at least solve the technical problem in related technologies where the need for manual sorting of associated test scenarios can easily lead to the loss of associated scenarios to be tested.
[0006] According to one aspect of the present invention, a method for extracting associated scenarios is provided, comprising: obtaining node information of nodes based on preset tracking logs, wherein each node corresponds to a test scenario, and the node information includes at least: node execution information and node performance information; constructing a directed connected graph based on the node execution information; generating a pressure transmission graph based on the node performance information and the directed connected graph; and extracting target links from the pressure transmission graph using the current test scenario as the initial node, wherein the test scenarios represented by each node in the target link constitute an associated scenario set.
[0007] Optionally, the step of constructing a directed connected graph based on the node execution information includes: using the node identifier recorded in the node execution information as the node identifier of the directed connected graph, and storing the execution count of the node in the node indicated by the node identifier of the directed connected graph; constructing the relationship edge of the directed connected graph based on the node relationship recorded in the node execution information, and using the number of transitions between nodes as the weight value of the relationship edge.
[0008] Optionally, after constructing a directed connected graph based on the node execution information, the method further includes: determining the in-degree and out-degree values of each relation edge based on the weight value of each relation edge in the directed connected graph and the execution count of each node; and generating node index information based on the in-degree and out-degree values.
[0009] Optionally, before generating the pressure transmission graph based on the node performance information and the directed connected graph, the method further includes: obtaining the number of transactions and the transaction execution duration of each node at each sampling time point within a preset time period based on the node performance information; determining the volatility ratio of each node based on the number of transactions and the transaction execution duration; deleting the in-degree edges of nodes whose volatility ratios are less than a first preset threshold, thereby obtaining an adjusted directed connected graph.
[0010] Optionally, the step of determining the volatility ratio of each node based on the number of transactions and the transaction execution duration includes: determining the sampling concurrency of each node based on the number of transactions, and determining the sampling overhead parameter of each node based on the transaction execution duration; converting the sampling concurrency to a standard sampling concurrency, and converting the sampling overhead parameter to a standard sampling overhead parameter; determining the concurrency volatility of the standard sampling concurrency, and determining the overhead volatility of the standard sampling overhead parameter; and determining the volatility ratio of each node based on the concurrency volatility and the overhead volatility.
[0011] Optionally, the step of generating a pressure transmission graph based on the node performance information and the directed connected graph includes: determining the correlation coefficient of each node based on the number of transactions and the transaction execution time to obtain a set of correlation coefficients; determining a target correlation coefficient with a negative value in the set of correlation coefficients; and deleting the in-degree edges of the nodes indicated by the target correlation coefficient based on the adjusted directed connected graph to obtain the pressure transmission graph.
[0012] Optionally, before extracting the target link from the pressure transmission graph using the current test scenario as the initial node, the method further includes: updating the node indicator information based on the pressure transmission graph to obtain target node indicator information; and determining the influence weight value of the predecessor node of each node on the current node based on the target node indicator information.
[0013] Optionally, the step of extracting the target link from the pressure transmission graph using the current test scenario as the initial node includes: representing the current test scenario as the initial node and adding the initial node to the target node set; determining the rise threshold of the initial node; performing the step of determining the target node set, wherein the step of determining the target node set includes: querying the pressure transmission graph for the set of nodes directly connected to the out-degree edge of the initial node; determining the rise rate of each node in the node set based on the rise threshold and the influence weight value; adding nodes with rise rates greater than a second preset threshold to the target node set; selecting the next node in the target node set after the initial node as the initial node, and repeating the step of determining the target node set until all nodes in the target node set have been processed to obtain the final node set; and extracting the target link based on the final node set.
[0014] Optionally, after extracting the target link from the pressure transmission graph using the current test scenario as the initial node, the method further includes: extracting other test scenarios associated with the current test scenario based on the target link to obtain the associated scenario set, wherein the current test scenario is a scenario where the target system undergoes version modification; and testing all the test scenarios in the associated scenario set to complete the performance test of the target system.
[0015] According to another aspect of the present invention, an apparatus for extracting associated scenarios is also provided, comprising: an acquisition unit, configured to acquire node information of nodes based on preset embedded logs, wherein each node corresponds to a test scenario, and the node information includes at least: node execution information and node performance information; a construction unit, configured to construct a directed connected graph based on the node execution information; a generation unit, configured to generate a pressure transmission graph based on the node performance information and the directed connected graph; and an extraction unit, configured to extract target links from the pressure transmission graph using the current test scenario as the initial node, wherein the test scenarios represented by each node in the target link constitute an associated scenario set.
[0016] Optionally, the construction unit includes: a first storage module, used to use the node identifier recorded in the node execution information as the node identifier of the directed connected graph, and to store the execution count of the node in the node indicated by the node identifier of the directed connected graph; and a first construction module, used to construct the relationship edge of the directed connected graph based on the node relationship recorded in the node execution information, and to use the number of transitions between nodes as the weight value of the relationship edge.
[0017] Optionally, the extraction device further includes: a first determining module, configured to determine the in-degree and out-degree values of each relation edge based on the weight value of each relation edge in the directed connected graph and the execution count of each node after constructing the directed connected graph based on the node execution information; and a first generating module, configured to generate node index information based on the in-degree and out-degree values.
[0018] Optionally, the extraction device further includes: a first acquisition module, configured to acquire, based on the node performance information, the number of transactions and the transaction execution duration at each sampling time point within a preset time period for each node; a second determination module, configured to determine the volatility ratio of each node based on the number of transactions and the transaction execution duration; and a first deletion module, configured to delete the in-degree edges of nodes whose volatility ratio is less than a first preset threshold, thereby obtaining an adjusted directed connected graph.
[0019] Optionally, the second determining module includes: a first determining submodule, configured to determine the sampling concurrency of each node based on the number of transactions, and to determine the sampling overhead parameter of each node based on the transaction execution duration; a first conversion submodule, configured to convert the sampling concurrency into a standard sampling concurrency, and to convert the sampling overhead parameter into a standard sampling overhead parameter; a second determining submodule, configured to determine the concurrency volatility of the standard sampling concurrency, and to determine the overhead volatility of the standard sampling overhead parameter; and a third determining submodule, configured to determine the volatility ratio of each node based on the concurrency volatility and the overhead volatility.
[0020] Optionally, the generation unit includes: a third determining module, configured to determine the correlation coefficient of each node based on the number of transactions and the transaction execution time, to obtain a set of correlation coefficients; a fourth determining module, configured to determine the target correlation coefficient with a negative coefficient value in the set of correlation coefficients; and a second deletion module, configured to delete the in-degree edges of the nodes indicated by the target correlation coefficient based on the adjusted directed connected graph, to obtain the pressure transmission graph.
[0021] Optionally, the extraction device further includes: a first update module, used to update the node indicator information based on the pressure transmission map before extracting the target link from the pressure transmission map with the current test scenario as the initial node, to obtain the target node indicator information; and a fifth determination module, used to determine the influence weight value of the predecessor node of each node on the current node based on the target node indicator information.
[0022] Optionally, the extraction unit includes: a first characterization module, used to characterize the current test scenario as an initial node and add the initial node to a target node set; a sixth determination module, used to determine the rise threshold of the initial node; a first execution module, used to execute the step of determining the target node set, wherein the step of determining the target node set includes: querying the pressure transmission graph for a set of nodes directly connected to the out-degree edge of the initial node; determining the rise rate of each node in the node set based on the rise threshold and the influence weight value; adding nodes with rise rates greater than a second preset threshold to the target node set; a first selection module, used to select the next node in the target node set after the initial node as the initial node, and repeatedly execute the step of determining the target node set until all nodes in the target node set have been executed to obtain a final node set; and a first extraction module, used to extract the target link based on the final node set.
[0023] Optionally, the extraction device further includes: a second extraction module, used to extract other test scenarios associated with the current test scenario based on the target link after extracting the target link from the pressure transmission diagram with the current test scenario as the initial node, to obtain the associated scenario set, wherein the current test scenario is a scenario in which the target system undergoes version modification; and a first testing module, used to test all the test scenarios in the associated scenario set to complete the performance test of the target system.
[0024] According to another aspect of the present invention, a computer-readable storage medium is also provided, the computer-readable storage medium including a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to perform the above-described method for extracting associated scenarios.
[0025] According to another aspect of the present invention, an electronic device is also provided, including one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement the above-described method for extracting associated scenarios.
[0026] In this disclosure, node information is obtained based on preset tracking logs. A directed connected graph is constructed based on node execution information. A pressure transmission graph is generated based on node performance information and the directed connected graph. Taking the current test scenario as the initial node, target links are extracted from the pressure transmission graph. Each node in the target link represents a test scenario that constitutes a set of associated scenarios. In this application, node information can be obtained through preset tracking logs, then a directed connected graph is constructed. By analyzing node performance information, a pressure transmission graph is generated. Subsequently, based on the pressure transmission graph, the associated scenarios for performance testing are extracted. The pressure transmission graph can be automatically adjusted according to behavioral data, avoiding the lag and one-sidedness of manual sorting. This solves the technical problem in related technologies where manual sorting of associated test scenarios is required, which can easily lead to the loss of associated scenarios to be tested. Attached Figure Description
[0027] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:
[0028] Figure 1 This is a flowchart of an optional method for extracting associated scenes according to an embodiment of the present invention;
[0029] Figure 2 This is a schematic diagram of an optional directed connected graph G representing the execution status of various transactions in a system according to an embodiment of the present invention;
[0030] Figure 3 This is a schematic diagram of an optional adjusted directed connected graph G according to an embodiment of the present invention;
[0031] Figure 4 This is a schematic diagram of an optional directed connected graph G based on correlation coefficient adjustment according to an embodiment of the present invention;
[0032] Figure 5 This is a schematic diagram of an optional performance test related scenario mining process according to an embodiment of the present invention;
[0033] Figure 6 This is a schematic diagram of an optional performance test correlation scenario mining system according to an embodiment of the present invention;
[0034] Figure 7 This is a schematic diagram of an optional connected graph generation and node index calculation according to an embodiment of the present invention;
[0035] Figure 8 This is a schematic diagram of an optional pressure transmission diagram construction according to an embodiment of the present invention;
[0036] Figure 9 This is a schematic diagram illustrating the establishment of an optional performance test association scenario according to an embodiment of the present invention;
[0037] Figure 10 This is a schematic diagram of an optional associated scene extraction device according to an embodiment of the present invention;
[0038] Figure 11 This is a hardware structure block diagram of an electronic device (or mobile device) for an associated scene extraction method according to an embodiment of the present invention. Detailed Implementation
[0039] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0040] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0041] To facilitate understanding of the present invention by those skilled in the art, some terms or nouns involved in the various embodiments of the present invention are explained below:
[0042] Pressure Transmission Graph: By embedding data points, the system's access flow scenario graph is constructed and can be represented as a directed connected graph. By calculating the performance indicators of each transaction node in the directed connected graph and the positive correlation of the indicators, a pressure transmission graph is generated. This pressure transmission graph can represent the process by which the pressure is transmitted to other nodes after the concurrency of a certain node in the system increases.
[0043] It should be noted that the method and apparatus for extracting related scenarios in this disclosure can be used in the field of fintech for extracting related scenarios, and can also be used in any field other than fintech for extracting related scenarios. This disclosure does not limit the application field of the method and apparatus for extracting related scenarios.
[0044] It should be noted that all information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data used for analysis, etc.) involved in this disclosure are information and data authorized by the user or fully authorized by all parties. For example, this system has an interface with the relevant user or organization. Before obtaining relevant information, it is necessary to send an acquisition request to the aforementioned user or organization through the interface, and obtain the relevant information after receiving consent from the aforementioned user or organization.
[0045] The following embodiments of the present invention can be applied to various systems / applications / devices for extracting related scenarios. The present invention proposes a method for automatically extracting related performance test scenarios, which can form a series of performance test scenarios. Performance testing is usually conducted on transactions or functions. The present invention solves the problem of identifying related test scenarios, applicable to both transactions and functions. For ease of description, the present invention will simply refer to transactions or functions as "nodes".
[0046] This invention can obtain the correlation between nodes through log data collection, forming a directed connected graph. Combined with transaction response times in the logs, a weighted directed connected graph is formed. Then, by analyzing the changing trends of transaction volume and response time of each node at different time points, nodes with similar trends are identified. The graph formed by these nodes and their connections serves as the system's pressure transmission diagram (i.e., which other nodes will be transmitted to when the pressure on some nodes increases). When the pressure on a node in the pressure transmission diagram changes, the pressure on subsequent nodes will also change accordingly, meaning these nodes also need to undergo performance testing. This completes the extraction of a performance test serial verification scenario. It can not only automatically adjust the system's pressure transmission diagram based on user behavior data, effectively avoiding the lag and bias of manual analysis, but also truly reflect the actual operation of the system, achieving relatively accurate and real-time analysis results.
[0047] It should be noted that the pressure transmission graph in this invention can calculate the impact of increased concurrency at the current node on subsequent nodes. Because the graphical method is more intuitive and easier to understand, it can be represented as a connected graph. In addition, the pressure transfer between nodes can also be recorded through data structures, functions, triples, etc. This invention does not limit the specific representation of the pressure transmission graph.
[0048] The present invention will now be described in detail with reference to various embodiments.
[0049] Example 1
[0050] According to an embodiment of the present invention, an embodiment of a method for extracting associated scenes is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0051] Figure 1 This is a flowchart of an optional method for extracting associated scenes according to an embodiment of the present invention, such as... Figure 1 As shown, the method includes the following steps:
[0052] Step S101: Based on the preset data entry logs, obtain the node information of the nodes. Each node corresponds to a test scenario, and the node information includes at least: node execution information and node performance information.
[0053] Step S102: Construct a directed connected graph based on node execution information.
[0054] Step S103: Generate a pressure transmission graph based on node performance information and the directed connectivity graph.
[0055] Step S104: Using the current test scenario as the initial node, extract the target link from the pressure transmission graph, where each node in the target link represents a test scenario that constitutes a set of associated scenarios.
[0056] Through the above steps, node information can be obtained based on preset tracking logs. A directed connected graph can be constructed based on node execution information. A pressure transmission graph is generated based on node performance information and the directed connected graph. Using the current test scenario as the initial node, target links are extracted from the pressure transmission graph. Each node in the target link represents a test scenario that constitutes a set of associated scenarios. In this embodiment of the invention, node information can be obtained through preset tracking logs, then a directed connected graph can be constructed. A pressure transmission graph is generated by analyzing node performance information. Based on the pressure transmission graph, the associated scenarios for performance testing are extracted. The pressure transmission graph can be automatically adjusted according to behavioral data, avoiding the lag and bias of manual sorting. This solves the technical problem in related technologies where manually sorting associated test scenarios easily leads to the loss of the required associated scenarios.
[0057] The embodiments of the present invention will now be described in detail with reference to the steps described above.
[0058] Step S101: Based on the preset data entry logs, obtain the node information of the nodes. Each node corresponds to a test scenario, and the node information includes at least: node execution information and node performance information.
[0059] In this embodiment of the invention, the daily operation logs of the business system (i.e., the preset logs) can be read first. The logs can collect the order of user access to nodes and the performance overhead of the node (in this embodiment, each node corresponds to a test scenario, which can be a test transaction scenario or a test function scenario, etc.).
[0060] In this embodiment, the node information obtained from the event logs includes at least: node execution information and node performance information. Node execution information refers to the state information during node execution, and includes at least the following elements: user session, node name, preceding node, execution time, etc. The preceding node can be obtained through the Referer information (used to indicate the source) in the URL (Uniform Resource Locator) request, or through parameter passing during transaction redirection; this is not limited here. Node performance information refers to the performance overhead during node execution. Considering that many factors affect server hardware performance overhead, the node execution time can be selected as the performance indicator of node consumption. Therefore, node performance information includes at least the following elements: request arrival time, request response time, execution time, etc. The execution time can be obtained through the request response time, or it can be collected and stored on the server side; this is not limited here.
[0061] Step S102: Construct a directed connected graph based on node execution information.
[0062] Optionally, the step of constructing a directed connected graph based on node execution information includes: using the node identifier recorded in the node execution information as the node identifier of the directed connected graph, and storing the number of times the node is executed in the node indicated by the node identifier of the directed connected graph; constructing relationship edges of the directed connected graph based on the node relationships recorded in the node execution information, and using the number of transitions between nodes as the weight value of the relationship edges.
[0063] In this embodiment of the invention, a directed connected graph can be generated based on the node execution information collected from the event logs. The nodes recorded in the node execution information are the nodes of the directed connected graph, and the user's access order constitutes the edges of the directed connected graph. Specifically, the node identifier recorded in the node execution information can be saved as the node marker of the directed connected graph, and the execution count can be saved to that node (i.e., the execution count of the node is saved in the node indicated by the node identifier in the directed connected graph). Then, the directed edges are constructed based on the node relationships recorded in the event logs (i.e., the relationship between the "current node" and the "preceding node"), and the number of transitions is saved as a weight (i.e., based on the node relationships recorded in the node execution information, the relationship edges of the directed connected graph are constructed, and the number of transitions between nodes is used as the weight value of the relationship edges), thus completing the construction of the directed connected graph. In this embodiment, isolated nodes without any edges are not saved. Furthermore, to establish node trigger flows as accurately as possible, a "user session" mechanism can be used for the identification of a single user.
[0064] Optionally, after constructing the directed connected graph based on node execution information, the method further includes: determining the in-degree and out-degree values of each relation edge based on the weight value of each relation edge in the directed connected graph and the execution count of each node; and generating node indicator information based on the in-degree and out-degree values.
[0065] In this embodiment of the invention, after constructing the directed connected graph, the number and proportion of out-degree and in-degree in the directed connected graph can be calculated based on the weight value of each relation edge and the execution count of each node (i.e., the in-degree and out-degree values of each relation edge are calculated). Then, based on the in-degree and out-degree values, node indicator information is generated and saved. The specific process of calculating the out-degree and in-degree is as follows:
[0066] (1) For any directed edge (i.e., relation edge), obtain its two adjacent nodes (i.e., the in-degree node and the out-degree node connected by the directed edge).
[0067] (2) For out-degree nodes, calculate the proportion of the out-degree weight of the directed edge to all out-degree edges of the out-degree node (i.e., the out-degree value of the relation edge).
[0068] (3) For an in-degree node, calculate the proportion of the in-degree weight of the directed edge to all in-degree edges of the in-degree node (i.e., the in-degree value of the relation edge).
[0069] (4) If a node is both an out-degree node and an in-degree node, calculate them separately.
[0070] For example, Figure 2 This is a schematic diagram of an optional directed connected graph G representing the execution status of various transactions in a system according to an embodiment of the present invention, such as... Figure 2As shown, the directed connected graph G represents the execution status of transactions in a certain system. Nodes represent transactions, and there are a total of 7 transaction nodes (M, A, B, C, D, E, and F). Edges represent the flow between transactions, and the weight of the edge represents the number of flows. Specifically, M was executed a total of 300 times, with A being executed after 100 executions, B after 100 executions, and C after 20 executions; A was executed a total of 120 times, with D being executed after 50 executions; B was executed a total of 150 times... After 30 executions, M continued execution; after 15 executions, E continued execution; after 20 executions, A continued execution; after 20 executions, D continued execution; C was executed a total of 80 times, after 30 executions, B continued execution; after 15 executions, F continued execution; D was executed a total of 100 times, after 40 executions, F continued execution; E was executed a total of 20 times, after 20 executions, B continued execution; F was executed a total of 65 times, after 10 executions, C continued execution.
[0071] from Figure 2 It can be seen that for transaction M, a total of 300 executions were performed. Among them, 100 executions were followed by the execution of transaction A, accounting for 33%; the subsequent execution of transaction B accounted for 33%; the subsequent execution of transaction C accounted for 7%; the execution triggered by transaction B accounted for 10%; and the execution of transaction M alone without any preceding or subsequent transactions accounted for 17%.
[0072] Optionally, before generating the pressure transmission graph based on node performance information and the directed connected graph, the method further includes: obtaining the number of transactions and the transaction execution time of each node at each sampling time point within a preset time period based on node performance information; determining the volatility ratio of each node based on the number of transactions and the transaction execution time; deleting the in-degree edges of nodes with volatility ratios less than a first preset threshold to obtain the adjusted directed connected graph.
[0073] In this embodiment, another optional step of determining the volatility ratio of each node based on the number of transactions and the transaction execution time includes: determining the sampling concurrency of each node based on the number of transactions, and determining the sampling overhead parameter of each node based on the transaction execution time; converting the sampling concurrency to a standard sampling concurrency, and converting the sampling overhead parameter to a standard sampling overhead parameter; determining the concurrency volatility of the standard sampling concurrency, and determining the overhead volatility of the standard sampling overhead parameter; and determining the volatility ratio of each node based on the concurrency volatility and the overhead volatility.
[0074] In this embodiment of the invention, the number of transactions and the transaction execution time of each node at each sampling time point within a preset time period (e.g., within a certain minute) can be obtained first. Then, based on the number of transactions at each sampling time point, the "sampled concurrency" can be calculated using formula (1). The specific calculation is as follows: the average number of concurrency of nodes within the preset time period is calculated by summing them up, and then rounded up (i.e., if the result has a decimal, the integer part is incremented by 1). Formula (1) is:
[0075] (1);
[0076] in, Indicates the number of concurrent samples. This represents the number of transactions at each sampling time point within a preset time period, where n represents the number of sampling time points.
[0077] For example, the system's transaction tracking data for transaction A within the time period from 9:00 AM to 9:01 AM is shown in Table 1. The transaction request time is accurate to the second, and there are a total of 5 data entries:
[0078] Table 1
[0079]
[0080] Then the sampling concurrency of transaction A = (295 / 5) = 59.
[0081] Then, based on the transaction execution duration at each sampling time point, the "sampling overhead parameter" can be calculated using formula (2). The specific calculation is as follows: The node performance overhead is calculated by dividing the total execution time of the node within the preset time period by the number of executions. Formula (2) is as follows:
[0082] (2);
[0083] in, Indicates the sampling cost parameter. This represents the transaction execution duration at each sampling time point within a preset time period, where n represents the number of sampling time points.
[0084] Taking Table 1 as an example, the sampling overhead parameters of transaction A = (1350 / 5) = 270.
[0085] Next, the "volatility" of the node's concurrency and performance overhead throughout the day can be calculated. In this embodiment, "volatility" refers to the differences in concurrency and performance overhead at different points in time. The stronger the volatility, the greater the amplitude of change. Considering that the amount of collected data is finite, volatility can be represented by the degree of dispersion of the values. The "sample standard deviation" can be used to calculate the degree of dispersion of the values (that is, the sampled concurrency can be converted into the standard sampled concurrency, and the sampled overhead parameters can be converted into the standard sampled overhead parameters). In this embodiment, the larger the "sample standard deviation," the greater the degree of dispersion of the values, that is, the greater the amplitude of the node's performance index change, and vice versa.
[0086] Formula (3) for calculating the sample standard deviation S:
[0087] (3);
[0088] in, For sample values, is the sample mean, and n is the sample size.
[0089] For example, the sampled data of transactions A, B, and C at 7 time points are shown in Table 2:
[0090] Table 2
[0091]
[0092] The calculation results are as follows:
[0093] Transaction A: =59.9; =218.7;
[0094] Transaction B: =59.9; =11.1;
[0095] Transaction C: =22.3; =111.0.
[0096] in, This represents the standard sampling concurrency. This represents the standard sampling overhead parameter.
[0097] In this embodiment, due to and The numerical differences are relatively large, making comparison inconvenient. Therefore, the "sample standard deviation" can be further normalized and proportionally processed. The processing formula for the standard sampling concurrency is formula (4), and the processing formula for the standard sampling overhead parameter is formula (5). That is, in this embodiment, the concurrency volatility of the standard sampling concurrency can be calculated using formula (4). The overhead volatility of the standard sampling overhead parameter is calculated using formula (5). .
[0098] (4);
[0099] (5).
[0100] The processing results, taking Table 2 as an example, are as follows:
[0101] Transaction A: =0.82; =0.56;
[0102] Transaction B: =0.82; =0.05;
[0103] Transaction C: =0.56; =0.41.
[0104] The results show that, with the same "fluctuation" in the number of concurrent transactions, transaction B exhibits very little "fluctuation" in performance.
[0105] Furthermore, a "performance-to-concurrency fluctuation ratio" (RT) can be introduced to represent the proportional relationship between performance overhead fluctuation and concurrency fluctuation (i.e., determining the fluctuation ratio of each node based on concurrency volatility and overhead volatility). A larger value indicates that the performance dispersion is more significantly affected by the dispersion of concurrency, while a smaller value indicates that the performance dispersion is not affected by the dispersion of concurrency. Therefore, the in-degree edges of nodes whose RT values (i.e., fluctuation ratios) are less than a first preset threshold can be removed from the directed connected graph (i.e., removing the in-degree edges of nodes indicated by fluctuation ratios less than the first preset threshold to obtain an adjusted directed connected graph). This indicates that the performance overhead of these nodes is not affected by the increase or decrease in concurrency of their preceding nodes.
[0106] The formula for calculating the volatility ratio is: ;
[0107] The calculation results, taking Table 2 as an example, are as follows:
[0108] Transaction A: RT=0.68;
[0109] Transaction B: RT=0.06;
[0110] Transaction C: RT=0.73.
[0111] The calculation results show that the performance overhead dispersion of transaction A is similar to that of concurrency dispersion, and its impact is relatively large (close to 1); the performance overhead dispersion of transaction B is only slightly affected by concurrency dispersion (close to 0). If the preset threshold of RT is set to 0.2, that is, the volatility of performance overhead is 20% of the volatility of concurrency, then the edges with in-degree nodes in transaction B will be deleted.
[0112] Figure 3 This is a schematic diagram of an optional adjusted directed connected graph G according to an embodiment of the present invention, such as... Figure 3 As shown, in Figure 2 Based on this, the in-degree edges of transaction B (i.e., the edges whose arrows point to B) were deleted. Figure 2 The arrow of the relation edge points to the edge with weight value 100 in B.
[0113] Step S103: Generate a pressure transmission graph based on node performance information and the directed connectivity graph.
[0114] Optionally, the step of generating a pressure transmission graph based on node performance information and a directed connected graph includes: determining the correlation coefficient of each node based on the number of transactions and the transaction execution time to obtain a set of correlation coefficients; determining the target correlation coefficient with a negative value in the set of correlation coefficients; and deleting the in-degree edges of the nodes indicated by the target correlation coefficient based on the adjusted directed connected graph to obtain the pressure transmission graph.
[0115] In this embodiment of the invention, simply calculating the performance concurrency fluctuation ratio is insufficient to draw a conclusion on the correlation between concurrency and performance overhead. It is also necessary to analyze whether concurrency and performance overhead are positively correlated. In this embodiment, if the concurrency of a node is positively correlated with its execution time, it indicates that the node's performance overhead is significantly affected by concurrency, and such nodes should be included in the analysis. Conversely, if the concurrency of a node is not positively correlated with its execution time, it indicates that the node's performance overhead is not affected by concurrency, meaning that an increase in the node's concurrency does not generate additional performance overhead. Such nodes do not need to be included in the analysis, and their in-degree edges can be deleted.
[0116] In this embodiment of the invention, considering that the data on concurrency and performance overhead during the sampling time are not normally distributed, the Spearman correlation coefficient (i.e., Spearman rank correlation coefficient) can be used to calculate the correlation between concurrency and performance overhead (i.e., determining the correlation coefficient of each node based on the number of transactions and the transaction execution time). , thus obtaining the set of correlation coefficients), where the formula (6) for the Spearman correlation coefficient is as follows:
[0117] (6);
[0118] Here, x and y represent two sets of data (i.e., the data consisting of the number of transactions and the array consisting of the transaction execution time). This indicates the rank of variable x after transformation. This represents the rank of variable y after transformation. (In this embodiment, for two sets of data with non-linear distributions, the Spearman algorithm can be used to obtain a better similarity calculation result. The rank is obtained by cutting the non-linear part into many linear parts and calculating them separately. For the Spearman algorithm, this means sorting the intervals with the same values (x or y) and then calculating them in segments.) This represents the covariance of the two sets of data. This represents the sample standard deviation of data x. This represents the sample standard deviation of data y.
[0119] Taking Table 2 as an example, the correlation calculation results are as follows:
[0120] Transaction a: x={25,76,54,32,108,189,23}, y={200,380,500,230,420,800,180}, then ;
[0121] Transaction c: x={25,38,24,32,89,43,34}, y={340,210,500,210,200,220,230}, then .
[0122] The calculation results show that the concurrency and performance consumption of transaction a are positively correlated, while the concurrency and performance consumption of transaction c are negatively correlated. Therefore, the in-degree edges of the node where transaction c is located should be deleted (that is, after determining the target correlation coefficient with a negative value in the correlation coefficient set, the in-degree edges of the node indicated by the target correlation coefficient can be deleted based on the adjusted directed connected graph to obtain the pressure transmission graph).
[0123] Figure 4 This is a schematic diagram of an optional directed connected graph G based on correlation coefficient adjustment according to an embodiment of the present invention, such as... Figure 4 As shown, in Figure 3 Based on this, the in-degree edges of transaction C (i.e., the edges whose arrows point to C) were deleted. Figure 3 The arrows of the relation edges point to edges with weights of 20 and 10 in C.
[0124] Optionally, the Spearman correlation coefficient in this embodiment is actually the Pearson correlation coefficient (i.e., the Pearson correlation coefficient) after the data has undergone rank transformation. Therefore, the Pearson correlation algorithm can be used after the data has been rank transformed or segmented, or the Kendall rank correlation coefficient can be used. There are no restrictions here.
[0125] Optionally, before extracting the target link from the pressure transmission graph using the current test scenario as the initial node, the method further includes: updating the node indicator information based on the pressure transmission graph to obtain the target node indicator information; and determining the influence weight value of the predecessor node of each node on the current node based on the target node indicator information.
[0126] In this embodiment of the invention, node indicator information can be updated based on the pressure transmission diagram to obtain target node indicator information (i.e., the generated pressure transmission diagram can be used to recalculate the in-degree and out-degree values of each relation edge, update the node indicator information, and obtain target node indicator information). Then, based on the target node indicator information, the influence weight value of each node's predecessor node on the current node can be determined. For example, for... Figure 4 In other words, the impact of transaction A on transaction M is 83% = (100 / 120) 100%).
[0127] Step S104: Using the current test scenario as the initial node, extract the target link from the pressure transmission graph, where each node in the target link represents a test scenario that constitutes a set of associated scenarios.
[0128] Optionally, after extracting the target link from the stress transmission graph using the current test scenario as the initial node, the process further includes: extracting other test scenarios associated with the current test scenario based on the target link to obtain a set of associated scenarios, where the current test scenario is the scenario where the target system undergoes version modification; and testing all test scenarios in the set of associated scenarios to complete the performance test of the target system.
[0129] In this embodiment of the invention, based on the target link extracted from the pressure transmission diagram, other test scenarios (e.g., other functional scenarios associated with the main test payment function) can be extracted that are related to the current test scenario (i.e., the scenario where the target system where the current test scenario is located undergoes version modification, for example, if a system modifies the payment function, then the scenario represented by the payment function is the current main test scenario), to obtain a set of related scenarios. Then, all test scenarios in the set of related scenarios are tested to complete the performance test of the target system. In this way, the omission of scenarios and low efficiency caused by manually connecting test scenarios can be effectively avoided.
[0130] Optionally, the step of extracting the target link from the pressure transmission graph using the current test scenario as the initial node includes: representing the current test scenario as the initial node and adding the initial node to the target node set; determining the rise threshold of the initial node; and performing the step of determining the target node set, wherein the step of determining the target node set includes: querying the set of nodes directly connected to the out-degree edge of the initial node in the pressure transmission graph; determining the rise rate of each node in the node set based on the rise threshold and the influence weight value; adding nodes with rise rates greater than a second preset threshold to the target node set; selecting the next node in the target node set after the initial node as the initial node, and repeating the step of determining the target node set until all nodes in the target node set have been processed to obtain the final node set; and extracting the target link based on the final node set.
[0131] In this embodiment of the invention, the pressure transmission graph is used as the basis for analyzing performance test-related scenarios. The target node that needs to be tested in the current period can be found on the pressure transmission graph. This node serves as the initial node for analysis. The calculation steps for the relevant pressure nodes are as follows:
[0132] Step 1: Starting from the initial node, find all directly related nodes along the adjacent directed edges and use them as the first layer of related nodes. Save the related node information to the node set (that is, represent the current test scenario as the initial node, add the initial node to the target node set, and then query the set of nodes directly connected to the out-degree edge of the initial node in the pressure transmission graph).
[0133] Step 2: For any node in the node set, calculate the node's rise rate by combining the node's indicator information (i.e., first determine the initial node's rise threshold, and then determine the rise rate of each node in the node set based on the rise threshold and the influence weight value). If the rise of the initial node's concurrency causes the node's concurrency to rise beyond the preset threshold, then retain the node; otherwise, remove the node from the node set (i.e., add nodes with rise rates greater than the second preset threshold to the target node set).
[0134] Step 3: Using the remaining nodes in the node set as the new initial nodes, repeat steps 1 and 2 until all nodes have been calculated (i.e., select the next node in the target node set after the initial node as the initial node, and repeat the steps to determine the target node set until all nodes in the target node set have been calculated, thus obtaining the final node set).
[0135] Then, based on the final node set, the target link can be extracted, and the test scenarios represented by each node in the target link can be used to form a set of related scenarios.
[0136] Figure 5This is a schematic diagram of an optional performance test correlation scenario mining process according to an embodiment of the present invention, such as... Figure 5 As shown, with Figure 4 The connected graph (i.e., the final pressure transmission graph) serves as the basis for analyzing performance test correlation scenarios, with M as the initial node and the second preset threshold set to 20%. If the increase threshold for transaction M in a certain version is 50%, the process for calculating the nodes requiring correlation performance testing is as follows:
[0137] (1) Starting from the initial node M, find node A along its out-degree edge and add it to the node set. Then the set contains {M, A}.
[0138] (2) Calculate the rise rate of the nodes, with node M at 50% and node A at 41.5%, and both nodes are retained.
[0139] Transaction A: The weight of the impact of Transaction M is 83% = (100 / 120) (100%), therefore the concurrent user growth rate for this period is 41.5% = (50%). (0.83%), exceeding the second preset threshold of 20%.
[0140] (3) Starting with node A, find node D along its out-degree edge and add it to the node set. The set contains {M, A, D}.
[0141] (4) The rise rate of node D is calculated to be 20.75%, and node D is retained.
[0142] Transaction D: The weight of the impact of Transaction A is 50% = (50 / 100) (100%), therefore the concurrent user growth rate for this period is 20.75% = (41.5%). (50%), exceeding the second preset threshold of 20%.
[0143] (5) Starting with node D, find node F by extending its out-degree edge and add it to the node set. The set contains {M, A, D, F}.
[0144] (6) The growth rate of node F is 12.66%, so node F is deleted.
[0145] Transaction F: The weight of the impact of transaction D is 61% = (40 / 65) (100%), therefore the concurrent user growth rate for this period is 12.66% = (20.75%). (61%), which did not exceed the second preset threshold of 20%.
[0146] (7) All nodes in the final node set have been calculated, and the result is {M, A, D}, that is... Figure 5 Bold nodes and relation edges.
[0147] In this embodiment, in addition to performance testing of transaction M, this version also needs to perform correlation testing on transactions A and D, and the performance test parameters are as follows: concurrency of transaction M increases by 50%, concurrency of transaction A increases by 41%, and concurrency of transaction D increases by 21%. Thus, the discovery of correlation scenarios for performance testing is complete.
[0148] The following describes in detail another optional implementation method.
[0149] This invention uses a weighted directed connected graph to obtain the correlation between system functions. It combines the convergent changes in performance overhead between nodes as transaction pressure increases, automatically analyzes the pressure transmission of the entire system, and extracts the correlation scenarios for performance testing. At the same time, since the entire process is automatically generated based on system logging, it can reduce the problems of insufficient experience and delayed response that exist in manual sorting.
[0150] Figure 6 This is a schematic diagram of an optional performance test correlation scenario mining system according to an embodiment of the present invention, such as... Figure 6 As shown, it includes: a data entry log input device 1, a connectivity graph generation device 2, a pressure transmission graph generation device 3, and a series pressure testing scheme generation device 4. The specific functions of each device are as follows:
[0151] The event tracking log input device 1 can read the event tracking logs from the daily operation of the business system. These logs collect the order in which users access nodes and the performance overhead of those nodes. The event tracking logs must include at least two types of information: node execution information and node performance information. Node execution information refers to the state information during node execution, including at least the following elements: user session, node name, preceding node, and execution time. The preceding node can be obtained through the Referer information in the URL request or through parameters passed during transaction redirection. Node performance information refers to the performance overhead during node execution. Considering the numerous factors affecting server hardware performance overhead, the node execution time can be selected as the performance indicator for node consumption. Node performance information must include at least the following elements: request arrival time, request response time, and execution time. The execution time can be obtained through the request response time or collected and stored on the server side.
[0152] The connected graph generation device 2 will generate a directed connected graph based on the execution information of the tracking log. The nodes recorded by the tracking log are the nodes of the directed connected graph, and the user's access order constitutes the edges of the directed connected graph, thus completing the node trigger flow construction.
[0153] The pressure transmission diagram generation device 3 constructs node performance curves based on the single-event performance overhead, concurrency, and occurrence time recorded in the data entry logs, representing the performance pressure of the node throughout the day. Based on the previously constructed node trigger flows and node performance curves, a correlation analysis is performed, analyzing the convergence of the current node and previous nodes in terms of concurrency and performance overhead at different times. If the current node and previous nodes show convergence, meaning the previous node influences the current node, an increase in the concurrency of the previous node may cause an increase in the concurrency of this node, and an increase in the concurrency of this node will lead to an increase in performance overhead. Based on the above analysis results, nodes with correlation in the node trigger flows are retained, while irrelevant nodes are removed, thus completing the construction of the system's performance pressure transmission diagram.
[0154] The series stress test scheme generation device 4 can infer other nodes that may have subsequent performance stress changes based on the performance stress changes of a single node by using the system's performance stress transmission diagram, thus completing the mining of relevant nodes in the performance test scenario and realizing the series connection of performance test scenarios.
[0155] Figure 7 This is a schematic diagram of an optional connected graph generation and node index calculation according to an embodiment of the present invention, such as... Figure 7 As shown, it includes: execution information extraction 701, node construction 702, relationship construction 703, node flow information calculation 704, connected graph storage device 705, and node index storage device 706, with specific functions as follows:
[0156] The Execution Information Extraction 701 function can extract execution information from the event logs, which can be used to construct a directed connected graph.
[0157] Node construction 702 saves the node name recorded in the execution information as a node in the directed connected graph, and also saves the number of executions to that node.
[0158] Relationship construction 703 completes the construction of directed edges based on the node relationships recorded in the execution information (i.e., the relationship between the "current node" and the "preceding node"), and saves the number of transitions as weights. Then, the constructed directed connected graph is saved in the connected graph storage device 705. In this embodiment, isolated nodes without any edges are not saved, and in order to establish node triggering flows as accurately as possible, the identification of a single user adopts the "user session" mechanism.
[0159] The node flow information calculation 704 calculates the number and proportion of out-degree and in-degree in the directed connected graph and saves the data in the node index storage device 706.
[0160] Figure 8 This is a schematic diagram of an optional pressure transmission diagram construction according to an embodiment of the present invention, such as... Figure 8As shown, it includes: performance information extraction 801, concurrency calculation 802, execution time calculation 803, volatility calculation 804, volatility ratio calculation 805, correlation calculation 806, pressure transmission graph storage device 807, connectivity graph storage device 808, and node change index storage device 809. The specific functions are as follows:
[0161] Performance Information Extraction 801 extracts performance information from the embedded logs according to the nodes in the connected graph, which is used to construct the performance curves of the nodes.
[0162] Concurrency calculation 802 calculates the "sampled concurrency" based on the number of transactions per node in each time period.
[0163] The execution time calculation 803 calculates the "sampling overhead" based on the execution time of each time period node.
[0164] The volatility calculation represents the "volatility" of concurrency and performance overhead of the 804 computing node throughout its operation throughout the day. In this embodiment, "volatility" refers to the variation in concurrency and performance overhead of the node at different points in time; the stronger the volatility, the greater the amplitude of the variation. Considering that the amount of collected data is finite, volatility can be represented by the degree of dispersion of the values. The degree of dispersion can be easily calculated using the "sample standard deviation." The larger the "sample standard deviation," the greater the degree of dispersion of the values, meaning the greater the amplitude of the node's performance index variation. Conversely, the smaller the amplitude of the node's performance index variation.
[0165] The volatility ratio calculation 805 can be further improved by introducing the "performance-concurrency volatility ratio" RT to represent the proportional relationship between performance overhead volatility and concurrency volatility. A larger value indicates that the performance dispersion is more significantly affected by the dispersion of concurrency, while a smaller value indicates that the performance dispersion is not affected by the dispersion of concurrency. Therefore, in-degree edges of nodes with RT values less than a preset threshold should be removed from the connected graph, indicating that the performance overhead of these nodes is not affected by the increase or decrease in concurrency of their preceding nodes.
[0166] The correlation calculation 806 will complete the correlation calculation between concurrency and performance overhead. Simply calculating the performance concurrency fluctuation ratio is insufficient to draw a conclusion on the correlation between concurrency and performance overhead; it is also necessary to analyze whether concurrency and performance overhead are positively correlated. Generally, if a node's concurrency is positively correlated with its execution time, it indicates that the node's performance overhead is significantly affected by concurrency, and such nodes should be included in the analysis. Conversely, if the concurrency of a node is not positively correlated with its execution time, it indicates that the node's performance overhead is not affected by concurrency; that is, an increase in node concurrency does not generate additional performance overhead, and such nodes do not need to be included in the analysis. Their in-degree edges can be deleted. The final calculation results are then stored in the pressure transmission graph storage device 807.
[0167] The connected graph storage device 808 can provide a connected graph for fluctuation ratio calculation 805 and correlation calculation 806.
[0168] In this embodiment, node index information can be recalculated based on the connected graph adjusted by correlation calculation 806 and saved to the node change index storage device 809.
[0169] Figure 9 This is a schematic diagram illustrating an optional performance test association scenario established according to an embodiment of the present invention, such as... Figure 9 As shown, it includes: pressure transmission diagram input 901, target node query 902, associated node query 903, series pressure testing scheme generation 904, and node index storage device 905. Specific functions are as follows:
[0170] Input 901 to load the completed system pressure transmission diagram, which serves as the basis for analyzing related scenarios in performance testing.
[0171] The target node 902 is located on the pressure transmission graph and is the target node that needs to be tested in the current period. This node is used as the initial node for analysis.
[0172] The related node 903 queries the node index information in the node index storage device 905 to complete the calculation of the relevant pressure node.
[0173] The node index storage device 905, combined with the final node set obtained by querying related nodes 903, completes the mining of performance test serial scenarios.
[0174] In this embodiment of the invention, operational metrics of each node in the system are obtained through embedded data points. A directed connected graph is used to construct the system's access flow. A correlation algorithm is then used to calculate the positive correlation of performance metrics among transaction nodes in the directed connected graph. Based on this, a pressure transmission graph is generated. This pressure transmission graph is then used to automatically extract relevant performance testing scenarios. This effectively solves the problem of missing relevant performance testing scenarios due to insufficient human experience and lack of understanding of the production system's operation during the performance testing phase. The following beneficial effects can be achieved:
[0175] (1) By using the embedded information, the pressure transmission diagram of each transaction node in the system can be automatically generated to understand the transmission situation after each transaction node is under pressure, automatically calculate the related scenarios and predict the performance factors, which can reduce manual intervention.
[0176] (2) The pressure transmission diagram accurately depicts the actual operation of each transaction node in the system, ensuring that the pressure transmission diagram is generated in a real, timely and objective manner, and is easy for users to understand.
[0177] (3) By using algorithms to calculate the correlation between system concurrency and performance overhead, the complexity of manual calculation can be reduced, making it easier to promote and use.
[0178] Example 2
[0179] The scene extraction device provided in this embodiment includes multiple implementation units, each of which corresponds to a specific implementation step in Embodiment 1 above.
[0180] Figure 10 This is a schematic diagram of an optional associated scene extraction device according to an embodiment of the present invention, such as... Figure 10 As shown, the extraction device may include: an acquisition unit 1000, a construction unit 1001, a generation unit 1002, and an extraction unit 1003, wherein,
[0181] The acquisition unit 1000 is used to acquire node information based on preset data entry logs. Each node corresponds to a test scenario, and the node information includes at least: node execution information and node performance information.
[0182] Construction unit 1001 is used to construct a directed connected graph based on node execution information;
[0183] The generation unit 1002 is used to generate a pressure transmission graph based on node performance information and a directed connected graph.
[0184] Extraction unit 1003 is used to extract target links from the pressure transmission graph with the current test scenario as the initial node, wherein the test scenarios represented by each node in the target link constitute a set of associated scenarios.
[0185] The aforementioned extraction device can acquire node information based on preset tracking logs using the acquisition unit 1000, construct a directed connected graph based on node execution information using the construction unit 1001, generate a pressure transmission graph based on node performance information and the directed connected graph using the generation unit 1002, and extract target links from the pressure transmission graph using the current test scenario as the initial node using the extraction unit 1003. Each node in the target link represents a test scenario that constitutes a set of associated scenarios. In this embodiment of the invention, node information can be acquired through preset tracking logs, then a directed connected graph can be constructed, a pressure transmission graph can be generated by analyzing node performance information, and then the associated scenarios for performance testing can be extracted based on the pressure transmission graph. This allows the pressure transmission graph to be automatically adjusted according to behavioral data, avoiding the lag and bias of manual sorting, thus solving the technical problem in related technologies where manual sorting of associated test scenarios easily leads to the loss of associated scenarios to be tested.
[0186] Optionally, the construction unit includes: a first storage module, used to use the node identifier recorded in the node execution information as the node identifier of the directed connected graph, and to store the number of times the node is executed in the node indicated by the node identifier of the directed connected graph; and a first construction module, used to construct the relationship edge of the directed connected graph based on the node relationship recorded in the node execution information, and to use the number of transitions between nodes as the weight value of the relationship edge.
[0187] Optionally, the extraction device further includes: a first determining module, used to determine the in-degree and out-degree values of each relation edge based on the weight value of each relation edge in the directed connected graph and the execution count of each node after constructing the directed connected graph based on the node execution information; and a first generating module, used to generate node index information based on the in-degree and out-degree values.
[0188] Optionally, the extraction device further includes: a first acquisition module, used to acquire the number of transactions and the transaction execution time of each node at each sampling time point within a preset time period based on node performance information; a second determination module, used to determine the volatility ratio of each node based on the number of transactions and the transaction execution time; and a first deletion module, used to delete the in-degree edges of nodes whose volatility ratio is less than a first preset threshold, to obtain an adjusted directed connected graph.
[0189] Optionally, the second determining module includes: a first determining submodule, used to determine the sampling concurrency of each node based on the number of transactions, and to determine the sampling overhead parameter of each node based on the transaction execution duration; a first conversion submodule, used to convert the sampling concurrency to a standard sampling concurrency and to convert the sampling overhead parameter to a standard sampling overhead parameter; a second determining submodule, used to determine the concurrency volatility of the standard sampling concurrency and to determine the overhead volatility of the standard sampling overhead parameter; and a third determining submodule, used to determine the volatility ratio of each node based on the concurrency volatility and the overhead volatility.
[0190] Optionally, the generation unit includes: a third determining module, used to determine the correlation coefficient of each node based on the number of transactions and the transaction execution time, to obtain a set of correlation coefficients; a fourth determining module, used to determine the target correlation coefficient with a negative value in the set of correlation coefficients; and a second deletion module, used to delete the in-degree edges of the nodes indicated by the target correlation coefficient based on the adjusted directed connected graph, to obtain a pressure transmission graph.
[0191] Optionally, the extraction device further includes: a first update module, used to update node indicator information based on the pressure transmission graph before extracting the target link from the pressure transmission graph with the current test scenario as the initial node, to obtain target node indicator information; and a fifth determination module, used to determine the influence weight value of the preceding node of each node on the current node based on the target node indicator information.
[0192] Optionally, the extraction unit includes: a first characterization module, used to characterize the current test scenario as an initial node and add the initial node to the target node set; a sixth determination module, used to determine the rise threshold of the initial node; a first execution module, used to execute the step of determining the target node set, wherein the step of determining the target node set includes: querying the set of nodes directly connected to the out-degree edge of the initial node in the pressure transmission graph; determining the rise rate of each node in the node set based on the rise threshold and the influence weight value; adding nodes with rise rates greater than a second preset threshold to the target node set; a first selection module, used to select the next node after the initial node in the target node set as the initial node, and repeatedly execute the step of determining the target node set until all nodes in the target node set have been executed to obtain the final node set; and a first extraction module, used to extract the target link based on the final node set.
[0193] Optionally, the extraction device further includes: a second extraction module, used to extract other test scenarios associated with the current test scenario based on the target link after extracting the target link from the pressure transmission diagram with the current test scenario as the initial node, to obtain a set of associated scenarios, wherein the current test scenario is a scenario in which the target system undergoes version modification; and a first testing module, used to test all test scenarios in the set of associated scenarios to complete the performance test of the target system.
[0194] The extraction device described above may also include a processor and a memory. The acquisition unit 1000, the construction unit 1001, the generation unit 1002, the extraction unit 1003, etc., are all stored in the memory as program units, and the processor executes the program units stored in the memory to realize the corresponding functions.
[0195] The aforementioned processor contains a kernel, which retrieves the corresponding program units from memory. One or more kernels can be configured, and by adjusting kernel parameters, the target pathway can be extracted from the stress transmission graph, using the current test scenario as the initial node.
[0196] The aforementioned memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash memory (flAsh RAM), and the memory includes at least one memory chip.
[0197] This application also provides a computer program product that, when executed on a data processing device, is suitable for executing an initialization program with the following method steps: obtaining node information based on preset embedded logs, constructing a directed connected graph based on node execution information, generating a pressure transmission graph based on node performance information and the directed connected graph, extracting target links from the pressure transmission graph with the current test scenario as the initial node, wherein the test scenarios represented by each node in the target link constitute a set of associated scenarios.
[0198] According to another aspect of the present invention, a computer-readable storage medium is also provided, the computer-readable storage medium including a stored computer program, wherein, when the computer program is running, it controls the device where the computer-readable storage medium is located to execute the above-described method for extracting related scenarios.
[0199] According to another aspect of the present invention, an electronic device is also provided, including one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the above-described method for extracting associated scenarios.
[0200] Figure 11 This is a hardware structure block diagram of an electronic device (or mobile device) for a method of extracting associated scenes according to an embodiment of the present invention. Figure 11 As shown, the electronic device may include one or more processors 1102 (shown as 1102a, 1102b, ..., 1102n in the figure) 1102 (processor 1102 may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 1104 for storing data. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, a keyboard, a power supply, and / or a camera. Those skilled in the art will understand that... Figure 11 The structure shown is for illustrative purposes only and does not limit the structure of the electronic device described above. For example, the electronic device may also include components that are more... Figure 11 The more or fewer components shown, or having the same Figure 11 The different configurations shown.
[0201] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0202] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0203] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.
[0204] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0205] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0206] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0207] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A method for extracting related scenes, characterized in that, include: Based on preset event logs, node information is obtained, wherein each node corresponds to a test scenario, and the node information includes at least: node execution information and node performance information; Based on the node execution information, a directed connected graph is constructed; Based on the node performance information and the directed connectivity graph, a pressure transmission graph is generated; Taking the current test scenario as the initial node, the target link is extracted from the pressure transmission diagram, wherein the test scenario represented by each node in the target link constitutes a set of associated scenarios; Before generating the pressure transmission graph based on the node performance information and the directed connected graph, the number of transactions and the transaction execution duration of each node at each sampling time point within a preset time period are obtained based on the node performance information; the fluctuation ratio of each node is determined based on the number of transactions and the transaction execution duration; the in-degree edges of nodes whose fluctuation ratios are less than a first preset threshold are deleted to obtain the adjusted directed connected graph. The step of generating a pressure transmission graph based on the node performance information and the directed connected graph includes: determining the correlation coefficient of each node based on the number of transactions and the transaction execution time to obtain a correlation coefficient set; determining the target correlation coefficient with a negative value in the correlation coefficient set; and deleting the in-degree edges of the nodes indicated by the target correlation coefficient based on the adjusted directed connected graph to obtain the pressure transmission graph. The steps for extracting target links from the pressure transmission graph, using the current test scenario as the initial node, include: representing the current test scenario as the initial node and adding the initial node to the target node set; determining the rise threshold of the initial node; performing the step of determining the target node set, wherein the step of determining the target node set includes: querying the pressure transmission graph for the set of nodes directly connected to the out-degree edge of the initial node; determining the rise rate of each node in the node set based on the rise threshold and the influence weight value; adding nodes with rise rates greater than a second preset threshold to the target node set; selecting the next node in the target node set after the initial node as the initial node, and repeating the step of determining the target node set until all nodes in the target node set have been processed to obtain the final node set; and extracting the target links based on the final node set.
2. The extraction method according to claim 1, characterized in that, The steps for constructing a directed connected graph based on the node execution information include: The node identifier recorded in the node execution information is used as the node identifier of the directed connected graph, and the number of times the node is executed is stored in the node indicated by the node identifier of the directed connected graph. Based on the node relationships recorded in the node execution information, the relational edges of the directed connected graph are constructed, and the number of transitions between nodes is used as the weight value of the relational edges.
3. The extraction method according to claim 2, characterized in that, After constructing the directed connected graph based on the node execution information, the process further includes: Based on the weight value of each relation edge in the directed connected graph and the number of executions of each node, the in-degree and out-degree values of each relation edge are determined. Based on the in-degree value and the out-degree value, node indicator information is generated.
4. The extraction method according to claim 1, characterized in that, The step of determining the volatility ratio of each node based on the number of transactions and the transaction execution duration includes: Based on the number of transactions, determine the sampling concurrency of each node, and based on the transaction execution duration, determine the sampling overhead parameter of each node; The sampling concurrency is converted to a standard sampling concurrency, and the sampling overhead parameter is converted to a standard sampling overhead parameter; Determine the concurrency volatility of the standard sampling concurrency and the overhead volatility of the standard sampling overhead parameter; Based on the concurrency volatility and the overhead volatility, the volatility ratio of each node is determined.
5. The extraction method according to claim 3, characterized in that, Before extracting the target link from the pressure transmission graph using the current test scenario as the initial node, the process also includes: Based on the pressure transmission diagram, update the node index information to obtain the target node index information; Based on the target node index information, determine the influence weight value of the predecessor node of each node on the current node.
6. The extraction method according to claim 1, characterized in that, After extracting the target link from the pressure transmission graph using the current test scenario as the initial node, the process also includes: Based on the target link, other test scenarios associated with the current test scenario are extracted to obtain the set of associated scenarios, wherein the current test scenario is a scenario in which the target system undergoes version modification; The performance test of the target system is completed by testing all the test scenarios in the associated scenario set.
7. An apparatus for extracting associated scenes in the method for extracting associated scenes according to claim 1, characterized in that, include: The acquisition unit is used to acquire node information of a node based on a preset data entry log. Each node corresponds to a test scenario, and the node information includes at least: node execution information and node performance information. The construction unit is used to construct a directed connected graph based on the node execution information; A generation unit is used to generate a pressure transmission graph based on the node performance information and the directed connected graph; The extraction unit is used to extract target links from the pressure transmission graph, with the current test scenario as the initial node, wherein each node in the target link represents a test scenario that constitutes an associated scenario set.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored computer program, wherein, when the computer program is executed, it controls the device on which the computer-readable storage medium is located to perform the method for extracting the associated scene as described in any one of claims 1 to 6.
9. An electronic device, characterized in that, It includes one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement the method for extracting associated scenes as described in any one of claims 1 to 6.