Resource Management Method, Apparatus, Device, Medium and Program Product
By analyzing historical consumption data to predict service duration, the resource management method reduces communication overhead and improves system stability and efficiency in all-flash storage systems.
Patent Information
- Application Number
- CN202510224360.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-27
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2045-02-27
AI Technical Summary
In an all-flash system, due to the large number of nodes in the service cluster, frequent interactions between nodes and load balancers are required to achieve dynamic allocation of resources, resulting in increased consumption of communication resources and affecting the overall performance of the system.
By obtaining historical resource consumption data of composite nodes in the server cluster, analyzing consumption changes, determining the sustainable service duration of the service nodes, and allocating resources based on this to reduce the interaction frequency between the control side and the service side.
Reduces real-time dependence on the control side, reduces service interruptions caused by space depletion, and improves resource allocation efficiency and system stability.
Smart Images

Figure CN119718684B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of cloud computing, and particularly to a resource management method, apparatus, device, medium and program product. Background Art
[0002] In a full-flash system, resources are usually pre-allocated to each node in a service cluster. To ensure load balancing among nodes when processing services, the system usually uses a load balancer to dynamically adjust resource allocation. The load balancer monitors the load status of each node in real time. If a certain node has a high load, tasks will be assigned to nodes with lower loads to achieve reasonable utilization of system resources.
[0003] In the process of implementing the inventive concept, the inventors found that at least the following problems exist in the related art. Since there are a large number of nodes in the service cluster, frequent interactions are required between the nodes and the load balancer to achieve dynamic resource allocation. Such frequent interactions will significantly increase the consumption of communication resources, thereby affecting the overall performance of the system. Summary of the Invention
[0004] In view of the above problems, the present invention provides a resource management method, apparatus, device, medium and program product.
[0005] According to a first aspect of the present invention, there is provided a resource management method, including: obtaining historical resource consumption data of each of a plurality of service nodes including composite nodes in a server cluster, where the composite node is a service node integrated with a resource management function; for each of the service nodes, determining a service duration during which the service node can continuously provide services when the service node maintains a consumption speed matching the consumption change rule with the current available resource amount based on the consumption change rule obtained by analyzing the historical resource consumption data of the service node; and according to the service durations of the plurality of service nodes, using the resource management function to allocate resources to a first target node determined from the plurality of service nodes.
[0006] The second aspect of the present invention provides a resource management device, including: a data acquisition module, configured to acquire the historical resource consumption data of each of multiple service nodes including composite nodes in a server cluster, where the composite node is a service node integrated with a resource management function; a duration determination module, configured to, for each of the service nodes, determine the service duration that the service node can continuously provide services when maintaining a consumption speed matching the consumption change rule with the current available resource amount based on the consumption change rule obtained by analyzing the historical resource consumption data of the service node; a resource allocation module, configured to allocate resources to a first target node determined from the multiple service nodes by using the resource management function according to the service durations of the multiple service nodes.
[0007] The third aspect of the present invention provides an electronic device, including: one or more processors; a memory, configured to store one or more computer programs, where the one or more processors execute the one or more computer programs to implement the steps of the above method.
[0008] The fourth aspect of the present invention further provides a computer-readable storage medium, on which a computer program or instruction is stored, and when the computer program or instruction is executed by a processor, the steps of the above method are implemented.
[0009] The fifth aspect of the present invention further provides a computer program product, including a computer program or instruction, and when the computer program or instruction is executed by a processor, the steps of the above method are implemented.
[0010] According to the embodiments of the present invention, resource allocation is performed through the resource management function of the composite node, realizing the separation of the control side and the service side. During the allocation process, the sustainable service duration of the service node is predicted according to the consumption change rule of the service node. Since the consumption change rule is determined based on the historical resource consumption data dynamically generated by the service node during business operation, the service side and the control side can understand the resource status without frequent interaction. Resource allocation is performed according to the determined service duration. This method not only reduces service interruption caused by space exhaustion, but also reduces the real-time dependence on the control side because resource allocation depends on local historical resource consumption data, significantly reducing the interaction frequency between the control side and the service side, thereby improving the resource allocation efficiency and system stability. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] Through the following description of the embodiments of the present invention with reference to the drawings, the above content and other objects, features, and advantages of the present invention will become clearer.
[0012] Figure 1 The application scenario diagram of the resource management method, device, equipment, medium, and program product according to the embodiments of the present invention is shown.
[0013] Figure 2 Shows a flowchart of a resource management method according to an embodiment of the present invention.
[0014] Figure 3 Shows a flowchart of the operation of a service node in a resource management method according to an embodiment of the present invention.
[0015] Figure 4 Shows a schematic diagram of the working principle of a resource management method according to an embodiment of the present invention.
[0016] Figure 5 Shows a schematic diagram of the trend of the consumption change law in a resource management method according to an embodiment of the present invention.
[0017] Figure 6 Shows a schematic diagram of the data synchronization process in a resource management method according to an embodiment of the present invention.
[0018] Figure 7 Shows a structural block diagram of a resource management device according to an embodiment of the present invention.
[0019] Figure 8 Shows a block diagram of an electronic device suitable for implementing a resource management method according to an embodiment of the present invention. Detailed implementation manners
[0020] Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are merely exemplary and are not intended to limit the scope of the present invention. In the following detailed description, for the sake of explanation, many specific details are set forth in order to provide a comprehensive understanding of the embodiments of the present invention. However, it is obvious that one or more embodiments can be implemented without these specific details. In addition, in the following description, descriptions of well-known structures and technologies are omitted to avoid unnecessarily obscuring the concepts of the present invention.
[0021] The terms used herein are merely for describing specific embodiments and are not intended to limit the present invention. The terms "including", "comprising", etc. used herein indicate the presence of the described features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.
[0022] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.
[0023] In the case of using expressions such as "at least one of A, B, and C", generally, it should be interpreted according to the meaning that those skilled in the art usually understand this expression (for example, "a system having at least one of A, B, and C" should include but not be limited to a system having only A, only B, only C, having A and B, having A and C, having B and C, and / or having A, B, and C, etc.).
[0024] In the technical solution of the present invention, the user information involved (including but not limited to user personal information, user image information, user device information, such as location information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) are all information and data that have been authorized by the user or fully authorized by all parties. Moreover, the processing of relevant data, such as collection, storage, use, processing, transmission, provision, disclosure, and application, all comply with relevant laws, regulations, and standards, adopt necessary confidentiality measures, do not violate public order and good customs, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0025] An embodiment of the present invention provides a resource management method, which includes: obtaining the historical resource consumption data of each of multiple service nodes including composite nodes in a server cluster, where the composite node is a service node integrated with a resource management function; for each service node, based on the consumption change rule obtained by analyzing the historical resource consumption data of the service node, determining the service duration that the service node can continuously provide services when the service node maintains a consumption speed matching the consumption change rule with the current available resource amount; and according to the service durations of each of the multiple service nodes, using the resource management function to allocate resources to a first target node determined from the multiple service nodes.
[0026] Figure 1 A scenario diagram of the application of a resource management method, device, equipment, medium, and program product according to an embodiment of the present invention is shown.
[0027] As Figure 1 shown, the application scenario 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 is a medium for providing a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, etc.
[0028] Users can use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 via the network 104 to receive or send messages, etc. Various communication client applications can be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (for example only).
[0029] The first terminal device 101, the second terminal device 102, and the third terminal device 103 can be various electronic devices with a display screen and supporting web browsing, including but not limited to smartphones, tablets, laptop computers, desktop computers, and so on.
[0030] The server 105 can be a server that provides various services, such as a background management server that supports the websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103 (for example only). The background management server can analyze and process data such as user requests received, and feedback the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal device.
[0031] It should be noted that the resource management method provided by the embodiments of the present invention can generally be executed by the server 105. Correspondingly, the resource management device provided by the embodiments of the present invention can generally be set in the server 105. The resource management method provided by the embodiments of the present invention can also be executed by a server or a server cluster different from the server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or the server 105. Correspondingly, the resource management device provided by the embodiments of the present invention can also be set in a server or a server cluster different from the server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or the server 105.
[0032] It should be understood that Figure 1 the numbers of terminal devices, networks, and servers in
[0033] are merely illustrative. According to the implementation requirements, there can be any number of terminal devices, networks, and servers. Figure 1 the following will be based on Figures 2 to 6 the described scenario, and will describe the resource management method of the embodiment in detail through
[0034] Figure 2 shows a flowchart of the resource management method according to an embodiment of the present invention.
[0035] As shown in Figure 2As shown, this embodiment includes operations S210 to S230.
[0036] In operation S210, historical resource consumption data of each of multiple service nodes including composite nodes in a server cluster is obtained, where a composite node is a service node integrated with a resource management function.
[0037] In operation S220, for each service node, based on the consumption change pattern obtained by analyzing the historical resource consumption data of the service node, when the service node maintains a consumption speed matching the consumption change pattern with the current available resource amount, the service duration for which the service node can continuously provide services is determined.
[0038] In operation S230, according to the service durations of the multiple service nodes, using the resource management function, resource allocation is performed on a first target node determined from the multiple service nodes.
[0039] According to an embodiment of the present invention, in an all-flash system, a distributed architecture is the core design to support its high performance and scalability. This architecture realizes load balancing and high availability by dispersing data storage across multiple service nodes. These service nodes are usually organized in the form of a server cluster, and each service node in the cluster independently processes data requests and executes computing tasks.
[0040] According to an embodiment of the present invention, each service node mainly includes two modules, namely a space allocation unit and a space recycling unit (whose working logic is as Figure 3 shown). Among them, the space allocation unit is responsible for managing and allocating the space in the service node to ensure that when performing a write-down operation, resources can be timely allocated to undertake the data writing requirements. During the operation of the service node, usually the space of the service node is managed in data block granularity (the data block size is defined according to the actual system implementation). Therefore, the space allocation unit can realize the management and allocation of data blocks, and at the same time will track and record the usage of data blocks to ensure that data blocks will not be reused.
[0041] According to an embodiment of the present invention, the space recycling unit is responsible for completing the recycling work of the used data blocks, which is generally realized through a garbage collection mechanism in the all-flash system, mainly to recycle the data blocks with little valid data that have been allocated for the space allocation unit to continue using.
[0042] Specifically, as Figure 3 shown, the working process of the service node in this embodiment includes operations S310 to S370.
[0043] In operation S310, load data is received. In operation S320, the load data is aggregated and flushed. In operation S330, the processed data is written to a data block. In operation S340, it is confirmed that the data has completed the disk writing operation. In operation S350, the used data blocks are recycled. In operation S360, the recycled data blocks are released. In operation S370, the released data blocks are reallocated for subsequent use.
[0044] According to an embodiment of the present invention, by systematically receiving, processing, writing, confirming, recycling, releasing, and reallocating data blocks for load data, the automation of data processing and resource management is achieved. At the same time, the recycling of resources is promoted, effectively improving the operation efficiency and the utilization rate of storage resources.
[0045] According to an embodiment of the present invention, among the multiple service nodes of the server cluster, there is also a composite node for resource management. The composite node can perform business processing with all other service nodes. Among them, the composite node is arbitrated and selected from multiple service nodes according to a preset rule. The composite node can monitor the load changes and resource consumption of each service node in the server cluster, and dynamically allocate resources for multiple service nodes including itself based on this information to meet the requirements of system operation.
[0046] According to an embodiment of the present invention, as Figure 4 shown, in the actual system design, the server where the composite node is located includes four main modules, namely a capacity monitoring unit 410, a trend prediction unit 420, a space scheduling unit 430, and a space management unit 440. Among them, the capacity monitoring unit 410 is mainly responsible for monitoring the capacity of each service node in the server cluster, providing reference data for subsequent resource allocation. The trend prediction unit 420 is mainly responsible for analyzing whether the capacity of each service node meets the business operation requirements and whether resource allocation is needed. It is the core module of the entire load balancing and scheduling. The space scheduling unit 430 is used to execute the resource allocation task to each service node and belongs to the task execution unit. When data block migration is required, it docks with the corresponding service node to complete the transfer of resources. The space management unit 440 is mainly responsible for storing records and is used to track and record the ownership relationship of resources. The composite node realizes the resource management function based on the above four modules, thereby allocating resources to each service node.
[0047] According to an embodiment of the present invention, as Figure 4As shown, the composite node obtains the historical resource consumption data of each service node in the server cluster. During the obtaining process, data is usually collected by means of periodic sampling. Specifically, at least three time points of records need to be retained in the historical resource consumption data. The obtained historical resource consumption data includes records of multiple monitoring metric items in the service node. Among them, the multiple monitoring metric items respectively include the total capacity of the service node, the current available resource amount, and the resource release rate, etc. It should be noted that these are the basic metrics that need to be monitored. If more refined regulation is required, more metrics can also be monitored, such as the usage rate of the processor, etc.
[0048] According to an embodiment of the present invention, the historical resource consumption data of the service node is generated based on the actual operations of internal resource allocation and release in the service node. As Figure 4 shown, the space allocation unit 450 and the space recycling unit 460 in the service node work together through an internal loop mechanism. When the service node completes a task and releases storage space, the space recycling unit 460 will recycle this space and put it back into the available space pool. Subsequently, the space allocation unit 450 can extract space from this pool and allocate it to a new service node. This loop process ensures the efficient utilization of storage resources and realizes continuous optimized management.
[0049] According to an embodiment of the present invention, the historical resource consumption data of each service node is analyzed to determine the consumption change pattern of its resources. These consumption change patterns are used to describe the resource consumption characteristics shown by the service node during the resource allocation and release process of the internal loop. As Figure 5 shown, the consumption change patterns can be divided into seven main trends, namely trend one 501 indicating that resource consumption tends to be stable, trend two 502 indicating that resource consumption increases steadily, trend three 503 indicating that the increase in resource consumption slows down, trend four 504 indicating that the increase in resource consumption accelerates, trend five 505 indicating that resource consumption decreases steadily, trend six 506 indicating that the decrease in resource consumption accelerates, and trend seven 507 indicating that the decrease in resource consumption slows down.
[0050] According to an embodiment of the present invention, after determining the current available resource amount of the service node, based on the consumption change pattern, the service duration during which the service node can continuously provide services is determined under the condition of maintaining a consumption speed matching the consumption change pattern with the current available resource amount. According to the service duration of each service node, the urgency of the space demand of each service node is evaluated. In this case, the service node with the shortest service duration, that is, the first target node, should be given the priority of resource allocation rights.
[0051] According to an embodiment of the present invention, resource allocation is performed through the resource management function of the composite node, realizing the separation of the control side and the service side. During the allocation process, the sustainable service duration of the service node is predicted according to the consumption change law, and since the consumption change law is determined based on the historical resource consumption data dynamically generated during the operation of the service node, the service side and the control side can understand the resource status without frequent interaction. Resource allocation is performed according to the determined service duration. This method not only reduces service interruption caused by space exhaustion, but also reduces the real-time dependence on the control side because resource allocation depends on local historical resource consumption data, significantly reducing the interaction frequency between the control side and the service side, thereby improving the resource allocation efficiency and the stability of the system.
[0052] According to an embodiment of the present invention, when determining the service duration that the service node can continuously provide services under the condition that the current available resource amount maintains the consumption speed matching the consumption change law based on the consumption change law obtained by analyzing the historical resource consumption data of the service node, it includes: quantifying the consumption change law using the discrete difference method based on the acquisition period of the historical resource consumption data to obtain consumption characteristic parameters; performing difference analysis on the current available resource amount and the historical resource remaining amount in the historical resource consumption data, and introducing the consumption characteristic parameters to calibrate the analysis result to obtain the consumption speed of the service node for resources; determining the service duration that the service node continuously provides services under the current available resource amount while maintaining the consumption speed.
[0053] According to an embodiment of the present invention, determining the acquisition period of the historical resource consumption data, assuming the acquisition period is , using the discrete difference method to quantify the consumption change law to obtain consumption characteristic parameters. Specifically, assume that the current available resource amounts corresponding to three sampling times of the service node are A1, A2, and A3 respectively. According to the acquisition period of the data, the consumption change law is quantified using formula (1).
[0054]
[0055] Among them, P represents the consumption characteristic parameter obtained after quantification.
[0056] According to an embodiment of the present invention, difference analysis is performed on the current available resource amount and the historical resource remaining amount in the historical resource consumption data. Among them, the historical resource remaining amount used in the difference analysis process is the available resource amount corresponding to the sampling point closest to the current moment. For example: when the current available resource amount is A3, the historical resource remaining amount is selected as A2. By selecting adjacent continuous data, the predicted result is made more accurate.
[0057] According to an embodiment of the present invention, after obtaining the analysis result, a consumption characteristic parameter is introduced to calibrate the analysis result so that the analysis result more conforms to the consumption change law. Based on the consumption speed of resources obtained after calibration, the service duration that the service node can continuously provide services under the current available resource amount is calculated. By calculating the service duration, the urgency of resource requirements of each service node can be known, and then resources can be preferentially allocated to the one with the shortest service time, making the resource allocation more reasonable and reducing the service interruption of the service node caused by resource exhaustion.
[0058] According to an embodiment of the present invention, a difference analysis is performed on the current available resource amount and the historical resource remaining amount in the historical resource consumption data, and a consumption characteristic parameter is introduced to calibrate the analysis result to obtain the consumption speed of resources by the service node, including: calculating the change rate of the resource amount within the acquisition period based on the difference between the current available resource amount and the historical resource remaining amount; adding the consumption characteristic parameter to the change rate to calibrate the change rate to obtain the consumption speed.
[0059] According to an embodiment of the present invention, during the calculation of the consumption speed of resources, first determine the change rate of the resource amount within the acquisition period, and then use the consumption characteristic parameter to calibrate the change rate to obtain the consumption speed. Based on the consumption speed, calculate the service duration that the service node can continuously provide services under the current available resource amount. The specific calculation methods are shown in formulas (2) and (3).
[0060]
[0061] Wherein, W represents the consumption speed, and T represents the service duration that the service node can continuously provide services when maintaining the consumption speed W with the current available resource amount A3. If W is less than or equal to zero, it means that the current resource consumption shows a negative growth trend, and the service duration theoretically approaches infinity. However, in actual use, this situation usually means that there is redundancy in resource allocation or the business load is low, which may lead to insufficient resource utilization.
[0062] According to an embodiment of the present invention, based on the consumption change law of the service node, predict its sustainable service duration and use this as the allocation basis for resource allocation, effectively reducing the service interruption caused by space exhaustion.
[0063] According to an embodiment of the present invention, resource allocation is performed on a first target node determined from multiple service nodes by using a resource management function according to the respective service durations of the multiple service nodes, including: determining a first target node from the multiple service nodes based on the respective service durations of the multiple service nodes, where the service duration of the first target node is the shortest; and allocating resources to the first target node by using the resource management function based on the free data blocks in the reserved space of the server cluster and the free data blocks of other service nodes in the server cluster except the first target node.
[0064] According to an embodiment of the present invention, since the resource requirements of each service node are detected in each sampling period, if there is a service node with a short service duration, it means that its resource requirements are large and resource allocation is needed. During the selection process of service nodes, since service nodes also perform internal resource allocation during business operation. Therefore, during the process of resource allocation using the resource management function, it is not necessary to allocate resources to multiple service nodes at one time, and only the first target node with the shortest service duration is determined from the multiple service nodes for resource allocation.
[0065] According to an embodiment of the present invention, during the process of resource allocation, it can be allocated based on the free data blocks in the reserved space of the service cluster and the free data blocks of other service nodes in the server cluster except the first target node. Specifically, the allocation source of free data blocks can be selected according to the resource margin in the reserved space of the service cluster. However, both sources can also be used simultaneously during the resource allocation process. For example: allocate resources from the reserved space in the server cluster preferentially, and if the reserved space is insufficient, supplement and allocate from other service nodes. By performing resource allocation in stages, the utilization of resources can be made more efficient.
[0066] According to an embodiment of the present invention, allocating resources to the first target node by using the resource management function based on the free data blocks in the reserved space of the server cluster and the free data blocks of other service nodes in the server cluster except the first target node includes: when it is determined that the resource margin in the reserved space of the server cluster is greater than a preset threshold, using the resource management function to migrate the free data blocks of a first preset data volume in the reserved space to the first target node; when it is determined that the resource margin in the reserved space of the server cluster is less than or equal to the preset threshold, allocating resources to the first target node by using the resource management function based on the free data blocks of other service nodes in the multiple service nodes except the first target node.
[0067] According to an embodiment of the present invention, as the composite node migrates free data blocks from the reserved space in the server cluster to the first target node, the reserved space in the server cluster may be gradually consumed. Once the resource margin of the reserved space in the server cluster is lower than a certain preset threshold (such as 10%), it is determined that the reserved space of the current server cluster is difficult to continue providing resource allocation. Therefore, the source of the free data blocks called in the resource allocation is changed, and resources are allocated to the first target node based on the free data blocks of other service nodes in the multiple service nodes except the first target node.
[0068] According to an embodiment of the present invention, when using the resource management function to migrate free data blocks to the first target node, since the service node will provide free data blocks from its internal space according to its consumption change rule when there is a trend of resource demand. Therefore, during the process of resource allocation, it is not necessary to allocate too much space to the first target node at one time to reduce the situation where resources cannot be allocated to other service nodes in time later. Specifically, the first preset data volume involved in the resource allocation process can be set according to the business processing capacity of the service node, for example, set to 5 data blocks or more. By selecting different allocation strategies at different stages, it is possible to effectively cope with the demand fluctuations of resources and reduce service interruptions or performance degradation caused by resource shortages.
[0069] According to an embodiment of the present invention, allocating resources to the first target node based on the free data blocks of other service nodes in the multiple service nodes except the first target node by using the resource management function includes: calculating the resource release rate of each service node based on the historical resource consumption data of the multiple service nodes; and determining a second target node from other service nodes in the multiple service nodes except the first target node; using the resource management function to call a second preset data volume of free data blocks in the second target node to the first target node.
[0070] According to an embodiment of the present invention, the core of the composite node's determination of whether resource allocation is required currently is whether the currently available resource volume in each service node can support the business consumption of the service node. If it is determined that the currently available resource volume of a certain service node is insufficient or there is a risk of exhaustion, it is considered that the space of the service node is insufficient and more resources need to be allocated to it. On the contrary, if it is determined that the free space of a certain service node increases, it is considered that the space of the service node is abundant. At this time, if there is a risk of insufficient space in other service nodes, some space will be appropriately recovered from the service node with relatively abundant space and finally transferred to the service node with insufficient space.
[0071] According to an embodiment of the present invention, based on the above rules, when analyzing the spatial free degree of each service node, the resource release rate of each service node will be checked first. Generally, the higher the resource release rate, the relatively greater the load pressure on the service node. By analyzing the resource release rates of each service node, although it is determined that the resources of each service node are in a consumption state, it may occur that some service nodes consume at a faster rate while some other service nodes consume at a slower rate, resulting in an unbalanced load situation. Therefore, once it is found that the resource release rate of an individual service node is higher than that of other service nodes and the number of free data blocks in this service node is significantly less than that of other service nodes, free data blocks can be transferred from this service node to other service nodes.
[0072] According to an embodiment of the present invention, if it is determined that the resource margin of the reserved space is lower than the preset threshold at this time, it can be known that there are not enough resources available for allocation in the current reserved space. Among the other service nodes except the first target node from multiple service nodes, a second target node with a lower resource release rate is determined to transfer the free data blocks of the second target node to the first target node. Using the resource management function, a second preset amount of free data blocks in the second target node is called to the first target node. Similarly, the second preset amount involved in the resource allocation process can be set according to the service processing capabilities of the service nodes. By selecting the second target node based on the resource release rate, the selection result is more in line with the business operation requirements.
[0073] According to an embodiment of the present invention, determining the second target node from the other service nodes except the first target node from multiple service nodes includes: respectively matching the resource release rate of each service node with a preset division range to determine the resource margin level of each service node according to the preset mapping relationship between the preset division range and the resource margin level; extracting multiple target service nodes with a preset resource margin level from multiple service nodes; determining the second target node from multiple target service nodes according to the service duration of each target service node, where the second target node is the node with the longest service duration among multiple target service nodes, and the resource margin level of the second target node is lower than that of the first target node.
[0074] According to an embodiment of the present invention, when analyzing the resource release rate, usually according to the threshold in the preset division range, the range to which the current resource release rate belongs is determined. According to the preset mapping relationship between the preset division range and the resource margin level, the resource margin level of each service node is determined. Among them, the resource margin level includes three levels, namely the first level, the second level, and the third level. The first level represents tight space, the second level represents moderate space, and the third level represents abundant space.
[0075] According to an embodiment of the present invention, for a target service node with a resource margin level of the third level, the second target node with the longest service duration is determined from multiple target service nodes according to the service duration of each target service node. In addition, the resource margin level of the second target node is lower than that of the first target node, and the level of the first target node is generally the first level. By determining the resource margin level of the service node according to the resource release rate, and then screening the second target node according to the service duration, the screening result is more accurate, and a node with sufficient space can be preferentially selected for resource allocation.
[0076] According to an embodiment of the present invention, the resource management method further includes: monitoring the growth rate of the available resource margin in each service node to determine the third target node with the highest growth rate from multiple service nodes; using the resource management function to release a preset number of occupied data blocks from the third target node to the reserved space; and updating the resource margin in the reserved space, where the occupied data blocks include a preset proportion of invalid data.
[0077] According to an embodiment of the present invention, if the reserved space of the server cluster is lower than a preset threshold, the composite node will attempt to recycle some resources from a certain service node to re-make the reserved space of the server cluster. The resource recovery method is opposite to the process of resource allocation. The composite node will detect the growth rate of the available resource margin in each service node. For a service node with a higher growth rate (if there is a service node with an increase in available resource margin), the space scheduling unit of the composite node is notified to return a predetermined number of occupied data blocks in the service node to the reserved space.
[0078] According to an embodiment of the present invention, the occupied data blocks include a preset proportion of invalid data. By performing resource recovery on the occupied data blocks, the utilization rate of resources can be effectively improved. After resource release, the resource margin in the reserved space is updated to facilitate subsequent resource allocation.
[0079] According to an embodiment of the present invention, during the actual system operation, it is possible that all service nodes are in a consumption state, and at this time, there will be no service node with an increase in available resource margin. In this case, it is regarded as having no returnable resources, and no forced resource release process is performed to reduce the situation where the composite node and the service node repeatedly release and allocate resources.
[0080] According to an embodiment of the present invention, the resource management method further includes: in the case where it is determined that the preset number of occupied data blocks include forcibly occupied data blocks, releasing other occupied data blocks in the third target node except the forcibly occupied data blocks, where the forcibly occupied data blocks are data blocks that are forcibly occupied and cannot be released in the third target node.
[0081] According to an embodiment of the present invention, the composite node will also ensure that a minimum amount of space is reserved in each service node based on the total capacity information of each service node provided by the capacity monitoring unit. These spaces will be forcibly occupied by each service node and cannot be transferred to other service nodes, thereby ensuring that each service node will pre-allocate a minimum database to meet the needs of data flushing.
[0082] According to an embodiment of the present invention, if during the process of releasing resources, the preset number of occupied data blocks that need to be released include the occupied data blocks, the data blocks other than the occupied data blocks are released. Under the premise of releasing resources, the occupied data blocks are left for each service node, which guarantees the normal operation of the service node to a certain extent.
[0083] According to an embodiment of the present invention, the resource management method also includes: in response to a received system operation instruction, the storage space in the system's occupied space except for the reserved space in the server cluster is evenly distributed to multiple service nodes in the server cluster, and the storage space is used to store data generated by running services on the service nodes.
[0084] According to the embodiment of the present invention, in the initial stage of system operation, due to less written data, the system space will be relatively abundant, and it is impossible to determine the business balance of each service node in the subsequent system operation, so each service node will be defaulted to a load balancing state. At this time, the composite node will divide 20% to 30% of the space as the reserved space of the server cluster, and the remaining storage space will be pre-allocated to all service nodes in the server cluster in an equal manner.
[0085] According to the embodiment of the present invention, the storage space allocated to the service nodes is managed by each service node. Only when some service nodes are at risk of insufficient space in the future, will the resource call and migration tasks be performed. By pre-allocating storage space for service nodes, the need for dynamic allocation of storage resources at the service nodes during operation is reduced, thereby reducing the delay caused by the allocation and recovery of storage resources and improving the overall performance of the system.
[0086] According to an embodiment of the present invention, the resource management method further includes: determining the capacity of the occupied data block allocated to each service node from the storage space based on the number of multiple service nodes in the server cluster and the resource capacity in the occupied space of the system.
[0087] According to an embodiment of the present invention, the capacity of the occupied data block in the service node needs to be determined according to the specific design of the system. The general principle is that the capacity corresponding to the occupied data block should not exceed 1 / N of the resource capacity of the system's occupied space (i.e., the space occupied inside the system, not reflected externally), where N is the number of service nodes in the server cluster.
[0088] According to an embodiment of the present invention, based on the number of multiple service nodes in the server cluster and the resource capacity in the occupied space of the system, calculate the capacity of the preemptive data blocks to be allocated in the storage space. Based on the capacity of the preemptive data blocks, evenly allocate the preemptive data blocks in the storage space to each service node. By calculating and allocating the capacity of the preemptive data blocks, the normal operation of the service nodes is ensured to a certain extent.
[0089] According to an embodiment of the present invention, the resource management method further includes: when allocating resources to a first target node, sending allocation information corresponding to the free data blocks to the first target node to notify the first target node to receive the resources; when reclaiming resources from a third target node, sending release information corresponding to the occupied data blocks to the third target node to notify the third target node to release the resources.
[0090] According to an embodiment of the present invention, when it is necessary to allocate resources to a first target node, select the corresponding capacity from the reserved space of the server cluster or a second target node according to the capacity of the resources to be allocated at one time. Send allocation information to the first target node based on this capacity to notify the first target node to receive the resources, and at the same time notify the space management unit in the composite node to complete information update.
[0091] According to an embodiment of the present invention, when it is necessary to reclaim resources from a third target node, the space scheduling unit in the composite node will notify the third target node of the number of returns to the database. Send release information to the third target node based on this number to notify the third target node to release the resources, and then wait for the space recovery unit in the third target node to complete the space preparation of the corresponding capacity. Return the resources released by the third target node to the reserved space of the server cluster, and at the same time update the resource margin in the reserved space. By means of information interaction for resource allocation and recovery, the service nodes can perform resource management in a timely manner.
[0092] According to an embodiment of the present invention, the resource management method further includes: when it is determined that the resource allocation is completed, obtain the resource distribution data in each service node; synchronize the resource distribution data to each service node.
[0093] According to an embodiment of the present invention, when it is determined that the resource allocation is completed, record and update the resource distribution data. Among them, the recording of the resource distribution data can usually be completed in the form of an array or a table. As Figure 6 shown, when the resource distribution data of the composite node 610 changes, the space management unit 611 of the composite node 610 needs to synchronize the resource distribution data to the space management units of the respective other service nodes 620.
[0094] According to an embodiment of the present invention, since only one service node in the server cluster is selected as the composite node, other service nodes only play a backup role, and the update is only completed after all information is synchronized. By synchronizing the resource distribution data to each service node, it is convenient for other service nodes to take over the resource management work of the composite node.
[0095] According to an embodiment of the present invention, the resource management method further includes: in the case of detecting a failure of the composite node, determining a new composite node from other service nodes except the composite node according to a preset rule associated with the node identifiers of the multiple service nodes in the server cluster, and the new composite node can execute the resource management function based on the synchronized resource distribution data.
[0096] According to an embodiment of the present invention, if a failure of the composite node is detected during system operation, a new composite node will be selected from the remaining service nodes, and the new composite node will continue to execute the resource management function based on the resource distribution data backed up by itself. Specifically, the new composite node is selected according to a preset rule associated with the node identifiers of the service nodes. Among them, the node identifier can be the ID of each server, and the preset rule can select the service node with the largest or smallest ID as the new composite node.
[0097] According to an embodiment of the present invention, if the failed composite node recovers, the current new composite node also needs to synchronize the resource distribution data to it first. Only after the resource distribution data is completely synchronized can the service node that has recovered after the failure join the system and provide services externally. When the composite node fails, the node switching can timely handle the failure situation.
[0098] According to an embodiment of the present invention, the resource management method further includes: determining a fourth target node from the multiple service nodes according to the consumption change law of the service nodes, where the consumption change law of the fourth target node conforms to an increasing law; allocating resources to the fourth target node to update the current available resource amount of the fourth target node; and determining the service duration that each service node can continuously provide services based on the current available resource amounts of the multiple service nodes including the fourth target node.
[0099] According to an embodiment of the present invention, before calculating the service duration of each service node, a fourth target node that conforms to the increasing law can be determined from the multiple service nodes. Among them, the increasing trend of the consumption change law of the fourth target node is the most significant among the multiple service nodes in the service cluster. During the resource allocation process, a certain number of free data blocks are allocated to the fourth target node in advance. After the allocation, the current available resource amount of the fourth target node is updated, and then the service duration of the multiple service nodes including the fourth target node is calculated.
[0100] According to an embodiment of the present invention, in each monitoring period, the allocation of resources is split into two times. On the premise of controlling the number of accesses, the amount of resources allocated each time can be effectively reduced, making the allocation of free data blocks more reasonable. And in the same monitoring period, resource allocation can be realized for two different service nodes, effectively maintaining the normal operation of the service.
[0101] According to an embodiment of the present invention, determining a fourth target node from multiple service nodes according to the consumption change rule of the service node includes: for each service node, calculating the growth rate of multiple monitoring indicators of the service node in the historical resource consumption data; based on the preset weight corresponding to each monitoring indicator, performing weighted summation on the growth rates of the multiple monitoring indicators respectively to obtain a comprehensive growth rate representing the consumption change rule of the service node; sorting the comprehensive growth rates of the multiple service nodes to determine the fourth target node with the highest comprehensive growth rate from the multiple service nodes.
[0102] According to an embodiment of the present invention, in the process of determining the fourth target node, the growth rate of multiple monitoring indicators of the service node in the historical resource consumption data can be calculated to determine the consumption change rule according to the multiple growth rates. Specifically, the multiple monitoring indicator items respectively include the total capacity of the service node, the current available resource amount, the resource release rate, etc. According to the preset weight corresponding to each monitoring indicator, weighted summation is performed on the multiple growth rates to obtain a comprehensive growth rate representing the consumption change rule. By determining the fourth target node according to each monitoring indicator, the determination result is more comprehensive and accurate.
[0103] According to an embodiment of the present invention, the consumption change rule can also be determined according to the current available resource amount at each sampling point. Specifically, the sampling moments and the corresponding available resource amounts of multiple sampling points are marked on a rectangular coordinate system, and the consumption change rule is determined by using the curve fitting method. When selecting the fourth target node, the fourth target node can be selected based on the change rate of the curve at different moments. Specifically, multiple selection conditions can be determined, such as the change rate at the last moment reaches a first threshold, and the average change rate of multiple sampling points reaches a second threshold, etc. By determining the fourth target node according to the current available resource amount of multiple sampling points, the determination result is more real-time and dynamic.
[0104] Based on the above resource management method, the present invention also provides a resource management device. The following will be combined with Figure 7 to describe this device in detail.
[0105] Figure 7 The structural block diagram of the resource management device according to an embodiment of the present invention is shown.
[0106] AsFigure 7 As shown in Figure 7 , the resource management device 700 of this embodiment includes a data acquisition module 710, a duration determination module 720, and a resource allocation module 730.
[0107] The data acquisition module 710 is configured to obtain the historical resource consumption data of each of multiple service nodes including composite nodes in the server cluster, where a composite node is a service node integrated with a resource management function. In one embodiment, the data acquisition module 710 may be configured to perform the operation S210 described above, which will not be elaborated here.
[0108] The duration determination module 720 is configured to, for each service node, based on the consumption change pattern obtained by analyzing the historical resource consumption data of the service node, determine the service duration during which the service node can continuously provide services when maintaining a consumption speed matching the consumption change pattern with the current available resource amount. In one embodiment, the duration determination module 720 may be configured to perform the operation S220 described above, which will not be elaborated here.
[0109] The resource allocation module 730 is configured to, according to the service durations of the multiple service nodes, use the resource management function to allocate resources to a first target node determined from the multiple service nodes. In one embodiment, the resource allocation module 730 may be configured to perform the operation S230 described above, which will not be elaborated here.
[0110] According to an embodiment of the present invention, the duration determination module 720 includes a pattern quantification sub-module, a difference analysis sub-module, and a duration determination sub-module.
[0111] The pattern quantification sub-module is configured to, based on the acquisition period of the historical resource consumption data, use the discrete difference method to quantify the consumption change pattern and obtain consumption characteristic parameters.
[0112] The difference analysis sub-module is configured to perform a difference analysis on the current available resource amount and the historical resource remaining amount in the historical resource consumption data, and introduce the consumption characteristic parameters to calibrate the analysis result to obtain the consumption speed of the service node for resources.
[0113] The duration determination sub-module is configured to determine the service duration during which the service node continuously provides services while maintaining the consumption speed with the current available resource amount.
[0114] According to an embodiment of the present invention, the difference analysis sub-module includes a change calculation unit and a change calibration unit.
[0115] The change calculation unit is configured to calculate the change rate of the resource amount within the acquisition period based on the difference between the current available resource amount and the historical resource remaining amount.
[0116] A change calibration unit for adding a consumption characteristic parameter and a change rate to calibrate the change rate to obtain a consumption speed.
[0117] According to an embodiment of the present invention, the resource allocation module 730 includes a first target determination sub-module and a resource allocation sub-module.
[0118] The first target determination sub-module is configured to determine a first target node from multiple service nodes based on the respective service durations of the multiple service nodes, where the service duration of the first target node is the shortest.
[0119] The resource allocation sub-module is configured to allocate resources to the first target node by using a resource management function based on the free data blocks in the reserved space of the server cluster and the free data blocks of other service nodes in the server cluster except the first target node.
[0120] According to an embodiment of the present invention, the resource allocation sub-module includes a resource migration unit and a resource allocation unit.
[0121] The resource migration unit is configured to, when it is determined that the resource margin in the reserved space of the server cluster is greater than a preset threshold, use the resource management function to migrate the free data blocks of a first preset data volume in the reserved space to the first target node.
[0122] The resource allocation unit is configured to, when it is determined that the resource margin in the reserved space of the server cluster is less than or equal to the preset threshold, allocate resources to the first target node by using a resource management function based on the free data blocks of other service nodes in the multiple service nodes except the first target node.
[0123] According to an embodiment of the present invention, the resource allocation unit includes a release calculation sub-unit, a second target determination sub-unit, and a resource invocation sub-unit.
[0124] The release calculation sub-unit is configured to calculate the resource release rate of each service node based on the historical resource consumption data of the multiple service nodes.
[0125] The second target determination sub-unit is configured to determine a second target node from other service nodes in the multiple service nodes except the first target node.
[0126] The resource invocation sub-unit is configured to use the resource management function to invoke the free data blocks of a second preset data volume in the second target node to the first target node.
[0127] According to an embodiment of the present invention, the release calculation sub-unit includes a range matching component, a node extraction component, and a second target determination component.
[0128] A range matching component for respectively matching the resource release rate of each service node with a preset division range, so as to determine the resource margin level of each service node according to the preset mapping relationship between the preset division range and the resource margin level.
[0129] A node extraction component for extracting multiple target service nodes with a preset resource margin level from multiple service nodes.
[0130] A second target determination component for determining a second target node from multiple target service nodes according to the service duration of each target service node, where the second target node is the node with the longest service duration among the multiple target service nodes, and the resource margin level of the second target node is lower than that of the first target node.
[0131] According to an embodiment of the present invention, the resource management device 700 further includes a third target determination module, a resource release module, and a margin update module.
[0132] A third target determination module for monitoring the growth rate of the available resource margin in each service node, so as to determine a third target node with the highest growth rate from multiple service nodes.
[0133] A resource release module for using the resource management function to release a preset number of occupied data blocks from the third target node to the reserved space.
[0134] A margin update module for updating the resource margin in the reserved space, where the occupied data blocks include a preset proportion of invalid data.
[0135] According to an embodiment of the present invention, the resource management device 700 further includes a forced occupation release module.
[0136] A forced occupation release module for releasing other occupied data blocks in the third target node except the forced occupation data blocks when it is determined that the preset number of occupied data blocks includes forced occupation data blocks, where the forced occupation data blocks are the data blocks that are forcibly occupied and cannot be released in the third target node.
[0137] According to an embodiment of the present invention, the resource management device 700 further includes a storage allocation module.
[0138] A storage allocation module for, in response to the received system operation instruction, evenly allocating the storage space in the system occupied space except the reserved space in the server cluster to multiple service nodes in the server cluster, and the storage space is used to store the data generated by the services running on the service nodes.
[0139] According to an embodiment of the present invention, the resource management device 700 further includes a forced occupation determination module.
[0140] The preemption determination module is configured to determine the capacity of the preemptive data blocks allocated for each of the service nodes from the storage space based on the number of multiple service nodes in the server cluster and the resource capacity in the occupied space of the system.
[0141] According to an embodiment of the present invention, the resource management device 700 further includes an allocation notification module and a release notification module.
[0142] The allocation notification module is configured to, when allocating resources to a first target node, send the allocation information corresponding to the free data blocks to the first target node to notify the first target node to receive the resources.
[0143] The release notification module is configured to, when reclaiming resources from a third target node, send the release information corresponding to the occupied data blocks to the third target node to notify the third target node to release the resources.
[0144] According to an embodiment of the present invention, the resource management device 700 further includes a distribution acquisition module and a data synchronization module.
[0145] The distribution acquisition module is configured to, when determining that the resource allocation is completed, acquire the resource distribution data in each service node.
[0146] The data synchronization module is configured to synchronize the resource distribution data to each service node.
[0147] According to an embodiment of the present invention, the resource management device 700 further includes a composite determination module.
[0148] The composite determination module is configured to, when detecting that a composite node fails, determine a new composite node from other service nodes except the composite node according to a preset rule associated with the node identifiers of the multiple service nodes in the server cluster, and the new composite node can execute the resource management function based on the synchronized resource distribution data.
[0149] According to an embodiment of the present invention, the resource management device 700 further includes a fourth target determination module, a resource update module, and a duration update module.
[0150] The fourth target determination module is configured to determine a fourth target node from the multiple service nodes according to the consumption change rule of the service nodes, wherein the consumption change rule of the fourth target node conforms to an increasing rule.
[0151] The resource update module is configured to allocate resources to the fourth target node to update the current available resource amount of the fourth target node.
[0152] A duration update module, configured to determine, based on the current available resource amount of each of multiple service nodes including a fourth target node, the service duration that each service node can continuously provide services.
[0153] According to an embodiment of the present invention, the fourth target determination module includes an increase calculation sub-module, an integrated calculation sub-module, and a fourth target determination sub-module.
[0154] The increase calculation sub-module is configured to calculate, for each service node, the growth rate of multiple monitoring metrics of the service node in the historical resource consumption data.
[0155] The integrated calculation sub-module is configured to perform a weighted sum of the growth rates of the multiple monitoring metrics based on a preset weight corresponding to each monitoring metric, to obtain an integrated growth rate characterizing the consumption change rule of the service node.
[0156] The fourth target determination sub-module is configured to sort the integrated growth rates of the multiple service nodes, to determine a fourth target node with the highest integrated growth rate from the multiple service nodes.
[0157] According to an embodiment of the present invention, any multiple of the data acquisition module 710, the duration determination module 720, and the resource allocation module 730 may be combined and implemented in one module, or any one of them may be split into multiple modules. Or, at least part of the functions of one or more of these modules may be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present invention, at least one of the data acquisition module 710, the duration determination module 720, and the resource allocation module 730 may be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on chip, a system on substrate, a system on package, an application specific integrated circuit (ASIC), or any other reasonable manner of integrating or packaging circuits, etc., implemented by hardware or firmware, or implemented in any one of the three implementation manners of software, hardware, and firmware, or in any appropriate combination of several of them. Or, at least one of the data acquisition module 710, the duration determination module 720, and the resource allocation module 730 may be at least partially implemented as a computer program module, and when the computer program module is run, it can execute the corresponding functions.
[0158] Figure 8 A block diagram of an electronic device suitable for implementing a resource management method according to an embodiment of the present invention is shown.
[0159] As Figure 8As shown, an electronic device 800 according to an embodiment of the present invention includes a processor 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage section 808 into a random access memory (RAM) 803. The processor 801 can include, for example, a general-purpose microprocessor (e.g., CPU), an instruction set processor, and / or a related chipset, and / or a dedicated microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 801 can also include on-board memory for caching purposes. The processor 801 can include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present invention.
[0160] In the RAM 803, various programs and data required for the operation of the electronic device 800 are stored. The processor 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. The processor 801 performs various operations of the method flow according to an embodiment of the present invention by executing programs in the ROM 802 and / or the RAM 803. It should be noted that the program can also be stored in one or more memories other than the ROM 802 and the RAM 803. The processor 801 can also perform various operations of the method flow according to an embodiment of the present invention by executing programs stored in one or more memories.
[0161] According to an embodiment of the present invention, the electronic device 800 can further include an input / output (I / O) interface 805, and the input / output (I / O) interface 805 is also connected to the bus 804. The electronic device 800 can further include one or more of the following components connected to the input / output (I / O) interface 805: an input section 806 including a keyboard, a mouse, etc.; an output section 807 including, for example, a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN card, a modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the input / output (I / O) interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as needed so that a computer program read from it can be installed into the storage section 808 as needed.
[0162] The present invention also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the one or more programs are executed, the method according to the embodiments of the present invention is implemented.
[0163] According to an embodiment of the present invention, the computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, it may include but is not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above. In the present invention, the computer-readable storage medium may be any tangible medium that contains or stores a program, and the program can be used by or in combination with an instruction execution system, apparatus, or device. For example, according to an embodiment of the present invention, the computer-readable storage medium may include the above-described ROM 802 and / or RAM 803 and / or one or more memories other than ROM 802 and RAM 803.
[0164] An embodiment of the present invention further includes a computer program product, which includes a computer program, and the computer program contains program codes for executing the method shown in the flowchart. When the computer program product runs in a computer system, the program codes are used to enable the computer system to implement the resource management method provided by the embodiments of the present invention.
[0165] When the computer program is executed by the processor 801, the above functions defined in the system / apparatus of the embodiments of the present invention are executed. According to an embodiment of the present invention, the above-described systems, apparatuses, modules, units, etc. may be implemented by computer program modules.
[0166] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices and magnetic storage devices. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and be downloaded and installed through the communication part 809, and / or be installed from the removable medium 811. The program codes included in the computer program may be transmitted by any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0167] In such an embodiment, the computer program can be downloaded and installed from a network through the communication part 809, and / or installed from the removable medium 811. When the computer program is executed by the processor 801, the above functions defined in the system of the embodiments of the present invention are executed. According to the embodiments of the present invention, the systems, devices, apparatuses, modules, units, etc. described above can be implemented by computer program modules.
[0168] According to the embodiments of the present invention, the program code for executing the computer program provided by the embodiments of the present invention can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level procedures and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, such as Java, C++, Python, the "C" language, or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, by using an Internet service provider to connect through the Internet).
[0169] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code, and the above module, program segment, or part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram or flowchart, and the combinations of blocks in the block diagram or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.
[0170] Those skilled in the art can understand that the features described in the various embodiments of the present invention can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in the present invention. In particular, without departing from the spirit and teachings of the present invention, the features described in the various embodiments of the present invention can be combined and / or combined in various ways. All such combinations and / or combinations fall within the scope of the present invention.
[0171] The embodiments of the present invention have been described above. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of the present invention. Although the embodiments have been described separately above, this does not mean that the measures in each embodiment cannot be used advantageously in combination. Without departing from the scope of the present invention, those skilled in the art can make various substitutions and modifications, and all such substitutions and modifications should fall within the scope of the present invention.
Claims
1. A resource management method, characterized in that, The method includes: Obtaining the historical resource consumption data of each of multiple service nodes including composite nodes in a server cluster, where the composite node is a service node integrated with a resource management function, and the historical resource consumption data of the service node is generated based on the actual operations of internal resource allocation and release of the service node; For each of the service nodes, based on the consumption change law obtained by analyzing the historical resource consumption data of the service node, determining the service duration during which the service node can continuously provide services when maintaining a consumption speed matching the consumption change law with the current available resource amount, where the consumption change law is used to describe the resource consumption characteristics demonstrated by the service node during the process of resource allocation and release; According to the service durations of the multiple service nodes respectively, using the resource management function to allocate resources to a first target node determined from the multiple service nodes.
2. The method according to claim 1, wherein The determining the service duration during which the service node can continuously provide services when maintaining a consumption speed matching the consumption change law with the current available resource amount based on the consumption change law obtained by analyzing the historical resource consumption data of the service node includes: Based on the acquisition period of the historical resource consumption data, using the discrete difference method to quantify the consumption change law to obtain consumption characteristic parameters; Performing a difference analysis on the current available resource amount and the historical resource remaining amount in the historical resource consumption data, and introducing the consumption characteristic parameters to calibrate the analysis result to obtain the consumption speed of the service node for resources; Determining the service duration during which the service node continuously provides services while maintaining the consumption speed with the current available resource amount.
3. The method according to claim 2, characterized in that The performing a difference analysis on the current available resource amount and the historical resource remaining amount in the historical resource consumption data, and introducing the consumption characteristic parameters to calibrate the analysis result to obtain the consumption speed of the service node for resources includes: Based on the difference between the current available resource amount and the historical resource remaining amount, calculating the change rate of the resource amount within the acquisition period; Adding the consumption characteristic parameters to the change rate to calibrate the change rate to obtain the consumption speed.
4. The method according to claim 1, characterized in that, The using the resource management function to allocate resources to a first target node determined from the multiple service nodes according to the service durations of the multiple service nodes respectively includes: Based on the service durations of the multiple service nodes respectively, determining a first target node from the multiple service nodes, where the service duration of the first target node is the shortest; Based on the free data blocks in the reserved space in the server cluster and the free data blocks of other service nodes in the server cluster except the first target node, using the resource management function to allocate resources to the first target node.
5. The method according to claim 4, wherein Allocating resources for the first target node by using the resource management function based on the free data blocks in the reserved space in the server cluster and the free data blocks of other service nodes in the server cluster except the first target node includes: When it is determined that the resource margin in the reserved space in the server cluster is greater than a preset threshold, using the resource management function to migrate free data blocks with a first preset data volume in the reserved space to the first target node; When it is determined that the resource margin in the reserved space in the server cluster is less than or equal to the preset threshold, allocating resources for the first target node by using the resource management function based on the free data blocks of other service nodes in the server cluster except the first target node.
6. The method according to claim 5, wherein The allocating resources for the first target node by using the resource management function based on the free data blocks of other service nodes in the server cluster except the first target node includes: Calculating the resource release rate of each service node based on the historical resource consumption data of multiple service nodes; and determining a second target node from other service nodes in the server cluster except the first target node; Using the resource management function to transfer free data blocks with a second preset data volume in the second target node to the first target node.
7. The method according to claim 6, wherein The determining a second target node from other service nodes in the server cluster except the first target node includes: Matching the resource release rate of each service node with a preset division range respectively to determine the resource margin level of each service node according to the preset mapping relationship between the preset division range and the resource margin level; Extracting multiple target service nodes with the resource margin level being a preset level from multiple service nodes; Determining the second target node from multiple target service nodes according to the service duration of each target service node, where the second target node is the node with the longest service duration among multiple target service nodes, and the resource margin level of the second target node is lower than that of the first target node.
8. The method according to claim 4, wherein The method further includes: Monitoring the growth rate of the available resource margin in each service node to determine a third target node with the highest growth rate from multiple service nodes; Using the resource management function to release a preset number of occupied data blocks in the third target node to the reserved space; and updating the resource margin in the reserved space, where the occupied data blocks include a preset proportion of invalid data.
9. The method according to claim 8, characterized in that The method further includes: When it is determined that the preset number of occupied data blocks includes forcibly occupied data blocks, releasing other occupied data blocks in the third target node except the forcibly occupied data blocks, where the forcibly occupied data blocks are the data blocks that are forcibly occupied and cannot be released in the third target node.
10. The method according to claim 9, wherein The method further includes: In response to the received system operation instruction, the storage space in the system occupied space except for the reserved space in the server cluster is evenly allocated to multiple service nodes in the server cluster, and the storage space is used to store the data generated by running services on the service nodes.
11. According to the method described in claim 10, wherein The method further includes: Based on the number of multiple service nodes in the server cluster and the resource capacity in the system occupied space, determine the capacity of the preempted data blocks allocated to each service node from the storage space.
12. The method according to any one of claims 8 to 11, characterized in that, The method further includes: In the case of allocating resources to the first target node, send the allocation information corresponding to the free data block to the first target node to notify the first target node to receive the resources; In the case of reclaiming resources from the third target node, send the release information corresponding to the occupied data block to the third target node to notify the third target node to release the resources.
13. The method according to claim 1, characterized in that, The method further includes: In the case of determining that the resource allocation is completed, obtain the resource distribution data in each service node; Synchronize the resource distribution data to each service node.
14. The method according to claim 13, wherein The method further includes: In the case of detecting that the composite node fails, determine a new composite node from other service nodes except the composite node according to a preset rule associated with the node identifiers of multiple service nodes in the server cluster, and the new composite node can execute the resource management function based on the synchronized resource distribution data.
15. The method according to claim 1, characterized in that, The method further includes: Determine a fourth target node from multiple service nodes according to the consumption change law of the service nodes, where the consumption change law of the fourth target node conforms to the growth law; Allocate resources to the fourth target node to update the current available resource amount of the fourth target node; Based on the current available resource amounts of multiple service nodes including the fourth target node, determine the service duration that each service node can continuously provide services.
16. The method according to claim 15, characterized in that, The determining the fourth target node from multiple service nodes according to the consumption change law of the service nodes includes: For each service node, calculate the growth rate of multiple monitoring indicators of the service node in the historical resource consumption data; Based on the preset weight corresponding to each monitoring indicator, perform weighted summation on the growth rates of multiple monitoring indicators respectively to obtain a comprehensive growth rate characterizing the consumption change law of the service node; Sort the comprehensive growth rates of multiple service nodes to determine the fourth target node with the highest comprehensive growth rate from multiple service nodes.
17. A resource management device, characterized in that, The device includes: A data acquisition module, configured to acquire the historical resource consumption data of multiple service nodes including a composite node in the server cluster, where the composite node is a service node integrated with a resource management function, and the historical resource consumption data of the service node is generated based on the actual operations of internal resource allocation and release of the service node. A duration determination module, configured to, for each of the service nodes, determine a service duration during which the service node can continuously provide services when the service node maintains a consumption speed matching the consumption change pattern with the current available resource amount, based on a consumption change pattern obtained by analyzing historical resource consumption data of the service node, where the consumption change pattern is used to describe resource consumption characteristics exhibited by the service node during the process of resource allocation and release; A resource allocation module, configured to, according to the service durations of the multiple service nodes respectively, use the resource management function to perform resource allocation on a first target node determined from the multiple service nodes.
18. An electronic device, comprising: One or more processors; A memory, configured to store one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 16.
19. A computer-readable storage medium having a computer program or instructions stored thereon, characterized in that, The computer program or instruction, when executed by a processor, implements the steps of the method according to any one of claims 1 to 16.
20. A computer program product, comprising a computer program, characterized in that, The computer program, when executed by a processor, implements the method according to any one of claims 1 to 16.
Citation Information
Patent Citations
Resource management method and device, electronic equipment and storage medium
CN114185675A
Task scheduling method and device, computer equipment and storage medium
CN117873679A