Resource management and control system and method, electronic equipment and storage medium
By introducing state transition, observation, differential and dynamic planning modules into the resource management system, the complexity and response time problems of resource management in traditional technologies are solved, and efficient, flexible and real-time management of resources are achieved.
Patent Information
- Application Number
- CN202311459087.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-02
- Publication Date
- 2025-05-06
AI Technical Summary
Traditional resource management and control technologies are difficult to achieve flexible and real-time management of resources through workflows, especially when the response time is long in the face of external changes, and complex design and implementation, which consumes a lot of time and resources.
It provides a resource management and control system, including a state conversion module, a state observation module, a state difference and dynamic planning module and an execution module. Through the collaboration of these modules, they respond to external operations in real time, dynamically adjust resource status, and realize efficient resource management and control.
It improves the system's response speed and availability, realizes flexible control and optimization utilization of resources, and reduces the complexity and time overhead of resource management.
Smart Images

Figure CN119945906A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a resource management and control system, method, electronic device and storage medium. Background Art
[0002] Traditional resource management and control technologies usually use workflows to describe management and control steps and dependencies to control the execution order of tasks. However, the workflow approach has some limitations: First, complex business processes involve collaboration and interaction between multiple departments, systems, and executors. The design and implementation of complex workflows need to consider various situations and exceptions, which increases complexity and difficulty. Second, workflows are usually executed based on predefined rules and conditions, while business processes in reality are often flexible and changeable. When business needs change, the workflow needs to be modified and adjusted, which consumes a lot of time and resources.
[0003] In addition, since the workflow is executed according to the preset process, it cannot perceive and adapt to changes in external inputs in real time, resulting in the workflow being unable to flexibly respond to external changes. When facing external changes, the workflow can choose to cancel the current process before responding, or wait until the current process ends before responding, but this execution method limits the real-time and flexibility of the workflow, resulting in a longer response time. Summary of the invention
[0004] The present application provides a resource management and control system, method, electronic device and storage medium to solve the problem of how to efficiently manage resources.
[0005] In a first aspect, the present application provides a resource management and control system, the resource management and control system comprising a state conversion module, a state observation module, a state difference and dynamic programming module and an execution module;
[0006] The state conversion module is used to respond to each external operation input and convert it into a target state of the resource;
[0007] The state observation module is used to continuously monitor the state of the resource to output the current state;
[0008] The state difference and dynamic programming module is used to calculate the difference between the target state and the current state, and generate an adjustment action from the current state to the target state according to the difference;
[0009] The execution module is used to receive the adjustment action and execute it to change the state of the resource.
[0010] In an embodiment of the present application, the external operation includes any one of the following or a combination thereof:
[0011] Create resources, used to create resource nodes;
[0012] Scaling resources, used to scale the number of resource nodes, increase storage capacity, or adjust network bandwidth;
[0013] Delete resource, used to delete resource node;
[0014] Resource node upgrades are used to improve the performance, capacity, and functionality of computing systems to meet computing needs;
[0015] State switching, used to switch resource nodes from normal operation to maintenance mode;
[0016] Fault recovery, used for fault recovery of resource nodes, storage devices or network configurations;
[0017] Data migration, which is used to migrate data on a storage node to a new storage device, or migrate workloads on a resource node to other nodes;
[0018] System configuration updates are used to enable or disable system features, adjust the load balancing strategy of resource nodes, optimize the read and write performance of storage nodes, or optimize the transmission speed of network nodes.
[0019] In one embodiment of the present application, the target state of the resource is represented by a first structure, and the current state of the resource is represented by a second structure and a third structure; wherein the first structure is used to describe the user's expectations and requirements for the resource node; the second structure is used to describe the actual situation of the resource node; and the third structure is used to describe the detailed information of the resource node.
[0020] In one embodiment of the present application,
[0021] The first structure includes a first field, a second field, a third field, a fourth field and a fifth field, wherein the first field indicates the size of the user's demand for the resource node, the second field indicates the user's expected final state of the resource node, the third field indicates the user's expected resource node model and specification, the fourth field indicates the user's expected node configuration version, and the fifth field indicates the user's expected fault migration result;
[0022] The second structure includes a sixth field and a seventh field, the sixth field indicates the current actual number of resource nodes, and the seventh field is an array consisting of a group of third structures, indicating the state of each resource node in the resource;
[0023] The third structure includes an eighth field, a ninth field, a tenth field and an eleventh field, the eighth field is the unique ID of the represented resource node, the ninth field indicates the current state of the node, the tenth field indicates the model and specification of the current node, and the eleventh field indicates the configuration version currently used by the node.
[0024] In one embodiment of the present application, based on the first field, the second field, the third field, the fourth field and the fifth field of the first structure, as well as the second structure and the third structure; when the external operation is to create a resource node, the state transition module generates the target state of the resource according to the input external operation, and the state observation module obtains the current state of the resource, and the first acquisition of the resource state is empty; the state differential and planner calculates the state differential according to the target state and the current state of the resource, and dynamically generates a series of actions related to the creation of the resource; the execution module executes these actions to complete the creation of the resource; during the resource creation, the state observation module will continuously monitor the state changes of the resource, update the current state of the resource, trigger the state differential and planner to recalculate the difference between the target state and the current state of the resource, and generate a new adjustment action corresponding to the state change; the execution module continues to execute the new adjustment action; and so on and so forth until the resource creation is completed.
[0025] In one embodiment of the present application, based on the first field of the first structure, the sixth field of the second structure, and the ninth field of the third structure, when the external operation is to scale a resource node, the state transition module modifies the capacity-related component in the target state of the resource according to the external input information; the state observation module obtains the current state of the resource; the state differential and planner calculates the state differential according to the target state and the current state of the resource, and dynamically generates a series of actions related to resource scaling; the execution module executes these actions to complete the expansion or reduction of the resource; during resource scaling, the state observation module continuously monitors the state changes of the resource, updates the current state of the resource, triggers the state differential and planner to recalculate the difference between the target state and the current state of the resource, and generates a new adjustment action corresponding to the state change; the execution module continues to execute the new adjustment action; and so on and so forth until the resource scaling is completed.
[0026] In one embodiment of the present application, based on the second field of the first structure and the first field of the second structure, when the external operation is to delete a resource node, the state transition module modifies the target state of the resource to destroyed according to the external input information; the state observation module obtains the current state of the resource; the state differential and planner calculates the state differential according to the target state and current state of the resource, and dynamically generates a series of actions related to deleting the resource; the execution module executes these actions to complete the deletion of the resource; during the resource deletion, the state observation module continuously monitors the state changes of the resource, updates the current state of the resource, triggers the state differential and planner to recalculate the difference between the target state and the current state of the resource, and generates a new adjustment action corresponding to the state change; the execution module continues to execute the new adjustment action; and so on and so forth until the resource deletion is completed.
[0027] In one embodiment of the present application, based on the third field of the first structure and the seventh and tenth fields of the second structure, when the external operation is to modify the model and specifications of the resource node, the state conversion module modifies the model and specification-related components in the target state of the resource according to the external input information; the state observation module obtains the current state of the resource; the state differential and planner calculates the state differential according to the target state and current state of the resource, and dynamically generates a series of actions related to the resource specification change; the execution module executes these actions to complete the resource specification change task; during the resource specification change, the state observation module will continuously monitor the state changes of the resource, update the current state of the resource, trigger the state differential and planner to recalculate the difference between the target state and the current state of the resource, and generate a new adjustment action corresponding to the state change; the execution module continues to execute the new adjustment action; and so on and so forth until the resource specification change is completed.
[0028] In one embodiment of the present application, based on the fourth field of the first structure and the seventh and eleventh fields of the second structure, when the external operation is to modify the configuration version of the resource node, the state transition module modifies the components related to the configuration version in the target state of the resource according to the external input information; the state observation module obtains the current state of the resource; the state differential and planner calculates the state differential according to the target state and the current state of the resource, and dynamically generates a series of actions related to the resource configuration change; the execution module executes these actions to complete the configuration update of the resource; during the resource configuration change, the state observation module will continuously monitor the state changes of the resource, update the current state of the resource, trigger the state differential and planner to recalculate the difference between the target state and the current state of the resource, and generate a new adjustment action corresponding to the state change; the execution module continues to execute the new adjustment action; and so on and so forth until the resource configuration change is completed.
[0029] In one embodiment of the present application, based on the seventh field of the second structure and the ninth field of the third structure, when a resource node fails, the state observation module observes the node failure and sets the ninth field in the element in the seventh field of the current state corresponding to the node to an abnormal state; the state differential and planner calculates the state differential according to the target state and current state of the resource, and dynamically generates a series of actions related to the fault recovery of the resource node based on the configuration information related to fault recovery in the fifth field of the first structure; the execution module executes these actions to complete the fault recovery of the resource; during the resource node fault recovery, the state observation module will continuously monitor the state changes of the resource, update the current state of the resource, trigger the state differential and planner to recalculate the difference between the target state and the current state of the resource, and generate a new adjustment action corresponding to the state change; the execution module continues to execute the new adjustment action; and so on and so forth until the resource node completes the fault recovery.
[0030] In a second aspect, the present application further provides a resource management and control method, which is applied to the resource management and control system described in any one of the first aspects above.
[0031] In an embodiment of the present application, the resource management method includes:
[0032] At the initial moment, read the current state of the resource output by the state observation module;
[0033] At a first moment, responding to a first external operation, and converting it into a first target state;
[0034] generating an adjustment action for reaching the first target state from the current state according to the calculated difference between the current state and the first target state;
[0035] The adjustment action is performed, and the first target state is set as the current state.
[0036] In an embodiment of the present application, the first external operation is scaling down to a first number of resource nodes, and the step of generating an adjustment action for reaching the first target state from the current state according to calculating the difference between the current state and the first target state includes:
[0037] Determine whether the number of currently ready resource nodes is greater than the first number;
[0038] If the number of currently ready resource nodes is greater than the first number, the number of resource nodes is reduced to the first number; otherwise, continue to determine whether the number of currently ready resource nodes is equal to the first number;
[0039] If the number of currently ready resource nodes is not equal to the first number, the number of resource nodes is expanded to the first number.
[0040] In an embodiment of the present application, the resource management method includes:
[0041] At a second moment, responding to a second external operation, and converting it to a second target state;
[0042] At a third moment, responding to a third external operation, and converting it to a third target state;
[0043] If the second moment and the third moment are within a preset interval, and the second external operation and the third external operation are external operations of the same type, merging the second target state and the third target state;
[0044] Calculating the difference between the current state and the merged target state, and generating an adjustment action from the current state to the merged target state according to the difference;
[0045] The adjustment action is performed, and at the same time, the merged target state is set as the current state.
[0046] In an embodiment of the present application, the resource management method further includes:
[0047] At a second moment, responding to a second external operation, and converting it to a second target state;
[0048] At a third moment, responding to a third external operation, and converting it to a third target state;
[0049] If the second moment and the third moment are within a preset interval time period, and the second external operation and the third external operation are external operations of different types, then calculating the difference between the current state and the second target state and the third target state respectively;
[0050] generating an adjustment action for reaching the second target state and the third target state from the current state according to the difference;
[0051] The adjustment action is performed, and the first target state and the second target state are set as current states at the same time.
[0052] In a third aspect, the present application also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein when the processor executes the computer program, the steps of the resource management method as described in any one of the second aspects are implemented.
[0053] In a fourth aspect, the present application further provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the resource management and control method as described in any one of the second aspects are implemented.
[0054] The present application provides a resource management system, method, electronic device and storage medium. The resource management system described in the present application constructs an architecture that includes components such as a state conversion module, a state observation module, a state difference and dynamic programming module, and an execution module, and establishes a collaboration mechanism between them to achieve efficient resource management. Specifically, the state conversion module converts external operations into the target state of the resource; the state observation module outputs the current state of the resource; the state difference and dynamic programming module calculates the difference based on the target state and the current state to generate an adjustment action; the execution module executes the adjustment action in sequence.
[0055] Through the collaboration of various components, this application can make correct decisions and adjustments based on actual conditions, meet the needs of management and system control of various types of resources, and thus achieve efficient management and control of resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] In order to more clearly illustrate the technical solutions in the present application or the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0057] Figure 1 It is a schematic diagram of the resource management and control system provided by this application;
[0058] Figure 2 is a schematic diagram of a reduced capacity resource node provided in an embodiment of the present application;
[0059] Figure 3 It is a general flow chart of the resource management and control system provided in the embodiment of the present application;
[0060] Figure 4 is a flow chart of continuous external operations of the same type provided by an embodiment of the present application;
[0061] Figure 5 This is a flowchart of continuous external operations of different types provided in an embodiment of the present application.
[0062] Figure 6 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0063] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions in this application will be clearly and completely described below in conjunction with the drawings in this application. Obviously, the described embodiments are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0064] The terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchanged where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein.
[0065] The following is a description of the technical terms involved in this application:
[0066] Workflow refers to organizing a series of related tasks according to a specific order, logic and rules to form a complete work process. In a workflow, there is a dependency relationship between tasks. Each task receives input data or results and generates output data or results, thereby promoting the execution of the entire workflow.
[0067] In order to solve the problems existing in traditional resource management and control technologies, the present application provides a resource management and control system, method, electronic device and storage medium; the resource management and control system includes a state conversion module, a state observation module, a state difference and dynamic programming module and an execution module. The state conversion module converts external operations into the target state of the resource, and the state observation module outputs the current state of the resource. The state difference and dynamic programming module calculates the difference based on the target state and the current state, and generates an adjustment action. The execution module executes the adjustment action in sequence. Through the collaboration of various components, the present application can make correct decisions and adjustments according to actual conditions, meet the needs of management and system control of various types of resources, and thus achieve efficient management and control of resources.
[0068] Combine the following Figure 1-Figure 6 Describe the resource management system, method, electronic device and storage medium of the present application.
[0069] Please refer to Figure 1 , Figure 1 is a schematic diagram of a resource management and control system provided in the present application, wherein a resource management and control system 100 includes a state conversion module 101 , a state observation module 102 , a state difference and dynamic programming module 103 and an execution module 104 .
[0070] Exemplarily, the state conversion module 101 is used to respond to each external operation input and convert it into a target state of the resource.
[0071] Exemplarily, the external operation includes but is not limited to any one of the following or a combination thereof:
[0072] Create resources: Create new resource instances according to specific requirements and configurations, such as creating resource nodes, which may include computing nodes, storage nodes, and network nodes.
[0073] Scaling resources: Adjusting the scale or capacity of resources, such as scaling the number of resource nodes, increasing storage capacity, or adjusting network bandwidth.
[0074] Deleting resources: Remove resource instances that are no longer needed or expired from the system, such as deleting resource nodes, storage nodes, or network nodes.
[0075] Resource node upgrades are used to improve the performance, capacity, and functionality of computing systems to meet growing and changing computing needs.
[0076] State switching: changes the working state of resources, such as switching a resource node from normal operation to maintenance mode, or switching a storage node from read / write mode to read-only mode.
[0077] Fault recovery: Repair operations for resource failures, such as failure recovery for resource nodes, storage devices, or network configurations.
[0078] Data migration: Migrate data from one resource to another, such as migrating data on a storage node to a new storage device, or migrating the workload on a resource node to another node.
[0079] System configuration updates are used to enable or disable certain functional features of the system, adjust the load balancing strategy of resource nodes, optimize the read and write performance of storage nodes, or optimize the transmission speed of network nodes.
[0080] It is important to note that the external operations that can be implemented in a specific application will vary depending on the specific resource type and management requirements. The above examples provide some common situations, but there may be other types of external operations in specific applications.
[0081] Specifically, the state transition module 101 needs to be able to monitor and receive external operations of external input, for example, which can be achieved by interacting with interfaces of other systems or components, such as receiving instructions or requests from a user interface or other systems.
[0082] In addition, the state conversion module 101 needs to parse and identify the received external operation to determine the type and parameters of the operation. Then, according to the operation type obtained by parsing and identifying, the state conversion module 101 will convert the external operation into the target state corresponding to the resource according to predefined rules and logic. Once successfully converted to the target state, the state conversion module 101 will output the converted target state. For example, the target state can be cached through an interface, a message queue, or a callback for the next step of processing.
[0083] The state conversion module 101 monitors, analyzes and identifies external operations, converts them into the target state corresponding to the resource according to the operation type, and outputs the converted target state. In this way, in the resource management process, the state conversion module 101 can be used to respond to external operations and calculate the target state, thereby achieving effective control of the resource state.
[0084] Exemplarily, the state observation module 102 is used to continuously monitor the state of the resource to output the current state of the resource.
[0085] Specifically, the state observation module 102 needs to clearly define the resources to be monitored, and the resources can be various types of resources such as hardware devices, software services, and database records. Then, the state observation module 102 will periodically or continuously obtain the state of the resources according to a predetermined time interval or other triggering conditions. After obtaining the state data of the resource, the state observation module 102 will parse and process it, such as decoding, formatting, converting, verifying or aggregating the state data, to ensure that correct and consistent state information is obtained. After processing the state data, the state observation module 102 will output the current state of the resource. For example, it can be cached through an interface, a message queue, a storage database, etc. for the next step of processing.
[0086] Specifically, the state observation module 102 obtains the current state of the resource in the following ways, including but not limited to:
[0087] Acquisition by monitoring events generated by the resource itself: The state observation module 102 can obtain resource state information by monitoring events generated by the resource itself. These events can be generated by changes in the state of the resource or by triggering specific conditions. By capturing and processing these events, the state observation module 102 can obtain the current state of the resource.
[0088] Acquisition through the measurement information output by the resource itself: the resource will actively output relevant measurement information, such as performance indicators and statistical data of the resource. The state observation module 102 can obtain the current state of the resource by receiving and parsing the measurement information.
[0089] Acquisition through information actively reported by the resource itself: The resource will actively report its status information regularly or according to specific conditions. For example, the resource may send status updates regularly, or actively report when important events or abnormal situations occur. The status observation module 102 can receive and process the reported information to obtain the current status of the resource.
[0090] Obtain by calling the state information query interface provided by the resource itself: Resources may provide some state information query interfaces, allowing external systems or components to obtain the current resource state by calling the interfaces. The state observation module 102 can use these interfaces to actively query the state information of the resource and obtain the current state of the resource.
[0091] Through the above approach, the state observation module 102 can obtain the state components of the resource from multiple dimensions, and then combine these components through calculation to form the current state of the resource. In this way, during the resource management process, the state observation module 102 can be used to monitor the state changes of the resource in real time, so as to obtain the current resource state information in time for subsequent resource management and regulation decisions.
[0092] Exemplarily, the state difference and dynamic programming module 103 is used to calculate the target state and the current state, and generate an adjustment action from the current state to the target state according to the difference.
[0093] Specifically, the state difference and dynamic programming module 103 compares the external operations of the target state and the current state to determine whether they have at least partially the same type of external operations. If the target state and the current state have at least partially the same type of external operations, the state difference and dynamic programming module 103 will merge the target states related to the external operations of the same type.
[0094] That is, external operations of the same type will be considered as a whole to better process and calculate differences. After merging the relevant target states, the state difference and dynamic programming module 103 will calculate the difference between the current state and the merged target state, and the difference can be the difference value between the state attributes or the difference between the configuration parameters. Based on the calculated difference, the state difference and dynamic programming module 103 will generate an adjustment action to reach the target state from the current state, and the adjustment action can be a specific command, a configuration update instruction, or other forms of operation sequences.
[0095] The state difference and dynamic programming module 103 reads the target state and the current state, determines the type of external operation, merges the relevant target states, calculates the difference, and generates the adjustment action to achieve dynamic adjustment and control from the current state to the target state. In this way, in the resource management process, the state difference and dynamic programming module 103 can be used to derive an effective operation sequence to help achieve the flexibility and dynamism of resource management.
[0096] In addition, in addition to considering the differential values of state components, the state differential and dynamic planning module 103 can also consider various constraints when performing dynamic planning, such as the maximum number of actions that can be executed at one time, the maximum available resources, the priority of similar resources, resource availability constraints, etc. The planner will sort and filter according to predefined weights and constraints, select the most advanced and orthogonal set of adjustment actions, and push them to the execution module for execution.
[0097] Exemplarily, the execution module 104 is used to receive the adjustment action and execute it to change the state of the resource.
[0098] Specifically, the execution module 104 will create a regulation action queue for storing the regulation actions to be executed. When the state difference and dynamic programming module 104 generate regulation actions, the execution module 104 can cache the regulation actions in the queue. The execution module 104 will take out all the received regulation actions from the queue, merge and fuse them according to the logic rules, such as canceling some useless actions, merging some regulation actions of the same type, forming multiple orthogonal execution actions, and then executing these actions in parallel. When the above actions are executed, the execution module 104 will take out all the newly received regulation actions from the queue again, and then continue to merge and fuse, and then execute the process in parallel. Until the queue is empty or reaches a predetermined stop condition. During the execution process, the execution module 104 can monitor the execution status of each regulation action and can perform error handling as needed. For example, if a certain regulation action fails to execute, the execution module can record error information, retry or take appropriate fault handling measures.
[0099] It should be noted that using the above queue is only one implementation method, and this application does not limit this.
[0100] Through the above method, the execution module 104 can realize batching and merging of adjustment actions and execute them in parallel, which can effectively reduce repeated adjustment actions, speed up the adjustment speed, and ensure the stability and consistency of resources.
[0101] In addition, the execution module 104 does not need to feed back the execution result to the state difference and dynamic programming module 103. Whether the adjustment action is executed successfully or not, it will not affect the execution logic of the state difference and dynamic programming module 103. The state difference and dynamic programming module 103 will only plan the execution plan according to the result value monitored by the state observation module 102. This feature can effectively suppress the oscillation of the adjustment process caused by abnormal execution.
[0102] It should be noted that the state conversion module 101, the state observation module 102, the state difference and dynamic programming module 103 and the execution module 104 all work in an asynchronous manner. In other words, the operation execution of the state conversion module 101, the state observation module 102, the state difference and dynamic programming module 103 and the execution module 104 will not block the processing of the user request.
[0103] Specifically, when a user makes a request on the operating system page, such as external operations such as expansion, reduction or version upgrade, these operations will be immediately returned to the user, and the background resource management and control loop will continue to monitor the changes in the current state and target state of the resource. Once the current state of the resource is inconsistent with the target state, the state difference and dynamic programming module 103 will calculate the difference between the two states, and calculate the best execution path from the current state to the target state in real time based on the difference value to generate an adjustment action, and push it to the execution module 104 for execution. In this way, the state of the resource will gradually approach the target state and eventually reach the target state.
[0104] Compared with the traditional workflow implementation method, this application has the following advantages:
[0105] First, improve the system response speed. The user's request operation can be returned immediately and will not be blocked by the execution operation of the back-end control loop, so it can quickly respond to user needs and provide a better user experience.
[0106] Second, improve system availability. Since the operations of the state conversion module 101, the state observation module 102, the state difference and dynamic programming module 103, and the execution module 104 are performed asynchronously, even when the control loop in the background performs adjustment operations, the user can still continue to perform other operations, such as continuous expansion and contraction, and version upgrades. This can ensure the availability of the system and reduce restrictions on user operations.
[0107] Third, efficient resource management. Through asynchronous execution, the resource management process can continue in the background, monitor the changes in resource status and target status in real time, calculate the difference and execute the best path to output the adjustment action, so as to manage and control resources in a more efficient way. This helps to achieve flexible regulation and optimal utilization of resources and improve system operation efficiency.
[0108] To summarize, the present application adopts a full-link asynchronous design method, specifically by allowing the state transition module, state observation module, state difference and dynamic programming module, and execution module to work in an asynchronous manner, thereby ensuring the system's rapid response to user request operations, while performing resource management and control in the background, thereby improving the system's availability and resource management efficiency.
[0109] That is to say, this application constructs an architecture that covers components such as state transition module, state observation module, state differential, dynamic planner and execution module, and establishes a collaboration mechanism between them to achieve efficient resource management and control. Secondly, this architecture is used to manage the status and resources of distributed resource nodes. Specifically, the state transition module is used to describe the conversion relationship between the states of resource nodes; the state observation module is used to monitor the health status and resource usage of resource nodes; the state differential technology of the state differential and dynamic programming modules is used to compare the difference between the desired resource node state and the current state, and the dynamic planner is applied to make decisions and optimize resource allocation based on state differences; finally, the execution module is used to perform corresponding operations to enable the resource nodes to reach the desired state and resource allocation.
[0110] It should be noted that the resource nodes described in the examples provided in this application can represent any type of resources and their combinations, including but not limited to computing nodes, physical resource nodes, storage nodes, network nodes, etc.
[0111] The specific implementation of the above-mentioned state transition module, state observation module, state difference and dynamic programming module and execution module is further described below.
[0112] The present application implements the functions of the above-mentioned state conversion module 101, state observation module 102, state difference and dynamic programming module 103 and execution module 104, which can be realized through the state space.
[0113] The state space is a model used to describe the dynamic behavior of resources, including state variables and the relationships between them. Each state variable represents the state of a resource at a certain moment, usually represented by a two-dimensional matrix or other data structure. The relationship between states describes how the state of a resource evolves and transforms between different time points.
[0114] The current state represents the current state of the resource and is a specific instance in the state space. By monitoring the resources, you can obtain information about the current state, such as the resource configuration, operation status, and performance indicators.
[0115] The target state is the state that the user expects the resource to reach. Each external operation of external input changes the target state of the resource. For example, the user may want to adjust the scale of the resource, update the configuration, or adjust certain attributes to specific values. The target state describes how the resource should be configured and run to meet specific needs and requirements.
[0116] The dynamic nature of the state space lies in the constant change of the target state. The user's operation will update the target state, and the resource management system will calculate the difference between the current state and the target state, generate the next execution plan, and gradually change the resource configuration and execution operations through the execution module, so that the resource state gradually approaches the target state.
[0117] The state space model is the basis for realizing automated resource management and control. It can provide dynamic performance, reliability and maintainability, and help the resource management and control system to better schedule and control resources. By using the state space model, the resource management and control system can formulate appropriate execution plans and operation strategies based on the difference between the current state and the target state to optimize resource utilization and meet user needs.
[0118] In some embodiments of the present application, the target state of a resource may be represented by a first structure, and the current state of the resource may be represented by a second structure and a third structure.
[0119] In computer programming, a structure is a composite data type used to organize and store multiple related data items. It can combine different data types into a single entity. A structure consists of multiple member variables, each of which can have a different data type, such as integers, floating-point numbers, characters, arrays, or other structures. By defining a structure, you can create a custom data type, in which member variables are used to represent different properties or characteristics.
[0120] Map the user's operations and execution status into the structure to construct the state space. The function and role of the structure mainly include two aspects:
[0121] Indicates system status: The fields in the structure can store the current status information of the system. For example, in the resource management scenario, the fields of the structure can be used to store status data such as the number of resource nodes, storage capacity, network configuration, etc.
[0122] Mapping user expectations: Another role of the structure is to map user expectations. By defining specific fields or methods, the structure can describe the user's expectations for the target state of the resource. For example, the structure can describe the user's expected scale, configuration, and other information for the resource.
[0123] The resource management and control system can clearly understand the meaning of user operations from the above structure, automatically plan adjustment actions, and make the resource status meet user expectations by implementing operations such as creating, deleting, and expanding resource nodes.
[0124] The structure makes the connection between system status and user operations clearer and easier to manage. By operating the structure, the status can be updated and the user operation can be executed. The structure can also be used to record historical status, save system snapshots, and other functions.
[0125] Exemplarily, the first structure may be used to describe the user's expectations and requirements for the resource node; the second structure may be used to describe the actual situation of the resource node; and the third structure may be used to describe the detailed information of the resource node.
[0126] In summary, the purpose of these structures is to describe and record the target state and current state of resources, as well as the specific information of resource nodes.
[0127] Specifically, the first structure includes a first field, a second field, a third field, a fourth field, and a fifth field. The first field indicates the size of the user's demand for resource nodes, the second field indicates the user's expected final state of the resource node (such as running, stopped, destroyed, etc.), the third field indicates the user's expected resource node model and specification, the fourth field indicates the user's expected node configuration version, and the fifth field indicates the user's expected fault migration result (such as in-place replacement, remote migration, etc.).
[0128] Specifically, the second structure includes a sixth field and a seventh field, wherein the sixth field indicates the current actual number of resource nodes, and the seventh field is an array composed of a group of third structures, indicating the state of each resource node in the resource.
[0129] Specifically, the third structure includes an eighth field, a ninth field, a tenth field, and an eleventh field. Among them, the eighth field is the unique ID of the resource node represented, the ninth field indicates the current state of the node, the tenth field indicates the model and specification of the current node, and the eleventh field indicates the configuration version currently used by the node.
[0130] Exemplarily, first, a state space is constructed. For example, the target state is represented by a first structure TargetStatus, and the current state is represented by a second structure CurrentStatus.
[0131] As shown below:
[0132]
[0133] It should be noted that the above structure can be expressed in Golang. Golang, also known as the Go language, is a programming language developed by Google. This application does not limit the programming language used by the structure, for example, it does not limit the Go language.
[0134] Among them, in the first structure TargetStatus mentioned above:
[0135] Size: represents the first field, which indicates the size of the resource node required by the user;
[0136] State: represents the second field, which indicates the final state of the resource node that the user expects (such as running, stopped, destroyed, etc.);
[0137] Specification: represents the third field, which indicates the resource node model and specification expected by the user;
[0138] ConfigVersion: represents the fourth field, which indicates the node configuration version expected by the user;
[0139] AdditionalConfig: represents the fifth field, which contains additional configuration information in addition to the first, second, third, and fourth fields. For example, you can add configuration items to indicate the user's expected fault migration results (such as in-place replacement, remote migration, etc.). For another example, you can add configuration items to indicate the priority of shrinking.
[0140] Among them, in the second structure CurrentStatus above:
[0141] Size: represents the sixth field, which indicates the current actual number of resource nodes
[0142] Nodes: Indicates that the seventh field is an array consisting of a set of third structures, which represents the status of each resource node in the resource.
[0143] Among them, in the third structure NodeStatus mentioned above:
[0144] NodeId: represents the eighth field, which represents the unique ID of the resource node;
[0145] State: represents the ninth field, which indicates the current state of the node. State represents the overall state of the resource node. It can include some advanced states, such as normal state, creating state, scaling state, deleting state or failed state. This field helps users and operators quickly understand the overall health status of the resource node;
[0146] Specification: represents the tenth field, which indicates the model and specification of the current node;
[0147] ConfigVersion: represents the eleventh field, which indicates the configuration version currently used by the node. Secondly, the user's external operations can be mapped to modifications to the target state.
[0148] In addition, it should be noted that the structure is only used as an example, and this application does not limit the types of the fields of the structure; this application can have default values for each field of the structure; the structure can have multiple variations, such as being decomposed into multiple finer-grained structures and combined. Therefore, this application does not limit the various variations of the structure.
[0149] Exemplarily, the first structure can also be disassembled into the following substructures and combined, for example:
[0150]
[0151]
[0152] The following describes an example operation on a resource node using the above structure.
[0153] Exemplarily, a resource node is created.
[0154] Based on the first field, the second field, the third field, the fourth field and the fifth field of the first structure, as well as the second structure and the third structure; when the external operation is to create a resource node, the state transition module generates the target state of the resource according to the input external operation, and the state observation module obtains the current state of the resource, and the first acquisition of the resource state is empty; the state difference and planner calculates the state difference according to the target state and the current state of the resource, and dynamically generates a series of actions related to the creation of the resource; the execution module executes these actions to complete the creation of the resource; during the resource creation, the state observation module will continuously monitor the state changes of the resource, update the current state of the resource, trigger the state difference and planner to recalculate the difference between the target state and the current state of the resource, and generate a new adjustment action corresponding to the state change; the execution module continues to execute the new adjustment action; and so on and so forth until the resource creation is completed.
[0155] For example, when a user creates a new resource node, a new target status is created, and the first field in the first structure TargetStatus specifies the number of resource nodes required (i.e. Size). You can create a TargetStatus instance as shown below:
[0156] TargetStatus.Size=5.
[0157] In this example, the user specifies Size as 5, indicating that five resource nodes are desired to be created.
[0158] Exemplarily, the capacity of resource nodes is expanded or reduced.
[0159] Based on the first field of the first structure, the sixth field of the second structure, and the ninth field of the third structure, when the external operation is to scale the resource node, the state transition module modifies the capacity-related component in the target state of the resource according to the external input information; the state observation module obtains the current state of the resource; the state differential and planner calculates the state differential according to the target state and the current state of the resource, and dynamically generates a series of actions related to resource scaling; the execution module executes these actions to complete the expansion or reduction of the resource; during the resource scaling, the state observation module will continuously monitor the state changes of the resource, update the current state of the resource, trigger the state differential and planner to recalculate the difference between the target state and the current state of the resource, and generate a new adjustment action corresponding to the state change; the execution module continues to execute the new adjustment action; and so on and so forth until the resource scaling is completed.
[0160] Specifically, to expand or shrink a resource node, the user only needs to update the Size value of the first field in the first structure TargetStatus of the existing target status, and then the resource management system will automatically perform the expansion and shrinking operations. For example:
[0161] TargetStatus.Size=10.
[0162] In this example, the user updates the size of the target state to 10, and the resource management and control system automatically performs the corresponding expansion operation.
[0163] It can be seen that the above external operation examples demonstrate the superiority of the present application over the traditional method. Figure 2 , Figure 2 This is a schematic diagram of shrinking resource nodes provided in an embodiment of the present application. A user creates a resource node and hopes to expand the number of resource nodes from 1 to 5. However, during the expansion process, a shrinking request is submitted, that is, the number of nodes is reduced from 5 to 3. The execution process is as follows:
[0164] Step 301: An external operation requesting to shrink the capacity to three resource nodes is received.
[0165] Step 302: determine whether the number of currently ready resource nodes is greater than 3.
[0166] If yes, execute step 303; otherwise, execute step 304.
[0167] Step 303: Scaling down to 3 resource nodes.
[0168] Step 304: determine whether the number of currently ready resource nodes is equal to 3.
[0169] If yes, the operation ends; otherwise, execute step 305.
[0170] Step 305, expand to 3 resource nodes.
[0171] In the traditional method, the expansion operation can only be responded to after the creation operation is completed, and the impact of the reduction request on the execution path cannot be dynamically considered. Therefore, in the traditional method, the reduction operation can only be performed after the expansion operation is completed.
[0172] However, in this application, the user submitted a scaling request during the scaling process, which actually adjusted the number of nodes in the target state from 5 to 3. The resource management system will dynamically adjust the execution strategy to meet the user's request without waiting for the scaling operation to be fully completed before executing the scaling operation. This flexibility and dynamic adjustment of the application can improve the efficiency and resource utilization of the system.
[0173] Exemplarily, a resource node is deleted.
[0174] Based on the second field of the first structure and the first field of the second structure, when the external operation is to delete a resource node, the state transition module modifies the target state of the resource to destroyed according to the external input information; the state observation module obtains the current state of the resource; the state difference and planner calculates the state difference according to the target state and current state of the resource, and dynamically generates a series of actions related to deleting the resource; the execution module executes these actions to complete the deletion of the resource; during the resource deletion, the state observation module will continuously monitor the state changes of the resource, update the current state of the resource, trigger the state difference and planner to recalculate the difference between the target state and the current state of the resource, and generate a new adjustment action corresponding to the state change; the execution module continues to execute the new adjustment action; and so on and so forth until the resource deletion is completed.
[0175] Exemplarily, the model and specification of the resource node are modified.
[0176] Based on the third field of the first structure and the seventh and tenth fields of the second structure, when the external operation is to modify the model and specification of the resource node, the state conversion module modifies the model and specification-related components in the target state of the resource according to the external input information; the state observation module obtains the current state of the resource; the state difference and planner calculates the state difference according to the target state and current state of the resource, and dynamically generates a series of actions related to the resource specification change; the execution module executes these actions to complete the resource specification change task; during the resource specification change, the state observation module will continuously monitor the state changes of the resource, update the current state of the resource, trigger the state difference and planner to recalculate the difference between the target state and the current state of the resource, and generate a new adjustment action corresponding to the state change; the execution module continues to execute the new adjustment action; and so on and so forth until the resource specification change is completed.
[0177] Exemplarily, the configuration version of the resource node is modified.
[0178] Based on the fourth field of the first structure and the seventh and eleventh fields of the second structure, when the external operation is to modify the configuration version of the resource node, the state transition module modifies the components related to the configuration version in the target state of the resource according to the external input information; the state observation module obtains the current state of the resource; the state differential and planner calculates the state differential according to the target state and current state of the resource, and dynamically generates a series of actions related to the resource configuration change; the execution module executes these actions to complete the configuration update of the resource; during the resource configuration change, the state observation module will continuously monitor the state changes of the resource, update the current state of the resource, trigger the state differential and planner to recalculate the difference between the target state and the current state of the resource, and generate a new adjustment action corresponding to the state change; the execution module continues to execute the new adjustment action; and so on and so forth until the resource configuration change is completed.
[0179] For example, when the external operation is to change the configuration version of the resource node, the resource management and control system can update the version of the fourth field to a new version and execute the configuration change operation of the resource node to ensure that the version of each resource node in the eleventh field is consistent with the version in the fourth field.
[0180] For example, the following indicates that the configuration version of all current resource nodes is v1:
[0181] CurrentStatus.Nodes[*].ConfigVersion=v1;
[0182] When the user performs a configuration change operation on a resource node, the ConfigVersion field in the second structure TargetStatus will be updated, as shown below:
[0183] TargetStatus.ConfigVersion=v2;
[0184] When the resource management and control system finds that the ConfigVersion field of the resource node in the seventh field of the second structure is inconsistent with the ConfigVersion of the fourth field of the first structure TargetStatus, it starts to execute the configuration change operation of the resource node until the versions of all resource nodes are consistent with the specified version.
[0185] Even during the version configuration process, users can still scale up and down and upgrade again, that is, modify the Size and ConfigVersion fields in the first structure TargetStatus. The resource management system will dynamically calculate the execution strategy and iterate all user operations.
[0186] For example, failure recovery
[0187] Based on the seventh field of the second structure and the ninth field of the third structure, when a resource node fails, the state observation module observes the node failure and sets the ninth field in the element in the seventh field of the current state corresponding to the node to an abnormal state; the state difference and planner calculates the state difference according to the target state and current state of the resource, and dynamically generates a series of actions related to the fault recovery of the resource node based on the configuration information related to fault recovery in the fifth field of the first structure; the execution module executes these actions to complete the fault recovery of the resource; during the resource node fault recovery, the state observation module will continuously monitor the state changes of the resource, update the current state of the resource, trigger the state difference and planner to recalculate the difference between the target state and the current state of the resource, and generate a new adjustment action corresponding to the state change; the execution module continues to execute the new adjustment action; and so on and so forth until the resource node completes the fault recovery.
[0188] Exemplarily, the following represents the resource status corresponding to a resource node when the node fails:
[0189] CurrentStatus.Nodes[1].State=Abnormal;
[0190] After the resource management and control system detects the above status change, it performs a fault recovery operation according to the configuration of the fifth field, with the goal of making the status of all current nodes conform to the description of the first structure TargetStatus.
[0191] Specifically, in this example, when the fifth field is configured for "in-place replacement", the resource management and control system will reset resource node 1 and expect the resource node status to be restored to "Normal", that is, CurrentStatus.Nodes[1].State = Normal. If resource node 1 cannot be restored to normal status for a long time, an alarm will be triggered, and then the manual maintenance phase will be entered. When the fifth field is configured for "migration recovery", the resource management and control system will perform fault recovery by expanding the capacity of a resource node and reducing the capacity of the current faulty node to ensure that the actual number of resource nodes (described by the sixth field) is consistent with the expected number of nodes (described by the first field).
[0192] In summary, the present application realizes the functions of the state transition module, the state observation module, the state difference and dynamic programming module, and the execution module by utilizing the state space. The specific function is: when receiving the external operation of the user, the change will not be rejected, but the target state will be modified according to the external operation. Unless the external operation violates the specification, such as an illegal change request that exceeds the quantity limit. Secondly, it can calculate in real time how to adjust to achieve the goal of the external operation. That is to say, according to the current state and the target state, dynamically determine how to adjust to complete the change. In addition, multiple external operations can be completed in one adjustment operation through state superposition. In other words, multiple external operations can be superimposed together and completed simultaneously in one adjustment operation, which can reduce the number of adjustments and speed up the completion of the entire change process. And it is not limited to specific change types, and can be applied to various external operations, such as expansion and contraction, version configuration, etc.
[0193] The resource management and control method provided in the present application is described below. The resource management and control method described below and the resource management and control system described above can be referenced to each other.
[0194] In some embodiments of the present application, the resource management and control method described in the present application can be applied to the resource management and control system described in any of the above embodiments.
[0195] Please refer to Figure 3 , Figure 3 It is a general flow chart of the resource management and control system provided in the embodiment of the present application. Figure 3 The execution flow of the state conversion module 101, the state observation module 102, the state difference and dynamic programming module 103 and the execution module 104 included in the resource management and control system is described.
[0196] Exemplarily, the main process of the state transition module 101 is as follows:
[0197] Step 1011: The user submits an external operation through the interactive interface.
[0198] For example, users can submit external operations by filling out forms on a web page, clicking buttons, etc., or use the OpenAPI client to call the API interface provided by the system to implement external operations. Through these interactive interfaces, users can easily communicate and interact with the system to complete the required external operations.
[0199] Step 1012: The state conversion module receives the external operation and converts it into the target state of the resource.
[0200] The purpose of this step is to convert the user's external operation into a target state that is suitable for resource understanding and processing. Through this step, the resource management system can accurately translate the user's intention into the actual state change of the resource. In this way, the resource can be adjusted and operated accordingly according to the target state, thereby achieving the change effect required by the user.
[0201] Step 1013, returning information indicating that the user's external operation has been successfully received.
[0202] The purpose of this step is to inform the user's external operation that has been received by the resource control system and is being processed, so that the user knows that their operation has been successfully received and can also wait for the resource control system to complete the corresponding processing.
[0203] Exemplarily, the main process of the state observation module 102 is as follows:
[0204] Step 1021, determine whether it is necessary to check the status of the resource.
[0205] If it is necessary to check the resource status, execute step 1022 ; if it is not necessary to check the resource status, return to step 1021 .
[0206] This step can obtain the actual status of resources through specific conditions, such as time intervals, trigger events, system requirements, etc., and determine subsequent processing steps based on this to ensure that external operations can proceed as expected and achieve the desired effect.
[0207] Step 1022, monitor the current status of the resource.
[0208] For example, the actual status of resources can be obtained by reading sensor data, monitoring process status, querying system information, etc. In this way, the status observation module can obtain accurate information to support subsequent processing and decision-making.
[0209] The role of the state observation module is to obtain the actual state of the resources and provide accurate information and judgment basis for subsequent processing steps. By monitoring the current state of the resources, the state observation module can ensure that external operations are carried out as expected and can handle changes in resource states accordingly. It plays an important role in the resource management and control process to ensure that the system can make correct decisions and adjustments based on actual conditions.
[0210] Exemplarily, the main process of the state difference and dynamic programming module 103 is as follows:
[0211] Step 1031, determine whether the target state or the current state has changed.
[0212] If yes, execute step 1032; otherwise return to step 1031 to wait for new changes.
[0213] Step 1032, read the target state and the current state, and calculate the difference between the current state and the target state, wherein the difference is information used to describe the state change or variation.
[0214] Step 1033, determine whether the difference is not zero.
[0215] If the difference is not zero, execute step 1034; if the difference is zero, it means that the target state has been reached or there is no difference with the current state, then return to step 1031.
[0216] Step 1034 , generating an adjustment action from the current state to the target state based on the difference to form an adjustment action list.
[0217] The role of the state difference and dynamic programming module is to generate an appropriate adjustment action list based on the difference between the current state and the target state in the process of resource management or control, so as to achieve the goal of gradually adjusting the current state to the target state. It can monitor the change of state and take corresponding measures to provide effective support for resource regulation.
[0218] Exemplarily, the main process of the execution module 104 is as follows:
[0219] Step 1041, determining whether an adjustment action needs to be performed.
[0220] Specifically, it can be judged by specific conditions or triggering events, such as a certain time interval, a specific system state, an external request, etc.
[0221] If the adjustment action needs to be performed, step 1042 is executed; if the adjustment action does not need to be performed, return to step 1041.
[0222] Step 1042, obtain and execute the adjustment action that needs to be performed to change the current state of the resource.
[0223] Specifically, the adjustment actions may include operations such as resource creation, deletion, expansion, reduction, configuration update, state switching, and fault recovery. By executing these actions in sequence, the execution module can gradually adjust the system state to make it close to the target state.
[0224] For example, the role of the execution module can be to execute the adjustment actions from the planner, which is a key component for controlling the resource state. The execution module ensures that the state of the resource migrates in the direction expected by the user by executing the adjustment actions in the plan, thereby achieving the required state adjustment and resource management goals. The execution module is the entity that actually operates the resources and provides the system with actual control capabilities.
[0225] It should be noted that the resource management and control system and method described in this application can be applied to the management and control of various types of resources and composite resource entities composed of their combinations, including but not limited to computing nodes, physical resources, network links, data storage, application components, etc.
[0226] The resource management method described in this application is described below through two embodiments.
[0227] Embodiment 1:
[0228] Please refer to Figure 4 , Figure 4 It is a flowchart of continuous external operations of the same type provided by an embodiment of the present application. Figure 4 The scenario shown is to perform multiple external operations of the same type in succession, that is, the external operation is to first expand to 3 resource nodes, then expand to 8 nodes, and finally shrink to 4 nodes. The resource management method described in this application may include the following steps:
[0229] Step 501, at the initial moment, read the current state of the resource output by the state observation module.
[0230] Specifically, at the initial time t 0 Read the current status of the second structure CurrentStatus: size=1, indicating that the current status of the resource is 1 resource node.
[0231] Step 502, at a first moment, respond to a first external operation and convert it into a first target state.
[0232] Specifically, the first external operation input by the user is to expand the system to 3 resource nodes. 1 , the state conversion module sets the first target state in the first structure TargetStatus to 3 resource nodes, that is, size=3.
[0233] Step 503: Return information indicating that the user's first external operation has been successfully received.
[0234] That is, at the first moment t 1 , the user submitted an external operation.
[0235] Step 504: The state difference and dynamic programming module calculates the difference between the current state and the first target state.
[0236] Specifically, the calculated difference d(size)=2 indicates that the value of the difference is 2 resource nodes.
[0237] Step 505: Generate an adjustment action to reach a first target state from the current state.
[0238] Specifically, at t 1-1 An adjustment action is generated at all times, which is to add 2 resource nodes.
[0239] It should be noted that t 1-1 represents the first moment t 1 The first time slot, t 1-2 represents the first moment t 1 The second time slot, t 1-3 represents the first moment t 1 The third time slot; t 2-1 represents the second time t 2 The first time slot, t 2-2 represents the second time t 2 The second time slot, t 2-3 represents the second time t 2 The third time slot of the ; and so on for other time slots.
[0240] Step 506: The execution module executes the adjustment action and sets the first target state as the current state.
[0241] Specifically, at t 1-2 Read the difference value at time (that is, add two resource nodes); at t 1-3 At time t, the execution module executes the adjustment action; at t 1-4 At this moment, the current state is size = 1, adding = 2, indicating that 2 resource nodes have been added, that is, the current state is 1 + 2 = 3 resource nodes. Through the state observation module, it can be known that the current state is 3 resource nodes.
[0242] Step 507, at a second moment, respond to a second external operation and convert it into a second target state.
[0243] Specifically, the second external operation input by the user is to expand the system capacity to 8 resource nodes. 2, the state conversion module sets the second target state in the first structure TargetStatus to 8 resource nodes, that is, size=8.
[0244] That is to say, at t 2 At this moment, the user submitted another external operation.
[0245] Step 508: Return information indicating that the second external operation of the user has been successfully received.
[0246] Step 509, at a third moment, respond to a third external operation and convert it to a third target state.
[0247] Specifically, the second external operation input by the user is to reduce the system capacity to 4 resource nodes. 3 , the state conversion module sets the third target state in the first structure TargetStatus to 4 resource nodes, that is, size=4.
[0248] Step 510: Return information indicating that the third external operation has been successfully received by the user.
[0249] Step 511, if the second moment and the third moment are within a preset interval, and the second external operation and the third external operation are external operations of the same type, the second target state and the third target state are merged, and then the difference between the current state and the merged target state is calculated.
[0250] Specifically, assuming that the second time t 2 and the third moment t 3 is very close, for example within millimeters, then the state difference and dynamic programming modules can be used at the third time t 3 Then respond to the second and third external operations. Since the second and third external operations are of the same type, the states can be superimposed, that is, the expansion of 8 resource nodes and the reduction of 4 resource nodes are merged, and the merged target state is 4 resource nodes.
[0251] It can be seen from the above step 506 that the current state is 3 resource nodes, and the target state after merging is 4 resource nodes, so the difference d(size)=1, indicating that the value of the difference is 1 resource node.
[0252] Step 512: Generate an adjustment action from the current state to the merged target state according to the difference.
[0253] Specifically, at t 3-1 At this moment, the state difference and dynamic programming module generates an adjustment action, which is to add one resource node.
[0254] Step 513: The execution module executes the adjustment action and sets the merged target state as the current state.
[0255] Specifically, at t 3-2 At time t, read the difference value, that is, add a resource node; at t 3-3 At time t, the execution module executes the adjustment action; assuming that during the execution process, one of the two resource nodes added last time is ready, then at t 3-4 At this moment, the current state size is set to 2, adding to 2, indicating 4 resource nodes. If the last 2 resource nodes added are not ready, then at t 3-4 At this moment, the current state can be set to: size = 1, adding = 3, indicating 4 resource nodes. 4 At this moment, the current state can be learned through the state observation module that there are 4 resource nodes.
[0256] Step 514: The current state of the resource is size=4.
[0257] Specifically, at t 4 No external operation from the user is received at this moment.
[0258] Step 515, read the current state size=4 of the resource output by the state observation module.
[0259] Specifically, at t 4-1 At this moment, the difference value d(size)=0, indicating that the target state after merging has been reached.
[0260] Step 516: No adjustment action is generated by the state difference and dynamic programming module.
[0261] Specifically, at t 4-2 At this moment, the state difference and dynamic programming modules generate no adjustment actions.
[0262] In summary, the present application realizes dynamic adjustment and management of resources by reading the current state, responding to external operations, generating adjustment actions, and executing the adjustment actions. At the same time, by merging external operations of the same type, the efficiency of resource management is also improved.
[0263] Embodiment 2:
[0264] Please refer to Figure 5 , Figure 5 is a flowchart of continuous external operations of different types provided in an embodiment of the present application, Figure 5 The scenario shown is to continuously perform multiple different types of external operations. For example, the external operation is to first expand to 3 resource nodes, then open the public network link, and then update the configuration of the resource node. The resource management method described in this application may include:
[0265] Step 601, at the initial moment, read the current state of the resource output by the state observation module.
[0266] Specifically, at the initial time t 0 Read the current status of the second structure CurrentStatus: size = 1, public network link: off, node configuration version: v1. Among them, "size = 1" means that the current status of the resource is 1 resource node, "public network link: off" means that the current public network link is closed, and "node configuration version: v1" means that the current configuration version of the resource node is v1.
[0267] Step 602, at a first moment, respond to a first external operation and convert it into a first target state.
[0268] Specifically, the first external operation input by the user is to expand the system to 3 resource nodes. 1 , the state conversion module sets the first target state in the first structure TargetStatus to 3 resource nodes, that is, size=3.
[0269] Step 603: Return information indicating that the user's first external operation has been successfully received.
[0270] That is, at the first moment t 1 , the user submitted an external operation, namely the first external operation.
[0271] Step 604: The state difference and dynamic programming module calculates the difference between the current state and the first target state.
[0272] Specifically, the calculated difference d(size)=2 indicates that the value of the difference is 2 resource nodes.
[0273] Step 605: Generate an adjustment action to reach a first target state from the current state.
[0274] Specifically, at t 1-1 An adjustment action is generated at all times, which is to add 2 resource nodes.
[0275] Step 606: The execution module executes the adjustment action and sets the first target state as the current state.
[0276] Specifically, at t 1-2 Read the difference value at time (that is, add two resource nodes); at t 1-3 At time t, the execution module executes the adjustment action; at t 1-4At this moment, the current state is size = 1, adding = 2, indicating that 2 resource nodes have been added, that is, the current state is 1 + 2 = 3 resource nodes. Through the state observation module, it can be known that the current state is 3 resource nodes.
[0277] Step 607, at a second moment, respond to a second external operation and convert it into a second target state.
[0278] Specifically, the second external operation input by the user is to enable the public network link. 2 , the state conversion module sets the second target state in the first structure TargetStatus to open the public network link, that is, public network link: open.
[0279] That is to say, at t 2 At this moment, the user submitted another external operation.
[0280] Step 608: Return information indicating that the second external operation of the user has been successfully received.
[0281] Step 609, at a third moment, respond to a third external operation and convert it to a third target state.
[0282] Specifically, the third external operation input by the user is to update the resource node configuration to v2. Therefore, at the third time t 3 , the state conversion module sets the third target state in the first structure TargetStatus to resource node configuration version = v2, that is, node configuration version = v2.
[0283] Step 610: Return the information that the user's third external operation has been successfully received
[0284] Step 611: If the second moment and the third moment are within a preset interval time period, and the second external operation and the third external operation are external operations of different types, then the differences between the current state and the second target state and the third target state are calculated.
[0285] Specifically, assuming that the second time t 2 and the third moment t 3 is very close, for example within millimeters, then the state difference and dynamic programming modules can be used at the third time t 3 Then, the second external operation and the third external operation are responded to. Since the second external operation and the third external operation are different types of external operations, the difference between the current state and the second target state and the third target state is calculated.
[0286] From the above step 606, it can be seen that the current state is 3 resource nodes, and the second target state is to open the public network link, and the third target state is to configure the resource node version to v2, so the calculated difference is:
[0287] d(size)=0;
[0288] d(public network link) = on;
[0289] d(resource node configuration)={n1:v1 / v2, n2:v1 / v2, n3:v1 / v2,pengding}.
[0290] Step 612, generating an adjustment action from the current state to the second target state and the third target state according to the difference.
[0291] In t 3-1 At this moment, the state difference and dynamic planning module generates a group of adjustment actions, which are to open the public network link and configure the versions of resource nodes n1, n2, and n3 to v2 respectively.
[0292] Step 613: The execution module executes the adjustment action and sets the first target state and the second target state as the current state.
[0293] Specifically, at t 3-2 At this moment, the differential value is read (i.e., the public network link is opened, the resource node n1 configuration is updated to v2, the resource node n2 configuration is updated to v2, and the computing node is updated) and the update configuration is started, i.e., the adjustment action of updating the resource node n1 configuration to version v2 is executed. Assume that during the execution process, one of the two resource nodes added last time is ready, so a new resource node n3 needs to be created, so a state superposition occurs, and the newly created resource node n3 is directly configured as v2.
[0294] That is to say, in a dynamic process, there are two external operations that need to be performed. In the first operation, there was originally only one resource node in the system, but now two resource nodes need to be added. In the second operation, the configuration of all resource nodes needs to be upgraded to version v2. When the second operation is entered, the first operation is in progress (only one resource node has been added and the second resource node is about to be added. In order to reduce the complexity and time overhead of the operation, these two operations can be combined. The specific approach is to directly create a third resource node configured as version v2, instead of first creating a third resource node configured as v1 and then upgrading its configuration to version v2.
[0295] This means that when executing the first operation, the system will also consider the configuration of the resource nodes required for the second operation. By merging operations, the process can be simplified and unnecessary intermediate steps can be reduced, thereby improving efficiency.
[0296] Therefore, in the dynamic process of resource management, operations can be flexibly merged according to actual needs, and nodes that meet the final target configuration can be directly created according to actual conditions, rather than creating intermediate configurations first and then upgrading them. This can improve the efficiency and effectiveness of operation execution.
[0297] In t 3-3 At this moment, the execution module completes the execution of the group of adjustment actions.
[0298] In t 3-4 At this moment, set the current state to:
[0299] size=2;
[0300] adding=1;
[0301] Public network link: setup;
[0302] Node configuration: {n1:v2,v2:v2,n3:v2,pengding}.
[0303] Step 614, the current state of the resource is:
[0304] size=2;
[0305] adding=1;
[0306] Public network link: setup;
[0307] Node configuration: {n1:v2,v2:v2,n3:v2,pengding}.
[0308] Specifically, at t 4 No external operation from the user is received at this moment.
[0309] Step 615, read the current state of the resource output by the state observation module:
[0310] size=2;
[0311] adding=1;
[0312] Public network link: setup;
[0313] Node configuration: {n1:v2,v2:v2,n3:v2,pengding}.
[0314] Specifically, at t 4-1 At this moment, the difference value is 0, indicating that the above target state is achieved.
[0315] Step 616: No adjustment action is generated by the state difference and dynamic programming module.
[0316] Specifically, at t 4-2 At this moment, the state difference and dynamic programming modules generate no adjustment actions.
[0317] Therefore, this application uses state differentiation and dynamic programming modules to generate a corresponding set of adjustment actions based on multiple external operations, and gradually adjusts the state of the resource to the target state through the execution module. At the same time, the processing method when merging different types of external operations is also considered to optimize the resource management process.
[0318] It should be noted here that the above-mentioned resource management method provided in the embodiment of the present application can implement all the method steps implemented in the above-mentioned device embodiment, and can achieve the same technical effect. The parts and beneficial effects that are the same as those in the device embodiment will not be described in detail here.
[0319] Figure 6 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application, such as Figure 6 As shown, the electronic device may include: a processor (Processor) 710, a communication interface (Communications Interface) 720, a memory (Memory) 730 and a communication bus 740, wherein the processor 710, the communication interface 720, and the memory 730 communicate with each other through the communication bus 740. The processor 710 may call the logic instructions in the memory 730 to execute the resource management method.
[0320] In addition, the logic instructions in the above-mentioned memory 730 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art, and the computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk.
[0321] On the other hand, the present application also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the resource management methods provided by the above methods.
[0322] On the other hand, the present application also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to execute the resource management and control methods provided above.
[0323] The embodiments of the present application provide an electronic device, a computer program product, and a processor-readable storage medium, on which the computer program stored enables the processor to implement all the method steps implemented in the above-mentioned method embodiments and to achieve the same technical effects. The parts and beneficial effects of this embodiment that are the same as those in the method embodiments will not be described in detail herein.
[0324] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0325] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0326] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A resource management and control system, characterized in that: The resource management and control system includes a state conversion module, a state observation module, a state difference and dynamic programming module and an execution module; The state conversion module is used to respond to each external operation input and convert it into a target state of the resource; The state observation module is used to continuously monitor the state of the resource to output the current state; The state difference and dynamic programming module is used to calculate the difference between the target state and the current state, and generate an adjustment action from the current state to the target state according to the difference; The execution module is used to receive the adjustment action and execute it to change the state of the resource.
2. The resource management and control system according to claim 1, characterized in that: The external operation includes any one or a combination of the following: Create resources, used to create resource nodes; Scaling resources, used to scale the number of resource nodes, increase storage capacity, or adjust network bandwidth; Delete resource, used to delete resource node; Resource node upgrades are used to improve the performance, capacity, and functionality of computing systems to meet computing needs; State switching, used to switch resource nodes from normal operation to maintenance mode; Fault recovery, used for fault recovery of resource nodes, storage devices or network configurations; Data migration, which is used to migrate data on a storage node to a new storage device, or migrate workloads on a resource node to other nodes; System configuration updates are used to enable or disable system features, adjust the load balancing strategy of resource nodes, optimize the read and write performance of storage nodes, or optimize the transmission speed of network nodes.
3. The resource management and control system according to claim 1, characterized in that: The target state of the resource is represented by the first structure, and the current state of the resource is represented by the second structure and the third structure; wherein the first structure is used to describe the user's expectations and requirements for the resource node; the second structure is used to describe the actual situation of the resource node; and the third structure is used to describe the detailed information of the resource node.
4. The resource management and control system according to claim 3, characterized in that: The first structure includes a first field, a second field, a third field, a fourth field and a fifth field, wherein the first field indicates the size of the user's demand for the resource node, the second field indicates the user's expected final state of the resource node, the third field indicates the user's expected resource node model and specification, the fourth field indicates the user's expected node configuration version, and the fifth field indicates the user's expected fault migration result; The second structure includes a sixth field and a seventh field, the sixth field indicates the current actual number of resource nodes, and the seventh field is an array consisting of a group of third structures, indicating the state of each resource node in the resource; The third structure includes an eighth field, a ninth field, a tenth field and an eleventh field, the eighth field is the unique ID of the represented resource node, the ninth field indicates the current state of the node, the tenth field indicates the model and specification of the current node, and the eleventh field indicates the configuration version currently used by the node.
5. The resource management and control system according to claim 4, characterized in that: Based on the first field, the second field, the third field, the fourth field and the fifth field of the first structure, as well as the second structure and the third structure; when the external operation is to create a resource node, the state transition module generates the target state of the resource according to the input external operation, and the state observation module obtains the current state of the resource, and the first acquisition of the resource state is empty; the state difference and planner calculates the state difference according to the target state and the current state of the resource, and dynamically generates a series of actions related to the creation of the resource; the execution module executes these actions to complete the creation of the resource; during the resource creation, the state observation module will continuously monitor the state changes of the resource, update the current state of the resource, trigger the state difference and planner to recalculate the difference between the target state and the current state of the resource, and generate a new adjustment action corresponding to the state change; the execution module continues to execute the new adjustment action; and so on and so forth until the resource creation is completed.
6. The resource management and control system according to claim 4, characterized in that: Based on the first field of the first structure, the sixth field of the second structure, and the ninth field of the third structure, when the external operation is to scale up or down a resource node, the state conversion module modifies a capacity-related component in a target state of the resource according to external input information; The state observation module obtains the current state of the resource; The state differential and planner calculates the state differential according to the target state and current state of the resource, and dynamically generates a series of actions related to resource expansion and contraction; the execution module executes these actions to complete the expansion or contraction of the resource; during the expansion or contraction of the resource, the state observation module continuously monitors the state changes of the resource, updates the current state of the resource, triggers the state differential and planner to recalculate the difference between the target state and the current state of the resource, and generates a new adjustment action corresponding to the state change; the execution module continues to execute the new adjustment action; and this process repeats until the resource scaling is completed.
7. The resource management and control system according to claim 4, characterized in that: Based on the second field of the first structure and the first field of the second structure, when the external operation is to delete a resource node, the state conversion module modifies the target state of the resource to destroyed according to the external input information; the state observation module obtains the current state of the resource; The state differential and planner calculates the state differential according to the target state and current state of the resource, and dynamically generates a series of actions related to deleting the resource; the execution module executes these actions to complete the deletion of the resource; during the resource deletion, the state observation module continuously monitors the state changes of the resource, updates the current state of the resource, triggers the state differential and planner to recalculate the difference between the target state and the current state of the resource, and generates a new adjustment action corresponding to the state change; the execution module continues to execute the new adjustment action; and this process repeats until the resource deletion is completed.
8. The resource management and control system according to claim 4, characterized in that: Based on the third field of the first structure and the seventh and tenth fields of the second structure, when the external operation is to modify the model and specification of the resource node, the state conversion module modifies the model and specification-related components in the target state of the resource according to the external input information; The state observation module obtains the current state of the resource; the state difference and planner calculates the state difference according to the target state and current state of the resource, and dynamically generates a series of actions related to the resource specification change; the execution module executes these actions to complete the resource specification change task; during the resource specification change, the state observation module will continuously monitor the state changes of the resource, update the current state of the resource, trigger the state difference and planner to recalculate the difference between the target state and the current state of the resource, and generate a new adjustment action corresponding to the state change; the execution module continues to execute the new adjustment action; and so on and so forth until the resource specification change is completed.
9. The resource management and control system according to claim 4, characterized in that: Based on the fourth field of the first structure and the seventh and eleventh fields of the second structure, when the external operation is to modify the configuration version of the resource node, the state conversion module modifies the configuration version-related components in the target state of the resource according to the external input information; The state observation module obtains the current state of the resource; The state differential and planner calculates the state differential according to the target state and current state of the resource, and dynamically generates a series of actions related to the resource configuration change; the execution module executes these actions to complete the configuration update of the resource; during the resource configuration change, the state observation module will continuously monitor the state changes of the resource, update the current state of the resource, trigger the state differential and planner to recalculate the difference between the target state and the current state of the resource, and generate a new adjustment action corresponding to the state change; the execution module continues to execute the new adjustment action; and this process repeats until the resource configuration change is completed.
10. The resource management and control system according to claim 4, characterized in that: Based on the seventh field of the second structure and the ninth field of the third structure, when a resource node fails, the state observation module observes the node failure and sets the ninth field in the element in the seventh field of the current state corresponding to the node to an abnormal state; The state differential and planner calculates the state differential according to the target state and current state of the resource, and dynamically generates a series of actions related to the fault recovery of the resource node based on the configuration information related to the fault recovery in the fifth field of the first structure; the execution module executes these actions to complete the fault recovery of the resource; during the fault recovery of the resource node, the state observation module continuously monitors the state changes of the resource, updates the current state of the resource, triggers the state differential and planner to recalculate the difference between the target state and the current state of the resource, and generates a new adjustment action corresponding to the state change; the execution module continues to execute the new adjustment action; and so on and so forth until the resource node completes the fault recovery.
11. A resource management method, characterized in that: The resource management and control method is applied to the resource management and control system described in any one of claims 1 to 10 above.
12. The resource management method according to claim 11, characterized in that: The resource management and control method comprises: At the initial moment, read the current state of the resource output by the state observation module; At a first moment, responding to a first external operation, and converting it into a first target state; generating an adjustment action for reaching the first target state from the current state according to the calculated difference between the current state and the first target state; The adjustment action is performed, and the first target state is set as the current state.
13. The resource management method according to claim 12, characterized in that: The first external operation is to shrink the capacity to a first number of resource nodes, and the step of generating an adjustment action for reaching the first target state from the current state according to the calculated difference between the current state and the first target state includes: Determine whether the number of currently ready resource nodes is greater than the first number; If the number of currently ready resource nodes is greater than the first number, the number of resource nodes is reduced to the first number; otherwise, continue to determine whether the number of currently ready resource nodes is equal to the first number; If the number of currently ready resource nodes is not equal to the first number, the number of resource nodes is expanded to the first number.
14. The resource management method according to claim 12, characterized in that: The resource management and control method comprises: At a second moment, responding to a second external operation, and converting it to a second target state; At a third moment, responding to a third external operation, and converting it to a third target state; If the second moment and the third moment are within a preset interval, and the second external operation and the third external operation are external operations of the same type, merging the second target state and the third target state; Calculating the difference between the current state and the merged target state, and generating an adjustment action from the current state to the merged target state according to the difference; The adjustment action is performed, and the merged target state is set as the current state.
15. The resource management method according to claim 12, characterized in that: The resource management method further includes: At a second moment, responding to a second external operation, and converting it to a second target state; At a third moment, responding to a third external operation, and converting it to a third target state; If the second moment and the third moment are within a preset interval time period, and the second external operation and the third external operation are external operations of different types, then calculating the difference between the current state and the second target state and the third target state respectively; generating an adjustment action for reaching the second target state and the third target state from the current state according to the difference; The adjustment action is performed, and the first target state and the second target state are set as current states at the same time.
16. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the steps of the resource management and control method according to any one of claims 11 to 15 are implemented.
17. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the resource management and control method according to any one of claims 11 to 15 are implemented.