Resource allocation correction methods, apparatus, equipment, media and procedures products
By monitoring resource allocation and executing appropriate correction procedures, the problem of business interruption caused by inaccurate resources in distributed storage systems was solved, thus ensuring the accuracy of the resource catalog and the continuity of client services.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SUGON INFORMATION IND
- Filing Date
- 2023-04-03
- Publication Date
- 2026-07-17
AI Technical Summary
In a distributed storage system, the restart of a client or resource management device can cause inaccuracies in the resource catalog, and the traditional resource allocation correction process can disrupt the client's normal business operations.
By monitoring resource allocation, target conditions are determined and corresponding correction processes are executed, including a first correction process and a second correction process. The first correction process performs resource correction when a resource acquisition request is received, while the second correction process rejects the resource acquisition request to ensure the accuracy of the resource catalog and the continuity of client services.
This approach ensures uninterrupted client services during resource correction, improves the applicability and accuracy of resource allocation correction methods, and guarantees the accuracy of the resource catalog and the normal operation of the client.
Smart Images

Figure CN116389244B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a resource allocation correction method, apparatus, device, medium, and program product. Background Technology
[0002] A distributed storage system can include multiple clients, resource management devices, and storage devices. Currently, the target resource management for resource acquisition typically involves users issuing resource management rules for a resource catalog to the resource management device via a web user interface (WebUI); the resource management device then sends these rules to each client. Users obtain quotas from the resource catalog through their clients and write the data to the resource catalog. However, if a client or resource management device experiences a restart failure during service, the available resources may become inaccurate.
[0003] In traditional technologies, when resource management devices determine that resources in the resource catalog are inaccurate, they initiate a resource allocation correction process to correct the resources in the catalog. However, executing this correction process can disrupt normal client operations. Summary of the Invention
[0004] Therefore, it is necessary to provide a resource allocation correction method, apparatus, device, medium, and program product that can ensure the normal operation of client services in response to the above-mentioned technical problems.
[0005] In a first aspect, one embodiment of this application provides a resource allocation correction method, the method comprising:
[0006] Determine the target conditions that the current resource allocation situation meets, including either the first condition or the second condition;
[0007] If the target condition is the first condition, execute the first correction process for the preset resources;
[0008] During the execution of the first correction process, a resource acquisition request sent by the client is received;
[0009] The system determines the target resource based on the resource acquisition request, allocates the target resource to the client, and determines the correction result for the preset resource.
[0010] The above embodiment monitors the allocation of preset resources in the resource catalog in real time. When the target condition is the first condition, a first correction process for the preset resources is executed. During the first correction process, the resource acquisition request sent by the client can be received normally, and the target resource can be allocated to the client. In this way, the client's resource acquisition request can be received normally during the correction of preset resources without causing service interruption, and it has high applicability.
[0011] In one embodiment, the first condition includes that the preset resources and available resources do not meet the first requirement; the available resources are determined based on the preset resources.
[0012] The above embodiment specifically describes the content of the first condition, namely, that the current resource allocation situation is that the preset resources in the resource catalog are inaccurate and the available resources are not greater than a first threshold, the first correction process is executed to correct the preset resources, and during the execution of the first correction process, the resource acquisition requests from the client are normally received and responded to. This allows users to set it directly and improves the applicability of the resource allocation correction method.
[0013] In one embodiment, the method for determining that the preset resources do not meet the first requirement includes:
[0014] Determine whether the device associated with the preset resource needs to be restarted;
[0015] If a restart is performed, it will be determined that the preset resources do not meet the first requirement.
[0016] The above embodiments determine whether the preset resource meets the first requirement by determining whether the device associated with the preset resource has restarted. This method is quick and easy to implement.
[0017] In one embodiment, before determining the target conditions satisfied by the current resource allocation, the method further includes:
[0018] Determine whether a resource acquisition request has been received within a preset time period;
[0019] If no response is received, the current resource allocation process is considered to have entered a silent period.
[0020] Before determining whether the target conditions met by the current resource allocation situation are met, the above embodiments determine whether the current resource allocation process has entered a silent period. This can increase the probability of successfully correcting the preset resources when the target conditions are the first condition, thereby making the resource allocation correction method more applicable.
[0021] In one embodiment, determining the correction result corresponding to the first correction process includes:
[0022] After assigning the target resource to the client, the correction result is determined to be a correction failure;
[0023] Return to the steps that determine if the current resource allocation meets the target conditions, until the correction result is successful.
[0024] In the above embodiment, after allocating the target resource to the client, the step of determining that the correction result is a correction failure and returning to re-execute the resource allocation correction method can improve the accuracy of the preset resource correction and make the resource allocation correction method more applicable.
[0025] In one embodiment, the method further includes:
[0026] If the target condition is the second condition, execute the second correction process for the preset resources;
[0027] During the execution of the second correction process, resource acquisition requests sent by clients are rejected.
[0028] When the target condition is determined to be the second condition, the above embodiments will execute a second correction process for the preset resources to achieve accurate correction of the preset resources, making the resource allocation correction method highly applicable.
[0029] Secondly, one embodiment of this application provides a resource allocation correction device, the device comprising:
[0030] The determination module is used to determine the target conditions that the current resource allocation situation meets. The target conditions include a first condition or a second condition.
[0031] The execution module is used to execute a first correction process for the preset resources if the target condition is the first condition.
[0032] The receiving module is used to receive resource acquisition requests sent by the client during the execution of the first correction process;
[0033] The allocation module is used to determine the corresponding target resource based on the resource acquisition request, allocate the target resource to the client, and determine the correction result for the preset resource.
[0034] Thirdly, one embodiment of this application provides a computer device including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps of the method provided in the first aspect above.
[0035] Fourthly, one embodiment of this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method provided in the first aspect above.
[0036] Fifthly, one embodiment of this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the method provided in the first aspect above. Attached Figure Description
[0037] Figure 1This is a flowchart illustrating the steps of a resource allocation correction method in one embodiment;
[0038] Figure 2 This is a schematic diagram of the steps in the first correction process in one embodiment;
[0039] Figure 3 This is a flowchart illustrating the steps of a resource allocation correction method in another embodiment;
[0040] Figure 4 This is a flowchart illustrating the steps of a resource allocation correction method in another embodiment;
[0041] Figure 5 This is a flowchart illustrating the steps of a resource allocation correction method in another embodiment;
[0042] Figure 6 This is a flowchart illustrating the steps of a resource allocation correction method in another embodiment;
[0043] Figure 7 This is a flowchart illustrating the steps of a resource allocation correction method in another embodiment;
[0044] Figure 8 This is a flowchart illustrating the steps of a resource allocation correction method in another embodiment;
[0045] Figure 9 This is a flowchart illustrating the steps of a resource allocation correction method in another embodiment;
[0046] Figure 10 This is a flowchart illustrating the steps of a resource allocation correction method in another embodiment;
[0047] Figure 11 This is a schematic diagram of the resource allocation correction device in one embodiment;
[0048] Figure 12 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0049] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0050] The serial numbers assigned to components in this article, such as "first" and "second", are used only to distinguish the objects being described and have no sequential or technical meaning.
[0051] Before detailing the technical solutions of the embodiments of this disclosure, the technical background or evolution of the embodiments of this application will be introduced first. A distributed storage system distributes data across multiple independent devices. A distributed storage system may include multiple clients, resource management devices, and storage settings. Currently, the target resource management of resource acquisition functions typically involves users issuing resource management rules for resource catalogs to resource management devices through a web product user interface (WebUI); these rules are then sent to various clients by the resource management devices. The resource catalog management rules refer to the resource capacity (physical or logical space size) and the number of resources preset by the user. Physical space refers to the actual disk space occupied by the stored data, and the logical space size refers to the size of the data.
[0052] When a user needs to store data in a distributed storage system, the client checks whether there are sufficient remaining local resources before writing data to the resource directory (the initial value of the client's local remaining resources is set to zero). If the local remaining resources are insufficient, the client sends a resource acquisition request to the resource management device. The resource management device responds to the resource acquisition request by determining whether there are sufficient remaining resources in the resource directory. If there are, it allocates resources to the client, and the client writes data according to the allocated resources. When the user needs to delete the written data, the client performs the deletion operation and returns the resources to the resource management device.
[0053] When a client or resource management device malfunctions, the resources in the resource catalog may become inaccurate. In traditional technologies, when the resource management device determines that a resource in the catalog is inaccurate, it initiates a resource allocation correction process to correct the resources in the catalog. However, during the resource allocation correction process, the resource management device may reject the client's resource retrieval requests, affecting the client's normal business operations. To address this, this application provides a resource allocation correction method.
[0054] The resource allocation correction method provided in this application is applied to a computer device. This computer device includes a resource management device and a storage device.
[0055] In one embodiment, such as Figure 1 As shown, a resource allocation correction method is provided. This embodiment illustrates the method by applying it to a computer device. In this embodiment, the method includes the following steps:
[0056] Step 100: Determine the target conditions that the current resource allocation situation meets. The target conditions include either the first condition or the second condition.
[0057] The current resource allocation status refers to the accuracy and allocation of resources in the current resource catalog. This embodiment does not limit the specific content included in the current resource allocation status. The computer device monitors the current resource allocation status in real time and, after obtaining the current resource allocation status, determines whether the current resource allocation status meets the target condition, i.e., whether it meets the first condition or the second condition. If the current resource allocation status meets the first condition, it indicates that the preset resources in the resource catalog are inaccurate and need to be corrected. During the correction process, the device normally receives and responds to the client's resource acquisition request. If the current resource allocation status meets the second condition, it indicates that the preset resources in the resource catalog are inaccurate and need to be corrected. During the correction process, the device rejects the client's resource acquisition request. This embodiment does not limit the specific content of the first and second conditions, as long as their functions can be achieved.
[0058] In an optional embodiment, the computer device obtains the amount of resources used and the amount of resources available in a resource catalog. The resource catalog includes pre-set resource thresholds, including resource capacity thresholds and resource count thresholds. Logical nodes managing system metadata can statistically analyze the amount of resources used in the resource catalog. The amount of resources used includes both resource capacity and resource count. Upon receiving the amount of resources used in the resource catalog, the resource management device in the computer device determines the amount of available resources based on the pre-set resource thresholds. The computer device then determines the target conditions to be met based on the determined amount of available resources and the accuracy of preset resources in the current resource catalog.
[0059] In an optional embodiment, the first condition may include any one or more of the following: the preset resources in the resource catalog are inaccurate, the available resources are not greater than a first threshold, or no resource acquisition request from the client is received within a certain period of time. Users can choose according to their actual application. The second condition may include any one or more of the following: the preset resources in the resource catalog are inaccurate, and the available resources reach a second threshold. Users can choose according to their actual application.
[0060] Step 110: If the target condition is the first condition, execute the first correction process for the preset resources.
[0061] If the computer device determines, through analysis of the current resource allocation, that the target condition met by the current resource allocation is the first condition, then it executes the first correction process for the preset resources in the resource catalog.
[0062] The first calibration procedure is as follows: Figure 2 As shown, it includes:
[0063] Step 200: The resource management device in the computer device sends a resource recall request to the client;
[0064] Step 210: In response to the resource recall request, the client returns all the resources it has requested to the resource management device; the data information written by the client on the allocated resources also includes the data information returned by the client to the resource management device.
[0065] Step 220: After receiving all the resources returned by the client, the resource management device monitors whether there is any data being written; if so, it waits for the client to successfully complete all the data being written.
[0066] Step 230: The resource management device sends a request to the logical node of the management system metadata;
[0067] Step 240: In response to the retrieval request, the logical node of the system metadata sends a statistical value of the data already written to the resource management device. The statistical value of the data already written refers to the size of the resources already used in the resource directory.
[0068] Step 250: The resource management device determines the corrected preset resources based on the preset resource thresholds and statistical values.
[0069] Step 120: During the execution of the first correction process, receive a resource acquisition request sent by the client.
[0070] Step 130: Determine the corresponding target resource based on the resource acquisition request, allocate the target resource to the client, and determine the correction result for the preset resource.
[0071] During the first calibration process of preset resources, when a client sends a resource acquisition request to the computer device, the computer device receives the request and, in response, allocates the target resource to the client. That is, the computer device determines the target resource required by the client based on the received resource acquisition request, selects the target resource from the resource directory, and allocates it to the client so that the client can write data to the allocated target resource. After allocating the target resource to the client, the computer device determines the calibration result of the preset resource. The calibration result of the preset resource includes calibration success and calibration failure.
[0072] The resource allocation correction method provided in this application determines the target conditions satisfied by the current resource allocation status; if the target condition is a first condition, a first correction process for preset resources is executed; during the execution of the first correction process, a resource acquisition request sent by the client is received; the corresponding target resource is determined according to the resource acquisition request, and the target resource is allocated to the client, and the correction result for the preset resources is determined. In this embodiment, the computer device monitors the allocation status of preset resources in the resource catalog in real time. When the target condition is the first condition, the first correction process for the preset resources is executed, and the resource acquisition request sent by the client can be received normally during the first correction process, and the target resource is allocated to the client. In this way, during the correction of preset resources, the resource acquisition request from the client can be received normally without causing interruption of the client's service, and it has high applicability.
[0073] In one embodiment, the first condition includes the fact that the preset resources and available resources do not meet the first requirement; the available resources are determined based on the preset resources.
[0074] The first requirement includes accurate preset resources and available resources exceeding a first threshold, meaning there are sufficient available resources and the set resource threshold will not be reached in a short period. If the preset resources and available resources do not meet the first requirement, that is, the preset resources are inaccurate and the available resources are not greater than the first threshold, then the first threshold can be set and stored by the user based on actual conditions.
[0075] Computer devices can determine the current preset resources by monitoring the current resource allocation. Based on these preset resources, they can determine the available resources, i.e., the resources that can be used in the resource catalog. If the preset resource obtained by the computer device is a resource that has already been used in the resource catalog, the difference between the set resource threshold and the already used resource can be used to determine the available resource. If the preset resource obtained by the computer device is a resource that can be used in the resource catalog, then this preset resource is the available resource.
[0076] In this embodiment, the first condition is specifically described: the current resource allocation is such that the preset resources in the resource catalog are inaccurate, and the available resources are no greater than a first threshold. A first correction process is then executed to correct the preset resources, and during the execution of the first correction process, resource acquisition requests from clients are received and responded to normally. This allows users to easily set the settings, improving the applicability of the resource allocation correction method.
[0077] In one embodiment, such as Figure 3 As shown, the method for determining when the preset resources do not meet the first requirement includes the following steps:
[0078] Step 300: Determine whether the device associated with the preset resource has been restarted.
[0079] The devices associated with the preset resources include the resource management device to which the preset resource belongs, and the client that needs to send a resource acquisition request to the resource management device. The computer device determines whether the client and / or the resource management device has restarted; that is, the computer device determines whether at least one of the client and the resource management device has restarted. This embodiment does not limit the specific method for determining whether the client and the resource management device have restarted, as long as the function can be achieved.
[0080] In an optional embodiment, if the client needs to re-establish communication with the computer device after restarting, the computer device determines that the client has restarted after receiving a message from the client to establish communication.
[0081] In an optional embodiment, the resource management device is located on a computer device, which is capable of automatically monitoring whether the resource management device has restarted.
[0082] Step 310: If restarting is required, determine that the preset resources do not meet the first requirement.
[0083] If the computer determines that the device associated with the preset resource has restarted, that is, if any one or both of the client associated with the preset resource and the resource management device associated with the preset resource have restarted, then the preset resource is determined to not meet the first requirement, that is, the preset resource is inaccurate.
[0084] Step 320: If the system does not restart, then confirm that the preset resources meet the first requirement.
[0085] If the computer determines that the device associated with the preset resource has not been restarted, that is, neither the client associated with the preset resource nor the resource management device associated with the preset resource has been restarted, then the preset resource is determined to meet the first requirement, that is, the preset resource is accurate.
[0086] In this embodiment, the method of determining whether the preset resource meets the first requirement is to determine whether the device associated with the preset resource has been restarted. This method is quick and easy to implement.
[0087] In an optional embodiment, the computer device can further determine whether the preset resource meets the first requirement by detecting whether the communication between the client associated with the preset resource and the resource management device is normal. If the communication is abnormal, it is determined that the preset resource does not meet the first requirement, that is, the preset resource is inaccurate; if the communication is normal, it is determined that the preset resource meets the first requirement, that is, the preset resource is accurate.
[0088] In one embodiment, such as Figure 4 As shown, before determining the target conditions satisfied by the current resource allocation, the method further includes:
[0089] Step 400: Determine whether a resource acquisition request has been received within the preset time period.
[0090] The preset time period can be user-defined and stored. Before determining whether the current resource allocation meets the target conditions, the computer device will check whether a resource acquisition request has been received from a client within the preset time period. In other words, it will determine whether any client has requested resource allocation from the resource management device within the preset time period.
[0091] Step 410: If no response is received, the current resource allocation process enters a silent period.
[0092] If the computer device determines that it has not received a resource acquisition request from the client within a preset time period, it determines that the current resource allocation process has entered a silent period.
[0093] After determining that the current resource allocation process has entered a silent period, the computer device continues to execute steps 100-130. That is, when it is determined that the resource allocation process has entered a silent period and the current resource allocation situation meets the first condition, the first correction process for the preset resources is executed.
[0094] In this embodiment, before determining whether the current resource allocation situation meets the target condition, it is determined whether the current resource allocation process has entered a silent period. This can increase the probability of successfully correcting the preset resources when the target condition is the first condition, thereby making the resource allocation correction method more applicable.
[0095] In one embodiment, such as Figure 5 As shown, one implementation method involves determining the correction result corresponding to the first correction process. The steps of this implementation method include:
[0096] Step 500: After allocating the target resource to the client, determine that the correction result is a correction failure; return to the step of determining that the target conditions are met by the current resource allocation, until the correction result is a correction success.
[0097] During the execution of the first calibration process, the computer device receives and responds to the resource request sent by the client, allocates the target resource to the client, and the calibration is completed, but the calibration result is determined to be a calibration failure. After determining that the calibration result is a calibration failure, the system returns to steps 100-130 to recalibrate the preset resource.
[0098] After receiving and responding to the resource request sent by the client and allocating the target resource to the client in the first correction process, although the correction is completed, it cannot be determined whether the resources requested by the client during the correction process were considered. In this embodiment, after the computer device allocates the target resource to the client, the correction result is determined to be a correction failure, and the process returns to re-execute the resource allocation correction method of steps 100-130. This can improve the accuracy of the correction of the preset resource and make the resource allocation correction method more applicable.
[0099] In one embodiment, such as Figure 6 As shown, the resource allocation correction method further includes the following steps:
[0100] Step 600: If the target condition is the second condition, execute the second correction process for the preset resources.
[0101] If the computer device determines, through analysis of the current resource allocation, that the target condition met by the current resource allocation is the second condition, then it executes the second correction process for the preset resources in the resource catalog.
[0102] In an optional embodiment, the second condition includes the fact that the preset resources and available resources do not meet the second requirement;
[0103] The second requirement includes that the preset resources are accurate and the available resources are less than a second threshold, meaning there are few available resources. If neither the preset nor the available resources meet the second requirement, that is, the preset resources are inaccurate and the available resources reach the second threshold, then the second threshold can be set and stored by the user based on actual conditions, and the second threshold is greater than the first threshold.
[0104] Step 610: During the execution of the second correction process, refuse to accept resource acquisition requests sent by the client.
[0105] During the second calibration process, the computer equipment does not accept resource acquisition requests sent by the client.
[0106] In this embodiment, when the target condition is determined to be the second condition, a second correction process for the preset resources will be executed to achieve accurate correction of the preset resources, making the resource allocation correction method highly applicable.
[0107] In an optional embodiment, during the execution of the second correction process, the steps for rejecting resource acquisition requests sent by the client and determining the correction result as successful are as follows: Figure 7 As shown, it includes:
[0108] Step 700: The resource management device in the computer equipment determines the target condition that the current resource allocation meets as the second condition, and executes the second correction process;
[0109] Step 710: The user creates a file and writes data in the client.
[0110] Step 720: The client confirms that the data to be written is under the resource management device and that a resource threshold has been set;
[0111] Step 730: The client sends a resource acquisition request to the resource management device;
[0112] Step 740: The resource management device rejects the resource acquisition request sent by the client;
[0113] Step 750: The client resends the resource acquisition request to the resource management device. The resource management device has not completed the second correction process and rejects the resource acquisition request.
[0114] Step 760: The resource management device completes the second calibration process and confirms successful calibration;
[0115] Step 770: The client resends the resource acquisition request to the resource management device;
[0116] Step 780: The resource management device sends the target resource to the client based on the resource acquisition request;
[0117] Step 790: After receiving the target resource, the client writes the data that the user needs to write.
[0118] Step 791: The client sends a write success indication to the user.
[0119] In an optional embodiment, the steps for determining that the correction result is successful are as follows: If no resource acquisition request is received from the client during the execution of the first correction process, the correction result is successful. Figure 8 As shown, it includes:
[0120] Step 800: The resource management device in the computer equipment determines the target condition that the current resource allocation situation meets as the first condition;
[0121] Step 810: Send a resource recall request to the client;
[0122] Step 820: In response to the resource recall request, the client returns all the resources it has requested to the resource management device;
[0123] Step 830: After receiving all the resources returned by the client, the resource management device monitors whether there is any data that has been written normally; if so, it waits for the client to complete all the data being written successfully.
[0124] Step 840: The resource management device sends a request to the logical node of the management system metadata;
[0125] Step 850: The logical node of the system metadata returns the statistical value of the data already written in the resource directory to the resource management device according to the acquisition request;
[0126] Step 860: The resource management device determines the pre-calibrated preset resources based on the preset resource thresholds and statistical values.
[0127] Step 870: If the resource management device determines that no resource acquisition request was received from the client during the execution of the first calibration process, the calibration result is determined to be successful.
[0128] In an optional embodiment, the steps of receiving a resource acquisition request from the client during the execution of the first correction process and determining that the correction result is a correction failure are as follows: Figure 9 As shown, it includes:
[0129] Step 900: The resource management device in the computer equipment determines the target condition that the current resource allocation meets as the first condition, and executes the first correction process;
[0130] Step 910: The user creates a file and writes data in the client.
[0131] Step 920: The client confirms that the data to be written is under the resource management device and that a resource threshold has been set;
[0132] Step 930: The client sends a resource acquisition request to the resource management device;
[0133] Step 940: The resource management device sends the target resource to the client according to the resource acquisition request, and records the resource acquisition request received during the execution of the first correction process;
[0134] Step 950: After receiving the target resource, the client writes the data that the user needs to write.
[0135] Step 960: The client sends a write success indication to the user;
[0136] Step 970: After the resource management device completes the first calibration process, it determines that a resource acquisition request was received during the execution of the first calibration process, and determines that the calibration result is calibration failure.
[0137] Step 980: Wait for the next execution of the first correction process, or the next execution of the second correction process.
[0138] Please see Figure 10 One embodiment of this application provides a resource allocation method, the steps of which include:
[0139] Step 101: Determine the target conditions that the current resource allocation situation meets. The target conditions include either the first condition or the second condition.
[0140] Step 102: If the target condition is the first condition, execute the first correction process for the preset resources; the first condition includes restarting the device associated with the preset resources, the available resources being less than or equal to the first threshold, and no resource acquisition request being received within the preset time period;
[0141] Step 103: During the execution of the first correction process, receive a resource acquisition request sent by the client;
[0142] Step 104: Determine the corresponding target resource based on the resource acquisition request, allocate the target resource to the client, and determine that the correction result for the preset resource is a correction failure;
[0143] Step 105: Return to steps 101-104 until the correction result is confirmed as successful.
[0144] Step 106: If the target condition is the second condition, execute the second correction process for the preset resources; the second condition includes restarting the device associated with the preset resources and the available resources being greater than the second threshold; the second threshold is greater than the first threshold;
[0145] Step 107: During the execution of the second correction process, refuse to accept resource acquisition requests sent by the client.
[0146] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0147] Based on the same inventive concept, this application also provides a resource allocation correction device for implementing the resource allocation correction method described above. The solution provided by this device is similar to the solution described in the above method; therefore, the specific limitations in one or more resource allocation correction device embodiments provided below can be found in the limitations of the resource allocation correction method described above, and will not be repeated here.
[0148] In one embodiment, such as Figure 11 As shown, a resource allocation correction device 10 is provided, including: a determining module 11, an execution module 12, a receiving module 13, and an allocation module 14, wherein:
[0149] The determination module 11 is used to determine the target conditions that the current resource allocation situation meets. The target conditions include a first condition or a second condition.
[0150] Execution module 12 is used to execute the first correction process for the preset resources if the target condition is the first condition.
[0151] The receiving module 13 is used to receive resource acquisition requests sent by the client during the execution of the first correction process.
[0152] The allocation module 14 is used to determine the corresponding target resource based on the resource acquisition request, allocate the target resource to the client, and determine the correction result of the preset resource.
[0153] In one embodiment, the first condition includes the fact that the preset resources and available resources do not meet the first requirement; the available resources are determined based on the preset resources.
[0154] In one embodiment, the resource allocation correction device 10 further includes a determination module. The determination module is used to determine whether the device associated with the preset resource has restarted; if it has restarted, it is determined that the preset resource does not meet the first requirement.
[0155] In one embodiment, the determination module is further configured to determine whether a resource acquisition request has been received within a preset time period; if no request has been received, it is determined that the current resource allocation process has entered a silent period.
[0156] In one embodiment, the allocation module is further configured to determine that the correction result is a correction failure after allocating the target resource to the client, and to cause the determination module 11, the execution module 12, the receiving module 13 and the allocation module 14 to perform corresponding operations until the correction result is a correction success.
[0157] In one embodiment, the execution module is further configured to execute a second correction process for the preset resource if the target condition is the second condition; and refuse to receive resource acquisition requests sent by the client during the execution of the second correction process.
[0158] Each module in the aforementioned resource allocation correction device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0159] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 12 As shown, the computer device includes a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a resource allocation correction method. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the computer device casing, or an external keyboard, touchpad, or mouse.
[0160] Those skilled in the art will understand that Figure 12 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0161] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0162] Determine the target conditions that the current resource allocation situation meets, including either the first condition or the second condition;
[0163] If the target condition is the first condition, execute the first correction process for the preset resources;
[0164] During the execution of the first correction process, a resource acquisition request sent by the client is received;
[0165] The system determines the target resource based on the resource acquisition request, allocates the target resource to the client, and determines the correction result for the preset resource.
[0166] In one embodiment, the first condition includes the fact that the preset resources and available resources do not meet the first requirement; the available resources are determined based on the preset resources.
[0167] In one embodiment, when the processor executes the computer program, it further performs the following steps: determining whether the device associated with the preset resource has restarted; if it has restarted, determining that the preset resource does not meet a first requirement.
[0168] In one embodiment, when the processor executes the computer program, it further performs the following steps: determining whether a resource acquisition request is received within a preset time period; if not received, determining that the current resource allocation process enters a silent period.
[0169] In one embodiment, when the processor executes the computer program, it further performs the following steps: after allocating the target resource to the client, it determines that the correction result is a correction failure; and returns to the step of determining that the target conditions are met by the current resource allocation, until the correction result is a correction success.
[0170] In one embodiment, when the processor executes the computer program, it further performs the following steps: if the target condition is a second condition, it executes a second correction process for a preset resource; during the execution of the second correction process, it rejects resource acquisition requests sent by the client.
[0171] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0172] Determine the target conditions that the current resource allocation situation meets, including either the first condition or the second condition;
[0173] If the target condition is the first condition, execute the first correction process for the preset resources;
[0174] During the execution of the first correction process, a resource acquisition request sent by the client is received;
[0175] The system determines the target resource based on the resource acquisition request, allocates the target resource to the client, and determines the correction result for the preset resource.
[0176] In one embodiment, the first condition includes the fact that the preset resources and available resources do not meet the first requirement; the available resources are determined based on the preset resources.
[0177] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: determining whether the device associated with the preset resource has restarted; if it has restarted, determining that the preset resource does not meet the first requirement.
[0178] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: determining whether a resource acquisition request is received within a preset time period; if not received, determining that the current resource allocation process enters a silent period.
[0179] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: after allocating the target resource to the client, determining that the correction result is a correction failure; returning to the step of determining that the target conditions are met by the current resource allocation, until the correction result is a correction success.
[0180] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: if the target condition is the second condition, execute a second correction process for the preset resource; during the execution of the second correction process, refuse to receive resource acquisition requests sent by the client.
[0181] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps:
[0182] Determine the target conditions that the current resource allocation situation meets, including either the first condition or the second condition;
[0183] If the target condition is the first condition, execute the first correction process for the preset resources;
[0184] During the execution of the first correction process, a resource acquisition request sent by the client is received;
[0185] The system determines the target resource based on the resource acquisition request, allocates the target resource to the client, and determines the correction result for the preset resource.
[0186] In one embodiment, the first condition includes the fact that the preset resources and available resources do not meet the first requirement; the available resources are determined based on the preset resources.
[0187] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: determining whether the device associated with the preset resource has restarted; if it has restarted, determining that the preset resource does not meet the first requirement.
[0188] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: determining whether a resource acquisition request is received within a preset time period; if not received, determining that the current resource allocation process enters a silent period.
[0189] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: after allocating the target resource to the client, determining that the correction result is a correction failure; returning to the step of determining that the target conditions are met by the current resource allocation, until the correction result is a correction success.
[0190] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: if the target condition is the second condition, execute a second correction process for the preset resource; during the execution of the second correction process, refuse to receive resource acquisition requests sent by the client.
[0191] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0192] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0193] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0194] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A resource allocation correction method, characterized in that, The method includes: Determine the target conditions that the current resource allocation situation meets, the target conditions include a first condition or a second condition; the first condition includes any one or more of the following: the preset resources in the resource catalog are inaccurate, the available resources are not greater than a first threshold, and no resource acquisition requests have been received within a preset time period; If the target condition is the first condition, execute the first correction process for the preset resources; During the execution of the first correction process, a resource acquisition request sent by the client is received; The corresponding target resource is determined based on the resource acquisition request, and the target resource is allocated to the client, and the correction result of the preset resource is determined; The first correction process includes: Send a resource recall request to the client; receive all resources returned by the client in response to the resource recall request; monitor whether there is data being written; if so, wait for all data being written by the client to be successfully written; receive the statistical value of the data already written in the resource directory; determine the corrected preset resources based on the preset resource threshold and the statistical value; Determining the correction result for the preset resource includes: After allocating the target resource to the client, the correction result is determined to be a correction failure; the process returns to the step of determining that the target condition of the current resource allocation is met, until the correction result is obtained as a correction success.
2. The method according to claim 1, characterized in that, The first condition includes the fact that the preset resources and available resources do not meet the first requirement; the available resources are determined based on the preset resources.
3. The method according to claim 2, characterized in that, The methods for determining whether the preset resources do not meet the first requirement include: Determine whether the device associated with the preset resource needs to be restarted; If a restart is performed, it is determined that the preset resources do not meet the first requirement.
4. The method according to any one of claims 1-3, characterized in that, Before determining the target conditions satisfied by the current resource allocation, the method further includes: Determine whether the resource acquisition request has been received within a preset time period; If no response is received, the current resource allocation process is considered to have entered a silent period.
5. The method according to any one of claims 1-3, characterized in that, The method further includes: If the target condition is the second condition, execute the second correction process for the preset resource; During the execution of the second correction process, resource acquisition requests sent by the client are rejected.
6. The method according to claim 5, characterized in that, The second condition includes device restart associated with preset resources and available resources being greater than a second threshold, where the second threshold is greater than the first threshold.
7. A resource allocation correction device, characterized in that, The device includes: The determination module is used to determine the target conditions that the current resource allocation situation meets. The target conditions include a first condition or a second condition. The first condition includes any one or more of the following: the preset resources in the resource catalog are inaccurate, the available resources are not greater than a first threshold, and no resource acquisition request has been received within a preset time period. The execution module is used to execute a first correction process for the preset resources if the target condition is the first condition. The receiving module is used to receive resource acquisition requests sent by the client during the execution of the first correction process; The allocation module is used to determine the corresponding target resource according to the resource acquisition request, allocate the target resource to the client, and determine the correction result of the preset resource; The first correction process includes: Send a resource recall request to the client; receive all resources returned by the client in response to the resource recall request; monitor whether there is data being written; if so, wait for all data being written by the client to be successfully written; receive the statistical value of the data already written in the resource directory; determine the corrected preset resources based on the preset resource threshold and the statistical value; Determining the correction result for the preset resource includes: After allocating the target resource to the client, the correction result is determined to be a correction identification; the process returns to the step of determining that the target conditions met by the current resource allocation are met, until the correction result is obtained as a successful correction.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.