Server detection method and apparatus
By classifying and weighting monitoring data from various server resource types, the problem of low accuracy in determining server load pressure was solved, thereby improving the accuracy of load pressure determination and resource utilization.
Patent Information
- Application Number
- CN202110579259.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-05-26
- Publication Date
- 2025-12-23
- Estimated Expiration
- 2041-05-26
AI Technical Summary
In existing technologies, the accuracy of determining server load pressure is low, mainly because it relies on the usage of individual resources, which leads to large errors.
By acquiring monitoring data from multiple resource types, classifying and weighting the data, the resource utilization rate of each resource type is obtained. Based on these utilization rates, the overall utilization rate of the server is determined, thereby improving the accuracy of load pressure determination.
It improves the accuracy of server load pressure determination, ensures effective resource utilization and stable server operation, and enables timely measures to reduce load pressure and avoid resource waste.
Smart Images

Figure CN115408139B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the technical field of server, and particularly relate to a server detection method and device. BACKGROUND
[0002] In the process of using the server, it is often necessary to determine the load pressure of the server. When determining that the load pressure of the server is too large, relevant personnel can take appropriate measures to reduce the load pressure of the server in time, and when determining that the load pressure of the server is too small, relevant personnel can recycle resources to ensure the utilization rate of resources.
[0003] In the prior art, when determining the load pressure of the server, the use of a certain resource (for example, memory usage) in the server is generally used to determine the corresponding usage of the server, that is, to obtain the load pressure of the server.
[0004] However, since the load pressure of the server, that is, the corresponding usage of the server, is determined according to the use of a single resource, the accuracy of the determined load pressure of the server is low. SUMMARY
[0005] Embodiments of the present application provide a server detection method and device to solve the technical problem of low accuracy of load pressure determination in the prior art.
[0006] In a first aspect, embodiments of the present application provide a server detection method, comprising:
[0007] obtaining monitoring data corresponding to a plurality of resource types corresponding to a to-be-detected server;
[0008] For each resource type, classifying the monitoring data corresponding to the resource type to obtain gear data information corresponding to the resource type, and performing weight comprehensive calculation on the gear data information corresponding to the resource type to obtain a resource usage rate corresponding to the resource type;
[0009] determining a comprehensive usage rate of the to-be-detected server according to the resource usage rate corresponding to each resource type.
[0010] In a possible design, the gear data information includes monitoring data and data centroids corresponding to each gear type.
[0011] The weight comprehensive calculation on the gear data information corresponding to the resource type to obtain the resource usage rate corresponding to the resource type comprises:
[0012] obtaining the number of all monitoring data corresponding to the resource type, and determining the number as the total data number corresponding to the resource type;
[0013] For each gear type corresponding to the resource type, a number of monitoring data corresponding to the gear type is counted to obtain a data number corresponding to the gear type, and a weight value corresponding to the gear type is obtained according to the data number corresponding to the gear type and the total data number;
[0014] According to the weight value corresponding to each gear type and the data centroid corresponding to each gear type, a resource usage rate corresponding to the resource type is determined.
[0015] In a possible design, the determining, according to the weight value corresponding to each gear type and the data centroid corresponding to each gear type, of the resource usage rate corresponding to the resource type includes:
[0016] For each gear type corresponding to the resource type, a product of the weight value and the data centroid corresponding to the gear type is obtained, and the product is determined as the resource usage rate corresponding to the gear type;
[0017] The resource usage rates corresponding to all gear types corresponding to the resource type are summed to obtain the resource usage rate corresponding to the resource type.
[0018] In a possible design, the determining, according to the resource usage rate corresponding to each resource type, of the comprehensive usage rate of the server to be detected includes:
[0019] The resource usage rates corresponding to all resource types are summed to obtain the comprehensive usage rate of the server to be detected.
[0020] In a possible design, the method further includes:
[0021] If the comprehensive usage rate of the server to be detected is greater than a first preset threshold, a load pressure is too large prompt information is generated and output.
[0022] If the comprehensive usage rate of the server to be detected is less than a second preset threshold, a load pressure is too small prompt information is generated and output.
[0023] In a possible design, the resource type includes one or more of a processor usage type, a memory usage type, a disk read-write type, a disk usage type, and a network card traffic in-out type.
[0024] In a second aspect, an embodiment of the present application provides a server detection device, including:
[0025] A data acquisition module is configured to acquire monitoring data corresponding to a plurality of resource types corresponding to a server to be detected.
[0026] The processing module is configured to, for each resource type, classify monitoring data corresponding to the resource type to obtain gear data information corresponding to the resource type, and perform weight comprehensive calculation on the gear data information corresponding to the resource type to obtain a resource utilization rate corresponding to the resource type.
[0027] The processing module is further configured to determine a comprehensive utilization rate of the server to be detected according to the resource utilization rate corresponding to each resource type.
[0028] In a possible design, the gear data information includes monitoring data and data centroids corresponding to each gear type.
[0029] The processing module is further configured to:
[0030] The processing module is further configured to:
[0031] The processing module is further configured to, for each gear type corresponding to the resource type, count a number of monitoring data corresponding to the gear type to obtain a data number corresponding to the gear type, and obtain a weight value corresponding to the gear type according to the data number corresponding to the gear type and the total data number.
[0032] The processing module is further configured to determine the resource utilization rate corresponding to the resource type according to the weight value corresponding to each gear type and the data centroid corresponding to each gear type.
[0033] In a possible design, the processing module is further configured to:
[0034] The processing module is further configured to, for each gear type corresponding to the resource type, obtain a product of the weight value and the data centroid corresponding to the gear type, and determine the product as a resource utilization rate corresponding to the gear type.
[0035] The processing module is further configured to sum the resource utilization rates corresponding to all gear types corresponding to the resource type to obtain the resource utilization rate corresponding to the resource type.
[0036] In a possible design, the processing module is further configured to:
[0037] The processing module is further configured to sum the resource utilization rates corresponding to each resource type to obtain the comprehensive utilization rate of the server to be detected.
[0038] In a possible design, the processing module is further configured to:
[0039] If the comprehensive utilization rate of the server to be detected is greater than a first preset threshold, a load pressure is too large prompt information is generated and output.
[0040] If the comprehensive usage rate of the server to be detected is less than a second preset threshold, a load pressure too small prompt information is generated and output.
[0041] In a possible design, the resource types include one or more of a processor usage type, a memory usage type, a disk read-write type, a disk usage type, and a network card traffic in-out type.
[0042] In a third aspect, an embodiment of the present application provides an electronic device, including at least one processor and a memory.
[0043] The memory stores computer-executed instructions.
[0044] The at least one processor executes the computer-executed instructions stored in the memory, so that the at least one processor executes the server detection method in the first aspect and various possible designs of the first aspect.
[0045] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, and the computer-readable storage medium stores computer-executed instructions, when the processor executes the computer-executed instructions, the server detection method in the first aspect and various possible designs of the first aspect is implemented.
[0046] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, when the processor executes the computer program, the server detection method in the first aspect and various possible designs of the first aspect is implemented.
[0047] The present application provides a server detection method and device, when it is needed to determine the load pressure of a server, i.e., a server to be detected, the monitoring data corresponding to the server to be detected is acquired, the monitoring data includes monitoring data corresponding to multiple resource types, for each resource type, the monitoring data corresponding to the resource type is classified, i.e., the monitoring data is divided into multiple gears, to obtain corresponding gear data information, and the gear data information corresponding to the resource type, i.e., the monitoring data of each gear, is comprehensively calculated, to obtain the resource usage rate corresponding to the resource type, so that the accurate determination of the resource usage rate is realized, when the resource usage rate corresponding to each resource type is obtained, the comprehensive usage rate of the server to be detected is determined by using the resource usage rate corresponding to each resource type, i.e., the load pressure of the server to be detected is determined by using the resource usage rates corresponding to multiple resource types, instead of using only a single resource usage rate, so that the accuracy of the determination of the usage rate, i.e., the load pressure, of the server can be effectively improved. BRIEF DESCRIPTION OF DRAWINGS
[0048] In order to make the technical solutions of the embodiments of the present application or the prior art clearer, the accompanying drawings needed in the embodiments or prior art description will be briefly introduced. Obviously, the accompanying drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without any creative effort on the basis of these drawings.
[0049] Figure 1 The scene schematic diagram of the server detection method provided by the embodiment of the present application is shown in the figure.
[0050] Figure 2 The flow schematic diagram of the server detection method provided by the embodiment of the present application is shown in the figure. Figure One
[0051] Figure 3 The schematic diagram of the monitoring data storage provided by the embodiment of the present application is shown in the figure.
[0052] Figure 4 The flow schematic diagram of the server detection method provided by the embodiment of the present application is shown in the figure. Figure Two
[0053] Figure 5 The structural schematic diagram of the server detection device provided by the embodiment of the present application is shown in the figure.
[0054] Figure 6 The hardware structural schematic diagram of the electronic device provided by the embodiment of the present application is shown in the figure. DETAILED DESCRIPTION
[0055] In order to make the technical solutions of the embodiments of the present application or the prior art clearer, the accompanying drawings needed in the embodiments or prior art description will be briefly introduced. Obviously, the accompanying drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without any creative effort on the basis of these drawings.
[0056] At present, when determining the load pressure of a server, the usage of a certain resource of the server is acquired to obtain the load pressure of the server. For example, the memory usage of the server is acquired and determined as the load pressure, that is, when the memory usage is greater than a first preset threshold, it is determined that the load pressure of the server is too large; when the memory usage is less than a second preset threshold, it is determined that the load pressure of the server is too small. However, since the usage of a single resource of the server is used to determine the load pressure of the server, the error of the determined load pressure of the server is large, and the accuracy of the determined load pressure of the server is low.
[0057] Therefore, in view of the correlation of multiple resource types, i.e., indexes, and the dynamic change characteristics of indexes over time, when the load pressure of a server needs to be determined, the usage of multiple resources of the server is acquired every certain time, and the usage of the multiple resources is comprehensively analyzed to obtain the load pressure of the server, so that the accuracy of the determination of the load pressure of the server is improved, and when the load pressure of the server is used as a basis to adjust the resources of the server or take corresponding measures to reduce the load pressure of the server, the effective adjustment of the resources or the timely reduction of the load pressure of the server can be realized, and thus the utilization rate of the resources of the server and the stability of the operation of the server are ensured.
[0058] The technical solutions of the present disclosure and how the technical solutions of the present disclosure solve the above technical problems will be described in detail below with specific examples. The following specific examples can be combined with each other, and the same or similar concepts or processes can not be described again in some examples. The examples of the present disclosure will be described below with reference to the accompanying drawings.
[0059] Figure 1 The scene schematic diagram of the server detection method provided by the embodiment of the present disclosure is shown in Figure 1 The server 101 collects its own running condition, i.e., obtains the monitoring data corresponding to each resource type, and sends the monitoring data to the electronic device 102, so that the electronic device 102 determines the load pressure of the server 102 by using the monitoring data corresponding to each resource type.
[0060] The electronic device 102 can be a computer, a server, or other devices with data processing capability.
[0061] Optionally, when the monitoring data corresponding to each resource type is obtained, the server 101 can also save the monitoring data in the middleware (for example, Kafka), so that the electronic device consumes the monitoring data from the middleware. Of course, the electronic device can also obtain the monitoring data corresponding to each resource type of the server 101 from the related database. The monitoring data in the database is directly saved by the server 101 or is consumed from the middleware.
[0062] Figure 2 The flowchart of the server detection method provided by the embodiment of the present disclosure is shown in Figure One The execution subject of the embodiment can be an electronic device as shown in Figure 1 As shown in Figure 2 The method comprises the following steps:
[0063] S201, obtaining monitoring data corresponding to multiple resource types corresponding to a server to be detected.
[0064] In the embodiment, when it is needed to determine the load pressure of the server, the server is taken as the server to be detected. The electronic device acquires the monitoring data corresponding to various resource types of the server every first preset time.
[0065] The monitoring data corresponding to each resource type includes a plurality of monitoring data, which is collected by the server every second preset time within the first preset time. For example, the resource type is a processor usage type, the second preset time is 2 minutes, the first preset time is a period 1, and the server collects the monitoring data corresponding to the processor usage type, i.e., the CPU (Central Processing Unit) usage rate, every 5 minutes. The electronic device acquires the CPU usage rate collected by the server within the period 1, i.e., the CPU usage rate collected by the server every 2 minutes within the period 1.
[0066] The first preset time and the second preset time can be set according to actual conditions, and generally have small values.
[0067] Optionally, the resource type includes one or more of a processor usage type, a memory usage type, a disk read-write type, a disk usage type, and a network card traffic in-out type.
[0068] In addition, optionally, when the type of the server to be detected is a normal type, the server to be detected collects the monitoring data through a locally installed collector (for example, an Exporter collector); when the type of the server to be detected is a virtual type, the server to be detected collects the monitoring data through target receiving.
[0069] In addition, as shown in Figure 3 After the server to be detected collects the monitoring data, the server to be detected sends the monitoring data to a message middleware (for example, kafka), and the message middleware stores the data in a time series database.
[0070] Specifically, as shown in Figure 3 When the server to be detected is a conventional server (for example, an X86 server), the server to be detected is of a normal type, the X86 server is locally installed with an Exporter collector, the Exporter collector collects data and sends the data to a message middleware kafka; when the server to be detected is a cloud virtual server, the server to be detected is of a virtual type, the cloud virtual server directly connects an API (Application Programming Interface) interface of a cloud management platform, collects server indexes in batches through the interface, and sends the server indexes to the message middleware kafka.
[0071] Further, the processor uses the type corresponding to the monitoring data for CPU usage; the memory usage type corresponding to the monitoring data is the memory usage; the disk read-write type corresponding to the monitoring data includes disk read rate and / or disk write rate; the network card flow in-out type corresponding to the monitoring data includes network card flow in rate and / or network card flow out rate.
[0072] In addition, the account of the server to be detected can also be managed, that is, the account information of the server to be detected is managed, and the account information includes the account name, the device IP, the machine room cabinet, the department, the serial number, the operating system, the brand manufacturer, the start time, the maintenance manufacturer, the maintenance time, the bearing service, the asset number and the responsible person, etc.
[0073] In addition, after obtaining the monitoring data corresponding to various resource types, the monitoring data corresponding to the resource type can also be converted by the segmented value algorithm.
[0074] Among them, the segmented value algorithm is to convert the monitoring data according to the preset numerical range where the monitoring data is located, for example, the CPU usage is 60%, which belongs to the preset numerical range of 50%~70%, and the numerical value corresponding to the preset numerical range is a, then the CPU usage is converted to a.
[0075] In addition, the disk read rate, the disk write rate, the network card flow in rate, and the network card flow out rate are all rate units and need to be converted through an additional processing procedure.
[0076] S202, for each resource type, the monitoring data corresponding to the resource type is classified to obtain the gear data information corresponding to the resource type, and the gear data information corresponding to the resource type is calculated by weight to obtain the resource usage rate corresponding to the resource type.
[0077] In this embodiment, after obtaining the monitoring data corresponding to various resource types corresponding to the server to be detected, it is necessary to determine the usage of various resources, then for each resource type, the monitoring data corresponding to the resource type is classified to obtain the gear data information corresponding to the resource type, that is, the monitoring data corresponding to each gear is obtained, and the gear data information corresponding to the resource type is used, that is, the monitoring data corresponding to each gear is used to calculate by weight to realize the comprehensive analysis of the monitoring data corresponding to each gear, to obtain the resource usage rate corresponding to the resource type, to determine the resource usage situation corresponding to the resource type.
[0078] Optionally, the gear data information includes the monitoring data corresponding to each gear type and the data centroid. The monitoring data is classified to obtain the monitoring data included by each gear and the centroid corresponding to each gear, that is, the data centroid corresponding to the gear type.
[0079] Optionally, when the monitoring data corresponding to the resource type is classified, the K-means, i.e., k-means clustering algorithm, can be used for classification.
[0080] wherein k=3, and the corresponding gear types include high gear type, medium gear type and low gear type. The monitoring data corresponding to the high gear type represents the monitoring data with larger values in the monitoring data corresponding to the resource type; the monitoring data corresponding to the medium gear type represents the monitoring data with values in a medium range in the monitoring data corresponding to the resource type; and the monitoring data corresponding to the low gear type represents the monitoring data with smaller values in the monitoring data corresponding to the resource type.
[0081] In addition, optionally, before the monitoring data corresponding to the resource type is classified, the maximum value and the minimum value in the monitoring data can be removed to further ensure the accuracy of data processing.
[0082] S203, determining the comprehensive usage rate of the server to be detected according to the resource usage rates corresponding to the resource types.
[0083] In this embodiment, after obtaining the resource usage rates corresponding to the resource types, the comprehensive usage of the server resources is determined based on the resource usage rates corresponding to all the resource types, so as to obtain the comprehensive usage rate of the server to be detected, i.e., the multi-index comprehensive judgment is performed to obtain the load pressure of the server to be detected, and the accuracy of the load pressure determination is improved.
[0084] In this embodiment, when the monitoring data of a certain period of time corresponding to the resource type is classified by using the k-means clustering algorithm, the noise is removed, and the monitoring data after noise reduction is classified, i.e., the monitoring data is divided into multiple gears to obtain the monitoring data corresponding to multiple gear types. The monitoring data corresponding to each gear type corresponding to the resource type is comprehensively analyzed to obtain the resource usage rate corresponding to the resource type, instead of directly using the monitoring data as the resource usage rate corresponding to the resource type after obtaining the monitoring data.
[0085] In this embodiment, the shrinking time period and the clustering proportion weight mean method are used to determine the comprehensive usage rate of the server, i.e., the resource comprehensive usage of the server to be detected is obtained, and the noise influence caused by the large data is effectively reduced.
[0086] From the above description, it can be known that when it is needed to determine the server, i.e., the load pressure of the server to be detected, the monitoring data corresponding to the server to be detected is acquired, the monitoring data includes monitoring data corresponding to multiple resource types, for each resource type, the monitoring data corresponding to the resource type is classified, i.e., the monitoring data is divided into multiple gears, to obtain corresponding gear data information, and the gear data information corresponding to the resource type, i.e., the monitoring data of each gear, is comprehensively calculated to obtain the resource usage rate corresponding to the resource type, the accurate determination of the resource usage rate is realized, when the resource usage rate corresponding to each resource type is obtained, the comprehensive usage rate of the server to be detected is determined by using the resource usage rate corresponding to each resource type, i.e., the load pressure of the server to be detected is determined by using the resource usage rates corresponding to multiple resource types, instead of only using a single resource usage rate, so that the usage rate of the server, i.e., the accuracy of the determination of the load pressure, can be effectively improved.
[0087] Figure 4 The flowchart of the server detection method provided by the embodiment of the application Figure Two The embodiment Figure 2 On the basis of the embodiment, after the comprehensive usage rate of the server to be detected, i.e., the load pressure, is determined, it can be further analyzed for alarm, which will be described below in combination with a specific embodiment. As shown in Figure 4 The method includes the following steps.
[0088] S401, acquire monitoring data corresponding to multiple resource types corresponding to a server to be detected.
[0089] S402, for each resource type, classify the monitoring data corresponding to the resource type to obtain gear data information corresponding to the resource type, and perform weight comprehensive calculation on the gear data information corresponding to the resource type to obtain a resource usage rate corresponding to the resource type.
[0090] In the embodiment, the number of all monitoring data corresponding to the resource type is acquired and determined as the total data number corresponding to the resource type. For each gear type corresponding to the resource type, the number of monitoring data corresponding to the gear type is counted to obtain a data number corresponding to the gear type, and according to the data number corresponding to the gear type and the total data number, a weight value corresponding to the gear type is obtained. According to the weight value corresponding to each gear type and the data centroid corresponding to each gear type, the resource usage rate corresponding to the resource type is determined.
[0091] Specifically, when determining the resource usage rate corresponding to the resource type based on the weighted average algorithm, the number of all monitoring data corresponding to each resource type is obtained to obtain the total data number corresponding to each resource type. For each resource type, i.e. index, after classifying the monitoring data corresponding to the resource type to obtain the gear data information corresponding to the resource type, i.e. after obtaining the relevant information of each gear type corresponding to the resource type, the resource usage of the resource type is determined by using the relevant information of each gear type, i.e. for each gear type corresponding to the resource type, the number of monitoring data included in the gear, i.e. the total number of all monitoring data corresponding to the gear type, is counted to obtain the data number corresponding to the gear type. The ratio of the data number corresponding to the gear type to the total data number is calculated to obtain the weight value corresponding to the gear type, and the weight value corresponding to the gear type represents the proportion of the monitoring data corresponding to the gear type.
[0092] After obtaining the weight value corresponding to each gear type corresponding to a certain resource type, the resource usage rate corresponding to the resource type is determined by using the weight value corresponding to each gear type and the data centroid.
[0093] Further, the resource usage rate corresponding to the resource type is determined according to the weight value corresponding to each gear type and the data centroid corresponding to each gear type, including:
[0094] For each gear type corresponding to the resource type, the product of the weight value and the data centroid corresponding to the gear type is obtained and is determined as the resource usage rate corresponding to the gear type.
[0095] The resource usage rates corresponding to all gear types corresponding to the resource type are summed to obtain the resource usage rate corresponding to the resource type.
[0096] Specifically, after obtaining the weight value corresponding to each gear type corresponding to the resource type, for each gear type, the product of the weight value corresponding to the gear type and the data centroid corresponding to the gear type is calculated to obtain the average monitoring value corresponding to the gear type, i.e. the resource usage rate corresponding to the gear type, and the average monitoring values, i.e. resource usage rates, corresponding to each gear type are summed to realize comprehensive analysis of the resource type and obtain the resource usage rate corresponding to the resource type.
[0097] For example, when the resource type is a processor usage type, the monitoring data corresponding to the resource type includes CPU usage rate, and when determining the resource usage rate corresponding to the resource type, the weighted average method is used, i.e. wherein Ecpu is the resource usage rate corresponding to the processor usage type, i is the i-th gear type, Numcpu iThe data number corresponding to the i-th gear type, M is the number of all CPU usage, i.e., the total of the data number corresponding to each gear, Kcpu i The data centroid corresponding to the i-th gear type.
[0098] S403, according to the resource usage corresponding to each resource type to determine the comprehensive usage of the server to be detected.
[0099] In this embodiment, after obtaining the resource usage corresponding to each resource type, the comprehensive analysis is performed on each resource type, i.e., the index, i.e., the resource usage corresponding to each resource type is summed to obtain the comprehensive usage of the server to be detected.
[0100] In addition, optionally, the comprehensive usage of the server to be detected can also be determined based on the resource usage corresponding to each resource type in other manners, for example, the resource usage corresponding to the largest resource type is taken as the comprehensive usage, which is not limited herein.
[0101] S404, if the comprehensive usage of the server to be detected is greater than the first preset threshold, a load pressure too large prompt information is generated and output.
[0102] In this embodiment, after obtaining the comprehensive usage of the server to be detected, i.e., the load pressure, it is determined whether the load pressure of the server to be detected is too large or too small, i.e., whether the comprehensive usage of the server to be detected is greater than the first preset threshold or less than the second preset threshold.
[0103] When the comprehensive usage of the server to be detected is greater than the first preset threshold, it indicates that the resource usage of the server to be detected is too much, and the load pressure of the server to be detected is too large, then according to the preset prompt format, the corresponding load pressure too large prompt information is generated and displayed, or the load pressure too large prompt information is sent to the target end through the preset sending mode, so that the relevant personnel can know the load pressure of the server to be detected is too large in time, so as to take corresponding measures in time to reduce the load pressure of the server to be detected and ensure the stability of the server.
[0104] S405, if the comprehensive usage of the server to be detected is less than the second preset threshold, a load pressure too small prompt information is generated and output.
[0105] In the embodiment, when the comprehensive usage rate of the to-be-detected server is less than the second preset threshold, it indicates that the resource usage of the to-be-detected server is too small, and the load pressure of the to-be-detected server is too small. Then, a load pressure too small prompt information is generated according to a preset prompt format, and is displayed or is sent to a target end through a preset sending mode, so that relevant personnel can know that the load pressure of the to-be-detected server is too small in time, and thus the relevant resources can be recycled, and resource waste caused by ineffective and reasonable allocation of resources can be avoided.
[0106] Optionally, the load pressure too large prompt information and / or the load pressure too small prompt information comprises one or more of an identifier of the to-be-detected server, resource usage rates of each resource type corresponding to the to-be-detected server, a comprehensive usage rate of the to-be-detected server, and an identifier of a responsible person.
[0107] Further, optionally, the identifier of the to-be-detected server comprises a unique identifier such as a serial number and a name of the server.
[0108] Further, optionally, the preset communication mode comprises a short message, an email and the like. In addition, the load pressure too large prompt information and / or the load pressure too small prompt information can be in a text form or a voice form.
[0109] In the embodiment, when it is determined that the load pressure of the to-be-detected server is too large or too small, an alarm is given, that is, relevant personnel are notified, and the notification frequency, the sending mode (short message, email), the receiving personnel, the silent time period and the like can be customized and configured, so that the relevant personnel can know the load pressure of the to-be-detected server in time, and when the load pressure is too large, corresponding measures (for example, expansion) are taken in time to ensure the stability of the to-be-detected server, or when the load pressure is too small, resources are recycled in time to avoid resource waste.
[0110] Figure 5 A structural schematic diagram of a server detection device provided in the embodiment is shown in FIG. 5. Figure 5 As shown in FIG. 5, the server detection device 500 comprises a data acquisition module 501 and a processing module 502.
[0111] The data acquisition module 501 is configured to acquire monitoring data corresponding to each resource type of a to-be-detected server.
[0112] The processing module 502 is configured to, for each resource type, classify the monitoring data corresponding to the resource type to obtain gear data information corresponding to the resource type, and perform a weight comprehensive calculation on the gear data information corresponding to the resource type to obtain a resource usage rate corresponding to the resource type.
[0113] The processing module 502 is further configured to determine the comprehensive usage rate of the server to be detected according to the resource usage rate corresponding to each resource type.
[0114] Optionally, the gear data information comprises monitoring data and data centroids corresponding to each gear type.
[0115] Optionally, the resource type comprises one or more of a processor usage type, a memory usage type, a disk read-write type, a disk usage type, and a network card traffic in-out type.
[0116] In another embodiment of the present application, on the basis of the above Figure 5 The processing module 502 is further configured to:
[0117] If the comprehensive usage rate of the server to be detected is greater than a first preset threshold, a load pressure is too large prompt information is generated and output.
[0118] If the comprehensive usage rate of the server to be detected is less than a second preset threshold, a load pressure is too small prompt information is generated and output.
[0119] In any embodiment, optionally, the processing module 502 is further configured to:
[0120] The number of all monitoring data corresponding to the resource type is obtained and determined as the total data number corresponding to the resource type.
[0121] For each gear type corresponding to the resource type, the number of monitoring data corresponding to the gear type is counted to obtain the data number corresponding to the gear type, and the weight value corresponding to the gear type is obtained according to the data number corresponding to the gear type and the total data number.
[0122] The resource usage rate corresponding to the resource type is determined according to the weight value corresponding to each gear type and the data centroid corresponding to each gear type.
[0123] Further, optionally, the processing module 502 is further configured to:
[0124] For each gear type corresponding to the resource type, the product of the weight value and the data centroid corresponding to the gear type is obtained and determined as the resource usage rate corresponding to the gear type.
[0125] The resource usage rates corresponding to all gear types corresponding to the resource type are summed to obtain the resource usage rate corresponding to the resource type.
[0126] Further, optionally, the processing module 502 is further configured to:
[0127] The resource usage rates corresponding to each resource type are summed to obtain the comprehensive usage rate of the server to be detected.
[0128] The server detection device provided by the embodiments of the present application can implement the server detection method of the above embodiments, and has similar implementation principles and technical effects, which will not be repeated here.
[0129] Figure 6 The hardware structure schematic diagram of the electronic device provided by the embodiments of the present application is shown in FIG. 6. As shown in FIG. 6, the electronic device 600 of the present embodiment includes a processor 601 and a memory 602. Figure 6
[0130] The memory 602 is configured to store computer execution instructions.
[0131] The processor 601 is configured to execute the computer execution instructions stored in the memory, so as to implement each step performed by the receiving device in the above embodiments. For details, refer to the related description in the foregoing method embodiments.
[0132] Optionally, the memory 602 can be independent or integrated with the processor 601.
[0133] When the memory 602 is independently arranged, the electronic device further includes a bus 603 configured to connect the memory 602 and the processor 601.
[0134] The embodiments of the present application further provide a computer readable storage medium, and the computer readable storage medium stores computer execution instructions. When the processor executes the computer execution instructions, the server detection method is implemented.
[0135] The embodiments of the present application further provide a computer program product, which includes a computer program. When the computer program is executed by the processor, the server detection method is implemented.
[0136] In the several embodiments of the present application, it should be understood that the disclosed device and method can be implemented in other ways. For example, the device embodiments described above are only schematic. The division of the modules is only a logical function division. There can be another division manner in actual implementation, for example, a plurality of modules can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the modules shown or discussed can be indirect coupling or communication connection through some interfaces, devices or modules, and can be electrical, mechanical or other forms.
[0137] The modules described as separate components can or can not be physically separate, and the components shown as modules can or can not be physical units, i.e. they can be located in one place, or can be distributed on a plurality of network units. According to actual needs, some or all of the modules can be selected to achieve the purpose of the present embodiment.
[0138] In addition, each functional module in various embodiments of the present application can be integrated in one processing unit, or each module can be physically present alone, or two or more modules can be integrated in one unit. The above-mentioned modules can be realized in the form of hardware or in the form of hardware and software function modules.
[0139] The integrated modules realized in the form of software function modules can be stored in a computer readable storage medium. The software function modules are stored in a storage medium, and include instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to execute some steps of the method according to various embodiments of the present application.
[0140] It should be understood that the processor can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), etc. The general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of the method disclosed in the present application can be directly embodied as hardware processor execution, or executed by a combination of hardware and software modules in the processor.
[0141] The memory can include a high-speed RAM memory, and can also include a non-volatile storage NVM, for example, at least one disk memory, and can also be a U disk, a mobile hard disk, a read-only memory, a magnetic disk or an optical disk, etc.
[0142] The bus can be an industry standard architecture (ISA) bus, a peripheral component (PCI) bus, or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For the convenience of representation, the bus in the drawings of the present application does not limit to only one bus or one type of bus.
[0143] The aforementioned storage medium can be realized by any type of volatile or nonvolatile storage devices or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk. The storage medium can be any available medium that can be accessed by a general or special purpose computer.
[0144] An exemplary storage medium is coupled to the processor so that the processor can read information from, and write information to, the storage medium. Of course, the storage medium can be a part of the processor. The processor and the storage medium can be located in an application specific integrated circuit (ASIC). The processor and the storage medium can be located in a remote terminal or server and accessed through a network.
[0145] Those of ordinary skill in the art can understand that all or part of the steps of the above-mentioned method embodiments can be completed by relevant hardware instructed by programs. The aforementioned programs can be stored in a computer readable storage medium. When the programs are executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes ROM, RAM, magnetic or optical disk and other various storage media that can store program codes.
[0146] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the above embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the above embodiments, or make equivalent replacements for part or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A server detection method, characterized by, The method comprises the following steps: obtaining monitoring data corresponding to a plurality of resource types corresponding to a to-be-detected server; for each resource type, classifying the monitoring data corresponding to the resource type to obtain gear data information corresponding to the resource type, the gear data information comprising monitoring data and data centroids corresponding to each gear type, and performing weight comprehensive calculation on the gear data information corresponding to the resource type to obtain resource usage rate corresponding to the resource type; determining the comprehensive usage rate of the to-be-detected server according to the resource usage rate corresponding to each resource type; the weight comprehensive calculation on the gear data information corresponding to the resource type to obtain the resource usage rate corresponding to the resource type comprises: obtaining the number of all monitoring data corresponding to the resource type, and determining the number as the total data number corresponding to the resource type; for each gear type corresponding to the resource type, counting the number of monitoring data corresponding to the gear type to obtain the data number corresponding to the gear type, and obtaining the weight value corresponding to the gear type according to the data number corresponding to the gear type and the total data number; for each gear type corresponding to the resource type, obtaining the product of the weight value corresponding to the gear type and the data centroid, and determining the product as the resource usage rate corresponding to the gear type; summing the resource usage rates corresponding to all gear types corresponding to the resource type to obtain the resource usage rate corresponding to the resource type.
2. The method of claim 1, wherein, the determination of the comprehensive usage rate of the to-be-detected server according to the resource usage rate corresponding to each resource type comprises: summing the resource usage rates corresponding to each resource type to obtain the comprehensive usage rate of the to-be-detected server.
3. The method of claim 1, wherein, The method further comprises: if the comprehensive usage rate of the to-be-detected server is greater than a first preset threshold, generating a load pressure too large prompt information and outputting; if the comprehensive usage rate of the to-be-detected server is less than a second preset threshold, generating a load pressure too small prompt information and outputting.
4. The method according to any one of claims 1 to 3, characterized in that, The resource types comprise one or more of processor usage type, memory usage type, disk read-write type, disk usage type, and network card traffic in-out type.
5. A server detection device, characterized by The method comprises the following steps: a data acquisition module is configured to obtain monitoring data corresponding to a plurality of resource types corresponding to a to-be-detected server; a processing module is configured to, for each resource type, classify the monitoring data corresponding to the resource type to obtain gear data information corresponding to the resource type, the gear data information comprising monitoring data and data centroids corresponding to each gear type, and perform weight comprehensive calculation on the gear data information corresponding to the resource type to obtain resource usage rate corresponding to the resource type; the processing module is further configured to determine the comprehensive usage rate of the to-be-detected server according to the resource usage rate corresponding to each resource type; the processing module is specifically configured to obtain the number of all monitoring data corresponding to the resource type, and determine the number as the total data number corresponding to the resource type; For each gear type corresponding to the resource type, a number of monitoring data corresponding to the gear type is counted to obtain a data number corresponding to the gear type, and a weight value corresponding to the gear type is obtained according to the data number corresponding to the gear type and the total data number; For each gear type corresponding to the resource type, a product of the weight value corresponding to the gear type and the data centroid is obtained and determined as a resource usage rate corresponding to the gear type; The resource usage rates corresponding to all gear types corresponding to the resource type are summed to obtain a resource usage rate corresponding to the resource type.
6. An electronic device, comprising: Comprise: At least one processor and a memory; The memory stores computer execution instructions; The at least one processor executes the computer execution instructions stored in the memory, so that the at least one processor executes the server detection method as claimed in any one of claims 1 to 4.
7. A computer readable storage medium characterized by The computer readable storage medium stores computer execution instructions, and when the processor executes the computer execution instructions, the server detection method as claimed in any one of claims 1 to 4 is realized.
8. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to realize the server detection method as claimed in any one of claims 1 to 4.
Citation Information
Patent Citations
Method and apparatus used for assessing resource utilization rate of equipment
CN108280007A
Resource configuration detection method and device, storage medium and electronic equipment
CN109800085A