Application Testing Method, Device, Electronic Device, and Storage Medium
By collecting and analyzing network state parameters through a sliding window method to create a simulated test network, the method addresses the challenge of accurately testing applications in dynamic network environments, improving testing accuracy.
Patent Information
- Application Number
- CN202110069107.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-19
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2041-01-19
AI Technical Summary
Existing methods for testing applications in varying network environments struggle to accurately simulate real-world network dynamics, leading to inaccurate testing results due to the complexity and rapid changes in network conditions.
A method involving the collection and analysis of network state parameters, using a sliding window approach to sample and filter these parameters, and generating a simulated test network that replicates the complex and dynamic conditions of the real network, allowing for targeted testing of applications.
This approach enhances the accuracy of application testing by replicating real-world network scenarios, enabling more precise evaluation of application performance under varying conditions.
Smart Images

Figure CN114816968B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer and communication technologies, and particularly to an application testing method, apparatus, electronic device, and storage medium. Background Art
[0002] In the Internet, the network environments in different regions and time periods are usually different. In order for an application program to be applicable to the network environments in different regions and time periods, it is necessary to test and optimize it in different network environments to ensure that the application programs in different network environments can all obtain good user experiences.
[0003] In order to test the performance of an application program in different network environments, it is usually necessary to collect the network environment of the real network and simulate it using a simulated network, and then run the application program in the simulated network to determine its performance and user experience.
[0004] However, the network environment of the real network is complex and changes rapidly. For the network state that changes suddenly, the simulated network often has difficulty processing dynamic information and cannot accurately simulate the changes of the real network, resulting in inaccurate test results of the application program. Summary of the Invention
[0005] Based on the above technical problems, this application provides an application testing method to reproduce various complex situations and sudden changes that occur in the real network in the test network, so that targeted testing of the target application can be carried out for these network situations in the test network, which is beneficial to improving the accuracy of application program testing.
[0006] Other features and advantages of this application will become apparent through the following detailed description, or be learned in part through the practice of this application.
[0007] According to one aspect of the embodiments of this application, an application testing method is provided, including:
[0008] When a target application runs in a first test network, obtaining the to-be-processed network state parameters generated by the first test network;
[0009] Sampling the to-be-processed network state parameters using a sliding window to obtain M groups of network state parameters, where each group of network state parameters in the M groups of network state parameters includes the characteristic values corresponding to network attributes, and M is an integer greater than 1;
[0010] Obtaining N groups of network state parameters from the M groups of network state parameters, where the N groups of network state parameters are parameters associated with the network abnormal state of the first test network, and N is an integer greater than or equal to 1 and less than M;
[0011] Generate a second test network according to the eigenvalues included in the N sets of network status parameters;
[0012] Control the target application to run in the second test network to obtain the test result of the target application.
[0013] According to one aspect of the embodiments of the present application, there is provided an application testing apparatus, including:
[0014] A first acquisition module, configured to acquire the to-be-processed network status parameters generated by the first test network when the target application runs in the first test network;
[0015] A sampling module, configured to perform sampling processing on the to-be-processed network status parameters by using a sliding window to obtain M sets of network status parameters, where the N sets of network status parameters indicate the network abnormal status of the first test network, each set of network status parameters in the M sets of network status parameters includes the eigenvalues corresponding to the network attributes, and M is an integer greater than 1;
[0016] A second acquisition module, configured to acquire N sets of network status parameters from the M sets of network status parameters, where N is an integer greater than or equal to 1 and less than M;
[0017] A generation module, configured to generate a second test network according to the eigenvalues included in the N sets of network status parameters;
[0018] A control module, configured to control the target application to run in the second test network to obtain the test result of the target application.
[0019] In an embodiment of the present application, based on the above technical solution, the second acquisition module may include:
[0020] An acquisition unit, further configured to acquire the first eigenvalues corresponding to the respective network attributes from the first parameter group, and acquire the second eigenvalues corresponding to the respective network attributes from the second parameter group;
[0021] A determination unit, further configured to determine the average eigenvalue corresponding to each network attribute according to the first eigenvalue and the second eigenvalue;
[0022] A determination unit, further configured to determine the average eigenvalue corresponding to the network attribute as the N sets of network status parameters.
[0023] In an embodiment of the present application, based on the above technical solution, the second acquisition module may include:
[0024] The obtaining unit is further configured to obtain the first eigenvalue corresponding to each network attribute from the first parameter group, and obtain the second eigenvalue corresponding to each network attribute from the second parameter group;
[0025] The clustering unit is further configured to cluster the first eigenvalue and the second eigenvalue to obtain a clustering grouping and a clustering center value corresponding to the clustering grouping, where the eigenvalue in the clustering grouping comes from at least one of the first eigenvalue and the second eigenvalue;
[0026] The determining unit is further configured to determine an abnormal clustering grouping in the clustering grouping according to the clustering center value and an abnormal threshold;
[0027] The determining unit is further configured to determine the N groups of network state parameters according to the abnormal clustering grouping.
[0028] In an embodiment of the present application, based on the above technical solution, the generating module may include:
[0029] The updating unit is configured to, when a specified time is reached, obtain a second test network at the specified time according to the eigenvalue of the third network state parameter in the N groups of network state parameters;
[0030] The updating unit is further configured to, at each time after the specified time, update the second test network updated at the previous time according to the eigenvalue of the fourth network state parameter in the N groups of network state parameters to obtain an updated second test network.
[0031] In an embodiment of the present application, based on the above technical solution, the control module 1005 may include:
[0032] The receiving unit is configured to receive a data packet sent by the target application;
[0033] The statistics unit is configured to perform statistics on the data packet to obtain network response data, where the network response data includes at least one of a packet loss rate, a delay, and a bandwidth;
[0034] The result generating unit is configured to generate a test result corresponding to the target application according to the network response data.
[0035] According to an aspect of an embodiment of the present application, there is provided an electronic device, and the electronic prompt device includes: a processor; and a memory for storing executable instructions of the processor; wherein, the processor is configured to execute the method for application testing in the above technical solution by executing the executable instructions.
[0036] According to one aspect of the embodiments of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the method for application testing in the above technical solution is implemented.
[0037] According to one aspect of the embodiments of the present application, a computer program product or a computer program is provided. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method for application testing provided in the above various optional implementation manners.
[0038] In the embodiments of the present application, network state parameters are collected for the existing network where the target application is located, and specific network state parameters are selected therefrom. Subsequently, according to the specific network state parameters, the corresponding network state is reproduced in the test network, and then the target application is tested in the test network. By the above method, various complex situations and sudden changes that occur in the real network can be reproduced in the test network, so that the target application can be specifically tested for these network situations in the test network, which is beneficial to improving the accuracy of application program testing.
[0039] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and are used together with the specification to explain the principles of the present application. Obviously, the accompanying drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts. In the drawings:
[0041] Figure 1 It is a schematic diagram of the composition architecture of an application scenario applicable to the present application;
[0042] Figure 2 It shows a schematic flowchart of a method for application testing in the embodiments of the present application;
[0043] Figure 3 It shows a schematic flowchart of a method for application testing in the embodiments of the present application;
[0044] Figure 4 It shows a schematic flowchart of a method for application testing in the embodiments of the present application;
[0045] Figure 5The flowchart shows a method for application testing according to an embodiment of the present application;
[0046] Figure 6 The flowchart shows a method for application testing according to an embodiment of the present application;
[0047] Figure 7 The flowchart shows a method for application testing according to an embodiment of the present application;
[0048] Figure 8 The flowchart shows a method for application testing according to an embodiment of the present application;
[0049] Figure 9 The flowchart shows a method for application testing according to an embodiment of the present application;
[0050] Figure 10 The block diagram schematically shows the composition of an application testing device according to an embodiment of the present application;
[0051] Figure 11 The structural diagram shows a computer system of an electronic device suitable for implementing an embodiment of the present application. Detailed implementation manners
[0052] Now, example embodiments will be described more fully with reference to the accompanying drawings. However, the example embodiments can be implemented in various forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be more complete and comprehensive, and will fully convey the concept of the example embodiments to those skilled in the art.
[0053] In addition, the described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of the embodiments of the present application. However, those skilled in the art will realize that the technical solutions of the present application can be practiced without one or more of the specific details, or other methods, components, devices, steps, etc. can be adopted. In other cases, well-known methods, devices, implementations, or operations are not shown or described in detail to avoid obscuring aspects of the present application.
[0054] The block diagrams shown in the drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0055] The flowcharts shown in the accompanying drawings are merely illustrative and not necessarily inclusive of all content and operations / steps, nor are they necessarily to be executed in the order described. For example, some operations / steps may be decomposed, while some operations / steps may be combined or partially combined, so the actual execution order may change according to the actual situation.
[0056] The solution of this application is applicable to testing the performance of an application program under specific network conditions of anomalies or mutations, so as to improve the accuracy of application program testing. The network state parameters mentioned in this application may be network state data when software products such as application programs run in the network. By collecting, analyzing, and simulating the network state data, the state in the real network can be reproduced in the test network, so as to test the software product, so that the technology can discover problems such as poor performance and faults in the software product.
[0057] The solution of this application can be applied to a personal computer, a server, or a server system composed of multiple servers. In order to improve the efficiency of determining the application program test, this application can also be applied to a cloud platform or other computing systems.
[0058] For the sake of easy understanding, the solution of this application is taken as an example in the scenario of being applied to a cloud platform for illustration. Please refer to Figure 1 , Figure 1 which is a schematic diagram of the composition architecture of an application scenario applicable to this application.
[0059] It can be seen from Figure 1 that this scenario includes an application client 110, a first test network 120, a cloud platform 130, a second test network 140, and a test client 150.
[0060] The application client 110 specifically includes multiple clients, and the target application program to be tested can run in these clients. Correspondingly, the test client 150 can also specifically include multiple clients, and the same target application program as that in the application client 110 runs in the clients. The target application program in the application client 110 runs in the network environment of the first test network 120. Generally, the first test network 120 can be the actual application environment where the target application program is located, such as the Internet.
[0061] The cloud platform 130 includes the application testing device provided by this application. During the running of the target application on the application client 110, the cloud platform 130 can use this application testing device to collect various network parameters generated by the first test network, and analyze and filter the collected network parameters to obtain the network parameters in a specific state of the first test network, such as in an abnormal state or a state with a large load, etc. Then, the cloud platform 130 can use the second test network 140 to reproduce the network state of the first test network 120, and use the test client 150 to run in the second test network to test the performance of the target application in this specific network state.
[0062] Among them, the cloud platform can also be called the cloud computing platform, which is a network platform built based on cloud technology. Cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software, and networks within a wide area network or a local area network to achieve data computing, storage, processing, and sharing.
[0063] Cloud technology is the general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the cloud computing business model. It can form a resource pool, be used on demand, and is flexible and convenient. Cloud computing technology will become an important support. The background services of the technical network system require a large amount of computing and storage resources, such as data collection and analysis, etc. With the highly developed application of the Internet industry, in the future, each item may have its own identification mark and needs to be transmitted to the background system for logical processing. Data at different levels will be processed separately, and various industry data requires a powerful system support, which can only be achieved through cloud computing.
[0064] Cloud computing is a computing model that distributes computing tasks on a resource pool composed of a large number of computing devices, enabling various application systems to obtain computing power, storage space, and information services according to needs. The network that provides resources is called the "cloud". The resources in the "cloud" seem to be infinitely expandable to users, and can be obtained at any time, used on demand, expanded at any time, and paid according to usage.
[0065] As a basic capability provider of cloud computing, a cloud computing resource pool (referred to as the cloud platform, generally called the IaaS (Infrastructure as a Service) platform) will be established, and various types of virtual resources will be deployed in the resource pool for external customers to choose and use. The cloud computing resource pool mainly includes: computing devices (virtual machines, including operating systems), storage devices, and network devices.
[0066] In Figure 1In the scenario, data collection, filtering, and analysis of the first test network can be completed through the cloud server of the cloud platform, and processing such as simulating the state of the first test network in the second test network can be performed according to the analysis results.
[0067] It can be understood that Figure 1 taking the cloud platform directly obtaining network state parameters from the first test network as an example, in practical applications, the cloud platform can also obtain network state parameters through other detection devices or through other network channels, and there is no limitation on this.
[0068] It should be noted that Figure 1 for the convenience of understanding, this application is described by taking the cloud platform as an example. When using a single computing device, server, or server cluster for application testing, only Figure 1 the cloud platform in the shown scenario needs to be replaced with the corresponding device or server cluster, and the scenario is similar, so it will not be elaborated here.
[0069] The technical solution provided by this application will be described in detail below in combination with specific embodiments.
[0070] As Figure 2 shown, Figure 2 a schematic flowchart of a method for application testing in an embodiment of this application is shown. The method of this embodiment can be applied to the computer devices, servers, cloud platforms, etc. mentioned above. The method of this embodiment may include:
[0071] Step S201, when the target application runs in the first test network, obtain the to-be-processed network state parameters generated by the first test network.
[0072] Among them, the to-be-processed network state parameters can be obtained in the form of streaming data. Specifically, the server can directly detect the first test network to directly obtain them, or the client running the target application can collect and actively report them to the server, or a third-party detection device can detect and send them to the server. The to-be-processed network state parameters can be parameter information reflecting network communication performance, and each parameter in the network state parameters can reflect the network state faced by the target application during operation.
[0073] It can be understood that for the application or test network, different network states and network state parameters may appear at different times. Therefore, the to-be-processed network state parameters can actually include multiple network state parameters at multiple different times respectively. For example, the to-be-processed network state parameters can be a network state report, and this network state report contains multiple network state data, and these multiple network state data can be regarded as a network state data sequence generated in chronological order.
[0074] It should be noted that in practical applications, multiple network status parameters may be obtained from multiple different sources simultaneously. However, the filtering and analysis processes for each network status parameter are the same and can be used for testing the application program in the subsequent steps of this application.
[0075] Step S202: Sample the to-be-processed network status parameter using a sliding window to obtain M groups of network status parameters, where each group of network status parameters in the M groups of network status parameters includes the eigenvalue corresponding to the network attribute, and M is an integer greater than 1.
[0076] Specifically, for the to-be-processed network status parameter in the form of stream data, data sampling is performed on each piece of stream data in a sliding window manner. The specific size of the sliding window can depend on the sampling frequency of the to-be-processed network status parameter. For example, if the to-be-processed network status parameter is sampled once per second, the size of the sliding window can be in seconds, such as 5 seconds. The network status parameters obtained using the sliding window include at least two groups of network status parameters. That is to say, if the to-be-processed network status parameter is sampled once per second, the size of the sliding window is at least 2 seconds.
[0077] Each group of network status parameters contains at least one network attribute, and the status value of each network attribute of the first test network is the corresponding eigenvalue. The network attributes can at least include dynamic delay, dynamic packet loss rate, dynamic bandwidth, static queue size, etc.
[0078] It can be understood that since software products generally have multiple different functional modes. For example, software products include different functional modules, and different functional modules implement different functional modes. For example, a game application may include a game communication module and a text message module. When the game is running different functional modules, the network attributes included in the to-be-processed network status parameter may be different. In practical applications, the to-be-processed network status parameters for different functional modules can be classified into different groups and processed separately.
[0079] Correspondingly, for functional modules with the same or nearly the same specific form, similar data can be classified into the same group for joint processing based on the data composition characteristics in the to-be-processed network status parameter. For example, for video applications, the network attributes involved in the video comment module and the in-site message module may be the same or nearly the same, so the to-be-processed network status parameters for these two modules can be jointly processed.
[0080] It can be understood that the network status parameter is a parameter generated according to the status of the first test network, and its change does not necessarily depend on the usage status of the target application. The network status parameters for different functional modules described above can be understood as the parameters generated by the first test network when the target application executes the functions of specific modules.
[0081] Step S203: Obtain N groups of network status parameters from the M groups of network status parameters, where the N groups of network status parameters are parameters associated with the network abnormal status of the first test network, and N is an integer greater than or equal to 1 and less than M.
[0082] Among them, the method of obtaining N groups of network status parameters can be different. For example, it can be obtained by means of statistical data, screening according to specific user feedback information, iterative evaluation using big data, etc. The obtained N groups of network status parameters have an association relationship with the network abnormal status of the first test network. Specifically, the N groups of network status parameters can be the parameters generated when the first test network is in an abnormal state, or the statistical parameters indicating that the first test network is in an abnormal state. Statistical parameters can be, for example, the percentage of points with a delay greater than a threshold, the percentage of points with a packet loss rate greater than a threshold, the average delay, the standard deviation of the delay, the average packet loss rate, and the standard deviation of the packet loss rate, etc. N is an integer greater than or equal to 1 and less than M. That is, when there are 10 groups of network status parameters, the value range of N can be from 1 to 9.
[0083] When obtaining N groups of network status parameters, the server can determine whether each group of network status parameters matches at least one abnormal detection rule. The abnormal detection rule includes the conditions that the network attributes in each group of network parameter statuses need to meet. For example, the network status parameter can include: delay and queue length. Correspondingly, the abnormal detection rule can include that the delay is greater than a predetermined delay and the queue length is greater than a predetermined length, etc.
[0084] It can be understood that the above abnormal detection rules can be set according to factors such as the network attributes in the network status parameters and different functional modules in the target application involved in combination with actual needs, and there is no limitation on this.
[0085] Step S204: Generate a second test network according to the eigenvalue included in the N groups of network status parameters.
[0086] Specifically, the server can control the network status simulator in the second test network to simulate the status of the first test network according to the eigenvalues of each group of network status parameters in the N groups of network status parameters, so as to reproduce the abnormal status of the first test network.
[0087] Specifically, the second test network may include a network status simulator and test terminals to be connected. The test device uses the network status simulator as a gateway and connects to the network through the network status simulator. The network status simulator is directly connected to the network and is responsible for receiving and forwarding the network communications of the test terminals.
[0088] The server configures the control parameters of the network status simulator according to the characteristic values of the network attributes in the respective network status parameters. The network status simulator forwards the communications of the test terminals according to the control parameters. For example, if the server adjusts the real-time delay in the control parameters of the simulator to 500 ms, then when the simulator receives the communication of the test terminal, it will forward it after delaying it for 500 ms.
[0089] Step S205: Control the target application to run in the second test network to obtain the test result of the target application.
[0090] The server can send a control instruction to the test device in the second test network. The test device runs the target application according to the control instruction to obtain the performance of the target application in the second test network as the test result. For example, for a live broadcast application, the server configures the packet loss rate in the second test network to a relatively high value, and then controls the test device in the second test network to perform live broadcast operations or viewing operations, and collects the performance of the live broadcast application in live broadcast and viewing as the test result, which is used as the basis for optimizing the performance of the live broadcast application under high packet loss rates.
[0091] In the embodiments of the present application, network status parameters of the existing network where the target application is located are collected, and specific network status parameters are selected therefrom. Subsequently, according to the specific network status parameters, the corresponding network status is reproduced in the test network, and then the target application is tested in the test network. Through the above method, various complex situations and sudden changes that occur in the real network can be reproduced in the test network, so that the target application can be specifically tested for these network situations in the test network, which is beneficial to improving the accuracy of application program testing.
[0092] In an embodiment of the present application, the M groups of network status parameters are from the same sliding window. To obtain N groups of network status parameters from the M groups of network status parameters, specifically, as Figure 3 shown, the above step S203 may be the following steps S301 to S303, which are described in detail as follows:
[0093] In step S301, obtain the characteristic values corresponding to the respective network attributes included in the M groups of network status parameters.
[0094] Among them, for each group of network status parameters in the M groups of network status parameters, the eigenvalue corresponding to each network attribute is read therefrom.
[0095] In step S302, according to the eigenvalue corresponding to the network attribute, the average eigenvalue corresponding to each network attribute is calculated.
[0096] Specifically, for the M groups of network status parameters, the same network attributes can be integrated together, and their average eigenvalues are calculated. Among them, the calculation of the average eigenvalue can adopt a subset of the M groups of network status parameters. For example, for 6 groups of network status parameters in a sliding window, for each network attribute, the average eigenvalue can be the average of the 6 groups of network status parameters, that is, for each network attribute, there is only one average eigenvalue. The average eigenvalue can be the average of every 2 groups or 3 groups of network status parameters, that is, for each network attribute, there are 3 or 2 average eigenvalues. In another embodiment, before calculating the average eigenvalue, the eigenvalues can be filtered first. For example, for 10 groups of network status parameters in a sliding window, for one network attribute, the eigenvalues exceeding a predetermined threshold can be filtered out first, or the eigenvalues are sorted according to their magnitudes and the top several eigenvalues are obtained, and then the average eigenvalue is calculated based on these filtered eigenvalues.
[0097] In step S303, N groups of network status parameters are generated according to the average eigenvalue corresponding to each network attribute.
[0098] Specifically, each network attribute obtains an average eigenvalue, and they can be combined into N groups of network status parameters. For different ways of obtaining the average eigenvalue, the ways of generating N groups of network status parameters are different. The N groups of network status parameters can include only 1 group of average eigenvalues, and this group of average eigenvalues is obtained based on all the network status parameters within the sliding window, or can include multiple groups of average eigenvalues, and each group of average eigenvalues is obtained based on a subset of the M groups of network status parameters.
[0099] In this embodiment, the collected network status parameters are processed by calculating the average value, so that the instantaneous network anomalies do not have too much impact on the subsequent testing process, and thus the overly short network transients or occasional instantaneous fluctuations will not be over-tested, saving testing resources and improving testing efficiency at the same time.
[0100] In an embodiment of the present application, the M groups of network status parameters are from the same sliding window. In order to obtain N groups of network status parameters from the M groups of network status parameters, specifically, it can be as Figure 4 shown. The above step S203 can be the following steps S401 to S404, which are described in detail as follows:
[0101] In step S401, obtain the eigenvalues corresponding to each network attribute included in the M groups of network status parameters.
[0102] The obtaining method in this step is the same as that in step S301 above, and will not be elaborated here.
[0103] In step S402, cluster the eigenvalues corresponding to each network attribute to obtain clustering groups and the corresponding cluster center values of the clustering groups.
[0104] Specifically, depending on the form of the network status parameters, the clustering algorithm can be calculated by various suitable methods such as StreamKM++ or Kmeans. Below, the method of using streamKM++ for streaming data will be taken as an example for introduction.
[0105] For a network attribute, among the M network status parameters in a sliding window, there will be M eigenvalues, and they will be input into the StreamKM++ clustering algorithm in a sequence arranged according to the acquisition time.
[0106] The method for the StreamKM++ clustering algorithm to calculate the cluster center value is as follows:
[0107]
[0108] n t+1 =n t +m t
[0109] Among them, c t represents the cluster center value obtained from the previous clustering calculation, which is a vector; n t represents the number of eigenvalues used in the previous clustering calculation; x t represents the center value of the eigenvalues input this time, which is a vector; m t is the number of eigenvalues newly added in this clustering calculation; a is the forgetting factor, and its value range is a ∈ (0, 1).
[0110] The clustering process is as follows:
[0111] Assume that each network status parameter includes two network attributes, such as the number of connections and the queue length. For the first calculation, two cluster center values will be randomly generated. Assume that the randomly generated cluster center c t is [[0, 0], [10, 10]]. Assume that M is 4. Then, in this clustering process, the number of eigenvalues input is 4. Assume they are [[0, 1], [1, 0], [2, 1], [9, 9]], and the forgetting factor a is 0.5. For each input eigenvalue, the distance to the nearest cluster center value will be calculated, and then n t and xt , m t . Taking cluster a with the cluster center value of [0, 0] as an example, n t = 0, x t = [1, 2 / 3], m t = 3, then for this clustering calculation,
[0112]
[0113] At this time, assuming the second calculation, the input feature values are [[1, 0], [0, 1], [11, 9], [10, 10]], then for cluster a, c t+1 = [1, 2 / 3], n t+1 = 3, x t+1 = [0.5, 0.5], m t+1 = 2, then for the second clustering calculation,
[0114]
[0115] For subsequent inputs, subsequent iterations can be continued to cyclically obtain the cluster center values.
[0116] In step S403, according to the cluster center value and the anomaly threshold, determine the abnormal cluster groups from the clustering groups.
[0117] Specifically, determine the abnormal cluster groups according to whether the cluster center value and the anomaly threshold satisfy at least one anomaly detection rule. The anomaly detection rules include the conditions that the cluster center value needs to satisfy compared with the anomaly threshold. For example, the network state parameter includes delay, and the anomaly detection rule can include that the cluster center value of the delay is greater than the anomaly threshold.
[0118] In step S404, according to the abnormal cluster groups, determine N groups of network state parameters.
[0119] For all abnormal cluster groups, the situation of the feature values within each group can be statistically analyzed. For example, statistically analyze the ratio between the number of abnormal values and the number of normal values within each group or the degree to which the abnormal values themselves exceed the normal values, sort the abnormal cluster groups, and use the cluster group with the highest ranking as the N groups of network state parameters. Specifically, for example, the abnormal cluster groups include delay clustering and packet loss rate clustering, and each clustering includes 20 feature values. Among them, the delay clustering contains 15 abnormal values, and the packet loss rate clustering contains 18 abnormal values. Then, N groups of network state parameters can be generated according to the abnormal feature values in the packet loss rate clustering.
[0120] It can be understood that among the N groups of network status parameters, it may only include the feature values in the abnormal clustering group, or the respective network status parameters corresponding to the feature values may be added to the N groups of network status parameters. For example, in the above example, the N groups of network status parameters may only include 18 outliers in the packet loss rate clustering, or may include a vector composed of 18 outliers and the corresponding delay feature values.
[0121] In one embodiment, the obtained clustering center value of the previous cycle can be used to determine the category of the currently input M network status parameters. If the input M network status parameters include feature values greater than the clustering center value of the previous cycle, it can be determined that the network status parameter is an outlier. At this time, an abnormal status report can be generated based on the network status parameter and reported to the user for real-time monitoring.
[0122] In this embodiment, the abnormal network status parameters are screened by clustering. Since the clustering method can more fully reflect the change trends of each network attribute, when the network condition deteriorates, the selected network status parameters can more fully reflect the abnormal network status, so that the abnormal condition can be simulated more accurately, improving the accuracy of network simulation.
[0123] In one embodiment of the present application, the M groups of network status parameters are derived from at least two sliding windows. The M groups of network status parameters include a first parameter group and a second parameter group, and the first parameter group and the second parameter group include the same number of groups of network status parameters. In order to obtain the N groups of network status parameters from the M groups of network status parameters, specifically, as Figure 5 shown, the above step S203 can be the following steps S501 to S503, which are described in detail as follows:
[0124] In step S501, the first feature values corresponding to each network attribute are obtained from the first parameter group, and the second feature values corresponding to each network attribute are obtained from the second parameter group.
[0125] Specifically, the number of network status parameters included in the first parameter group and the second parameter group is the same, and generally, the types of network attributes included are also the same. Depending on the number of network attributes, the first feature values may specifically include multiple feature values respectively corresponding to multiple network attributes. Similarly, the second feature values may also include multiple feature values respectively corresponding to multiple network attributes. For each network attribute, the feature values corresponding to each network attribute are read from the network status parameters in each of the first parameter group and the second parameter group.
[0126] In step S502, according to the first feature values and the second feature values, the average feature values corresponding to each network attribute are determined.
[0127] Specifically, for each network attribute of the first parameter group and the second parameter group, the first eigenvalue and the second eigenvalue corresponding to the same network attribute are integrated together, and their average eigenvalue is calculated. The network attributes included in the first parameter group and the second parameter group may be different. For the network attributes commonly included in the first parameter group and the second parameter group, the average eigenvalue is calculated across the sliding window, and for the different network attributes, the average eigenvalue is only calculated within the window.
[0128] The calculation of the average eigenvalue can adopt a subset of the first eigenvalue and the second eigenvalue. For example, for a total of 6 groups of network state parameters from two different windows, where the first parameter group and the second parameter group each include 3 groups of network state parameters, for each network attribute, the average eigenvalue can be the average of the 6 groups of network state parameters, that is, for each network attribute, there is only one average eigenvalue. The average eigenvalue can also be the average of multiple groups of network state parameters from the first parameter group and the second parameter group respectively, that is, for each network attribute, the average of a group of network state parameters in the first parameter group and a group of network state parameters in the second parameter group is calculated. Therefore, for each network attribute in the 6 groups of network state parameters, there will be 3 groups of averages.
[0129] In step S503, the average eigenvalue corresponding to the network attribute is determined as N groups of network state parameters.
[0130] Specifically, each network attribute obtains an average eigenvalue, and they can be combined into N groups of network state parameters. For different ways of obtaining the average eigenvalue, the ways of generating N groups of network state parameters are different. The N groups of network state parameters may only include 1 group of average eigenvalues, and this group of average eigenvalues is obtained based on all the network state parameters within at least two sliding windows, or may include multiple groups of average eigenvalues, with each group of average eigenvalues obtained based on the eigenvalues from the first parameter group and the second parameter group respectively.
[0131] It can be understood that although only two sliding windows are taken as examples in the above embodiments, for more than two sliding windows, the method of calculating the average eigenvalue is analogized according to the above process and will not be elaborated here.
[0132] In this embodiment, the average eigenvalue is calculated based on the network state parameters from different sliding windows as the calculation result. Since the sampling result of the sliding window can only target the short-term state within one window, calculating the average across sliding windows makes the calculation result based on a sample space with sufficient time span, thereby weakening the influence of individual special cases on the calculation result. According to the calculation result, the network state can be more accurately simulated.
[0133] In one embodiment of the present application, the M sets of network state parameters are derived from at least two sliding windows. The M sets of network state parameters include a first parameter set and a second parameter set, and the first parameter set and the second parameter set include the same number of sets of network state parameters. In order to obtain N sets of network state parameters from the M sets of network state parameters, specifically, it can be as follows Figure 6 As shown, step S203 above can be steps S601 to S604 as follows, and the details are as follows:
[0134] In step S601, obtain the first eigenvalue corresponding to each network attribute from the first parameter set, and obtain the second eigenvalue corresponding to each network attribute from the second parameter set.
[0135] The obtaining method in this step is the same as the obtaining method in step S501 above, and will not be elaborated here.
[0136] In step S602, cluster the first eigenvalue and the second eigenvalue to obtain a clustering group and a clustering center value corresponding to the clustering group, where the eigenvalues in the clustering group come from at least one of the first eigenvalue and the second eigenvalue.
[0137] Specifically, depending on the form of the network state parameters, the clustering algorithm can be calculated in various suitable ways such as StreamKM++ or Kmeans. Below, taking the example of using streamKM++ for stream data will be introduced.
[0138] Depending on the number of network attributes included in the network state parameters, the first eigenvalue and the second eigenvalue may specifically include multiple eigenvalues.
[0139] For one network attribute, among the M network state parameters from at least two sliding windows, there will be M eigenvalues. These M eigenvalues may specifically come from at least one of the first eigenvalue and the second eigenvalue, and they will be input into the StreamKM++ clustering algorithm in a sequence arranged according to the acquisition time.
[0140] For the specific calculation process of the StreamKM++ clustering algorithm, please refer to the introduction in step S402 above, and it will not be elaborated here.
[0141] In step S603, determine the abnormal clustering group in the clustering group according to the clustering center value and the abnormal threshold.
[0142] Specifically, judge the abnormal clustering group according to whether the clustering center value and the abnormal threshold satisfy at least one abnormal detection rule. The abnormal detection rule includes the conditions that the clustering center value needs to satisfy compared with the abnormal threshold. For example, if the network state parameter includes delay, the abnormal detection rule may include that the clustering center value of the delay is greater than the abnormal threshold.
[0143] In step S604, according to the abnormal clustering groups, N groups of network state parameters are determined.
[0144] For all abnormal clustering groups, the situation of the eigenvalues within each group can be statistically analyzed. For example, the ratio between the number of abnormal values and the number of normal values within each group or the degree to which the abnormal values exceed the normal values is statistically analyzed. The abnormal clustering groups are sorted, and the clustering group with the highest ranking is used as the N groups of network state parameters. Specifically, for example, the abnormal clustering groups include delay clustering and packet loss rate clustering, and each clustering contains 20 eigenvalues. Among them, the delay clustering contains 15 abnormal values, and the packet loss rate clustering contains 18 abnormal values. Then, the N groups of network state parameters can be generated according to the abnormal eigenvalues in the packet loss rate clustering.
[0145] It can be understood that in the N groups of network state parameters, only the eigenvalues in the abnormal clustering groups can be included, or the respective network state parameters corresponding to the eigenvalues can be added to the N groups of network state parameters. For example, in the above example, the N groups of network state parameters can only include 18 abnormal values in the packet loss rate clustering, or can include the vector composed of 18 abnormal values and the corresponding delay eigenvalues.
[0146] In one embodiment, the obtained clustering center values of the previous cycle can be used to judge the category of the currently input M network state parameters. If the input M network state parameters include eigenvalues greater than the clustering center values of the previous cycle, it can be determined that the network state parameter is an abnormal value. At this time, an abnormal state report can be generated based on the network state parameter and reported to the user for real-time monitoring.
[0147] In this embodiment, when screening the abnormal network state parameters by using the network state parameter pairs from at least two sliding windows, since the number of input values of the clustering algorithm increases, the clustering center value can be closer to the real situation in the network, so that the abnormal situation can be simulated more accurately, and the accuracy of network simulation is improved.
[0148] In one embodiment of the present application, based on the above technical solution, specifically as Figure 7 shown, the above step S204. Generating a second test network according to the eigenvalues in the N groups of network state parameters can be as steps S701 and S702 as follows:
[0149] In step S701, when the specified moment is reached, according to the eigenvalues of the third network state parameter in the N groups of network state parameters, the second test network at the specified moment is obtained;
[0150] In step S702, at each moment after the specified moment, according to the eigenvalue of the fourth network state parameter among the N groups of network state parameters, the second test network updated at the previous moment is updated to obtain the updated second test network.
[0151] Specifically, the server includes a network state simulator in the second test network, and uses this network state simulator to generate the second test network. Please refer to Figure 8 , Figure 8 for the functional module schematic diagram of the network state simulator. As Figure 8 shown, the network state simulator 800 includes a remote control interface 801, a parameter controller 802, an uplink queue 803, a downlink queue 804, and a data visualization device 805. Among them, the remote control interface 801 can be used to send and receive control signals with the server and send and receive control signals with the test devices in the second test network. The parameter controller 802 is used to control the forwarding of data packets according to the control signals of the server. The uplink queue 803 and the downlink queue 804 are used to store the data packets sent and received by the target application on the test device. The data visualization device 805 then statistically analyzes the communication information therein based on the records of the uplink queue and the downlink queue and displays it as a chart for the user to check.
[0152] Specifically, in this embodiment, the server starts a timer for each group of network state parameters in the parameter controller according to the N groups of network state parameters. The timing length of the timer is mainly determined according to the order and the degree of abnormality of the network state parameters. For example, the timing length of the timer for the network state parameter that occurred earlier in the first test network can be shorter, and the network state parameter with a high degree of abnormality can also be shorter. It can be understood that the timing lengths of the respective timers should be different to ensure that each group of network state parameters has an appropriate test duration.
[0153] When any timer expires, it means that the current time has reached the specified moment. At this time, the parameter controller will update the control parameters of the network state simulator according to the eigenvalue of the third network state parameter corresponding to this timer. Subsequently, the network state simulator will provide communication services for the target application of the test device in the second test network. For communication data that needs to simulate abnormalities, operations such as delay, packet loss, and bandwidth reduction can be performed using the uplink queue or the downlink queue. For example, according to the delay parameter, the communication request of the target application in the test device is added to the uplink queue or the downlink queue and forwarded after a certain delay to simulate a high-delay network.
[0154] Among them, when the network status simulator controls communication according to network status parameters, it can perform filtering and judgment based on the Internet protocol address, port, protocol type, etc. used by the test device for communication, so as to add only the communication data related to the target application to the queue for communication control.
[0155] After reaching the specified moment, other timers will continue to count. At each moment after the specified moment, when any timer expires, according to the eigenvalue of the fourth network status parameter in the N groups of network status parameters, the second test network updated at the previous moment is updated. That is, the parameter controller in the network status simulator will update its control parameters according to the eigenvalue of the fourth network status parameter, so as to simulate and test the new abnormal network status.
[0156] After the network status simulator updates the control parameters, it can send instructions to the test device in the second test network through the remote control interface to start the target application to perform the test operation. The start of the target application and the execution of the test operation can also be carried out in other ways, such as being actively triggered by a third party, which is not limited here.
[0157] It can be understood that the above-mentioned network status simulator can be executed by an independent device or by the server itself that executes the method of application testing. In the embodiment where the server itself serves as the simulator, the server can send control instructions between its own functional modules, so as to generate the second test network according to the obtained network status parameters associated with the abnormal network status.
[0158] In this application, when reaching the specified moment and each subsequent moment, the second test network is updated. Therefore, it can automatically switch between various network statuses, thereby avoiding the manual access and configuration process and improving the efficiency of testing the application.
[0159] In an embodiment of this application, based on the above technical solution, specifically as Figure 9 shown, the above step S205. Controlling the target application to run in the second test network to obtain the test result corresponding to the target application can be as follows in step S901 and step S903:
[0160] In step S901, receive the data packet sent by the target application;
[0161] In step S902, count the data packet to obtain network response data, where the network response data includes at least one of packet loss rate, delay, and bandwidth;
[0162] In step S903, generate the test result corresponding to the target application according to the network response data.
[0163] Specifically, the server can receive data packets sent by the target application through the network status simulator. The data packets can include information for the target application to monitor and count its own running status. The server parses and counts the data packets to obtain network response data. The data packets can also be data packets for business processing. In this case, the server can count the business performance of the target application to obtain network response data. The network response data generally includes at least one of the packet loss rate, latency, and bandwidth in the communication of the target application. The network response data can also include the performance of the target application itself with respect to the network status. Such performance depends on the type and use of the target application itself. For example, for a game application, the smoothness of the game under high latency can be counted, and for a transaction application, the transaction success rate under high packet loss rate can be counted. The test content related to the specific performance of the target application is not limited here.
[0164] After obtaining the network response data, statistics can be performed based on the content in the network response data as the test result corresponding to the target application. At the same time, it can also be merged with the previously obtained test results for graphical display to facilitate user use.
[0165] In this application, network response data is obtained based on the data packets sent by the target application, so that the test results of the target application tested under the second test network can be automatically obtained. Thus, the manual intervention in the test process can be reduced, thereby saving the cost consumption of the test and improving the efficiency and operability of the test.
[0166] It should be noted that although the steps of the method in this application are described in a specific order in the drawings, this does not require or imply that these steps must be executed in that specific order, or that all the steps shown must be executed to achieve the desired result. Additionally or alternatively, some steps can be omitted, multiple steps can be combined into one step for execution, and / or one step can be decomposed into multiple steps for execution, etc.
[0167] The following introduces the apparatus embodiment of this application, which can be used to execute the application test method in the above embodiments of this application. Figure 10 The block diagram of the application test apparatus in the embodiment of this application is schematically shown. As Figure 10 shown, the application test apparatus 1000 mainly can include:
[0168] The first acquisition module 1001 is used to acquire the to-be-processed network status parameters generated by the first test network when the target application runs on the first test network;
[0169] A sampling module 1002, configured to sample the network status parameters to be processed by using a sliding window, so as to obtain M groups of network status parameters, where N groups of network status parameters indicate the network abnormal status of a first test network, and each group of network status parameters in the M groups of network status parameters includes eigenvalues corresponding to network attributes, and M is an integer greater than 1;
[0170] A second obtaining module 1003, configured to obtain N groups of network status parameters from the M groups of network status parameters, where N is an integer greater than or equal to 1 and less than M;
[0171] A generating module 1004, configured to generate a second test network according to the eigenvalues included in the N groups of network status parameters;
[0172] A control module 1005, configured to control a target application to run in the second test network, so as to obtain a test result of the target application.
[0173] In an embodiment of the present application, based on the above technical solution, the second obtaining module 1003 may include:
[0174] An obtaining unit, configured to obtain the eigenvalues corresponding to the respective network attributes included in the M groups of network status parameters;
[0175] A calculating unit, configured to calculate the average eigenvalue corresponding to each network attribute according to the eigenvalue corresponding to the network attribute;
[0176] A generating unit, configured to generate the N groups of network status parameters according to the average eigenvalue corresponding to each network attribute.
[0177] In an embodiment of the present application, based on the above technical solution, the second obtaining module 1003 may include:
[0178] The obtaining unit is further configured to obtain the eigenvalues corresponding to the respective network attributes included in the M groups of network status parameters;
[0179] A clustering unit, configured to cluster the eigenvalues corresponding to the respective network attributes to obtain a clustering group and a clustering center value corresponding to the clustering group;
[0180] A determining unit, configured to determine an abnormal clustering group from the clustering groups according to the clustering center value and an abnormal threshold;
[0181] The determining unit is further configured to determine the N groups of network status parameters according to the abnormal clustering group.
[0182] In an embodiment of the present application, based on the above technical solution, the second obtaining module 1003 may include:
[0183] The obtaining unit is further configured to obtain the first eigenvalue corresponding to each network attribute from the first parameter group, and obtain the second eigenvalue corresponding to each network attribute from the second parameter group;
[0184] The determining unit is further configured to determine the average eigenvalue corresponding to each network attribute according to the first eigenvalue and the second eigenvalue;
[0185] The determining unit is further configured to determine the average eigenvalue corresponding to the network attribute as the N groups of network state parameters.
[0186] In an embodiment of the present application, based on the above technical solution, the second obtaining module 1003 may include:
[0187] The obtaining unit is further configured to obtain the first eigenvalue corresponding to each network attribute from the first parameter group, and obtain the second eigenvalue corresponding to each network attribute from the second parameter group;
[0188] The clustering unit is further configured to cluster the first eigenvalue and the second eigenvalue to obtain a clustering group and a clustering center value corresponding to the clustering group, where the eigenvalues in the clustering group come from at least one of the first eigenvalue and the second eigenvalue;
[0189] The determining unit is further configured to determine the abnormal clustering group in the clustering group according to the clustering center value and the abnormal threshold;
[0190] The determining unit is further configured to determine the N groups of network state parameters according to the abnormal clustering group.
[0191] In an embodiment of the present application, based on the above technical solution, the generating module 1004 may include:
[0192] The updating unit is configured to obtain the second test network at the specified moment according to the eigenvalue of the third network state parameter in the N groups of network state parameters;
[0193] The updating unit is further configured to update the second test network updated at the previous moment according to the eigenvalue of the fourth network state parameter in the N groups of network state parameters at each moment after the specified moment to obtain the updated second test network.
[0194] In an embodiment of the present application, based on the above technical solution, the control module 1005 may include:
[0195] The receiving unit is configured to receive the data packet sent by the target application;
[0196] A statistical unit for statistically analyzing the data packet to obtain network response data, where the network response data includes at least one of packet loss rate, latency, and bandwidth;
[0197] A result generation unit for generating a test result corresponding to the target application according to the network response data.
[0198] It should be noted that the device provided in the above embodiment and the method provided in the above embodiment belong to the same concept. The specific manners in which each module performs operations have been described in detail in the method embodiment and will not be elaborated here.
[0199] Figure 11 The structural diagram of a computer system of an electronic device suitable for implementing the embodiments of the present application is shown.
[0200] It should be noted that Figure 11 The computer system 1100 of the shown electronic device is only an example and should not impose any limitations on the functions and usage scope of the embodiments of the present application.
[0201] As Figure 11 shown, the computer system 1100 includes a central processing unit (CPU) 1101, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1102 or the program loaded from the storage section 1108 into the random access memory (RAM) 1103. In the RAM 1103, various programs and data required for system operation are also stored. The CPU 1101, ROM 1102, and RAM 1103 are connected to each other through a bus 1104. The input / output (I / O) interface 1105 is also connected to the bus 1104.
[0202] The following components are connected to the I / O interface 1105: an input section 1106 including a keyboard, a mouse, etc.; an output section 1107 including such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), etc. and a speaker, etc.; a storage section 1108 including a hard disk, etc.; and a communication section 1109 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 1109 performs communication processing via a network such as the Internet. A drive 1110 is also connected to the I / O interface 1105 as required. A removable medium 1111, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is mounted on the drive 1110 as required so that a computer program read therefrom is installed into the storage section 1108 as required.
[0203] Specifically, according to an embodiment of the present application, the processes described in each of the method flowcharts can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product that includes a computer program carried on a computer-readable medium, and the computer program includes program code for performing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 1109, and / or installed from the removable medium 1111. When the computer program is executed by a central processing unit (CPU) 1101, various functions defined in the system of the present application are executed.
[0204] It should be noted that the computer-readable medium shown in the embodiments of the present application can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer-readable storage medium can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, the computer-readable storage medium can be any tangible medium that contains or stores a program, and this program can be used by or in combination with an instruction execution system, apparatus, or device. In the present application, the computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, in which the computer-readable program code is carried. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable storage medium, and this computer-readable medium can send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted by any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0205] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagram can represent a module, a program segment, or a part of code, and the above module, program segment, or part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram or flowchart, and the combination of blocks in the block diagram or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.
[0206] It should be noted that although several modules or units of the device for action execution are mentioned in the above detailed description, such division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of the two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0207] Through the description of the above embodiments, those skilled in the art can easily understand that the example embodiments described herein can be implemented by software or by a combination of software and necessary hardware. Therefore, the technical solutions according to the embodiments of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (such as a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the embodiments of the present application.
[0208] After considering the specification and practicing the invention disclosed herein, those skilled in the art will readily conceive of other embodiments of the present application. The present application is intended to cover any variations, uses, or adaptations of the present application, which follow the general principles of the present application and include well-known common general knowledge or conventional technical means in the technical field not disclosed in the present application.
[0209] It should be understood that the present application is not limited to the exact structures already described and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present application is only limited by the appended claims.
Claims
1. A method for application testing, characterized in that, including: When the target application runs on the first test network, obtaining the to-be-processed network state parameters generated by the first test network; Sampling the to-be-processed network state parameters by using a sliding window to obtain M groups of network state parameters, where each group of network state parameters in the M groups of network state parameters includes the eigenvalue corresponding to the network attribute, and M is an integer greater than 1; Obtaining N groups of network state parameters from the M groups of network state parameters, where the N groups of network state parameters are parameters associated with the network abnormal state of the first test network, and N is an integer greater than or equal to 1 and less than M; Generating a second test network according to the eigenvalues included in the N groups of network state parameters; Controlling the target application to run in the second test network to obtain the test result of the target application.
2. The method according to claim 1, characterized in that, The M groups of network state parameters are from the same sliding window; Obtaining N groups of network state parameters from the M groups of network state parameters includes: Obtaining the eigenvalues corresponding to each network attribute included in the M groups of network state parameters; Calculating the characteristic average value corresponding to each network attribute according to the eigenvalue corresponding to the network attribute; Generating the N groups of network state parameters according to the characteristic average value corresponding to each network attribute.
3. The method according to claim 1, characterized in that The M groups of network state parameters are from the same sliding window; Obtaining N groups of network state parameters from the M groups of network state parameters includes: Obtaining the eigenvalues corresponding to each network attribute included in the M groups of network state parameters; Clustering the eigenvalues corresponding to each network attribute to obtain clustering groups and the clustering center values corresponding to the clustering groups; Determining abnormal clustering groups from the clustering groups according to the clustering center values and the abnormal threshold; Determining the N groups of network state parameters according to the abnormal clustering groups.
4. The method according to claim 1, characterized in that, The M groups of network state parameters are from at least two sliding windows, the M groups of network state parameters include a first parameter group and a second parameter group, and the first parameter group and the second parameter group include the same number of groups of network state parameters; Obtaining N groups of network state parameters from the M groups of network state parameters includes: Obtaining the first eigenvalues corresponding to each network attribute from the first parameter group and obtaining the second eigenvalues corresponding to each network attribute from the second parameter group; Determining the characteristic average value corresponding to each network attribute according to the first eigenvalue and the second eigenvalue; Determining the characteristic average value corresponding to the network attribute as the N groups of network state parameters.
5. The method according to claim 1, wherein The M groups of network state parameters are from at least two sliding windows, the M groups of network state parameters include a first parameter group and a second parameter group, and the first parameter group and the second parameter group include the same number of groups of network state parameters; Obtaining N groups of network state parameters from the M groups of network state parameters includes: Obtaining the first eigenvalues corresponding to each network attribute from the first parameter group and obtaining the second eigenvalues corresponding to each network attribute from the second parameter group; Cluster the first eigenvalue and the second eigenvalue to obtain cluster groups and the corresponding cluster center values of the cluster groups, where the eigenvalues in the cluster groups come from at least one of the first eigenvalue and the second eigenvalue; Determine the abnormal cluster groups in the cluster groups according to the cluster center values and the abnormal threshold; Determine the N groups of network state parameters according to the abnormal cluster groups; 6. The method according to any one of claims 1 to 5, characterized in that, The generating the second test network according to the eigenvalues in the N groups of network state parameters includes: When reaching a specified moment, obtain the second test network at the specified moment according to the eigenvalues of the third network state parameter in the N groups of network state parameters; At each moment after the specified moment, update the second test network updated at the previous moment according to the eigenvalues of the fourth network state parameter in the N groups of network state parameters to obtain the updated second test network; 7. The method according to any one of claims 1 to 5, characterized in that, The controlling the target application to run in the second test network to obtain the test result corresponding to the target application includes: Receive the data packets sent by the target application; Perform statistics on the data packets to obtain network response data, where the network response data includes at least one of packet loss rate, latency, and bandwidth; Generate the test result corresponding to the target application according to the network response data; 8. An application testing device, characterized in that, including: A first acquisition module, configured to acquire the to-be-processed network state parameters generated by the first test network when the target application runs in the first test network; A sampling module, configured to perform sampling processing on the to-be-processed network state parameters by using a sliding window to obtain M groups of network state parameters, where each group of network state parameters in the M groups of network state parameters includes eigenvalues corresponding to network attributes, and M is an integer greater than 1; A second acquisition module, configured to acquire N groups of network state parameters from the M groups of network state parameters, where the N groups of network state parameters are parameters associated with the network abnormal state of the first test network, and N is an integer greater than or equal to 1 and less than M; A generation module, configured to generate a second test network according to the eigenvalues included in the N groups of network state parameters; A control module, configured to control the target application to run in the second test network to obtain the test result of the target application; 9. An electronic device, characterized in that, including: A processor; A memory, configured to store the executable instructions of the processor; Wherein, the processor is configured to execute the method for application testing according to any one of claims 1 to 7 by executing the executable instructions; 10. A computer-readable medium having a computer program stored thereon, characterized in that, The computer program, when executed by the processor, implements the method for application testing according to any one of claims 1 to 7; 11. A computer program product, characterized in that, The computer program product includes computer instructions, the computer instructions are stored in a computer-readable storage medium, a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method for application testing according to any one of claims 1 to 7.
Citation Information
Patent Citations
Method and device for simulating network anomaly and testing automatic switching of database faults
CN105512343A
DeApplication program development debugging method and devicevelopment debugging method and device of application program, electronic equipment and storage medium
CN109614340A