Resource occupation evaluation method and device for namespace, equipment and storage medium

By detecting the total resource occupancy parameters in each preset period in the namespace resource evaluation, and performing pre-statistics within the specified statistical period, the problem of server downtime caused by too long calculation time in the prior art is solved, and the stability of the server is improved.

CN119645627APending Publication Date: 2025-03-18CHINA POST INFORMATION TECH (BEIJING CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411623804.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-14
Publication Date
2025-03-18

AI Technical Summary

Technical Problem

When evaluating resource in namespaces, the existing technology is prone to calculating large amounts of data in a short period of time, which will cause server downtime and other failures.

Method used

By detecting the total resource occupancy parameters of the target namespace every interval preset period, and performing pre-statistics when the first statistical period and the second statistical period are triggered, the calculation amount and calculation time of subsequent statistics are reduced.

Benefits of technology

It effectively reduces the computing load of the server, improves the stability of the server operation, and avoids downtime caused by too long calculation time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119645627A_ABST
    Figure CN119645627A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a namespace resource occupation evaluation method and device, equipment and a storage medium, and the method comprises the steps: detecting a total resource occupation parameter of at least one target namespace every preset period, and taking the detected total resource occupation parameter as a resource detection parameter of a corresponding detection time point; under the condition that a first statistical period is triggered, performing statistics on resource detection parameters of a plurality of detection time points in the first statistical period to obtain a first resource occupation parameter; wherein the first statistical period is greater than the preset period; under the condition that a second statistical period is triggered, performing statistics on first resource occupation parameters of a plurality of first statistical periods in the second statistical period to obtain a target resource occupation parameter; wherein the second statistical period is greater than the first statistical period. According to the technical scheme provided by the embodiment of the invention, the problems that a large amount of data is easy to calculate in a short time, the calculation time is too long and a server is easy to crash during resource evaluation of the namespace in the prior art are solved, and the resource detection parameters at the detection time point can be counted in advance under the condition that the first statistical period is triggered, so that the resource evaluation efficiency is improved. The calculation amount and calculation time of subsequent statistics are reduced, and the stability of server operation is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the technical field of namespace occupancy resource management, and in particular to a namespace resource occupancy assessment method, apparatus, device and storage medium. Background Art

[0002] Modern enterprise application software is generally deployed in a Kubernetes cluster, using Kubernetes' Namespace to manage the resource quotas that can be used by each project, thereby ensuring that resources between different applications or teams do not interfere with each other. However, after the application is successfully deployed, it is necessary to accurately evaluate the resource usage under a Namespace, so as to provide a reference for setting reasonable quotas for different Namespaces. When conducting a monthly resource evaluation, it is necessary to add up all the detection points in a month to get the total number. There are many monitoring points in a month. Although the values ​​are accurate, it takes a long time for a general server to calculate a large amount of data in a short period of time, which is prone to server downtime and other failures. Summary of the invention

[0003] The embodiments of the present invention provide a method, apparatus, device and storage medium for evaluating resource occupancy of a namespace, which can pre-statistic the resource detection parameters at the detection time point when the first statistical cycle is triggered, thereby reducing the calculation amount and calculation time of subsequent statistics and improving the stability of server operation.

[0004] In a first aspect, an embodiment of the present invention provides a method for evaluating resource occupancy of a namespace, the method comprising:

[0005] At every preset period, the total resource occupancy parameter of at least one target namespace is detected, and the detected total resource occupancy parameter is used as the resource detection parameter of the corresponding detection time point; when the first statistical period is triggered, the resource detection parameters of multiple detection time points within the first statistical period are counted to obtain the first resource occupancy parameter; wherein the first statistical period is greater than the preset period; when the second statistical period is triggered, the first resource occupancy parameters of multiple first statistical periods within the second statistical period are counted to obtain the target resource occupancy parameter; wherein the second statistical period is greater than the first statistical period.

[0006] In a second aspect, an embodiment of the present invention provides a device for evaluating resource occupancy of a namespace, the device comprising:

[0007] A parameter detection module is used to detect the total resource occupancy parameter of at least one target namespace at every preset period, and use the detected total resource occupancy parameter as the resource detection parameter of the corresponding detection time point; a first parameter statistics module is used to count the resource detection parameters of multiple detection time points within the first statistical period when a first statistical period is triggered, so as to obtain a first resource occupancy parameter; wherein the first statistical period is greater than the preset period; a second parameter statistics module is used to count the first resource occupancy parameters of multiple first statistical periods within the second statistical period when a second statistical period is triggered, so as to obtain a target resource occupancy parameter; wherein the second statistical period is greater than the first statistical period.

[0008] In a third aspect, an embodiment of the present invention provides a computer device, the computer device comprising:

[0009] one or more processors;

[0010] A memory for storing one or more programs;

[0011] When the one or more programs are executed by the one or more processors, the one or more processors implement the resource occupancy evaluation method of the namespace described in any embodiment.

[0012] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method for evaluating resource occupancy of a namespace described in any one of the embodiments.

[0013] The technical solution provided by the embodiment of the present invention detects the total resource occupancy parameter of at least one target namespace at each preset period, and uses the detected total resource occupancy parameter as the resource detection parameter of the corresponding detection time point; when the first statistical period is triggered, the resource detection parameters of multiple detection time points in the first statistical period are counted to obtain the first resource occupancy parameter; wherein the first statistical period is greater than the preset period; when the second statistical period is triggered, the first resource occupancy parameters of multiple first statistical periods in the second statistical period are counted to obtain the target resource occupancy parameter; wherein the second statistical period is greater than the first statistical period. The technical solution of the embodiment of the present invention solves the problem that the prior art is prone to calculating a large amount of data in a short time, the calculation time is too long, and the server is prone to crash when performing resource evaluation of the namespace. When the first statistical period is triggered, the resource detection parameters of the detection time point can be pre-counted, the calculation amount and calculation time of subsequent statistics can be reduced, and the stability of server operation can be improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] Figure 1 It is a flow chart of a method for evaluating resource occupancy of a namespace provided by an embodiment of the present invention;

[0015] Figure 2 It is a flow chart of another method for evaluating resource occupancy of a namespace provided by an embodiment of the present invention;

[0016] Figure 3 It is a structural schematic diagram of a device for evaluating resource occupancy of a namespace provided by an embodiment of the present invention;

[0017] Figure 4 It is a structural schematic diagram of a computer device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0018] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0019] Figure 1 It is a flow chart of a method for evaluating resource occupancy of a namespace provided by an embodiment of the present invention. The embodiment of the present invention can be applied to a scenario in which statistics are collected on resource occupancy parameters of a namespace. The method can be executed by a device for evaluating resource occupancy of a namespace, and the device can be implemented by software and / or hardware.

[0020] like Figure 1 As shown, the resource occupancy evaluation method of a namespace includes the following steps:

[0021] S110 , detecting a total resource occupancy parameter of at least one target namespace at every preset period, and using the detected total resource occupancy parameter as a resource detection parameter at a corresponding detection time point.

[0022] Among them, the preset period can be a preset period for evaluating the resource occupancy level of the namespace. The target namespace can be a namespace (Namespace) that needs to be evaluated for resource occupancy level. Specifically, the target namespace can also be specified manually. The total resource occupancy parameter can be a parameter representing the total resource occupancy level of multiple target namespaces. Specifically, the resource occupancy parameter of each target namespace can be detected separately, and then the resource occupancy parameters corresponding to the multiple target namespaces are added together to obtain the total resource occupancy parameter.

[0023] The detection time point may be a time point for detecting the resource occupancy level of the target namespace. Specifically, the time point at each preset period may be used as the detection time point. For example, if the preset period is one minute, a detection time point may be set at one-minute intervals. The resource detection parameter may be a resource occupancy detection result corresponding to the detection time point. Specifically, the total resource occupancy parameter obtained at the detection time point may be used as the resource detection parameter at that time point.

[0024] S120: When a first statistical period is triggered, statistics are collected on resource detection parameters at multiple detection time points within the first statistical period to obtain a first resource occupancy parameter.

[0025] The first statistical period may be a preset period for counting resource occupancy at multiple detection time points. Specifically, if the time point from the last time the first resource occupancy parameter was determined is not less than the first statistical period, the step of determining the first resource occupancy parameter for the next time may be started. The first statistical period is greater than the preset period. For example, if the preset period is one minute, the first statistical period may be one day, and the first resource occupancy parameter is determined once every one day.

[0026] Further, the first resource occupancy parameter may be a statistical parameter of the resource occupancy degree of the namespace in the first statistical period. Exemplarily, a statistical analysis may be performed on the resource detection parameters at multiple detection time points in the first statistical period, and a parameter such as a median or an average of the resource detection parameters at multiple detection time points may be obtained as the first resource occupancy parameter.

[0027] S130: When the second statistical period is triggered, statistics are collected on first resource occupancy parameters of multiple first statistical periods within the second statistical period to obtain a target resource occupancy parameter.

[0028] The second statistical period may be a preset period for counting the resource occupancy of the namespace. The second statistical period is greater than the first statistical period. For example, if the first statistical period may be one day, the second statistical period may be one month, and the target resource occupancy parameter may be determined once every one month.

[0029] Furthermore, the target resource occupancy parameter may be a statistical result of the resource occupancy degree of the target namespace based on the second statistical period. Similarly, a statistical analysis may be performed on the first resource occupancy parameters of multiple first statistical periods within the second statistical period to obtain parameters such as the median or average of the multiple first resource occupancy parameters as the target resource occupancy parameter.

[0030] The technical solution provided by the embodiment of the present invention detects the total resource occupancy parameter of at least one target namespace at each preset period, and uses the detected total resource occupancy parameter as the resource detection parameter of the corresponding detection time point; when the first statistical period is triggered, the resource detection parameters of multiple detection time points in the first statistical period are counted to obtain the first resource occupancy parameter; wherein the first statistical period is greater than the preset period; when the second statistical period is triggered, the first resource occupancy parameters of multiple first statistical periods in the second statistical period are counted to obtain the target resource occupancy parameter; wherein the second statistical period is greater than the first statistical period. The technical solution of the embodiment of the present invention solves the problem that the prior art is prone to calculating a large amount of data in a short time, the calculation time is too long, and the server is prone to crash when performing resource evaluation of the namespace. When the first statistical period is triggered, the resource detection parameters of the detection time point can be pre-counted, the calculation amount and calculation time of subsequent statistics can be reduced, and the stability of server operation can be improved.

[0031] Figure 2 It is a flow chart of another method for evaluating resource occupancy of a namespace provided by an embodiment of the present invention. The embodiment of the present invention can be applied to the scenario of performing statistics on resource occupancy parameters of a namespace. Based on the above embodiment, this embodiment further explains how to detect the total resource occupancy parameters of at least one target namespace; how to perform statistics on resource detection parameters at multiple detection time points within the first statistical period to obtain first resource occupancy parameters; and how to perform statistics on first resource occupancy parameters of multiple first statistical periods within the second statistical period to obtain target resource occupancy parameters. The device can be implemented by software and / or hardware and integrated in a computer device with application development function.

[0032] like Figure 2 As shown, the resource occupancy evaluation method of a namespace includes the following steps:

[0033] S210 . At preset intervals, for each target namespace, obtain the resource occupancy sub-parameter of each instance in the target namespace based on a preset step corresponding to the preset time.

[0034] The preset period may be a preset period for evaluating the resource occupancy of the namespace. The target namespace may be a namespace for which resource occupancy evaluation is required. Specifically, the target namespace may also be manually specified. There are often multiple instances (pods) in the target namespace. By analyzing the resource occupancy of multiple instances in the target namespace, the resource occupancy of the target namespace may be obtained.

[0035] The preset step size can be understood as the preset detection step size for instances in the target namespace. The preset step size can be determined based on the preset period and the monitoring period of the resource occupancy sub-parameter. For example, when the monitoring period of the resource occupancy sub-parameter is 1s and the preset period is 5s, the preset step size corresponding to the preset time can be determined to be 5. For example, a Namespace has m pods, and the monitoring data under a Pod is Xi, then the resource occupancy parameter of the Namespace is The preset step length corresponding to the preset period is n, and the resource occupancy parameter under the Namespace can be obtained at every preset period as O. 1+n .

[0036] The resource occupancy sub-parameter may be a parameter indicating the degree of resource occupancy of the instance. The resource occupancy sub-parameter includes at least: a CPU occupancy parameter and a memory occupancy parameter. The CPU occupancy parameter may be a parameter indicating the degree of occupancy of CPU resources by the instance. The memory occupancy parameter may be a parameter indicating the degree of occupancy of memory resources by the instance.

[0037] S220: Determine a resource occupancy parameter corresponding to the target namespace according to resource occupancy sub-parameters of all instances in the target namespace.

[0038] The resource occupancy parameter may be a parameter indicating the resource occupancy degree of the target namespace. Specifically, the resource occupancy sub-parameters of all instances in the target namespace may be summed to obtain the resource occupancy parameter corresponding to the target namespace.

[0039] S230: sum the resource occupancy parameters corresponding to the multiple target namespaces to obtain the total resource occupancy parameter, and use the total resource occupancy parameter obtained by detection as the resource detection parameter at the corresponding detection time point.

[0040] Among them, the total resource occupancy parameter may be a parameter indicating the total resource occupancy degree of multiple target namespaces. Specifically, the resource occupancy parameters corresponding to multiple target namespaces may be added together to obtain the total resource occupancy parameter. The detection time point may be a time point for detecting the resource occupancy degree of the target namespace. Specifically, the time point at each preset period interval may be used as the detection time point. For example, if the preset period is one minute, a detection time point may be set at one-minute intervals. The resource detection parameter may be the resource occupancy detection result corresponding to the detection time point. Specifically, the total resource occupancy parameter obtained at the detection time point may be used as the resource detection parameter at that time point.

[0041] Optionally, when it is detected that an instance is deleted and / or created in any target namespace, the total resource occupancy parameters of multiple target namespaces can be re-detected, and the total resource occupancy parameters obtained by the re-detection can also be used as the resource detection parameters at the corresponding detection time point. For example, when a Pod is created or deleted, the detection process of the resource detection parameters is immediately triggered, and the expression of the total resource occupancy parameters recalculated is Then recalculate the resource detection parameter Oq+n according to the set step size n.

[0042] Among them, the above step of determining resource detection parameters can be re-triggered when an instance is deleted or created, and the resource detection parameters can be updated in time when the instance in the target namespace is changed, thereby improving the accuracy of determining resource detection parameters.

[0043] S240. When the first statistical period is triggered, the resource detection parameters of multiple detection time points in the first statistical period are summed to obtain a total resource detection parameter, and the total resource detection parameter is divided by the number of detection time points in the statistical period to obtain the first resource occupancy parameter.

[0044] The first statistical period may be a preset period for counting resource occupancy at multiple detection time points. Specifically, if the time point from the last time the first resource occupancy parameter was determined is not less than the first statistical period, the step of determining the first resource occupancy parameter for the next time may be started. Furthermore, the first statistical period is greater than the preset period. For example, if the preset period is one minute, the first statistical period may be one day, and the first resource occupancy parameter is determined once every one day.

[0045] For example, if resource detection parameters of k detection time points are obtained in one day, the first resource occupancy parameter corresponding to that day is:

[0046] The total resource detection parameter may be the sum of the resource detection parameters in the first statistical period. Specifically, the resource detection parameters of multiple detection time points in the first statistical period are summed to obtain the total resource detection parameter. The first resource occupancy parameter may be a statistical parameter of the resource occupancy degree of the namespace in the first statistical period. Specifically, the total resource detection parameter may be divided by the number of detection time points in a statistical period to obtain the first resource occupancy parameter.

[0047] S250: When the second statistical period is triggered, obtain an average of the first resource occupancy parameters of multiple first statistical periods within the second statistical period, and use the obtained average as the target resource occupancy parameter.

[0048] The second statistical period may be a preset period for counting the resource occupancy of the namespace. The second statistical period is greater than the first statistical period. For example, if the first statistical period may be one day, the second statistical period may be one month, and the target resource occupancy parameter may be determined once every one month.

[0049] Furthermore, the target resource occupancy parameter may be a statistical result of the resource occupancy degree of the target namespace based on the second statistical period. Specifically, the average value of the first resource occupancy parameters of multiple first statistical periods within the second statistical period may be obtained, and the obtained average value is used as the target resource occupancy parameter.

[0050] Exemplarily, if the second statistical period is t days, the target resource occupancy parameter corresponding to the second statistical period is: This solution solves the problem of inaccurate evaluation of CPU or memory resource usage under Namespace, thus providing a reference for setting the CPU and memory quota of Namespace reasonably. When the Pod of Namespace changes, the resource usage can be recalculated according to the change, which solves the problem of inaccurate calculation of resource usage under Namespace after the Pod changes. At the same time, it solves the problem of excessive memory usage, long calculation time or inaccurate data due to sampling problems in general.

[0051] Optionally, after statistics are collected on the first resource occupancy parameters of multiple first statistical periods within the second statistical period to obtain the target resource occupancy parameters, parameter change trend information can be determined based on the first resource occupancy parameters of multiple first statistical periods, and the parameter change trend information can be sent to a preset interactive interface.

[0052] Among them, the parameter change trend information may be information indicating the change trend of multiple first resource occupancy parameters within the second statistical period. Exemplarily, the parameter change trend information may be determined by performing regression analysis on the first resource occupancy parameters of multiple first statistical periods within the second statistical period, or by obtaining a slope or the like. The preset interactive interface may be a preset interaction for managing occupied resource information. By sending the parameter change trend information to the preset interactive interface, the user can timely perceive the changes in the resource occupancy parameters of the target namespace, so that the user can make adaptive adjustments in a timely manner based on the parameter change trend information, thereby improving the security of the system.

[0053] The technical solution provided by the embodiment of the present invention is to obtain the resource occupancy sub-parameters of each instance in the target namespace based on the preset step size corresponding to the preset time for each target namespace at each preset interval; determine the resource occupancy parameter corresponding to the target namespace according to the resource occupancy sub-parameters of all instances in the target namespace; sum the resource occupancy parameters corresponding to multiple target namespaces to obtain the total resource occupancy parameter, and use the total resource occupancy parameter obtained by detection as the resource detection parameter of the corresponding detection time point; when the first statistical period is triggered, sum the resource detection parameters of multiple detection time points in the first statistical period to obtain the total resource detection parameter, and divide the total resource detection parameter by the number of detection time points in the one statistical period to obtain the first resource occupancy parameter; when the second statistical period is triggered, obtain the average of the first resource occupancy parameters of multiple first statistical periods in the second statistical period, and use the obtained average as the target resource occupancy parameter. The technical solution of the embodiment of the present invention solves the problem that in the prior art, when performing resource evaluation of a namespace, a large amount of data is easily calculated in a short period of time, the calculation time is too long, and the server is prone to crash. When the first statistical cycle is triggered, the resource detection parameters at the detection time point can be pre-statisticed to reduce the calculation amount and calculation time of subsequent statistics, thereby improving the stability of server operation.

[0054] Figure 3 It is a structural diagram of a namespace resource occupancy assessment device provided in an embodiment of the present invention. The embodiment of the present invention can be applied to the scenario of performing statistics on the resource occupancy parameters of the namespace. The device can be implemented by software and / or hardware and integrated into a computer device with application development function.

[0055] like Figure 3 As shown, the resource occupancy assessment device of a namespace includes: a parameter detection module 310 , a first parameter statistics module 320 and a second parameter statistics module 330 .

[0056] Among them, the parameter detection module 310 is used to detect the total resource occupancy parameter of at least one target namespace at every preset period, and use the detected total resource occupancy parameter as the resource detection parameter of the corresponding detection time point; the first parameter statistics module 320 is used to count the resource detection parameters of multiple detection time points within the first statistical period when the first statistical period is triggered, so as to obtain the first resource occupancy parameter; wherein the first statistical period is greater than the preset period; the second parameter statistics module 330 is used to count the first resource occupancy parameters of multiple first statistical periods within the second statistical period when the second statistical period is triggered, so as to obtain the target resource occupancy parameter; wherein the second statistical period is greater than the first statistical period.

[0057] The technical solution provided by the embodiment of the present invention detects the total resource occupancy parameter of at least one target namespace at each preset period, and uses the detected total resource occupancy parameter as the resource detection parameter of the corresponding detection time point; when the first statistical period is triggered, the resource detection parameters of multiple detection time points in the first statistical period are counted to obtain the first resource occupancy parameter; wherein the first statistical period is greater than the preset period; when the second statistical period is triggered, the first resource occupancy parameters of multiple first statistical periods in the second statistical period are counted to obtain the target resource occupancy parameter; wherein the second statistical period is greater than the first statistical period. The technical solution of the embodiment of the present invention solves the problem that the prior art is prone to calculating a large amount of data in a short time, the calculation time is too long, and the server is prone to crash when performing resource evaluation of the namespace. When the first statistical period is triggered, the resource detection parameters of the detection time point can be pre-counted, the calculation amount and calculation time of subsequent statistics can be reduced, and the stability of server operation can be improved.

[0058] In an optional implementation, the parameter detection module 310 includes: a total resource occupancy parameter determination unit, used to: for each target namespace, obtain the resource occupancy sub-parameters of each instance in the target namespace based on the preset step corresponding to the preset time; determine the resource occupancy parameter corresponding to the target namespace according to the resource occupancy sub-parameters of all instances in the target namespace; and sum the resource occupancy parameters corresponding to multiple target namespaces to obtain the total resource occupancy parameter.

[0059] In an optional implementation, the first parameter statistics module 320 includes: a first resource occupancy parameter determination unit, used to: sum the resource detection parameters of multiple detection time points within the first statistical period to obtain a total resource detection parameter; divide the total resource detection parameter by the number of detection time points within the statistical period to obtain the first resource occupancy parameter.

[0060] In an optional implementation, the second parameter statistics module 330 includes: a first resource occupancy parameter determination unit, used to: obtain an average of the first resource occupancy parameters of multiple first statistical periods within the second statistical period, and use the obtained average as the target resource occupancy parameter.

[0061] In an optional embodiment, the resource occupancy assessment device of the namespace also includes: an instance status detection module, which is used to: when it is detected that instance deletion and / or instance creation exists in any target namespace, re-detect the total resource occupancy parameters of multiple target namespaces, and use the total resource occupancy parameters obtained by re-detection as resource detection parameters at the corresponding detection time point.

[0062] In an optional implementation, the resource occupancy assessment device of the namespace further includes: a resource occupancy parameter analysis module, used to: determine parameter change trend information based on the first resource occupancy parameters of multiple first statistical periods, and send the parameter change trend information to a preset interactive interface.

[0063] In an optional implementation, the resource occupancy sub-parameters include at least: a CPU occupancy parameter and a memory occupancy parameter.

[0064] The device for evaluating the resource occupancy of a namespace provided in the embodiment of the present invention can execute the method for evaluating the resource occupancy of a namespace provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0065] Figure 4 A schematic diagram of the structure of a computer device provided in an embodiment of the present invention. Figure 4 A block diagram of an exemplary computer device 12 suitable for use in implementing embodiments of the present invention is shown. Figure 4 The computer device 12 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention. The computer device 12 can be any terminal device with computing capability and can be configured in the resource occupancy evaluation device of the namespace.

[0066] like Figure 4 As shown, the computer device 12 is in the form of a general-purpose computing device. The components of the computer device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that connects various system components (including the system memory 28 and the processing unit 16).

[0067] The bus 18 may be one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. For example, these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.

[0068] The computer device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the computer device 12, including volatile and non-volatile media, removable and non-removable media.

[0069] The system memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache 32. The computer device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be used to read and write non-removable, non-volatile magnetic media ( Figure 4 not shown, usually called a "hard drive"). Although Figure 4 Not shown in the figure, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The system memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present invention.

[0070] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. Program modules 42 generally perform the functions and / or methods of the embodiments described herein.

[0071] The computer device 12 may also communicate with one or more external devices 14 (e.g., keyboards, pointing devices, displays 24, etc.), one or more devices that enable a user to interact with the computer device 12, and / or any device that enables the computer device 12 to communicate with one or more other computing devices (e.g., network cards, modems, etc.). Such communication may be performed through an input / output (I / O) interface 22. Furthermore, the computer device 12 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) through a network adapter 20. Figure 4 As shown, the network adapter 20 communicates with other modules of the computer device 12 via the bus 18. It should be understood that although Figure 4 Not shown, other hardware and / or software modules may be used in conjunction with computer device 12, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0072] The processing unit 16 executes various functional applications and data processing by running the program stored in the system memory 28, for example, implementing the resource occupancy evaluation method of the namespace provided in the embodiment of the present invention, the method comprising:

[0073] At every preset period, the total resource occupancy parameter of at least one target namespace is detected, and the detected total resource occupancy parameter is used as the resource detection parameter of the corresponding detection time point; when the first statistical period is triggered, the resource detection parameters of multiple detection time points within the first statistical period are counted to obtain the first resource occupancy parameter; wherein the first statistical period is greater than the preset period; when the second statistical period is triggered, the first resource occupancy parameters of multiple first statistical periods within the second statistical period are counted to obtain the target resource occupancy parameter; wherein the second statistical period is greater than the first statistical period.

[0074] This embodiment provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, the method for evaluating resource occupancy of a namespace provided in any embodiment of the present invention is implemented, including:

[0075] At every preset period, the total resource occupancy parameter of at least one target namespace is detected, and the detected total resource occupancy parameter is used as the resource detection parameter of the corresponding detection time point; when the first statistical period is triggered, the resource detection parameters of multiple detection time points within the first statistical period are counted to obtain the first resource occupancy parameter; wherein the first statistical period is greater than the preset period; when the second statistical period is triggered, the first resource occupancy parameters of multiple first statistical periods within the second statistical period are counted to obtain the target resource occupancy parameter; wherein the second statistical period is greater than the first statistical period.

[0076] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to: an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.

[0077] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0078] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0079] Computer program code for performing the operations of the present invention may be written in one or more programming languages ​​or combinations thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0080] It should be understood by those skilled in the art that the modules or steps of the present invention described above can be implemented by a general-purpose computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, optionally, they can be implemented by a program code executable by a computer device, so that they can be stored in a storage device and executed by the computing device, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.

[0081] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims

1. A method for evaluating resource occupancy of a namespace, characterized in that: include: At each preset period, the total resource occupancy parameter of at least one target namespace is detected, and the detected total resource occupancy parameter is used as the resource detection parameter at the corresponding detection time point; When a first statistical period is triggered, statistics are collected on resource detection parameters at multiple detection time points within the first statistical period to obtain a first resource occupancy parameter; wherein the first statistical period is greater than the preset period; When the second statistical period is triggered, statistics are collected on the first resource occupancy parameters of multiple first statistical periods within the second statistical period to obtain a target resource occupancy parameter; wherein the second statistical period is greater than the first statistical period.

2. The method according to claim 1, characterized in that: The detecting of the total resource occupancy parameter of at least one target namespace includes: For each target namespace, obtaining the resource occupancy sub-parameter of each instance in the target namespace based on the preset step corresponding to the preset time; Determining a resource occupancy parameter corresponding to the target namespace according to the resource occupancy sub-parameters of all instances in the target namespace; The resource occupancy parameters corresponding to the multiple target namespaces are summed to obtain the total resource occupancy parameter.

3. The method according to claim 1, characterized in that The step of collecting statistics on the resource detection parameters at multiple detection time points within the first statistical period to obtain a first resource occupancy parameter includes: Summing the resource detection parameters at multiple detection time points in the first statistical period to obtain a total resource detection parameter; The total resource detection parameter is divided by the number of detection time points in the statistical period to obtain the first resource occupancy parameter.

4. The method according to claim 1, characterized in that: The obtaining the target resource occupancy parameter by counting the first resource occupancy parameters of the plurality of first statistical periods within the second statistical period includes: An average value of the first resource occupancy parameters of multiple first statistical periods within the second statistical period is calculated, and the obtained average value is used as the target resource occupancy parameter.

5. The method according to claim 1, characterized in that The method further comprises: When instance deletion and / or instance creation is detected in any target namespace, the total resource occupancy parameters of multiple target namespaces are re-detected, and the re-detected total resource occupancy parameters are also used as resource detection parameters at the corresponding detection time point.

6. The method according to claim 1, characterized in that After the first resource occupancy parameters of multiple first statistical periods within the second statistical period are counted to obtain the target resource occupancy parameter, the method further includes: Based on the first resource occupancy parameters of the multiple first statistical periods, parameter change trend information is determined, and the parameter change trend information is sent to a preset interactive interface.

7. The method according to claim 2, characterized in that The resource occupancy sub-parameters include at least: a CPU occupancy parameter and a memory occupancy parameter.

8. A device for evaluating resource occupancy of a namespace, characterized in that: The device comprises: A parameter detection module, used to detect the total resource occupancy parameter of at least one target namespace at every preset period, and use the detected total resource occupancy parameter as the resource detection parameter at the corresponding detection time point; A first parameter statistics module is used to, when a first statistical period is triggered, perform statistics on resource detection parameters at multiple detection time points within the first statistical period to obtain a first resource occupancy parameter; wherein the first statistical period is greater than the preset period; The second parameter statistics module is used to, when a second statistical period is triggered, perform statistics on the first resource occupancy parameters of multiple first statistical periods within the second statistical period to obtain a target resource occupancy parameter; wherein the second statistical period is greater than the first statistical period.

9. A computer device, characterized in that: The computer device comprises: one or more processors; A memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the resource occupancy evaluation method for a namespace as described in any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method for evaluating the resource occupancy of a namespace as described in any one of claims 1 to 7 is implemented.