Resource state management method, device and equipment and readable storage medium
By receiving and processing resource allocation requests, the real-time resource data of the physical server is obtained and the resource status is updated, which solves the problem of untimely resource updates in the existing technology, improves the real-time and flexibility of resource management, and ensures that the system is highly dynamic. Stability and resource utilization in sexual environments.
Patent Information
- Application Number
- CN202410836057.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-26
- Publication Date
- 2024-10-15
AI Technical Summary
In the existing technology, physical server resources are updated through scheduled reporting, which results in the system being unable to obtain accurate information on currently available resources in a timely manner. The real-time performance is insufficient, especially in highly dynamic environments, resulting in the scheduling system being unable to respond to sudden requests. The performance is poor, resource allocation is not flexible enough, and it cannot respond to changes in server resources in a timely manner.
By receiving the resource allocation request sent by the scheduling system, allocate resources based on the resource allocation request, obtain real-time resource data of the physical server, and update the resource status according to the allocation result, including initial status, bound status, occupied status, failed status and expiration status to ensure timely updating and recycling of resource status.
It achieves timely acquisition of accurate information about currently available resources, improves real-time performance, enables the scheduling system to better respond to sudden requests, obtains the latest status of physical server resources in real time, improves the flexibility of resource allocation, and can respond to servers in a timely manner Changes in resources.
Smart Images

Figure CN118779103A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a resource status management method, device, equipment and readable storage medium. Background Art
[0002] Currently, in the scheduling of cloud hosts, it is necessary to read the resources (CPU, memory, etc.) of the physical server and match a physical server that is most suitable for activating the virtual machine through the virtual machine configuration in the cloud host request.
[0003] The resource data of the physical server is reported periodically (one minute by default) and stored in the database. If the scheduling system receives a request to create a virtual machine, it obtains the number of resources of the physical server from the database and subtracts the number of resources currently in use by the physical server to determine how many available resources the physical server has.
[0004] However, in the prior art, physical server resources are updated through timed reporting, with updates every one minute. The system is unable to obtain accurate information about currently available resources in a timely manner, and lacks real-time performance, which causes the scheduling system to perform poorly when responding to sudden requests. It also causes the scheduling system to be unable to obtain the latest status of physical server resources in real time. Especially in a highly dynamic environment, this delay may lead to inflexible resource allocation and an inability to respond to changes in server resources in a timely manner. Summary of the invention
[0005] In order to solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides a resource status management method, device, equipment and readable storage medium, so as to timely obtain accurate information about currently available resources, improve real-time performance, enable the scheduling system to better respond to sudden requests, and obtain the latest status of physical server resources in real time, improve the flexibility of resource allocation, so as to respond to changes in server resources in a timely manner.
[0006] In a first aspect, an embodiment of the present disclosure provides a resource status management method, which is applied to a resource management system. The method includes:
[0007] Receive resource allocation requests sent by the scheduling system;
[0008] Perform resource allocation based on the resource allocation request to obtain a resource allocation result;
[0009] The resource allocation result is passed to the scheduling system; the scheduling system is used to send the resource allocation result to the physical server, so that the physical server can activate resources based on the resource allocation result, obtain the resource activation result, and pass the resource activation result to the scheduling system; the scheduling system is used to return the resource activation result to the resource management system;
[0010] The resource status of the physical server is updated according to the resource activation result.
[0011] In some embodiments, the resource status of the physical server includes at least one of the following:
[0012] Initial state, bound state, occupied state, failed state, expired state.
[0013] In some embodiments, performing resource allocation based on the resource allocation request to obtain a resource allocation result includes:
[0014] Obtain real-time resource data of physical servers;
[0015] Calculation is performed based on the resource allocation request, the resource data and a preset allocation strategy to obtain a resource allocation result.
[0016] In some embodiments, before performing resource allocation based on the resource allocation request and obtaining a resource allocation result, the method further includes:
[0017] When resource allocation is not performed, the resource status is marked as the initial status;
[0018] After performing resource allocation based on the resource allocation request and obtaining a resource allocation result, the method further includes:
[0019] The resource state of the corresponding resource in the resource allocation result is changed to a bound state.
[0020] In some embodiments, updating the resource status of the physical server according to the resource activation result includes:
[0021] If the resource activation result is successful, the resource status is marked as occupied;
[0022] If the resource activation result is activation failure, the resource status is marked as failed.
[0023] In some embodiments, after transmitting the resource allocation result to the scheduling system, the method further includes:
[0024] If it is determined that an error occurs when the scheduling system sends the resource allocation result to the physical server, the resource state of the corresponding resource in the resource allocation result is marked as an initial state, and the occupied resource data is recovered; and / or,
[0025] If the scheduling system does not return the resource activation result to the resource management system within a preset time period, the resource status of the corresponding resource in the resource allocation result is marked as expired.
[0026] In some embodiments, after updating the resource status of the physical server according to the resource activation result, the method further includes:
[0027] The resources whose resource status is expired, occupied, and / or failed are released, the resource status is set to the initial status, and the occupied resource data is recovered.
[0028] In a second aspect, an embodiment of the present disclosure provides a resource status management device, which is applied to a resource management system, and the device includes:
[0029] A receiving module, used for receiving a resource allocation request sent by a scheduling system;
[0030] An obtaining module, used to perform resource allocation based on the resource allocation request and obtain a resource allocation result;
[0031] A transmission module is used to transmit the resource allocation result to the scheduling system; the scheduling system is used to send the resource allocation result to the physical server, so that the physical server can activate resources based on the resource allocation result, obtain the resource activation result, and transmit the resource activation result to the scheduling system; the scheduling system is used to return the resource activation result to the resource management system;
[0032] The updating module is used to update the resource status of the physical server according to the resource activation result.
[0033] In a third aspect, an embodiment of the present disclosure provides an electronic device, including:
[0034] Memory;
[0035] Processor; and
[0036] Computer programs;
[0037] The computer program is stored in the memory and is configured to be executed by the processor to implement the method as described in the first aspect.
[0038] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program is executed by a processor to implement the method as described in the first aspect.
[0039] In a fifth aspect, an embodiment of the present disclosure further provides a computer program product, which includes a computer program or instructions, and when the computer program or instructions are executed by a processor, the method described in the first aspect is implemented.
[0040] The resource status management method, device, equipment and readable storage medium provided in the embodiments of the present disclosure receive resource allocation requests sent by the scheduling system, perform resource allocation based on the resource allocation requests, obtain resource allocation results, and pass the resource allocation results to the scheduling system; the scheduling system is used to send the resource allocation results to the physical server, so that the physical server can activate resources based on the resource allocation results, obtain resource activation results, and pass the resource activation results to the scheduling system; the scheduling system is used to return the resource activation results to the resource management system, and then update the resource status of the physical server according to the resource activation results. Compared with the prior art, the embodiments of the present disclosure update the resource status of the physical server according to the resource activation results, can obtain accurate information on currently available resources in a timely manner, improve real-time performance, enable the scheduling system to better respond to sudden requests, can obtain the latest status of physical server resources in real time, improve the flexibility of resource allocation, and thus can respond to changes in server resources in a timely manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0042] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0043] Figure 1 A flow chart of a resource status management method provided by an embodiment of the present disclosure;
[0044] Figure 2 A flow chart of a resource status management method provided by another embodiment of the present disclosure;
[0045] Figure 3 A flow chart of a resource status management method provided by another embodiment of the present disclosure;
[0046] Figure 4A schematic diagram of the overall process of the resource status management method provided in the embodiment of the present disclosure;
[0047] Figure 5 A schematic diagram of resource status transfer provided by an embodiment of the present disclosure;
[0048] Figure 6 A schematic diagram of the structure of a resource status management device provided in an embodiment of the present disclosure;
[0049] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0050] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.
[0051] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.
[0052] Currently, in the scheduling of cloud hosts, it is necessary to read the resources (CPU, memory, etc.) of the physical server and match a physical server that is most suitable for activating the virtual machine through the virtual machine configuration in the cloud host request.
[0053] The resource data of the physical server is reported periodically (one minute by default) and stored in the database. If the scheduling system receives a request to create a virtual machine, it obtains the number of resources of the physical server from the database and subtracts the number of resources currently in use by the physical server to determine how many available resources the physical server has.
[0054] However, in the prior art, the update of physical server resources is carried out through a timed reporting method, which is updated every one minute. The system cannot obtain accurate information about the currently available resources in a timely manner, and the real-time performance is insufficient, which causes the scheduling system to perform poorly when responding to sudden requests, and also causes the scheduling system to be unable to obtain the latest status of physical server resources in real time. Especially in a highly dynamic environment, this delay may cause resource allocation to be inflexible and unable to respond to changes in server resources in a timely manner. To address this problem, the embodiments of the present disclosure provide a resource status management method, which is introduced below in conjunction with specific embodiments.
[0055] Figure 1A flow chart of a resource status management method provided in an embodiment of the present disclosure. The execution subject of the method is an electronic device, which may be a resource management system. The method may be applied to a scenario of managing resource status, or to a scenario of updating resource status. It is understandable that the resource status management method provided in an embodiment of the present disclosure may also be applied in other scenarios.
[0056] Below Figure 1 The resource status management method shown is introduced, and the method can be applied to the resource management system. The specific steps of the method are as follows:
[0057] S101. Receive a resource allocation request sent by a scheduling system.
[0058] In this step, the resource management system receives the resource allocation request sent by the scheduling system. Figure 4 As shown, when the request management system receives a cloud host creation request, it will first determine whether the cloud host creation request has been processed. If it has been processed, the cloud host creation request will be discarded; if it has not been processed, the cloud host creation request will be placed in a cache queue; the scheduling system periodically obtains tasks for cloud host creation requests from the cache queue, and the scheduling system needs to apply for resources for the cloud host creation request, that is, the scheduling system will send a resource allocation request to the resource management system; the resource management system receives the resource allocation request sent by the scheduling system.
[0059] S102: Perform resource allocation based on the resource allocation request to obtain a resource allocation result.
[0060] In this step, after receiving the resource allocation request sent by the scheduling system, the resource management system will perform resource allocation according to the resource allocation request and obtain a resource allocation result. Specifically, the resource allocation result is the resource allocated to the task of the cloud host creation request according to the resource allocation request. Optionally, the resource allocation result is the resource allocated corresponding to the resource allocation request, such as CPU, memory and other resources.
[0061] S103, passing the resource allocation result to the scheduling system; the scheduling system is used to send the resource allocation result to the physical server, so that the physical server can activate resources based on the resource allocation result, obtain the resource activation result, and pass the resource activation result to the scheduling system; the scheduling system is used to return the resource activation result to the resource management system.
[0062] In this step, after obtaining the resource allocation result, the resource management system will pass the resource allocation result to the scheduling system; the scheduling system receives the resource allocation result transmitted by the resource management system, and further sends the resource allocation result to the physical server; the physical server activates resources based on the resource allocation result, obtains the resource activation result, and passes the resource activation result to the scheduling system; the scheduling system then returns the resource activation result to the resource management system.
[0063] S104: Update the resource status of the physical server according to the resource activation result.
[0064] In this step, the resource management system receives the resource activation result returned by the scheduling system, and updates the resource status of the physical server according to the resource activation result, thereby obtaining the latest status of the physical server resources in real time, improving the flexibility of resource allocation, and responding to changes in server resources in a timely manner.
[0065] In some embodiments, the resource status of the physical server includes at least one of the following: an initial status, a bound status, an occupied status, a failed status, and an expired status.
[0066] Optionally, the resource status of the physical server may include an initial status, a bound status, an occupied status, a failed status, an expired status, or other statuses, which are not specifically limited here.
[0067] Specifically, the initial state (Original): when scheduling begins, resources are in an unallocated initial state. This may be the state when the system is initially started, or the state when a task with released resources is received.
[0068] Bound state (Binded): After the resource management system completes the calculation, it allocates resources on a physical server to the resource allocation request. The resource state is set to bound, indicating that the request has pre-occupied the allocated resources, and the resources of the corresponding machine are deducted.
[0069] Occupied: After receiving the resource allocation result, the scheduling system sends the requested resource allocation result to the physical server. If the request is successfully initiated, the resource management system is called back and the corresponding resources are marked as used. The resource status is set to occupied.
[0070] Failed state: When the physical server resource fails to be provisioned, the corresponding resource enters the failed state. The allocation failure may be caused by insufficient resources or other problems.
[0071] Expired status (Expired): After the resource management system calculates the scheduling result, if the scheduling system does not return the resource usage result within the preset time period, that is, the resource usage result is not returned within the time limit, the corresponding resource status is set to expire. This situation may be caused by the loss of the scheduling system or other abnormalities.
[0072] The disclosed embodiment receives a resource allocation request sent by a scheduling system, performs resource allocation based on the resource allocation request, obtains a resource allocation result, and transmits the resource allocation result to the scheduling system; the scheduling system is used to send the resource allocation result to the physical server, so that the physical server can activate resources based on the resource allocation result, obtain a resource activation result, and transmit the resource activation result to the scheduling system; the scheduling system is used to return the resource activation result to the resource management system, and then update the resource status of the physical server according to the resource activation result. Compared with the prior art, the disclosed embodiment updates the resource status of the physical server according to the resource activation result, can obtain accurate information on currently available resources in a timely manner, improve real-time performance, enable the scheduling system to better respond to sudden requests, can obtain the latest status of physical server resources in real time, improve the flexibility of resource allocation, and thus can respond to changes in server resources in a timely manner.
[0073] Figure 2 A flow chart of a resource status management method provided by another embodiment of the present disclosure is shown in FIG. Figure 2 As shown, the method includes the following steps:
[0074] S201. Receive a resource allocation request sent by a scheduling system.
[0075] Specifically, the implementation process and principle of S201 and S101 are the same, and will not be repeated here.
[0076] S202: When resource allocation is not performed, mark the resource state as an initial state.
[0077] In this step, when the resources of the physical server are not allocated, the resource management system marks the resource status as the initial status. Figure 5 As shown, the resource management system marks the resource state as the initial state, that is, the Original state.
[0078] In some embodiments, the core functions of the resource management system mainly involve three operations: Assign, Feedback, and Release. These three functions provide key resource calling support for the request management system and the scheduling system.
[0079] 1) Assign:
[0080] In the Assign operation, the scheduling system initiates a resource allocation request to the resource management system. The resource management system calculates according to the predetermined allocation strategy and real-time resource data to meet the resource requirements of the resource allocation request. Once the resource is successfully allocated, the resource management system updates the status of the corresponding resource to the Bound state, indicating that the resource has been successfully pre-occupied.
[0081] 2) Feedback:
[0082] Feedback operation covers the return of resource allocation results and feedback on execution status. The resource management system passes the calculated resource allocation results to the scheduling system, and then the scheduling system sends the resource allocation results to the physical server. In the process of resource use, the timeout mechanism is used to avoid long-term idleness of resources, which leads to resource waste. The resource management system updates the status accordingly based on the execution results:
[0083] If the resource is successfully activated, the resource status is marked as occupied.
[0084] If resource activation fails, the resource status is set to Failed.
[0085] If an error occurs when the scheduling system sends resource allocation results to the physical server (for example, a request timeout caused by a network failure), the resource state of the corresponding resource will be marked as the initial state (Original) and the occupied resource data will be reclaimed.
[0086] 3) Release:
[0087] The Release operation is mainly for resources in the Expired, Occupied, and Failed states. The resource management system releases resources in these states, sets the resource state to the initial state (Original), and reclaims the corresponding occupied resource data.
[0088] This operation process of the resource management system effectively adapts to different operation scenarios and system feedback through state transition and dynamic management of resources, which can improve resource utilization and prevent resource waste. It also realizes flexible management of resource status through the state transition mechanism, which contributes to the stability of the system and the effective use of resources, and improves the performance and maintainability of the overall system.
[0089] S203: Obtain real-time resource data of the physical server.
[0090] like Figure 4As shown, the resource management system obtains real-time resource data of the physical server. Specifically, the physical server cluster reports the resource data to the resource management system in real time, and the resource management system obtains the real-time resource data of the physical server reported by the physical server cluster. This embodiment can obtain accurate information about the currently available resources in a timely manner, improve real-time performance, and enable the scheduling system to better respond to sudden requests.
[0091] S204: Perform calculation based on the resource allocation request, the resource data and a preset allocation strategy to obtain a resource allocation result.
[0092] In this step, after acquiring the real-time resource data of the physical server, the resource management system may perform calculations according to the resource allocation request, the resource data and a preset allocation strategy to obtain a resource allocation result.
[0093] S205: Change the resource status of the corresponding resource in the resource allocation result to a bound status.
[0094] like Figure 5 As shown, the resource management system changes the resource state of the corresponding resource in the resource allocation result to a bound state, that is, a Binded state.
[0095] S206. The resource allocation result is passed to the scheduling system; the scheduling system is used to send the resource allocation result to the physical server, so that the physical server can activate resources based on the resource allocation result, obtain the resource activation result, and pass the resource activation result to the scheduling system; the scheduling system is used to return the resource activation result to the resource management system.
[0096] Specifically, the implementation process and principle of S206 and S103 are the same, and will not be repeated here.
[0097] S207: Update the resource status of the physical server according to the resource activation result.
[0098] Specifically, the implementation process and principle of S207 and S104 are the same, and will not be repeated here.
[0099] The embodiment of the present disclosure receives a resource allocation request sent by a scheduling system, and marks the resource state as the initial state when no resource allocation is performed. Further, the real-time resource data of the physical server is obtained, and the resource allocation result is calculated based on the resource allocation request, the resource data and the preset allocation strategy to obtain the resource allocation result, and the resource state of the corresponding resource in the resource allocation result is changed to the bound state. Then, the resource allocation result is passed to the scheduling system; the scheduling system is used to send the resource allocation result to the physical server, so that the physical server performs resource activation based on the resource allocation result, obtains the resource activation result, and transmits the resource activation result to the scheduling system; the scheduling system is used to return the resource activation result to the resource management system. Then, the resource state of the physical server is updated according to the resource activation result. Through this method, accurate information of currently available resources can be obtained in time, real-time performance can be improved, and the scheduling system can better respond to sudden requests, and the latest status of physical server resources can be obtained in real time, and the flexibility of resource allocation can be improved, so that changes in server resources can be responded to in time.
[0100] Figure 3 A flow chart of a resource status management method provided by another embodiment of the present disclosure is shown in FIG. Figure 3 As shown, the method includes the following steps:
[0101] S301: Receive a resource allocation request sent by a scheduling system.
[0102] Specifically, the implementation process and principle of S301 and S101 are the same, and will not be repeated here.
[0103] S302: Perform resource allocation based on the resource allocation request to obtain a resource allocation result.
[0104] Specifically, the implementation process and principle of S302 and S102 are the same, and will not be repeated here.
[0105] S303, passing the resource allocation result to the scheduling system; the scheduling system is used to send the resource allocation result to the physical server, so that the physical server can activate resources based on the resource allocation result, obtain the resource activation result, and pass the resource activation result to the scheduling system; the scheduling system is used to return the resource activation result to the resource management system.
[0106] Specifically, the implementation process and principle of S302 and S102 are the same, and will not be repeated here.
[0107] S304: If it is determined that an error occurs when the scheduling system sends the resource allocation result to the physical server, the resource state of the corresponding resource in the resource allocation result is marked as an initial state, and the occupied resource data is recovered.
[0108] In this step, if an error occurs when the scheduling system sends the resource allocation result to the physical server (for example, a request timeout caused by a network failure), the resource management system will mark the resource status of the corresponding resource in the resource allocation result as the initial status (Original) and recycle the occupied resource data.
[0109] S305: If the scheduling system does not return the resource activation result to the resource management system within the preset time period, the resource status of the corresponding resource in the resource allocation result is marked as expired.
[0110] In this step, if it is determined that the scheduling system has not returned the resource activation result to the resource management system within the preset time period, the resource management system will mark the resource status of the corresponding resource in the resource allocation result as expired, that is, Expired status.
[0111] S306: If the resource activation result is successful, the resource status is marked as occupied.
[0112] If the resource is successfully activated, the resource status is marked as occupied.
[0113] S307: If the resource activation result is activation failure, mark the resource status as a failure status.
[0114] If resource provisioning fails, the resource status is set to Failed.
[0115] S308: Release resources that are in expired state, and / or occupied state, and / or failed state, set the resource state to an initial state, and recycle the occupied resource data.
[0116] like Figure 5 As shown in the figure, the resource management system will release the expired, occupied, and failed resources, set the resource status to the original status, and recycle the corresponding occupied resource data, so that the system can flexibly adapt to different scenarios of resource allocation, execution feedback, and resource release, improving resource utilization and system stability. At the same time, it effectively prevents waste caused by long-term idle resources, thereby improving the performance and maintainability of the overall system.
[0117] The embodiment of the present disclosure receives a resource allocation request sent by a scheduling system, performs resource allocation based on the resource allocation request, obtains a resource allocation result, and transmits the resource allocation result to the scheduling system; the scheduling system is used to send the resource allocation result to a physical server, so that the physical server performs resource activation based on the resource allocation result, obtains a resource activation result, and transmits the resource activation result to the scheduling system; the scheduling system is used to return the resource activation result to the resource management system. Further, if it is determined that an error occurs when the scheduling system sends the resource allocation result to the physical server, the resource state of the corresponding resource in the resource allocation result is marked as an initial state, and the occupied resource data is recovered; if the scheduling system does not return the resource activation result to the resource management system within a preset time period, the resource state of the corresponding resource in the resource allocation result is marked as an expired state. In addition, if the resource activation result is a successful activation, the resource state is marked as an occupied state; if the resource activation result is a failed activation, the resource state is marked as a failed state. Then, the resources whose resource status is expired, occupied, and / or failed are released, the resource status is set to the initial status, and the occupied resource data is recovered. Compared with the prior art, the disclosed embodiment realizes more accurate and real-time management and allocation of physical server resources, achieves significant improvements in improving system flexibility, robustness and real-time performance, and realizes efficient scheduling and dynamic state maintenance of the resource management system. This enables the system to flexibly adapt to different scenarios of resource allocation, execution feedback and resource release, improves resource utilization and system stability. At the same time, it effectively prevents waste caused by long-term idleness of resources, thereby improving the performance and maintainability of the overall system.
[0118] Figure 6 The schematic diagram of the structure of the resource status management device provided in the embodiment of the present disclosure. The resource status management device may be the resource management system described in the above embodiment, or the resource status management device may be a component or assembly in the resource management system. The resource status management device provided in the embodiment of the present disclosure may execute the processing flow provided in the resource status management method embodiment, such as Figure 6As shown, the resource status management device 40 includes: a receiving module 41, an obtaining module 42, a transmission module 43, and an updating module 44; wherein the receiving module 41 is used to receive a resource allocation request sent by a scheduling system; the obtaining module 42 is used to perform resource allocation based on the resource allocation request and obtain a resource allocation result; the transmission module 43 is used to transmit the resource allocation result to the scheduling system; the scheduling system is used to send the resource allocation result to the physical server, so that the physical server can activate resources based on the resource allocation result, obtain a resource activation result, and transmit the resource activation result to the scheduling system; the scheduling system is used to return the resource activation result to the resource management system; the updating module 44 is used to update the resource status of the physical server according to the resource activation result.
[0119] Optionally, the resource status of the physical server includes at least one of the following: initial status, bound status, occupied status, failed status, and expired status.
[0120] Optionally, the obtaining module 42 performs resource allocation based on the resource allocation request, and when obtaining the resource allocation result, is specifically used to: obtain real-time resource data of the physical server; perform calculations based on the resource allocation request, the resource data and a preset allocation strategy to obtain the resource allocation result.
[0121] Optionally, before performing resource allocation based on the resource allocation request and obtaining the resource allocation result, the device 40 further includes: a marking module 45; the marking module 45 is used to mark the resource state as an initial state when resource allocation is not performed;
[0122] After performing resource allocation based on the resource allocation request and obtaining a resource allocation result, the device 40 further includes: a changing module 46; the changing module 46 is used to change the resource state of the corresponding resource in the resource allocation result to a bound state.
[0123] Optionally, when the update module 44 updates the resource status of the physical server according to the resource activation result, it is specifically used to: if the resource activation result is successful, mark the resource status as occupied; if the resource activation result is failed, mark the resource status as failed.
[0124] Optionally, after the resource allocation result is passed to the scheduling system, the marking module 45 is also used for: if it is determined that an error occurs when the scheduling system sends the resource allocation result to the physical server, the resource status of the corresponding resource in the resource allocation result is marked as an initial state, and the occupied resource data is recovered; and / or, if the scheduling system does not return the resource activation result to the resource management system within a preset time period, the resource status of the corresponding resource in the resource allocation result is marked as an expired state.
[0125] Optionally, after updating the resource status of the physical server according to the resource activation result, the device 40 also includes: a release module 47; the release module 47 is used to release resources whose resource status is expired, and / or occupied, and / or failed, set the resource status to the initial state, and recycle the occupied resource data.
[0126] Figure 6 The resource status management device of the illustrated embodiment can be used to execute the technical solution of the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.
[0127] Figure 7 Schematic diagram of the structure of an electronic device in the embodiment of the present disclosure. Figure 7 , which shows a structural schematic diagram of an electronic device 600 suitable for implementing the embodiments of the present disclosure. Figure 7 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0128] like Figure 7 As shown, the electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 to a random access memory (RAM) 603 to implement the resource state management method of the embodiment described in the present disclosure. In the RAM 603, various programs and data required for the operation of the electronic device 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0129] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 7 The electronic device 600 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0130] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains a program code for executing the method shown in the flowchart, thereby implementing the resource status management method as described above. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 609, or installed from the storage device 608, or installed from the ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0131] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0132] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0133] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0134] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device:
[0135] Receive resource allocation requests sent by the scheduling system;
[0136] Perform resource allocation based on the resource allocation request to obtain a resource allocation result;
[0137] The resource allocation result is passed to the scheduling system; the scheduling system is used to send the resource allocation result to the physical server, so that the physical server can activate resources based on the resource allocation result, obtain the resource activation result, and pass the resource activation result to the scheduling system; the scheduling system is used to return the resource activation result to the resource management system;
[0138] The resource status of the physical server is updated according to the resource activation result.
[0139] Optionally, when the above one or more programs are executed by the electronic device, the electronic device may also execute other steps described in the above embodiments.
[0140] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0141] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0142] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a unit does not, in some cases, limit the unit itself.
[0143] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0144] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0145] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[0146] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0147] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
Claims
1. A resource status management method, characterized in that: Applied to a resource management system, the method comprises: Receive resource allocation requests sent by the scheduling system; Perform resource allocation based on the resource allocation request to obtain a resource allocation result; The resource allocation result is passed to the scheduling system; the scheduling system is used to send the resource allocation result to the physical server, so that the physical server can activate resources based on the resource allocation result, obtain the resource activation result, and pass the resource activation result to the scheduling system; the scheduling system is used to return the resource activation result to the resource management system; The resource status of the physical server is updated according to the resource activation result.
2. The method according to claim 1, characterized in that The resource status of the physical server includes at least one of the following: Initial state, bound state, occupied state, failed state, expired state.
3. The method according to claim 1, characterized in that The performing resource allocation based on the resource allocation request to obtain a resource allocation result includes: Obtain real-time resource data of physical servers; Calculation is performed based on the resource allocation request, the resource data and a preset allocation strategy to obtain a resource allocation result.
4. The method according to claim 1, characterized in that Before performing resource allocation based on the resource allocation request and obtaining a resource allocation result, the method further includes: When resource allocation is not performed, the resource status is marked as the initial status; After performing resource allocation based on the resource allocation request and obtaining a resource allocation result, the method further includes: The resource state of the corresponding resource in the resource allocation result is changed to a bound state.
5. The method according to claim 1, characterized in that The updating of the resource status of the physical server according to the resource activation result includes: If the resource activation result is successful, the resource status is marked as occupied; If the resource activation result is activation failure, the resource status is marked as failed.
6. The method according to claim 1, characterized in that After the resource allocation result is transmitted to the scheduling system, the method further includes: If it is determined that an error occurs when the scheduling system sends the resource allocation result to the physical server, the resource state of the corresponding resource in the resource allocation result is marked as an initial state, and the occupied resource data is recovered; and / or, If the scheduling system does not return the resource activation result to the resource management system within a preset time period, the resource status of the corresponding resource in the resource allocation result is marked as expired.
7. The method according to claim 1, characterized in that After updating the resource status of the physical server according to the resource activation result, the method further includes: The resources whose resource status is expired, occupied, and / or failed are released, the resource status is set to the initial status, and the occupied resource data is recovered.
8. A resource status management device, characterized in that: Applied to a resource management system, the device comprises: A receiving module, used for receiving a resource allocation request sent by a scheduling system; An obtaining module, used to perform resource allocation based on the resource allocation request and obtain a resource allocation result; A transmission module is used to transmit the resource allocation result to the scheduling system; the scheduling system is used to send the resource allocation result to the physical server, so that the physical server can activate resources based on the resource allocation result, obtain the resource activation result, and transmit the resource activation result to the scheduling system; the scheduling system is used to return the resource activation result to the resource management system; The updating module is used to update the resource status of the physical server according to the resource activation result.
9. An electronic device, characterized in that: include: Memory; processor; as well as Computer programs; The computer program is stored in the memory and is configured to be executed by the processor to implement the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
