Simulation test method and device for cloud server
By building a custom service framework test environment and deploying a failure prediction model and behavior analysis model, the problem of inefficient cloud server testing is solved, and a variety of simulation tests are implemented, which improves the accuracy and reliability of the test.
Patent Information
- Application Number
- CN202411813838.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2024-11-27
- Filing Date
- 2024-12-10
- Publication Date
- 2025-04-15
AI Technical Summary
In the prior art, cloud servers have low testing efficiency and require manual configuration of system components such as virtual machines. The steps are cumbersome and error-prone.
Provides a simulation test method for cloud servers, by building a custom service framework test environment, deploying fault prediction models and behavioral analysis models, and using simulation test data for resource allocation, fault repair and security protection.
It improves the testing efficiency of cloud servers, avoids the tedious steps of manual configuration, realizes a variety of simulated tests of cloud servers, and enhances the accuracy and reliability of the test.
Smart Images

Figure CN119829390A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computers, and more specifically, to a simulation test method and device for a cloud server. Background Art
[0002] In the prior art, testing a cloud server often requires manual configuration of multiple system components such as virtual machines. The configuration process is cumbersome and error-prone, which leads to low testing efficiency of the cloud server. Therefore, in the prior art, there is a problem of low testing efficiency of the cloud server.
[0003] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0004] The embodiments of the present application provide a simulation test method and device for a cloud server, so as to at least solve the problem of low test efficiency of the cloud server in the related art.
[0005] According to an embodiment of the present application, a simulation test method for a cloud server is provided, comprising:
[0006] Build a customized service framework test environment, wherein the service framework test environment is used to simulate various operation scenarios of the cloud server, and a fault prediction model and a behavior analysis model are deployed in the service framework test environment. The fault prediction model is a neural network model trained by collecting and analyzing operation data and used to predict faults, and the behavior analysis model is a neural network model trained by collecting and analyzing behavior data and used to analyze behavior;
[0007] Using the simulated first test data, the resource allocation of the service framework test environment is tested, wherein the resource allocation is based on the real-time load to dynamically adjust the allocation of cloud server resources;
[0008] Using the simulated second test data, the fault recovery situation of the service framework test environment is tested, wherein the fault recovery situation is a situation in which the fault recovery script of the cloud server is triggered after the fault prediction model predicts the existence of a fault;
[0009] The security protection situation of the service framework test environment is tested using the simulated third test data, wherein the security protection situation is a situation in which the security protection script of the cloud server is triggered after the behavior analysis model analyzes abnormal behavior.
[0010] According to another embodiment of the present application, a simulation test device for a cloud server is provided, comprising:
[0011] A construction unit is used to construct a customized service framework test environment, wherein the service framework test environment is used to simulate various operation scenarios of the cloud server, and a fault prediction model and a behavior analysis model are deployed in the service framework test environment, wherein the fault prediction model is a neural network model trained by collecting and analyzing operation data and used to predict faults, and the behavior analysis model is a neural network model trained by collecting and analyzing behavior data and used to analyze behavior;
[0012] A first testing unit is used to test the resource allocation of the service framework test environment using simulated first test data, wherein the resource allocation is based on real-time load to dynamically adjust the allocation of cloud server resources;
[0013] A second testing unit is used to test the fault recovery situation of the service framework test environment by using simulated second test data, wherein the fault recovery situation is a situation in which a fault recovery script of the cloud server is triggered after the fault prediction model predicts the existence of a fault;
[0014] The third test unit is used to test the security protection status of the above-mentioned service framework test environment by using simulated third test data, wherein the above-mentioned security protection status is the situation where the security protection script of the above-mentioned cloud server is triggered after the above-mentioned behavior analysis model analyzes the abnormal behavior.
[0015] In an exemplary embodiment, the first test unit includes: a first test module, which is used to process the first test data through a standard algorithm and a custom algorithm, and start a dynamic load balancing algorithm to test the resource allocation of the service framework test environment.
[0016] In an exemplary embodiment, the above-mentioned first test module includes: a first preprocessing submodule, which is used to adopt the MapReduce algorithm as the above-mentioned standard algorithm to perform a first preprocessing on the first test data in key value form, wherein the above-mentioned first preprocessing includes a Map stage and a Reduce stage, the above-mentioned first test data in key value form is processed into intermediate key-value pairs by the Map function in the above-mentioned Map stage, and the above-mentioned intermediate key-value pairs are aggregated into a target set by the Reduce function in the above-mentioned Reduce stage, the values in the above-mentioned target set are processed by the Reduce function, and the final result is output, and the above-mentioned final result is the processing result of the above-mentioned first preprocessing.
[0017] In an exemplary embodiment, the above-mentioned first test module also includes: a second preprocessing submodule, used to use the K-Means clustering algorithm as the above-mentioned custom algorithm to perform a second preprocessing on the second test data containing user behavior information, wherein the above-mentioned second preprocessing includes dividing the above-mentioned second test data containing user behavior information into different groups, each group representing a class of similar user behavior characteristics.
[0018] In an exemplary embodiment, the above-mentioned construction unit includes: a first configuration module, used to configure the first parameters of the virtual machine instance in the above-mentioned service framework test environment according to the test requirements; a second configuration module, used to configure the second parameters of the network connection in the above-mentioned service framework test environment according to the test conditions.
[0019] In an exemplary embodiment, the above-mentioned first configuration module includes: a first configuration sub-module, used to configure the number of CPU cores of the above-mentioned virtual machine instance, wherein the above-mentioned first parameter includes the above-mentioned number of CPU cores, and the above-mentioned number of CPU cores matches the above-mentioned test requirement; a second configuration sub-module, used to configure the memory size of the above-mentioned virtual machine instance, wherein the above-mentioned first parameter includes the above-mentioned memory size, and the above-mentioned memory size matches the above-mentioned test requirement; a third configuration sub-module, used to configure the disk size of the above-mentioned virtual machine instance, wherein the above-mentioned first parameter includes the above-mentioned disk size, and the above-mentioned disk size matches the above-mentioned test requirement; a fourth configuration sub-module, used to configure the operating system of the above-mentioned virtual machine instance, wherein the above-mentioned first parameter includes the above-mentioned operating system, and the above-mentioned operating system matches the above-mentioned test requirement.
[0020] In an exemplary embodiment, the above-mentioned second configuration module includes: a fifth configuration submodule, used to configure the bandwidth of the above-mentioned network connection, wherein the above-mentioned second parameter includes the above-mentioned bandwidth, and the above-mentioned bandwidth matches the above-mentioned test condition; a sixth configuration submodule, used to configure the delay of the above-mentioned network connection, wherein the above-mentioned second parameter includes the above-mentioned delay, and the above-mentioned delay matches the above-mentioned test condition; a seventh configuration submodule, used to configure the packet loss rate of the above-mentioned network connection, wherein the above-mentioned second parameter includes the above-mentioned packet loss rate, and the above-mentioned packet loss rate matches the above-mentioned test condition.
[0021] In an exemplary embodiment, the above-mentioned first test unit includes: an acquisition module, including obtaining the load ratio of each node in the above-mentioned service framework test environment, wherein the above-mentioned load ratio is the ratio of the processing capacity of the above-mentioned node to the current load of the above-mentioned node; a determination module, used to determine the target node with the largest load ratio among multiple nodes in the above-mentioned service framework test environment; an adjustment module, used to allocate the above-mentioned first test data to the above-mentioned target node, and dynamically adjust the resource allocation of the above-mentioned target node according to the current load of the above-mentioned target node and the load of the above-mentioned first test data.
[0022] In an exemplary embodiment, the apparatus further includes: a first acquisition unit, used to acquire a plurality of first samples before testing the fault repair status of the service framework test environment using the simulated second test data, wherein the first samples are performance data of the cloud server at different time points; a second acquisition unit, used to acquire time series features corresponding to the plurality of first samples, and statistical features corresponding to the plurality of samples, wherein the time series features are used to represent the changing trend of the performance data in the time series, and the statistical features are used to represent the average response time and standard deviation of the performance data; a first training unit, used to train the performance data using the time series features and the statistical features; The simulated features are used to train the initial fault prediction model until the trained fault prediction model is obtained; the third acquisition unit is used to acquire multiple second samples before testing the security protection of the service framework test environment using the simulated third test data, wherein the second samples are the user's behavior data in the cloud server; the fourth acquisition unit is used to acquire user behavior features corresponding to the multiple second samples, wherein the user behavior features include time series features, access pattern features, and operation frequency features; the second training unit is used to train the initial behavior analysis model using the user behavior features until the trained behavior analysis model is obtained.
[0023] In an exemplary embodiment, the third test unit includes: a blocking module, which is used to automatically adjust firewall rules and access permission settings to prevent the above-mentioned abnormal behavior after testing the security protection of the service framework test environment using the simulated third test data; a prompting module, which is used to automatically trigger an alarm mechanism to prompt the above-mentioned abnormal behavior; and a recording module, which is used to generate an abnormal report regularly or on demand to record the above-mentioned abnormal behavior.
[0024] In an exemplary embodiment, the above-mentioned first test unit includes: a first simulation module, which is used to use the above-mentioned first test data to simulate the first test scenarios of low load, medium load, high load and burst load; a second test module, which is used to test the resource allocation of the above-mentioned service framework test environment under different above-mentioned first test scenarios; the above-mentioned second test unit includes: a second simulation module, which is used to use the above-mentioned second test data to simulate the second test scenario of hardware failure, software failure and network failure; a third test module, which is used to test the fault repair of the above-mentioned service framework test environment under different above-mentioned second test scenarios; the above-mentioned third test unit includes: a third simulation module, which is used to use the above-mentioned third test data to simulate the third test scenario of malicious access, unauthorized access and data leakage; a fourth test module is used to test the security protection of the above-mentioned service framework test environment under different above-mentioned third test scenarios.
[0025] According to another embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any one of the above method embodiments when running.
[0026] According to another embodiment of the present application, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0027] Through this application, a pre-built customized service framework test environment is adopted, and the service framework test environment can be used to simulate various scenarios of cloud servers. Because the neural network model of the fault prediction model and the behavior analysis model is also deployed in the service framework scenario, it is used to predict faults and analyze user behavior.
[0028] Furthermore, by simulating the first test data, the resource allocation of the service framework test environment is tested to test whether the resource allocation of the cloud server is reasonable; by simulating the second test data, the fault repair situation of the service framework test environment is tested to test whether the fault repair capability of the cloud server is normal after the fault prediction model predicts the existence of a fault; by simulating the third test data, the security protection situation of the service framework test environment is tested to test whether the protection capability of the security script of the cloud server is normal after the analysis model analyzes the existence of abnormal user behavior.
[0029] That is, through the pre-built service framework test scenario, the risk of reduced cloud server testing efficiency caused by the tedious steps of manually configuring system components during cloud server testing is avoided, thereby realizing multiple simulation tests of the cloud server, which can solve the problem of low cloud server testing efficiency and achieve the technical effect of improving cloud server testing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 is a schematic diagram of an application environment of a simulation test method for a cloud server according to an embodiment of the present application;
[0031] Figure 2 is a flow chart of a simulation test method of a cloud server according to an embodiment of the present application;
[0032] Figure 3 is a schematic diagram of a simulation test method of a cloud server according to an embodiment of the present application;
[0033] Figure 4 It is a structural block diagram of a simulation test device of a cloud server in an embodiment of the present application. DETAILED DESCRIPTION
[0034] The embodiments of the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0035] It should be noted that the terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0036] The method embodiments provided in the embodiments of the present application can be executed in a server device or a similar computing device. Taking running on a server device as an example, Figure 1 1 is a hardware structure block diagram of a server device of a simulation test method of a cloud server in an embodiment of the present application. Figure 1 As shown, the server device may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the server device may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above server device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.
[0037] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the simulation test method of the cloud server in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the server device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0038] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the server device. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0039] In this embodiment, a simulation test method of a cloud server is provided. Figure 2 is a flow chart of a simulation test method of a cloud server according to an embodiment of the present application, such as Figure 2 As shown, the process includes the following steps:
[0040] Step S202, building a customized service framework test environment, wherein the service framework test environment is used to simulate various operation scenarios of the cloud server, and a fault prediction model and a behavior analysis model are deployed in the service framework test environment, wherein the fault prediction model is a neural network model trained by collecting and analyzing operation data and used to predict faults, and the behavior analysis model is a neural network model trained by collecting and analyzing behavior data and used to analyze behavior;
[0041] In an exemplary embodiment, customization can be, but is not limited to, personalizing, individualizing, setting, configuring or selecting something according to personal or specific needs to make it meet personal preferences or meet specific needs. In the field of cloud server development, customization generally refers to personalizing or modifying a cloud server according to user needs to meet the user's personalized needs.
[0042] The service framework test environment may refer to, but is not limited to, a collection of hardware and software equipment, system configuration, and network environment required for service framework testing, and is a test environment built to simulate the operating environment and / or operating scenario of a real cloud server.
[0043] The fault prediction model may be, but is not limited to, a neural network model that collects and analyzes the operating data of the cloud server to predict possible failures of the cloud server, and may be, but is not limited to, predicting possible failures of the cloud server based on the fault prediction model, thereby taking measures in advance to avoid or reduce the occurrence of failures of the cloud server.
[0044] The behavior analysis model can be, but is not limited to, obtained by collecting and analyzing the behavior data of the cloud server and / or the user for training, and is used to analyze the behavior data of the cloud server and / or the user. It can also be, but is not limited to, analyzing the user's behavior based on the behavior analysis model and identifying the user's abnormal behavior, thereby avoiding risks and abnormal behavior of the user to the cloud server.
[0045] To further illustrate, in a simulated test environment of a cloud server, assuming that the behavior analysis model analyzes that a certain user's behavior is abnormal and may have an adverse impact on the cloud server, the user's behavior operations are temporarily prohibited to prevent the user from causing a security hazard to the cloud server.
[0046] Step S204, using the simulated first test data, testing the resource allocation of the service framework test environment, wherein the resource allocation is based on the real-time load to dynamically adjust the allocation of cloud server resources;
[0047] In an exemplary embodiment, the real-time load may be, but is not limited to, a measure of the workload or pressure borne by the cloud server during operation, and may be, but is not limited to, represented by indicators such as CPU usage, memory usage, network traffic, and disk I / O.
[0048] By using the first test data, the resource allocation of the cloud server in the service framework test environment is tested. According to the real-time load of the cloud server, the resource allocation is dynamically adjusted to ensure that the response time and processing capacity of the cloud server system can be maintained at a relatively good level under high concurrent requests.
[0049] Step S206, using the simulated second test data, testing the fault recovery situation of the service framework test environment, wherein the fault recovery situation is a situation in which a fault recovery script of the cloud server is triggered after the fault prediction model predicts the existence of a fault;
[0050] In an exemplary embodiment, the fault repair situation may be, but is not limited to, triggering a fault recovery script of a cloud server after a fault prediction model predicts the existence of a fault. It may also be, but is not limited to, switching to other cloud servers to provide services if the fault recovery script of the cloud server is not successfully repaired after triggering the fault recovery script of the cloud server.
[0051] By using the second test data, the failure of the cloud server in the service framework test environment is predicted. If potential failures and / or signs of failures are predicted, the self-repair program is immediately started to execute a predefined failure repair script.
[0052] Step S208, using the simulated third test data, to test the security protection status of the service framework test environment, wherein the security protection status is the situation where the security protection script of the cloud server is triggered after the behavior analysis model analyzes the abnormal behavior.
[0053] In an exemplary embodiment, the security protection situation may be, but is not limited to, analyzing the user's behavior. If the user's behavior is found to be abnormal, the security protection script of the cloud server is triggered to prevent the user's abnormal behavior from damaging the security of the cloud server. The security protection situation may also be, but is not limited to, rolling back the user's abnormal behavior after the user's abnormal behavior has affected the cloud server, returning the abnormal behavior to a state not affected by the abnormal behavior.
[0054] The security protection script may be, but is not limited to, temporarily prohibiting the actions of the user who has abnormal behavior and / or rolling back the user's abnormal behavior, and may also be, but is not limited to, prohibiting the user from continuing to access the cloud server, and may also be, but is not limited to, obtaining the user's behavior log.
[0055] By using the third test data, the user behavior under the cloud server in the service framework test environment is analyzed. If abnormal behavior of the user is analyzed, the security protection script is triggered to prevent further abnormal behavior of the user from causing security impact on the cloud server.
[0056] The execution subject of the above steps may be a server, a terminal, etc., but is not limited thereto.
[0057] Through the above steps, a pre-built customized service framework test environment is adopted, and the service framework test environment can be used to simulate various scenarios of cloud servers. Because the neural network model of the fault prediction model and the behavior analysis model is also deployed in the service framework scenario, it is used to predict faults and analyze user behavior.
[0058] Furthermore, by simulating the first test data, the resource allocation of the service framework test environment is tested to test whether the resource allocation of the cloud server is reasonable; by simulating the second test data, the fault repair situation of the service framework test environment is tested to test whether the fault repair capability of the cloud server is normal after the fault prediction model predicts the existence of a fault; by simulating the third test data, the security protection situation of the service framework test environment is tested to test whether the protection capability of the security script of the cloud server is normal after the analysis model analyzes the existence of abnormal user behavior.
[0059] That is, through the pre-built service framework test scenarios, the risk of reduced cloud server testing efficiency due to the tedious steps of manually configuring system components during cloud server testing is avoided, thereby realizing multiple simulation tests of cloud servers, which can solve the problem of low cloud server testing efficiency, thereby achieving the technical goal of fully utilizing the server's multi-core processors and parallel computing capabilities, and further achieving the technical effect of improving the testing efficiency of cloud servers.
[0060] As an optional solution, the resource allocation of the service framework test environment is tested using the simulated first test data, including:
[0061] The first test data is processed through standard algorithms and custom algorithms, and the dynamic load balancing algorithm is started to test the resource allocation of the service framework test environment.
[0062] In an optional embodiment, the standard algorithm may be, but is not limited to, a MapReduce algorithm, which is a distributed data processing model used for parallel processing of large-scale data sets.
[0063] The custom algorithm may be, but is not limited to, a K-Means clustering algorithm, which is used to find intrinsic patterns and structures in a data set by dividing data into different groups or clusters based on the similarity of the data, clustering similar data samples together and separating dissimilar samples.
[0064] The dynamic load balancing algorithm can be, but is not limited to, used as a load balancing strategy in a cloud server system to reasonably allocate and schedule tasks or requests to achieve efficient resource utilization of the cloud server system and optimize the performance of the cloud server system.
[0065] Through the embodiments of the present application, the first test data is processed using a standard algorithm and a custom algorithm, and the resource allocation strategy is dynamically adjusted according to the real-time system load, thereby ensuring the response time and processing capacity of the system under high concurrent requests.
[0066] As an optional solution, the first test data is processed by using a standard algorithm and a custom algorithm, and a dynamic load balancing algorithm is started to test the resource allocation of the service framework test environment, including:
[0067] A MapReduce algorithm as a standard algorithm is used to perform a first preprocessing on the first test data in key value form, wherein the first preprocessing includes a Map stage and a Reduce stage, the first test data in key value form is processed into intermediate key-value pairs by the Map function in the Map stage, the intermediate key-value pairs are aggregated into a target set by the Reduce function in the Reduce stage, the values in the target set are processed by the Reduce function, and a final result is output, which is the processing result of the first preprocessing.
[0068] In an optional embodiment, the first preprocessing may include, but is not limited to, a Map phase and a Reduce phase, and may include, but is not limited to, a phase of inputting a data set and then outputting a combing result of the data set. In the Map phase, the data set may be divided into, but is not limited to, a number of small databases, and processed in parallel by multiple computing nodes, and the multiple computing nodes may be, but are not limited to, independent computers and / or a machine in a computing cluster. In the Reduce phase, the computing nodes may be merged and reduced according to the key of the key-value pair, and the final output result is generated.
[0069] The generation of the intermediate key-value pairs may be, but is not limited to, inputting the first test data in the form of key values in the Map stage, and then processing or mapping them into the intermediate key-value pairs.
[0070] Through the embodiments of the present application, the first test data is first preprocessed using the standard MapReduce algorithm, which fully utilizes the advantages of distributed computing and improves the efficiency and speed of data processing on the first test data while having fault tolerance.
[0071] As an optional solution, the first test data is processed by using a standard algorithm and a custom algorithm, and a dynamic load balancing algorithm is started to test the resource allocation of the service framework test environment, including:
[0072] A K-Means clustering algorithm as a custom algorithm is used to perform a second preprocessing on the second test data containing the user behavior information, wherein the second preprocessing includes dividing the second test data containing the user behavior information into different groups, each group representing a class of similar user behavior characteristics.
[0073] In an optional embodiment, the second preprocessing may include, but is not limited to, dividing the second test data containing user behavior information into different groups, each group representing a class of similar user behavior characteristics. User behavior information may be, but is not limited to, data and records generated when a user uses the cloud server, and user behavior information may be, but is not limited to, acquired and recorded through user operations, interactions, and behavior data. User behavior characteristics may be, but are not limited to, behavior patterns, preferences, and habits exhibited by users when using the cloud server system.
[0074] To further illustrate, if a user is usually at location A when logging into and / or using a cloud server, then when recording the user's behavioral characteristics, the frequent login location A will be recorded as one of the user's behavioral characteristics.
[0075] It should be noted that by analyzing the behavioral characteristics of users when using cloud servers, we can understand users' usage habits and needs for cloud servers, provide users with better services and support, and monitor user behavior to prevent user behavior from endangering the security of cloud services.
[0076] Through the embodiments of the present application, by performing a second preprocessing on the second test data containing the user behavior information, the users are divided into different groups according to their behavior characteristics, and thus better services and support can be provided to the users.
[0077] As an optional solution, build a custom service framework test environment, including at least one of the following:
[0078] S1-1, according to the test requirements, configure the first parameter of the virtual machine instance in the service framework test environment;
[0079] S1-2, configuring the second parameter of the network connection in the service framework test environment according to the test conditions.
[0080] In an optional embodiment, the first parameter may be, but is not limited to, used to balance resources of virtual machine instances, and the second parameter may be, but is not limited to, used to represent the quality of a network connection.
[0081] Through the embodiments of the present application, by configuring the first parameter and the second parameter in the service framework test environment, it is convenient to perform simulation testing on the cloud server in the service framework test environment.
[0082] As an optional solution, according to the test requirements, the first parameter of the virtual machine instance in the service framework test environment is configured, including at least one of the following:
[0083] S2-1, configuring the number of CPU cores of the virtual machine instance, wherein the first parameter includes the number of CPU cores, and the number of CPU cores matches the test requirements;
[0084] S2-2, configuring the memory size of the virtual machine instance, wherein the first parameter includes the memory size, and the memory size matches the test requirements;
[0085] S2-3, configuring the disk size of the virtual machine instance, wherein the first parameter includes the disk size, and the disk size matches the test requirements;
[0086] S2-4, configuring the operating system of the virtual machine instance, wherein the first parameter includes the operating system, and the operating system matches the test requirements.
[0087] It should be noted that test requirements can be, but are not limited to, specific requirements and specifications for the functions, performance, reliability, etc. of the test object or system in order to meet specific test objectives and requirements during the operation of the cloud server. Test requirements are the basis of testing work. By clarifying and specifying the test objectives and requirements, the test team can be effectively guided to carry out test activities to ensure the comprehensiveness, accuracy, and effectiveness of the test.
[0088] Through the embodiments of the present application, by subdividing the first parameter into various parameters of the virtual machine instance and matching the first parameter with the test requirements, it is convenient to balance the importance of different resources in the virtual machine instance so that resources can be better allocated.
[0089] As an optional embodiment, configuring the second parameter of the network connection in the service framework test environment according to the test condition includes at least one of the following:
[0090] S3-1, configuring the bandwidth of the network connection, wherein the second parameter includes the bandwidth, and the bandwidth matches the test condition;
[0091] S3-2, configuring a delay of the network connection, wherein the second parameter includes the delay, and the delay matches the test condition;
[0092] S3-3, configure the packet loss rate of the network connection, wherein the second parameter includes the packet loss rate, and the packet loss rate matches the test condition.
[0093] In an optional embodiment, bandwidth may be, but is not limited to, the ability or rate to transmit data in network communications, and is used to indicate the amount of data that can be transmitted per unit time.
[0094] Delay can be, but is not limited to, the time required for data to be transmitted from the sender to the receiver in network communication, and is used to indicate the delay time of data transmission in the network.
[0095] The packet loss rate may be, but is not limited to, the proportion or probability that a data packet sent during network communication fails to reach the target address due to various reasons during the transmission process and is lost.
[0096] It should be noted that test conditions refer to the prerequisites or specific environments and resources that need to be met in order to ensure that the test object or system can be tested normally under a specific environment. The setting and satisfaction of test conditions are crucial to the accuracy and effectiveness of the test, and can ensure the repeatability and comparability of the test.
[0097] Through the embodiment of the present application, the second parameter is subdivided into various parameters of the network connection, and the second parameter is matched with the test condition, so as to facilitate the measurement of whether the quality of the network communication meets the test condition.
[0098] As an optional solution, the resource allocation of the service framework test environment is tested using the simulated first test data, including:
[0099] S4-1, obtaining a load ratio of each node in the service framework test environment, wherein the load ratio is a ratio of the processing capacity of the node to the current load of the node;
[0100] S4-2, determining a target node with the largest load ratio among multiple nodes in the service framework test environment;
[0101] S4-3, allocating the first test data to the target node, and dynamically adjusting the resource allocation of the target node according to the current load of the target node and the load of the first test data.
[0102] In an optional embodiment, the processing capability of a node may be, but is not limited to, the ability or performance of a cloud server node in processing data and executing tasks, and may be, but is not limited to, used to represent the amount of data that a cloud server node can process, the number of concurrent connections, the processing speed, etc.
[0103] The current load of a node may be, but is not limited to, the tasks and data volume being processed by the node of the cloud server, and may be, but is not limited to, used to reflect the current working status and resource utilization of the node.
[0104] It should be noted that by determining the load ratio of each node, then confirming the target node with the largest load ratio, and then allocating the first test data to the target node, the resource allocation of the target node is dynamically adjusted according to the current load of the target node and the load of the first data, so that the load of each node of the cloud server is more balanced, preventing the problem of overload of a certain node.
[0105] Through the embodiment of the present application, the first test data is allocated to the target node with the largest load ratio, and then the resource allocation of the target node is dynamically adjusted according to the load of the first test data, which has the effect of promoting a more balanced load on each node of the cloud server.
[0106] As an optional solution, the above cloud server simulation test method further includes:
[0107] Before testing the fault repair status of the service framework test environment using the simulated second test data, the method further includes:
[0108] S5-1, obtaining a plurality of first samples, wherein the first samples are performance data of the cloud server at different time points;
[0109] S5-2, obtaining time series features corresponding to the plurality of samples and statistical features corresponding to the plurality of first samples, wherein the time series features are used to represent a change trend of the performance data in the time series, and the statistical features are used to represent an average response time and a standard deviation of the performance data;
[0110] S5-3, using time series features and statistical features, training the initial fault prediction model until a trained fault prediction model is obtained;
[0111] Before testing the security protection status of the service framework test environment using the simulated third test data, the method further includes:
[0112] S5-4, obtaining a plurality of second samples, wherein the second samples are behavior data of the user in the cloud server;
[0113] S5-5, obtaining user behavior characteristics corresponding to the plurality of second samples, wherein the user behavior characteristics include time series characteristics, access mode characteristics, and operation frequency characteristics;
[0114] S5-6, using the user behavior characteristics, the initial behavior analysis model is trained until a trained behavior analysis model is obtained.
[0115] In an optional embodiment, time series features may refer to, but are not limited to, features or patterns in data that change over time, and are data collected in chronological order, and may include, but are not limited to, trends, periodicity, autocorrelation, etc. Trends may refer to, but are not limited to, the overall direction of data changes over time, reflecting the long-term evolution trend of data; periodicity may refer to, but is not limited to, irregular or longer-period fluctuations in data; autocorrelation may refer to, but is not limited to, the correlation between data and itself at different time points.
[0116] Statistical features may be, but are not limited to, average response time and standard deviation used to represent performance data. Average response time of performance data may be, but are not limited to, the average time taken by a cloud server to respond to a request in performance testing and / or monitoring, used to measure the response speed and performance of the cloud server. Standard deviation may be, but are not limited to, a measure of the degree of dispersion and / or variation of performance data, used to measure the dispersion of data points around the average value of performance data.
[0117] It should be noted that time series features and statistical features can provide detailed information about fault behaviors and patterns. By analyzing and modeling these features, the occurrence of faults can be predicted more accurately. Traditional fault models may only use basic indicators or data and cannot capture subtle changes or trends. The introduction of time series features and statistical features can more comprehensively describe the dynamic changes of data, thereby improving the fault prediction model.
[0118] In an optional embodiment, the user's behavior characteristics may include, but are not limited to, time series characteristics, access pattern characteristics, and operation frequency characteristics. Access pattern characteristics may refer to, but are not limited to, the user's access methods and characteristics to data, resources, or functions in the cloud server, and may be used to describe, but are not limited to, the user's access rules and behavior habits when using the cloud server. Operation frequency characteristics may refer to, but are not limited to, the number and / or frequency of operations performed by the user on a certain data, resource, or function in the cloud server, and may be used to describe the user's frequency of use and / or repeated operations on a certain aspect of the cloud server.
[0119] It should be noted that user behavior characteristics include information such as users' operations, interactions, and behavioral habits in the cloud server. By analyzing and modeling these characteristics, we can more accurately understand users' behavior patterns and preferences, thereby improving the accuracy of the behavior analysis model.
[0120] Through the embodiments of the present application, the fault prediction model is trained by using the first sample and the time series characteristics and statistical characteristics of the first sample to obtain a trained fault prediction model, and the initial behavior model is trained by using the second sample and the user behavior characteristics of the second sample to obtain a trained behavior analysis model, thereby providing a good prediction model for the simulation test method of the cloud server.
[0121] As an optional solution, after testing the security protection of the service framework test environment using the simulated third test data, the method further includes at least one of the following:
[0122] S6-1, automatically adjusts firewall rules and access permission settings to prevent abnormal behavior;
[0123] S6-2, automatically triggering an alarm mechanism to indicate abnormal behavior;
[0124] S6-3, Generate exception reports regularly or as needed to record abnormal behavior.
[0125] In an optional embodiment, the automatic adjustment of firewall rules may be, but is not limited to, adding a specific user ID, IP address, IP segment or port to a deny list based on the user's behavior analysis model to prevent it from accessing the cloud server. Access permission settings may be, but are not limited to, setting permissions for a specific user ID, IP address, IP segment or port to not allow the use of a certain function and / or data based on the user's behavior analysis model.
[0126] The alarm mechanism may be, but is not limited to, an alarm mechanism that is automatically triggered when a user's behavior analysis model detects that a user has performed abnormal behavior and blocks the user's abnormal behavior, and is used to prompt the cloud server administrator about the user's abnormal behavior.
[0127] The abnormal report may be used, but is not limited to, to record abnormal behavior, the user who generated the abnormal behavior, and the time when the abnormality occurred.
[0128] Through the embodiments of the present application, after detecting that a user has performed abnormal behavior, the defense mechanism is activated immediately, and the firewall rules and access permission settings are automatically adjusted to prevent the user from continuing to perform abnormal behaviors that may endanger the cloud server. The user's abnormal behavior is recorded and notified to the administrator of the cloud server through an alarm mechanism, thereby achieving the technical effect of preventing the user's abnormal behavior from endangering the security of the cloud server.
[0129] As an optional embodiment, the above-mentioned cloud server simulation test method further includes:
[0130] Using the simulated first test data, test the resource allocation of the service framework test environment, including:
[0131] S7-1, using the first test data, simulating a first test scenario of low load, medium load, high load and sudden load;
[0132] S7-2, testing resource allocation of the service framework test environment under different first test scenarios;
[0133] Use the simulated second test data to test the fault repair of the service framework test environment, including:
[0134] S7-3, using the second test data, simulating a second test scenario of hardware failure, software failure and network failure;
[0135] S7-4, testing the fault repair status of the service framework test environment under different second test scenarios;
[0136] S7-5, using the simulated third test data, test the security protection of the service framework test environment, including:
[0137] S7-6, using the third test data, simulating the third test scenario of malicious access, unauthorized access and data leakage;
[0138] S7-7, test the security protection of the service framework test environment under different third test scenarios.
[0139] In an optional embodiment, different load scenarios are simulated through the first test data, and the resource allocation of the service framework in different first test scenarios is tested to measure the resource allocation capability of the service framework to prevent load imbalance that may cause some nodes to be underloaded or some nodes to be overloaded.
[0140] In an optional embodiment, different fault scenarios are simulated by second test data, and the fault repair status of the service framework in different second test scenarios is tested to measure the automatic repair capability of the service framework when it is in different faults.
[0141] In an optional embodiment, different abnormal behaviors are simulated by third test data, and the security protection of the service framework in different third test scenarios is tested to measure whether the security protection mechanism of the service framework is comprehensive when facing different types of abnormal behaviors.
[0142] Through the embodiments of the present application, by simulating the testing of different levels of the cloud server with different test data, the resource allocation, fault repair, and security protection of the cloud server can be tested, so that different problems that may arise in the cloud server can be predicted, helping administrators to manage the cloud server.
[0143] As an optional solution, for ease of understanding, the simulation test method of the cloud server is applied to the cloud computing server based on big data.
[0144] In an optional embodiment, cloud computing servers refer to virtual servers running in a cloud computing environment. They provide computing resources, storage resources and network resources through a cloud computing platform. Users can dynamically allocate and use these resources according to demand. Cloud computing servers are usually based on virtualization technologies such as VMware, KVM, Docker, etc., to provide flexible, scalable and highly available computing services.
[0145] The construction of existing test environments often requires manual configuration of virtual machines, network connections, and storage device system components. This process is cumbersome and error-prone. In addition, due to the lack of effective data cleaning and standardization tools in existing technologies, test data sets may contain a large amount of invalid or erroneous data, resulting in unreliable test results. At the same time, traditional resource allocation methods are difficult to cope with dynamic load changes under high-concurrency requests, resulting in longer system response time and reduced processing capabilities.
[0146] In order to solve the above problems, a test method based on cloud servers is proposed. The steps of the test method include:
[0147] S8-1. Build a customizable service framework test environment, including a graphical user interface (GUI) that allows users to configure virtual machine instances, network connections, and storage device system components by dragging and dropping;
[0148] S8-2. Deploy a set of data cleaning and standardization tools in this environment, import representative data sets from multiple sources, remove invalid or erroneous data through data cleaning tools, and use standardization tools to unify data formats;
[0149] S8-3. Develop and run a set of standard algorithms and custom algorithms to process the prepared data sets, and start the dynamic load balancing algorithm in the process to dynamically adjust the resource allocation strategy according to the real-time system load to ensure the system's response time and processing capacity under high concurrent requests;
[0150] S8-4. Implement a machine learning-based fault prediction model, which is trained by collecting and analyzing log data during system operation. Once a potential fault sign is found, the self-healing program is immediately started and a predefined fault recovery script is executed;
[0151] S8-5. Design and implement a security protection system based on user behavior analysis, which can detect abnormal activities by analyzing user behavior patterns and automatically adjust firewall rules and access permission settings to prevent unauthorized access;
[0152] S8-6. During the test, record the key performance indicators of system processing speed, accuracy and resource utilization, and store these data in a central database for later analysis;
[0153] S8-7. Analyze the test results and iteratively optimize the configuration and algorithms in the test environment based on the analysis conclusions until the predetermined performance goals and creative requirements are achieved.
[0154] In step S8-1, the configuration of the virtual machine instance basically includes the following parameters:
[0155] (1) Number of CPU cores: cpucores, which indicates the number of CPU cores of the virtual machine instance;
[0156] (2) Memory size: memorysize, which indicates the memory size of the virtual machine instance in GB;
[0157] (3) Disk size: disksize, indicating the disk size of the virtual machine instance, in GB;
[0158] (4) Operating system: ostype, indicating the operating system type of the virtual machine instance;
[0159] The resource allocation for a VM instance is calculated using the following formula:
[0160] totalresource=cpucores×cpuweigt+memorysize×memoryweigt+disksize×diskweigt;
[0161] Among them, cpuweight, memoryweight, and diskweight are the weights of each resource, which are used to balance the importance of different resources.
[0162] Step S8-1 also includes network connection configuration, which specifically includes the following parameters:
[0163] (1) Bandwidth: Bandwidth refers to the bandwidth of the network connection, abbreviated as B, and the unit is Mbps;
[0164] (2) Latency: refers to the delay of network connection, abbreviated as L, in milliseconds;
[0165] (3) Packet loss rate: packetlossrate, which indicates the packet loss rate of the network connection, abbreviated as P, expressed in percentage;
[0166] The quality of the network connection is calculated using the following formula:
[0167]
[0168] in:
[0169] B is the bandwidth in Mbps;
[0170] L is the delay in milliseconds;
[0171] P is the packet loss rate, expressed as a percentage, converted to decimal form;
[0172] The formula takes into account bandwidth, latency, and packet loss to assess the quality of a network connection.
[0173] The standard algorithm in step S8-3 adopts the MapReduce algorithm, which is a distributed data processing model suitable for parallel processing of large-scale data sets, as follows:
[0174] Input: Dataset D = (k1, v1), (k2, v2), ..., (k n , v n );
[0175] Output: Processing result R = (k′1, r1), (k′2, r2), ..., (k′ m , r m );
[0176] Map function:
[0177] Input: key-value pair (k I , v i );
[0178] Output: intermediate key-value pair (k′ i , v′ i );
[0179] map(k i , v i )=(k′1, v′1), (k′2, v′2),..., (k′ p , v′ p );
[0180] Reduce function:
[0181] Input: intermediate key-value pair (k′ i , {v′1, v′2,..., v′ q});
[0182] Output: Final result (k′ i , r i );
[0183] reduce(k′ i , {v′1, v′2,..., v′q})=(k′ i , r i ).
[0184] The custom algorithm in step S8-3 adopts a clustering algorithm, which is as follows:
[0185] Input: User behavior dataset X = {x1, x2, ..., x n}, where x i is the user behavior feature vector;
[0186] Output: User group G = {g1, g2, ..., g k}, where g i is a user group;
[0187] K-Means Clustering Algorithm:
[0188] Initialization: Randomly select k center points as the initial cluster centers μ1, μ2, ..., μ k ;
[0189] Assignment: For each data point x i Assign to the nearest cluster center;
[0190] Update: Recalculate the center point of each cluster;
[0191] Repeat: Repeat the steps of assigning and updating until the cluster center no longer changes or the maximum number of iterations is reached;
[0192]
[0193] cluster assignment=arg min distance(x i , μ j );
[0194]
[0195] Here C j is the set of all data points in cluster j.
[0196] The dynamic load balancing algorithm in step S8-3 is as follows:
[0197] Input: Node set N = {n1, n2, ..., n N}, each node has a processing capacity of C i and the current load L i ; Output: Task allocation decision A = {a1, a2, ..., a m}, where a i Indicates that tasks are assigned to nodes;
[0198] Select strategy:
[0199] Calculate the node load ratio: for each node i;
[0200]
[0201] Where ∈ is a small positive number to prevent the denominator from being zero;
[0202] Select the node with the largest load ratio:
[0203] Selected Node=argmax w i ;
[0204] Load Update:
[0205] Whenever a node accepts a new task, the current load of the node needs to be updated. Assuming that the size of task t is St, the load update formula of node i is as follows:
[0206] L′ i =L i +S t ;
[0207] Here L′ i represents the updated load;
[0208] Weight adjustment:
[0209] To further optimize load balancing, the weights are dynamically adjusted based on the actual load of the nodes:
[0210] W′ i =W i ·f(L i );
[0211] Where f(L i ) is an adjustment factor function, and the adjustment factor function is:
[0212]
[0213] Here Tlow and Thigh are the low and high thresholds of the load respectively.
[0214] Step S8-4 also includes data collection, feature extraction, model training, model prediction, and self-repair, which are as follows:
[0215] Assume there is a time series data X = {x1, x2, ..., x n}, where x i is the value of a certain performance indicator at the i-th time point;
[0216] Time series characteristics: calculate the changing trend of time series;
[0217]
[0218] in and
[0219] Statistical features: Calculate the average response time and standard deviation;
[0220]
[0221] In the above model training, the extracted features are used to train a machine learning model using a supervised learning method:
[0222] Suppose we use a logistic regression model f(X;θ)=P(y=1|X;θ), where y is the binary label (faulty / normal), X is the feature vector, and θ is the model parameter;
[0223] Loss function: binary cross entropy loss;
[0224]
[0225] Gradient descent update rule: Update the parameter θ using gradient descent;
[0226] Updated (α is the learning rate, is a partial derivative);
[0227] Model prediction: Use the trained model to predict real-time data. If the prediction result indicates a potential failure, the self-healing procedure is started. The formula is as follows:
[0228] Assume that the probability of the model output is p=f(X;θ), if p>τ, it is considered that there is a potential fault, where τ is the threshold.
[0229] As a further solution of this embodiment: in S8-5, the security protection system for user behavior analysis specifically includes:
[0230] S9-1, collect user behavior data in the system, including but not limited to login time, access frequency, operation type and access path;
[0231] S9-2, pre-process the collected behavioral data, including data cleaning and formatting, to ensure data consistency and integrity;
[0232] S9-3, extracting user behavior features from the preprocessed data, including but not limited to time series features, access pattern features, and operation frequency features;
[0233] S9-4, using machine learning algorithms to train user behavior models, the models can identify normal behavior patterns and abnormal behavior patterns;
[0234] S9-5, monitor user behavior online and input real-time behavior data into the trained model for real-time prediction;
[0235] S9-6, when the prediction results indicate abnormal activity, automatically adjust the firewall rules and access permission settings to prevent unauthorized access.
[0236] A further embodiment of the security protection system further includes:
[0237] S9-1, realizes the visualization of behavior patterns, allowing administrators to intuitively view the user's behavior trajectory;
[0238] S9-2, set thresholds to distinguish normal from abnormal behavior, and automatically trigger an alarm mechanism when abnormal behavior is detected;
[0239] S9-3, provides user behavior analysis reports to help administrators understand the security status of the system;
[0240] To further illustrate, Figure 3 As shown, Figure 3 The figure is a flow chart of a testing method for cloud computing servers based on big data. Figure 3 A test method for cloud computing servers based on big data is provided, as follows:
[0241] S1. Build a customizable service framework test environment:
[0242] Implementation details:
[0243] Software tools: Use Docker and Kubernetes (K8s) to build a test environment;
[0244] GUI tool: Use a graphical user interface (GUI) tool, Portainer, that allows users to configure virtual machine instances, network connections, and storage system components by dragging and dropping;
[0245] Virtual machine instance configuration:
[0246] Number of CPU cores: The user specifies the number of CPU cores of the virtual machine instance through the GUI (4 cores);
[0247] Memory size: User-specified memory size (8GB);
[0248] Disk size: User-specified disk size (100GB);
[0249] Operating system type: The user selects the operating system type (Ubuntu 20.04);
[0250] Resource allocation formula: Resource Allocation = cpucores × cpuweight + memorysize × memoryweight + disksize × diskweight;
[0251] The weights are: cpuweight=0.4, memoryweight=0.3, diskweight=0.3;
[0252] Network connection configuration:
[0253] Bandwidth: User-specified bandwidth (100Mbps);
[0254] Delay: User-specified delay (5ms);
[0255] Packet loss rate: User-specified packet loss rate (0.5%);
[0256] The quality of the network connection is calculated using the following formula:
[0257]
[0258] Calculation process:
[0259] Convert the packet loss rate to a decimal: P = 0.5% = 0.005;
[0260] Substitute the formula to calculate the network quality Q:
[0261]
[0262] Calculate the denominator: 5×(1+0.005)=5×1.005=5.025;
[0263] The final calculation of Q is:
[0264]
[0265] S2. Deploy data cleaning and standardization tools:
[0266] Implementation details:
[0267] Tool selection: Apache NiFi for data flow management and Python Pandas for data cleaning;
[0268] Data import: Import representative data sets from multiple sources (MySQL databases, CSV files, and API interfaces);
[0269] Data cleaning: remove invalid or erroneous data, null values and outliers;
[0270] Data standardization: unify data format, date format and character encoding;
[0271] S3. Develop and run the algorithm:
[0272] Implementation details:
[0273] Standard algorithm: using MapReduce algorithm;
[0274] Input: Dataset (CSV file);
[0275] Output: processing results (statistical data);
[0276] Map function: converts the input key-value pair into an intermediate key-value pair;
[0277] Reduce function: aggregates the intermediate key-value pairs into the final result;
[0278] Custom algorithm: Use K-Means clustering algorithm;
[0279] Input: user behavior dataset (user access log);
[0280] Output: user group;
[0281] Initialization: Randomly select K center points;
[0282] Assignment: Assign each data point to the nearest cluster center;
[0283] Update: Recalculate the center point of each cluster;
[0284] Repeat: Repeat the above steps until the cluster center does not change or the maximum number of iterations is reached; Dynamic load balancing algorithm:
[0285] Input: A collection of nodes and their processing capabilities and current loads;
[0286] Output: task allocation decision;
[0287] Selection strategy: Calculate the load ratio of each node and select the node with the largest load ratio; Load update: Whenever a node accepts a new task, update its current load;
[0288] Weight adjustment: Dynamically adjust weight according to node load;
[0289] S4. Implement a fault prediction model based on machine learning:
[0290] Implementation details:
[0291] Data collection: Collect data from system logs during operation;
[0292] Feature extraction:
[0293] 1. Time series characteristics: calculate the changing trend of time series;
[0294] 2. Statistical features: calculate the average response time and standard deviation;
[0295] Model training:
[0296] Model selection: Logistic regression model was used;
[0297] Loss function: binary cross entropy loss;
[0298] Update rule: Update parameters using gradient descent method;
[0299] Model prediction: Use the trained model to predict real-time data. If the predicted probability exceeds the threshold, the self-healing program is started;
[0300] S5. Design and implement a security protection system for user behavior analysis:
[0301] Implementation details:
[0302] Data collection: Collect data on user login time, access frequency, and operation type;
[0303] Data preprocessing: cleaning and formatting data;
[0304] Feature extraction: extract time series features and access pattern features;
[0305] Model training: Use machine learning algorithms to train user behavior models;
[0306] Real-time monitoring: inputting real-time behavior data into the model for prediction;
[0307] Automatically adjust rules: Automatically adjust firewall rules and access permission settings when prediction results indicate abnormal activity;
[0308] Visual display: Display user behavior trajectories through dashboards;
[0309] Alarm mechanism: Set thresholds to distinguish between normal and abnormal behaviors and trigger alarm mechanisms;
[0310] Behavior analysis report: provide user behavior analysis report;
[0311] S6. Record and store performance indicators:
[0312] Implementation details:
[0313] Record performance indicators: record system processing speed, accuracy, and resource utilization;
[0314] Data aggregation: aggregate performance indicator data;
[0315] Storage database: store the aggregated data in a central database (MySQL);
[0316] S7. Analyze test results and iterate optimization:
[0317] Implementation details:
[0318] Test result analysis: extract test data from the central database and analyze it;
[0319] Optimize configuration: adjust the configuration in the test environment based on the analysis conclusions;
[0320] Iterative testing: Repeated iterative testing and optimization until the predetermined performance target is achieved.
[0321] Through the embodiments of the present application, a customizable service framework test environment is constructed, and users can configure virtual machine instances, network connections, and storage device system components by dragging and dropping through a graphical user interface (GUI). The method not only simplifies the process of building a test environment, but also improves the flexibility of the test environment, allowing users to quickly adjust and configure different test scenarios, develop and run a set of standard algorithms and custom algorithms, and combine them with a dynamic load balancing algorithm to effectively process large-scale data sets and dynamically adjust resource allocation strategies under high-concurrency requests to ensure the response time and processing capabilities of the system, and can significantly improve the performance of the system under high load conditions. By implementing a fault prediction model based on machine learning, potential fault signs can be discovered in a timely manner, and predefined fault recovery scripts can be executed through a self-repair program, which not only reduces system downtime, but also improves system reliability and stability.
[0322] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of each embodiment of the present application.
[0323] In this embodiment, a simulation test device for a cloud server is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware for a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0324] Figure 4 is a structural block diagram of a simulation test device of a cloud server according to an embodiment of the present application, such as Figure 4 As shown, the device comprises:
[0325] A construction unit 402 is used to construct a customized service framework test environment, wherein the service framework test environment is used to simulate various operation scenarios of the cloud server, and a fault prediction model and a behavior analysis model are deployed in the service framework test environment, wherein the fault prediction model is a neural network model trained by collecting and analyzing operation data and used to predict faults, and the behavior analysis model is a neural network model trained by collecting and analyzing behavior data and used to analyze behavior;
[0326] The first test unit 404 is used to test the resource allocation of the service framework test environment using simulated first test data, wherein the resource allocation is based on real-time load to dynamically adjust the allocation of cloud server resources;
[0327] The second testing unit 406 is used to test the fault recovery situation of the service framework test environment by using the simulated second test data, wherein the fault recovery situation is the situation in which the fault recovery script of the cloud server is triggered after the fault prediction model predicts the existence of a fault;
[0328] The third test unit 408 is used to test the security protection status of the above-mentioned service framework test environment by using simulated third test data, wherein the above-mentioned security protection status is the situation where the security protection script of the above-mentioned cloud server is triggered after the above-mentioned behavior analysis model analyzes the abnormal behavior.
[0329] As an optional solution, the first test unit 404 includes: a first test module, which is used to process the first test data through a standard algorithm and a custom algorithm, and start a dynamic load balancing algorithm to test the resource allocation of the service framework test environment.
[0330] For specific embodiments, reference may be made to the examples shown in the above-mentioned simulation test method for the cloud server, which will not be described in detail in this example.
[0331] As an optional scheme, the above-mentioned first test module includes: a first preprocessing submodule, which is used to adopt the MapReduce algorithm as the above-mentioned standard algorithm to perform a first preprocessing on the first test data in key value form, wherein the above-mentioned first preprocessing includes a Map stage and a Reduce stage, the above-mentioned first test data in key value form is processed into intermediate key-value pairs by the Map function in the above-mentioned Map stage, and the above-mentioned intermediate key-value pairs are aggregated into a target set by the Reduce function in the above-mentioned Reduce stage, the values in the above-mentioned target set are processed by the Reduce function, and the final result is output, and the above-mentioned final result is the processing result of the above-mentioned first preprocessing.
[0332] For specific embodiments, reference may be made to the examples shown in the above-mentioned simulation test method for the cloud server, which will not be described in detail in this example.
[0333] As an optional solution, the above-mentioned first test module also includes: a second preprocessing submodule, which is used to use the K-Means clustering algorithm as the above-mentioned custom algorithm to perform a second preprocessing on the second test data containing user behavior information, wherein the above-mentioned second preprocessing includes dividing the above-mentioned second test data containing user behavior information into different groups, each group representing a class of similar user behavior characteristics.
[0334] For specific embodiments, reference may be made to the examples shown in the above-mentioned simulation test method for the cloud server, which will not be described in detail in this example.
[0335] As an optional solution, the above-mentioned construction unit 402 includes: a first configuration module, used to configure the first parameters of the virtual machine instance in the above-mentioned service framework test environment according to the test requirements; a second configuration module, used to configure the second parameters of the network connection in the above-mentioned service framework test environment according to the test conditions.
[0336] For specific embodiments, reference may be made to the examples shown in the above-mentioned simulation test method for the cloud server, which will not be described in detail in this example.
[0337] As an optional solution, the above-mentioned first configuration module includes: a first configuration sub-module, used to configure the number of CPU cores of the above-mentioned virtual machine instance, wherein the above-mentioned first parameter includes the above-mentioned number of CPU cores, and the above-mentioned number of CPU cores matches the above-mentioned test requirements; a second configuration sub-module, used to configure the memory size of the above-mentioned virtual machine instance, wherein the above-mentioned first parameter includes the above-mentioned memory size, and the above-mentioned memory size matches the above-mentioned test requirements; a third configuration sub-module, used to configure the disk size of the above-mentioned virtual machine instance, wherein the above-mentioned first parameter includes the above-mentioned disk size, and the above-mentioned disk size matches the above-mentioned test requirements; a fourth configuration sub-module, used to configure the operating system of the above-mentioned virtual machine instance, wherein the above-mentioned first parameter includes the above-mentioned operating system, and the above-mentioned operating system matches the above-mentioned test requirements.
[0338] For specific embodiments, reference may be made to the examples shown in the above-mentioned simulation test method for the cloud server, which will not be described in detail in this example.
[0339] As an optional solution, the above-mentioned second configuration module includes: a fifth configuration submodule, used to configure the bandwidth of the above-mentioned network connection, wherein the above-mentioned second parameter includes the above-mentioned bandwidth, and the above-mentioned bandwidth matches the above-mentioned test condition; a sixth configuration submodule, used to configure the delay of the above-mentioned network connection, wherein the above-mentioned second parameter includes the above-mentioned delay, and the above-mentioned delay matches the above-mentioned test condition; a seventh configuration submodule, used to configure the packet loss rate of the above-mentioned network connection, wherein the above-mentioned second parameter includes the above-mentioned packet loss rate, and the above-mentioned packet loss rate matches the above-mentioned test condition.
[0340] For specific embodiments, reference may be made to the examples shown in the above-mentioned simulation test method for the cloud server, which will not be described in detail in this example.
[0341] As an optional scheme, the above-mentioned first test unit 404 includes: an acquisition module, including obtaining the load ratio of each node in the above-mentioned service framework test environment, wherein the above-mentioned load ratio is the ratio of the processing capacity of the above-mentioned node to the current load of the above-mentioned node; a determination module, used to determine the target node with the largest load ratio among multiple nodes in the above-mentioned service framework test environment; an adjustment module, used to distribute the above-mentioned first test data to the above-mentioned target node, and dynamically adjust the resource allocation of the above-mentioned target node according to the current load of the above-mentioned target node and the load of the above-mentioned first test data.
[0342] For specific embodiments, reference may be made to the examples shown in the above-mentioned simulation test method for the cloud server, which will not be described in detail in this example.
[0343] As an optional solution, the above-mentioned device also includes: a first acquisition unit, which is used to acquire multiple first samples before testing the fault repair status of the above-mentioned service framework test environment using the simulated second test data, wherein the above-mentioned first samples are performance data of the above-mentioned cloud server at different time points; a second acquisition unit, which is used to acquire time series features corresponding to the above-mentioned multiple first samples, and statistical features corresponding to the above-mentioned multiple samples, wherein the above-mentioned time series features are used to represent the change trend of the above-mentioned performance data in the time series, and the above-mentioned statistical features are used to represent the average response time and standard deviation of the above-mentioned performance data; a first training unit, which is used to use the above-mentioned time series features and the above-mentioned statistical features to train the above-mentioned performance data. The simulated features are used to train the initial fault prediction model until the trained fault prediction model is obtained; the third acquisition unit is used to acquire multiple second samples before testing the security protection of the service framework test environment using the simulated third test data, wherein the second samples are the user's behavior data in the cloud server; the fourth acquisition unit is used to acquire user behavior features corresponding to the multiple second samples, wherein the user behavior features include time series features, access pattern features, and operation frequency features; the second training unit is used to train the initial behavior analysis model using the user behavior features until the trained behavior analysis model is obtained.
[0344] For specific embodiments, reference may be made to the examples shown in the above-mentioned simulation test method for the cloud server, which will not be described in detail in this example.
[0345] As an optional solution, the above-mentioned third test unit 408 includes: a blocking module, which is used to automatically adjust the firewall rules and access permission settings to prevent the above-mentioned abnormal behavior after testing the security protection of the above-mentioned service framework test environment using the simulated third test data; a prompt module, which is used to automatically trigger an alarm mechanism to prompt the above-mentioned abnormal behavior; a recording module, which is used to generate an abnormal report regularly or on demand to record the above-mentioned abnormal behavior.
[0346] For specific embodiments, reference may be made to the examples shown in the above-mentioned simulation test method for the cloud server, which will not be described in detail in this example.
[0347] As an optional scheme, the above-mentioned first test unit 404 includes: a first simulation module, which is used to use the above-mentioned first test data to simulate the first test scenarios of low load, medium load, high load and burst load; a second test module, which is used to test the resource allocation of the above-mentioned service framework test environment under different above-mentioned first test scenarios; the above-mentioned second test unit 406 includes: a second simulation module, which is used to use the above-mentioned second test data to simulate the second test scenario of hardware failure, software failure and network failure; a third test module, which is used to test the fault repair situation of the above-mentioned service framework test environment under different above-mentioned second test scenarios; the above-mentioned third test unit 408 includes: a third simulation module, which is used to use the above-mentioned third test data to simulate the third test scenario of malicious access, unauthorized access and data leakage; a fourth test module, which is used to test the security protection of the above-mentioned service framework test environment under different above-mentioned third test scenarios.
[0348] For specific embodiments, reference may be made to the examples shown in the above-mentioned simulation test method for the cloud server, which will not be described in detail in this example.
[0349] It should be noted that the above-mentioned virtual devices (modules, units, sub-modules, sub-units, components, etc.) can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above-mentioned virtual devices are all located in the same processor; or, the above-mentioned virtual devices are located in different processors in any combination.
[0350] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when run.
[0351] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0352] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0353] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0354] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.
[0355] Obviously, those skilled in the art should understand that the above-mentioned virtual devices or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.
[0356] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principles of the present application shall be included in the protection scope of the present application.
Claims
1. A simulation test method for a cloud server, characterized in that: include: Build a customized service framework test environment, wherein the service framework test environment is used to simulate various operation scenarios of the cloud server, and a fault prediction model and a behavior analysis model are deployed in the service framework test environment. The fault prediction model is a neural network model trained by collecting and analyzing operation data and used to predict faults, and the behavior analysis model is a neural network model trained by collecting and analyzing behavior data and used to analyze behavior; Using the simulated first test data, testing the resource allocation of the service framework test environment, wherein the resource allocation is based on the real-time load to dynamically adjust the allocation of cloud server resources; Using the simulated second test data, testing the fault recovery situation of the service framework test environment, wherein the fault recovery situation is a situation in which a fault recovery script of the cloud server is triggered after the fault prediction model predicts the existence of a fault; The security protection situation of the service framework test environment is tested using the simulated third test data, wherein the security protection situation is a situation in which the security protection script of the cloud server is triggered after the behavior analysis model analyzes abnormal behavior.
2. The method according to claim 1, characterized in that The step of testing the resource allocation of the service framework test environment by using the simulated first test data includes: The first test data is processed by a standard algorithm and a custom algorithm, and a dynamic load balancing algorithm is started to test the resource allocation of the service framework test environment.
3. The method according to claim 2, characterized in that The first test data is processed by a standard algorithm and a custom algorithm, and a dynamic load balancing algorithm is started to test the resource allocation of the service framework test environment, including: Using the MapReduce algorithm as the standard algorithm, a first preprocessing is performed on the first test data in key value form, wherein the first preprocessing includes a Map stage and a Reduce stage, the first test data in key value form is processed into intermediate key-value pairs by the Map function in the Map stage, the intermediate key-value pairs are aggregated into a target set by the Reduce function in the Reduce stage, the values in the target set are processed by the Reduce function, and a final result is output, and the final result is the processing result of the first preprocessing.
4. The method according to claim 2, characterized in that: The first test data is processed by a standard algorithm and a custom algorithm, and a dynamic load balancing algorithm is started to test the resource allocation of the service framework test environment, including: The K-Means clustering algorithm as the custom algorithm is used to perform a second preprocessing on the second test data containing the user behavior information, wherein the second preprocessing includes dividing the second test data containing the user behavior information into different groups, each group representing a class of similar user behavior characteristics.
5. The method according to claim 1, characterized in that The step of building a customized service framework test environment includes at least one of the following: According to the test requirements, configure the first parameter of the virtual machine instance in the service framework test environment; According to the test conditions, second parameters of the network connection in the service framework test environment are configured.
6. The method according to claim 5, characterized in that Configuring the first parameter of the virtual machine instance in the service framework test environment according to the test requirements includes at least one of the following: Configuring the number of CPU cores of the virtual machine instance, wherein the first parameter includes the number of CPU cores, and the number of CPU cores matches the test requirement; Configuring a memory size of the virtual machine instance, wherein the first parameter includes the memory size, and the memory size matches the test requirement; Configuring a disk size of the virtual machine instance, wherein the first parameter includes the disk size, and the disk size matches the test requirement; An operating system of the virtual machine instance is configured, wherein the first parameter includes the operating system, and the operating system matches the test requirement.
7. The method according to claim 5, characterized in that The configuring the second parameter of the network connection in the service framework test environment according to the test condition includes at least one of the following: configuring a bandwidth of the network connection, wherein the second parameter includes the bandwidth, and the bandwidth matches the test condition; configuring a delay of the network connection, wherein the second parameter includes the delay, and the delay matches the test condition; A packet loss rate of the network connection is configured, wherein the second parameter includes the packet loss rate, and the packet loss rate matches the test condition.
8. The method according to any one of claims 1 to 7, characterized in that The step of testing the resource allocation of the service framework test environment by using the simulated first test data includes: Obtaining a load ratio of each node in the service framework test environment, wherein the load ratio is a ratio of the processing capacity of the node to the current load of the node; Determine the target node with the largest load ratio among multiple nodes in the service framework test environment; The first test data is distributed to the target node, and resource allocation of the target node is dynamically adjusted according to the current load of the target node and the load of the first test data.
9. The method according to any one of claims 1 to 7, characterized in that Before testing the fault repair status of the service framework test environment by using the simulated second test data, the method further includes: Acquire multiple first samples, wherein the first samples are performance data of the cloud server at different time points; Obtaining time series features corresponding to the multiple samples and statistical features corresponding to the multiple first samples, wherein the time series features are used to represent the changing trend of the performance data in the time series, and the statistical features are used to represent the average response time and standard deviation of the performance data; Using the time series features and the statistical features, an initial fault prediction model is trained until a trained fault prediction model is obtained; Before testing the security protection status of the service framework test environment using the simulated third test data, the method further includes: Acquire multiple second samples, wherein the second samples are behavior data of users in the cloud server; Acquire user behavior features corresponding to the plurality of second samples, wherein the user behavior features include time series features, access mode features, and operation frequency features; The initial behavior analysis model is trained using the user behavior characteristics until a trained behavior analysis model is obtained.
10. The method according to any one of claims 1 to 7, characterized in that After testing the security protection of the service framework test environment using the simulated third test data, the method further includes at least one of the following: Automatically adjust firewall rules and access permission settings to block the abnormal behavior; Automatically trigger an alarm mechanism to indicate the abnormal behavior; Generate exception reports periodically or as needed to record the abnormal behavior.
11. The method according to any one of claims 1 to 7, characterized in that The step of testing the resource allocation of the service framework test environment by using the simulated first test data includes: Using the first test data, simulating a first test scenario of low load, medium load, high load and sudden load; Testing resource allocation of the service framework test environment under different first test scenarios; The testing of the fault repair status of the service framework test environment by using the simulated second test data includes: Using the second test data, simulating a second test scenario of hardware failure, software failure and network failure; Testing the fault repair status of the service framework test environment under different second test scenarios; The testing of the security protection status of the service framework test environment by using the simulated third test data includes: Using the third test data, simulating a third test scenario of malicious access, unauthorized access, and data leakage; The security protection status of the service framework test environment under different third test scenarios is tested.
12. A simulation test device for a cloud server, characterized in that: include: A construction unit, used to construct a customized service framework test environment, wherein the service framework test environment is used to simulate various operation scenarios of the cloud server, and a fault prediction model and a behavior analysis model are deployed in the service framework test environment, wherein the fault prediction model is a neural network model trained by collecting and analyzing operation data and used to predict faults, and the behavior analysis model is a neural network model trained by collecting and analyzing behavior data and used to analyze behavior; A first testing unit, configured to test resource allocation of the service framework testing environment using simulated first test data, wherein the resource allocation is based on real-time load to dynamically adjust the allocation of cloud server resources; A second testing unit is used to test the fault recovery situation of the service framework test environment by using simulated second test data, wherein the fault recovery situation is a situation in which a fault recovery script of the cloud server is triggered after the fault prediction model predicts the existence of a fault; The third test unit is used to test the security protection status of the service framework test environment by using simulated third test data, wherein the security protection status is the situation where the security protection script of the cloud server is triggered after the behavior analysis model analyzes the abnormal behavior.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the method described in any one of claims 1 to 11 when executed by a processor.
14. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method described in any one of claims 1 to 11 are implemented.
15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method described in any one of claims 1 to 11 are implemented.