A method and device for controlling the use of system resource virtual environment
By obtaining and clustering the parameter information of the process in the docker container, identifying and controlling the malicious attack process, the problem of virtual resource abuse is solved and the normal operation of the power system is ensured.
Patent Information
- Application Number
- CN202311828786.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-28
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2043-12-28
AI Technical Summary
In the new power system, as the number of equipment increases, the risk of resource abuse by a malicious attack on virtual resources increases, affecting the normal progress of the business. Effective resource use control methods need to be designed to prevent resource abuse.
By obtaining the resource, network and usage parameter information of the processes in the docker container, using the k-means algorithm for clustering, identifying and controlling processes with similar running status, batch shutdown of malicious attack processes, and blocking attacks.
Effectively classify and divide the process, timely monitor and block malicious attacks, prevent virtual system resources from being abused, and ensure the normal use of power system resources.
Smart Images

Figure CN117971385B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of novel power systems, and in particular to a method and device for controlling the use of a system resource virtual environment. Background Art
[0002] In new power systems, as the number of connected devices continues to increase, the risk of virtual resources of devices being attacked and abused will continue to increase.
[0003] At present, in particular, for example, if the process in the device terminal is attacked maliciously (such as encountering a denial of service attack), the CPU resources and memory resources of the device terminal will be abused, thereby seriously affecting the normal operation of the power system. Therefore, it is urgent to design a method for controlling the use of system resources to avoid the abuse of system resources. Summary of the invention
[0004] The present application provides a method and device for controlling the use of a system resource virtual environment, the main purpose of which is to provide a control solution for processes in a system resource virtual environment to block malicious attacks and solve the problem of abuse of virtual system resources.
[0005] In order to achieve the above objectives, this application mainly provides the following technical solutions:
[0006] The first aspect of the present application provides a method for controlling the use of a system resource virtual environment, the method comprising:
[0007] At the current moment, resource parameter information, network parameter information and process usage parameter information corresponding to the process in the docker container on the terminal device are obtained; the resource parameter information at least includes: CPU usage percentage and memory usage percentage; the network parameter information at least includes: DNS request volume, domain name registration usage time and domain resolution error rate; the process usage parameter information at least includes: the number of times the process is opened per unit time and the usage time per unit time;
[0008] According to the resource parameter information, the network parameter information and the process usage parameter information, a k-means algorithm is used to cluster the processes in the docker container to obtain a clustering result;
[0009] According to the clustering result, control operations are performed on the processes in the Docker container.
[0010] A second aspect of the present application provides a system resource virtual environment use control device, the device comprising:
[0011] The acquisition unit is used to obtain resource parameter information, network parameter information and process usage parameter information corresponding to the process in the docker container on the terminal device at the current moment; the resource parameter information at least includes: CPU usage ratio and memory usage ratio; the network parameter information at least includes: DNS request volume, domain name registration usage time and domain resolution error rate; the process usage parameter information at least includes: the number of times the process is opened per unit time and the usage time per unit time;
[0012] A clustering processing unit, configured to perform clustering processing on the processes in the Docker container using a k-means algorithm according to the resource parameter information, the network parameter information and the process usage parameter information to obtain a clustering result;
[0013] A control unit is used to control the process in the Docker container according to the clustering result.
[0014] A third aspect of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned system resource virtual environment usage control method is implemented.
[0015] The fourth aspect of the present application provides an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the above-mentioned system resource virtual environment usage control method when executed by the processor.
[0016] By means of the above technical solution, the technical solution provided by this application has at least the following advantages:
[0017] The present application provides a method and device for controlling the use of a system resource virtual environment. The present application first obtains resource parameter information, network parameter information, and process usage parameter information corresponding to a process in a docker container on a terminal device at the current moment, and then uses a k-means algorithm to process these data information to achieve clustering of processes in the docker container, and obtain clustering results, which is equivalent to classifying processes with similar operating states into one category and obtaining multiple classifications, and finally based on such classifications, performing control operations (such as opening / closing or maintaining the operating state) on the processes in each classification. Accordingly, in response to the technical problem of resource abuse caused by attacks on device virtual resources, the present application effectively classifies and divides multiple processes based on clustering processing, and since the operating states of processes under each classification are similar, malicious attack monitoring is performed for each classification. If a malicious attack is found to be possible, all processes under the classification can be closed in batches in a timely manner to block malicious attacks in a timely manner to solve the problem of abuse of virtual system resources.
[0018] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present application. Also, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0020] Figure 1 A flow chart of a method for controlling the use of a system resource virtual environment provided in an embodiment of the present application;
[0021] Figure 2 A block diagram of a system resource virtual environment use control device provided in an embodiment of the present application;
[0022] Figure 3 A block diagram of another system resource virtual environment usage control device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0023] The exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present application and to fully convey the scope of the present application to those skilled in the art.
[0024] Now, for the resource usage management of docker containers in smart terminals, if the determined resource usage of the container reaches a preset resource usage resource (such as a measurement boundary set based on experience values), it will consider whether the terminal has spare resources, or whether there are other containers that reach the preset resource usage rate, so as to facilitate the use of the container with excessively high resource usage.
[0025] However, the inventors have found that although such resource allocation can solve the problem of container resource demand in a friendly manner, once the container encounters a malicious attack (such as a denial of service attack), the container's resource demand will become extremely large. If the resource allocation scheme is still used, it will be more conducive to such malicious attacks and cause the container to occupy more resources.
[0026] To this end, the inventors have studied that if it is possible to control and intervene in the process in the container (such as opening / closing or keeping it running), for example, to close the process in the container that is attacked by malicious attacks, this will effectively respond to malicious attacks and avoid the abuse of virtual system resources.
[0027] Based on the above considerations, the present application embodiment provides a method for controlling the use of a system resource virtual environment, such as Figure 1 As shown, the present application embodiment provides the following specific steps:
[0028] 101. At the current moment, obtain resource parameter information, network parameter information, and process usage parameter information corresponding to the process in the Docker container on the terminal device.
[0029] Among them, resource parameter information at least includes: CPU usage percentage and memory usage percentage; network parameter information at least includes: domain name (Domain Name System, DNS) request volume, domain name registration usage time and domain resolution error rate; process usage parameter information at least includes: the number of process openings per unit time and the usage time per unit time. For example, specific parameter indicators are shown in Table 1 below.
[0030] Table 1
[0031]
[0032] With the widespread application of docker technology, a large number of services are deployed using container technology. The embodiment of the present application monitors the processes in the docker container to find out those processes with relatively high resource parameters, network parameters and process usage parameters, so as to further determine whether a malicious attack has occurred. If so, timely measures such as shutting down are taken.
[0033] 102. According to the resource parameter information, network parameter information and process usage parameter information, the k-means algorithm is used to cluster the processes in the docker container to obtain the clustering results.
[0034] Among them, the k-means clustering algorithm is an iterative clustering analysis algorithm. The embodiment of the present application uses the k-means algorithm to cluster the processes in the docker container, which is equivalent to classifying each process in terms of resource parameters, network parameters, and process usage parameters (i.e., combining these three aspects), so as to classify processes with similar running status into one category.
[0035] 103. Based on the clustering results, control the processes in the Docker container
[0036] Since the clustering result is equivalent to classifying processes with similar running status into one category, based on the judgment of each category, it is possible to find out which process in that category is likely to be attacked maliciously.
[0037] For example, a malicious attack is a denial of service attack, which actually makes the server achieve two effects: one is to force the server's buffer to be full and not accept new requests; the other is to use IP spoofing to force the server to reset the connection of illegal users, affecting the connection of legitimate users. And for containers, it is easy to suffer from the first attack effect of denial of service attacks, which is equivalent to occupying a large number of processes in the container to achieve excessive resource occupation.
[0038] Then, based on the clustering results, the embodiment of the present application performs unified control operations on the processes in each category according to the effective resource requirements (i.e., non-malicious attack requirements). For example, if a process in a category is found to be likely to be attacked maliciously, the process in this category can be directly closed to block the malicious attack.
[0039] As above, the embodiment of the present application provides a method for controlling the use of a system resource virtual environment. The embodiment of the present application first obtains the resource parameter information, network parameter information and process usage parameter information corresponding to the process in the docker container on the terminal device at the current moment, and then uses the k-means algorithm to process these data information to achieve clustering of the process in the docker container to obtain a clustering result, which is equivalent to classifying processes with similar running states into one category and obtaining multiple categories. Finally, based on such classification, control operations are performed on the processes in each category (such as opening / closing or keeping the running state). Accordingly, in response to the technical problem of resource abuse caused by attacks on device virtual resources, the embodiment of the present application effectively classifies and divides multiple processes based on clustering processing, and since the running states of the processes under each category are similar, malicious attack monitoring is performed for each category. If a malicious attack is found to be possible, all processes under the category can be closed in batches in a timely manner to block the malicious attack in time to solve the problem of abuse of virtual system resources.
[0040] In some modified embodiments, step 102, "clustering the processes in the Docker container using the k-means algorithm according to the resource parameter information, the network parameter information and the process usage parameter information to obtain a clustering result", can be further refined to include the following:
[0041] Step A1: Obtain historical resource parameter information, historical network parameter information, and historical process usage parameter information corresponding to the process in the Docker container.
[0042] Among them, historical resource parameter information at least includes: CPU usage percentage and memory usage percentage; historical network parameter information at least includes: DNS request volume, domain name registration usage time and domain resolution error rate; process usage parameter information at least includes: historical process unit time corresponding to the number of openings and unit time corresponding to usage time. In fact, historical resource parameter information, historical network parameter information and historical process usage parameter information are data information obtained at a certain historical moment, which are used as training samples.
[0043] In the embodiment of the present application, considering that the use of resource parameters by terminal devices usually exists within a certain range, if the use of resource parameters by the process in the container exceeds the average use value over a period of time, resource control for the process is considered. At the same time, in addition to facing denial of service attacks on resources, terminal devices will also face corresponding network attacks. In order to identify the parameters of the process for network resources, the network parameters used by the process, such as the DNS request volume and the domain name usage time, are considered.
[0044] Exemplarily, for obtaining parameter information of a process in a container on a terminal device, the embodiments of the present application may be implemented, but not limited to, by using a monitoring script, for example, using promethus as a container monitoring script deployed on the terminal device.
[0045] Prometheus is mainly composed of Prometheus server, alertmanager, and client libraries. Prometheus server is mainly responsible for capturing and storing time series data, client libraries are mainly used for monitoring script codes, and alertmanager is responsible for processing alerts. The script is easy to use and is implemented using a microservice architecture, and can accurately monitor resource changes in terminal containers.
[0046] Step A2: By taking each process as a corresponding sample, a training set consisting of multiple samples is established, where the sample is a data matrix consisting of historical resource parameter information, historical network parameter information and historical process usage parameter information on the terminal device.
[0047] Step A3, selecting K initialization cluster center points from the plurality of samples according to a preset algorithm;
[0048] Step A4: clustering the plurality of samples based on the K initialized cluster centers, and obtaining clustering results corresponding to the training set;
[0049] Step A5: Based on the clustering results corresponding to the training set, and based on the resource parameter information, network parameter information and process usage parameter information corresponding to each of the processes at the current moment, classify each of the processes to obtain the clustering results corresponding to the current moment.
[0050] Exemplarily, the embodiment of the present application is based on the historical resource parameter information, historical network parameter information and historical process usage parameter information corresponding to the process, such as "the difference between the CPU usage ratio of the process and the average CPU usage of the process history, and the difference between the memory usage ratio and the average. The number of DNS requests within a certain period of time, the domain name registration usage time used by the process, the domain resolution error rate, and the number of daily opens and daily usage time in the process log" as parameters, and the following example 1 is used to explain steps A2-A5 in detail as follows:
[0051] Step 1: Establishment of data matrix. Establish a data set based on the collected parameters. The specific data set format is shown in formula (1):
[0052] M={c1,c2,c3…,c n} (1)
[0053] Where M represents the total sample set, c i represents the i-th process sample where c i It is a 1*8 matrix in which the values are CPU usage percentage, memory usage percentage, DNS request volume, domain name registration usage time, domain resolution error rate, daily open times, and daily usage time.
[0054] Step 2: Randomly select a point from the sample set as the initial cluster center, such as ψ = c i
[0055] Step 3: Select the remaining cluster centers based on the roulette method. In order to select a more discriminative initial cluster center, calculate the cluster center ψ k The distance between the sample points is Q(c i ), the next cluster center is selected based on the roulette method, where the probability of each sample point being selected as the cluster center is shown in formula (2)
[0056]
[0057] Step 4: Repeat "Step 3" until K cluster centers are selected. K is a random value we initialize. Considering that the number of cluster centers has a great influence on the results, we will use GAP to determine the K value in the subsequent steps.
[0058] Step 5: Calculate c for each sample in the dataseti The distance from the K cluster centers is calculated, and the cluster is divided into the cluster center with the smallest distance. The formula for measuring the distance is shown in (3).
[0059]
[0060] where c i represents the i-th sample, u i represents the i-th cluster center.
[0061] Step 6: Update each category ψ by recalculating the mean value belonging to each current category k The cluster center of is as follows:
[0062]
[0063] where ψ k represents the kth category.
[0064] Step 7: Repeat "Step 5" to "Step 6" until the classification does not change, and finally output the category ψ k .
[0065] Step 8: Use the historical data of each process in the container process as a training set and the various parameters of the process at the current moment as a test set to classify the current process.
[0066] Step 9: Use the GAP value to select the number of cluster centers K. Considering the impact of the K value on the classification results, we use the GAP value to measure the effect of the current selection of K cluster centers. The specific calculation formula of the GAP value is shown in formula (5).
[0067] GAP(K)=E(logD k )-logD k (5)
[0068] Where E(logD k ) refers to the mean of the corresponding loss function generated by the Monte Carlo simulation of the samples when selecting K cluster centers. The GAP value corresponding to each K value is traversed and selected, and the clustering result with the largest GAP value is taken as the final number of cluster centers.
[0069] In some modified embodiments, for example, step 103 of "performing control operations on the processes in the Docker container according to the clustering results" can be further refined to include the following:
[0070] Step B1: Based on the clustering results, multiple cluster centers and the processes associated with each cluster center are determined.
[0071] Step B2: Filter out the target cluster center point for the risk to be evaluated from multiple cluster centers.
[0072] The embodiment of the present application is based on clustering results, which is equivalent to classifying a large number of processes based on resource parameters, network parameters and process usage parameters (i.e., combining these three aspects) to obtain the associated process corresponding to each cluster center point, and the running status of these associated processes are similar.
[0073] Based on this similarity, in fact, the running status of the process represented by the cluster center point can also indirectly represent the running status of each process under the corresponding category.
[0074] The embodiment of the present application comprehensively evaluates the processes represented by some cluster center points that are suspected of malicious attack risks based on three aspects: resource parameters, network parameters, and process usage parameters. Based on the classification corresponding to the cluster center point and the processes associated with it, it is equivalent to indirectly finding some processes that are suspected of malicious attack risks, so as to facilitate subsequent risk assessment.
[0075] Step B3: using a preset threshold interval to measure the number of processes associated with the target cluster center point, so as to perform control operations on the processes associated with the target cluster center point.
[0076] After preliminary judgment in step B2 of the embodiment of the present application, it is determined that the associated process under the category corresponding to the target cluster center point is at suspected risk of malicious attack, and considering that the "malicious consequences" caused by malicious attacks on the container are often "forcing the server's buffer to be full and not accepting new requests" (such as denial of service attacks), the embodiment of the present application proposes to use a preset threshold interval to measure the number of processes associated with the target cluster center point, so as to indirectly judge whether there is a possibility of the above "malicious consequences" based on the number of running processes.
[0077] Exemplarily, in some modified embodiments, the boundary values of the preset threshold interval are an open threshold and a closed threshold, and the closed threshold is greater than the open threshold. The above step B3 can be refined to include the following:
[0078] Step C1: If it is determined that the number of processes associated with the target cluster center point is greater than the closing threshold, the process corresponding to the cluster center point is controlled to be closed.
[0079] For example, if two boundary values of different sizes in the preset threshold interval are called "closing threshold" is greater than "opening threshold", if the number of processes associated with the target cluster center point is greater than the closing threshold, it means that the number of processes associated with the target cluster center point is too large and there may be a risk of being occupied by malicious attacks. Therefore, these processes are controlled and closed to free up more system resources.
[0080] Step C2: If it is determined that the number of processes associated with the target cluster center point is within a preset threshold range, the running state of the process corresponding to the cluster center point is controlled to remain unchanged.
[0081] If it is determined that the number of processes associated with the target cluster center point is within the preset threshold range, it can be shown that the number of processes associated with the target cluster center point is appropriate and reasonable and meets the current system operation requirements, thereby controlling the operation status of the process corresponding to the cluster center point to remain unchanged.
[0082] Step C3: If it is determined that the number of processes associated with the target cluster center point is less than the opening threshold, the process corresponding to the cluster center point is opened.
[0083] If it is determined that the number of processes associated with the target cluster center point is less than the opening threshold, it indicates that the number of processes associated with the target cluster center point is small, which can indicate that the processes associated with the target cluster center point occupy very few system resources, and thus the risk of malicious attacks is very low. Therefore, the risk possibility of such a target cluster center point can be removed, and it can be treated in the same way as other cluster centers (i.e., no risk assessment is required in step B2), and these processes can be opened and marked so that they can be preempted by other tasks in time when the process task ends, so that system resources can be fully utilized to the maximum extent.
[0084] As a supplementary solution to the embodiment of the present application, in some modified embodiments, the present application can also monitor each process in the docker container based on the preset priority level of each process and the constraints on each parameter information, specifically including the following:
[0085] Step D1: Add a preset priority level to each process in the Docker container.
[0086] In the embodiment of the present application, a preset priority level can be added to the process where the task is located according to the level of the task.
[0087] Step D2: monitor resource parameter information, network parameter information and process usage parameter information of each process according to a preset time period.
[0088] Step D3: Use the first preset constraint conditions corresponding to the resource parameter information, the network parameter information, and the process usage parameter information and the second preset constraint conditions corresponding to the preset priority to constrain the control operation on the process in the docker container.
[0089] For example, the first preset constraint conditions corresponding to the resource parameter information, network parameter information and process usage parameter information are equivalent to comprehensively evaluating the possibility of malicious attacks on the process from these three aspects, and the second preset constraint conditions corresponding to the preset priority are equivalent to sorting the processes in order of importance. Therefore, the embodiment of the present application can further set the first preset constraint condition to be higher than the second preset constraint condition, or the second preset constraint condition to be higher than the first preset constraint condition, so as to avoid misjudgment and closure of a process.
[0090] For example, if the second preset constraint is higher than the first preset constraint, then when a process is predicted to have a malicious risk based on the first preset constraint, assuming that the preset priority of the process is relatively high, that is, the importance level of the task on the process is relatively high, then the process should be excluded from control and shutdown based on the fact that "the second preset constraint is higher than the first preset constraint" to ensure the execution of important tasks.
[0091] As the above Figure 1 The implementation of the method shown in the figure, the embodiment of the present application provides a system resource virtual environment use control device. The device embodiment corresponds to the aforementioned method embodiment. For ease of reading, the present device embodiment will not repeat the details of the aforementioned method embodiment one by one, but it should be clear that the device in this embodiment can correspond to all the contents of the aforementioned method embodiment. The device is used to control the opening / closing or keeping of processes in docker containers to achieve effective resource utilization, specifically as follows Figure 2 As shown, the device comprises:
[0092] The acquisition unit 21 is used to obtain resource parameter information, network parameter information and process usage parameter information corresponding to the process in the docker container on the terminal device at the current moment; the resource parameter information at least includes: CPU usage ratio and memory usage ratio; the network parameter information at least includes: DNS request volume, domain name registration usage time and domain resolution error rate; the process usage parameter information at least includes: the number of openings per unit time and the usage time per unit time of the process;
[0093] A clustering processing unit 22 is used to perform clustering processing on the processes in the Docker container using a k-means algorithm according to the resource parameter information, the network parameter information and the process usage parameter information to obtain a clustering result;
[0094] The control unit 23 is used to control the process in the Docker container according to the clustering result.
[0095] Further, such as Figure 3 As shown, the cluster processing unit 22 includes:
[0096] The acquisition module 221 is used to obtain historical resource parameter information, historical network parameter information and historical process usage parameter information corresponding to the process in the Docker container;
[0097] An establishing module 222, configured to establish a training set consisting of a plurality of the samples by taking each of the processes as a corresponding sample, wherein the sample is a data matrix consisting of the historical resource parameter information, the historical network parameter information, and the historical process usage parameter information on the terminal device;
[0098] A selection module 223 is used to select K initialization cluster center points from the plurality of samples according to a preset algorithm;
[0099] A clustering processing module 224, configured to perform clustering processing on the plurality of samples based on the K initialized cluster centers, and obtain clustering results corresponding to the training set;
[0100] The classification module 225 is used to classify each of the processes based on the clustering results corresponding to the training set, and based on the resource parameter information, network parameter information and process usage parameter information corresponding to each of the processes at the current moment, to obtain the corresponding clustering results at the current moment.
[0101] Further, such as Figure 3 As shown, the control unit 23 includes:
[0102] A determination module 231, configured to determine, based on the clustering result, a plurality of cluster centers and a process associated with each of the cluster centers;
[0103] A screening module 232, used to screen out a target cluster center point of the risk to be assessed from the plurality of cluster centers;
[0104] The control module 233 is used to measure the number of processes associated with the target cluster center point using a preset threshold interval, so as to perform control operations on the processes associated with the target cluster center point.
[0105] Further, such as Figure 3 As shown, the boundary values of the preset threshold interval are an open threshold and a closed threshold, the closed threshold is greater than the open threshold, and the control module 233 is further specifically used to:
[0106] If it is determined that the number of processes associated with the target cluster center point is greater than the closing threshold, controlling the closing of the process corresponding to the target cluster center point;
[0107] If it is determined that the number of processes associated with the target cluster center point is within the preset threshold interval, controlling to keep the running state of the process corresponding to the target cluster center point unchanged;
[0108] If it is determined that the number of processes associated with the target cluster center point is less than the opening threshold, the process corresponding to the target cluster center point is marked as open.
[0109] Further, such as Figure 3 As shown, the device also includes:
[0110] An adding unit 24 is used to add a preset priority level to each process in the docker container;
[0111] A monitoring unit 25, configured to monitor resource parameter information, network parameter information and process usage parameter information of each of the processes according to a preset time period;
[0112] The constraint control unit 26 is used to constrain the control operation of the process in the docker container by using the first preset constraint conditions corresponding to the resource parameter information, the network parameter information and the process usage parameter information and the second preset constraint conditions corresponding to the preset priority.
[0113] The system resource virtual environment use control device includes a processor and a memory. The above-mentioned acquisition unit, clustering processing unit and control unit are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to realize corresponding functions.
[0114] The processor contains a kernel, which calls the corresponding program unit from the memory. The kernel can be set to one or more, and provide a control scheme for the process in the system resource virtual environment by adjusting the kernel parameters to block malicious attacks and solve the problem of abuse of virtual system resources.
[0115] An embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned system resource virtual environment usage control method is implemented.
[0116] An embodiment of the present application provides an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the above-mentioned system resource virtual environment usage control method is implemented.
[0117] The embodiment of the present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing the program steps of the method for initializing the use of the system resource virtual environment.
[0118] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0119] In a typical configuration, the device includes one or more processors (CPU), memory and bus. The device may also include input / output interface, network interface and the like.
[0120] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip. The memory is an example of a computer-readable medium.
[0121] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0122] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0123] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0124] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A method for controlling the use of a system resource virtual environment, characterized in that: The method comprises: At the current moment, resource parameter information, network parameter information and process usage parameter information corresponding to the process in the docker container on the terminal device are obtained; the resource parameter information at least includes: CPU usage percentage and memory usage percentage; the network parameter information at least includes: DNS request volume, domain name registration usage time and domain resolution error rate; the process usage parameter information at least includes: the number of times the process is opened per unit time and the usage time per unit time; According to the resource parameter information, the network parameter information and the process usage parameter information, a k-means algorithm is used to cluster the processes in the docker container to obtain a clustering result; According to the clustering result, a control operation is performed on the process in the docker container, including: based on the clustering result, determining multiple cluster center points and the processes corresponding to each of the cluster center points; screening out the target cluster center point to be assessed for risk from the multiple cluster center points; using a preset threshold interval to measure the number of processes corresponding to the target cluster center point, so as to control the processes corresponding to the target cluster center point, wherein the boundary values of the preset threshold interval are an open threshold and a closed threshold, and the closed threshold is greater than the open threshold; The method of using a preset threshold interval to measure the number of processes associated with the target cluster center point to control the processes associated with the target cluster center point includes: If it is determined that the number of processes associated with the target cluster center point is greater than the closing threshold, controlling the closing of the process corresponding to the target cluster center point; If it is determined that the number of processes associated with the target cluster center point is within the preset threshold interval, controlling to keep the running state of the process corresponding to the target cluster center point unchanged; If it is determined that the number of processes associated with the target cluster center point is less than the opening threshold, the process corresponding to the target cluster center point is marked as open.
2. The method according to claim 1, characterized in that The clustering process in the docker container is performed using a k-means algorithm according to the resource parameter information, the network parameter information and the process usage parameter information to obtain a clustering result, including: Obtain historical resource parameter information, historical network parameter information, and historical process usage parameter information corresponding to the process in the Docker container; By taking each of the processes as a corresponding sample, a training set consisting of a plurality of the samples is established, wherein the sample is a data matrix consisting of the historical resource parameter information, the historical network parameter information and the historical process usage parameter information on the terminal device; Selecting K initialization cluster center points from the plurality of samples according to a preset algorithm; Based on the K initialized cluster centers, clustering is performed on the plurality of samples, and the clustering results corresponding to the training set are obtained; Based on the clustering results corresponding to the training set, and based on the resource parameter information, network parameter information and process usage parameter information corresponding to each of the processes at the current moment, classification is performed on each of the processes to obtain the clustering results corresponding to the current moment.
3. The method according to claim 1 or 2, characterized in that: The method further comprises: Add preset priority levels to each process in the docker container; Monitoring resource parameter information, network parameter information and process usage parameter information of each of the processes according to a preset time period; The control operation on the process in the docker container is constrained by using the first preset constraint conditions corresponding to the resource parameter information, the network parameter information and the process usage parameter information and the second preset constraint conditions corresponding to the preset priority.
4. A system resource virtual environment use control device, characterized in that: The device comprises: The acquisition unit is used to obtain resource parameter information, network parameter information and process usage parameter information corresponding to the process in the docker container on the terminal device at the current moment; the resource parameter information at least includes: CPU usage ratio and memory usage ratio; the network parameter information at least includes: DNS request volume, domain name registration usage time and domain resolution error rate; the process usage parameter information at least includes: the number of times the process is opened per unit time and the usage time per unit time; A clustering processing unit, configured to perform clustering processing on the processes in the Docker container using a k-means algorithm according to the resource parameter information, the network parameter information and the process usage parameter information to obtain a clustering result; A control unit, used to control the process in the Docker container according to the clustering result; The control unit includes: a determination module, for determining multiple cluster center points and the processes associated with each cluster center point based on the clustering result; a screening module, for screening out the target cluster center point of the risk to be assessed from the multiple cluster center points; a control module, for measuring the number of processes associated with the target cluster center point using a preset threshold interval to control the processes associated with the target cluster center point, wherein the boundary values of the preset threshold interval are an open threshold and a closed threshold, and the closed threshold is greater than the open threshold; The control module is also specifically used for: If it is determined that the number of processes associated with the target cluster center point is greater than the closing threshold, controlling the closing of the process corresponding to the target cluster center point; If it is determined that the number of processes associated with the target cluster center point is within the preset threshold interval, controlling to keep the running state of the process corresponding to the target cluster center point unchanged; If it is determined that the number of processes associated with the target cluster center point is less than the opening threshold, the process corresponding to the target cluster center point is marked as open.
5. The device according to claim 4, characterized in that The cluster processing unit comprises: An acquisition module is used to obtain historical resource parameter information, historical network parameter information and historical process usage parameter information corresponding to the process in the Docker container; An establishing module, used to establish a training set consisting of a plurality of the samples by taking each of the processes as a corresponding sample, wherein the sample is a data matrix consisting of the historical resource parameter information, the historical network parameter information and the historical process usage parameter information on the terminal device; A selection module, used to select K initialization cluster center points from the plurality of samples according to a preset algorithm; A clustering processing module, used for performing clustering processing on the plurality of samples based on the K initialized cluster center points, and obtaining clustering results corresponding to the training set; The classification module is used to classify each of the processes based on the clustering results corresponding to the training set and the resource parameter information, network parameter information and process usage parameter information corresponding to each of the processes at the current moment, so as to obtain the clustering results corresponding to the current moment.
6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for controlling the use of a system resource virtual environment according to any one of claims 1 to 3 is implemented.
7. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the system resource virtual environment usage control method according to any one of claims 1 to 3.
Citation Information
Patent Citations
IP address analysis method and device for network attack and storage medium
CN111294318A
Cloud malicious program detection system and method based on deep learning
CN111931179A
Secure remote access system and method thereof, computer equipment and storage medium
CN113194104A
Application program running method and device, equipment and storage medium
CN114201304A
Botnet identification method and device and terminal equipment
CN114666071A
